{% set version = "0.0.6" %}

{% 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: 3d9ca31d081ce8540a87790786840bde5f833543af608c53a26623c7874e722f

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
