{% set version = "0.1.0" %}

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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/leafpop_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/leafpop/leafpop_{{ version }}.tar.gz
  sha256: 6e546886e1db4ad93a038de6d1e8331c0d686e96a0d3f0694e7575471f7d9db1

build:
  number: 0
  merge_build_host: true  # [win]
  script: R CMD INSTALL --build .
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{ compiler('c') }}  # [not win]
    - {{ compiler('cxx') }}  # [not win]
    - {{ compiler('m2w64_c') }}  # [win]
    - {{ compiler('m2w64_cxx') }}  # [win]
    - {{ posix }}filesystem  # [win]
    - {{ posix }}make
    - {{ posix }}sed  # [win]
    - {{ posix }}coreutils  # [win]
    - {{ posix }}zip  # [win]
  host:
    - r-base
    - r-base
    - r-base64enc
    - r-brew
    - r-htmltools
    - r-htmlwidgets
    - r-sf
    - r-svglite
    - r-uuid
  run:
    - r-base
    - {{ native }}gcc-libs  # [win]
    - r-base64enc
    - r-brew
    - r-htmltools
    - r-htmlwidgets
    - r-sf
    - r-svglite
    - r-uuid


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

about:
  home: https://CRAN.R-project.org/package=leafpop
  license: MIT
  license_file: LICENSE
  summary: Creates 'HTML' strings to embed tables, images or graphs in pop-ups of interactive maps created with packages like 'leaflet' or 'mapview'. Handles local images located on the file system or via remote URL. Handles graphs created  with 'lattice' or 'ggplot2' as well as interactive plots created with 'htmlwidgets'.
  license_family: MIT

extra:
  recipe-maintainers:
    - ocefpaf
