{% set version = '1.1.0' %}

{% set posix = 'm2-' if win else '' %}
{% set native = 'm2w64-' if win else '' %}

package:
  name: r-leaflet
  version: {{ version|replace("-", "_") }}

source:
  fn: leaflet_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/leaflet_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/leaflet/leaflet_{{ version }}.tar.gz
  sha256: f474be80f40f62175c5a08aab7e549251ced9faa70d340374d522fdaf08cca15

build:
  number: 0
  skip: true  # [win32]

  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - r-base
    - r-rcolorbrewer
    - r-base64enc
    - r-crosstalk
    - r-htmltools
    - r-htmlwidgets
    - r-magrittr
    - r-markdown
    - r-png
    - r-raster
    - r-scales >=0.2.5
    - r-sp
    - r-viridis

  run:
    - r-base
    - r-rcolorbrewer
    - r-base64enc
    - r-crosstalk
    - r-htmltools
    - r-htmlwidgets
    - r-magrittr
    - r-markdown
    - r-png
    - r-raster
    - r-scales >=0.2.5
    - r-sp
    - r-viridis

test:
  commands:
    - $R -e "library('leaflet')"  # [not win]
    - "\"%R%\" -e \"library('leaflet')\""  # [win]

about:
  home: http://rstudio.github.io/leaflet/
  license: GPL-3
  summary: Create and customize interactive maps using the 'Leaflet' JavaScript library and the
    'htmlwidgets' package. These maps can be used directly from the R console, from
    'RStudio', in Shiny apps and R Markdown documents.
  license_family: GPL3

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
