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

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

source:
  fn: r2d3_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/r2d3_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/r2d3/r2d3_{{ version }}.tar.gz
  sha256: 2ba02fb859d087fa21286d1f2b9ef1425a6fda066babf2a287646da349e8e0e4

build:
  merge_build_host: True  # [win]
  number: 0
  skip: true  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{posix}}zip               # [win]
  host:
    - r-base
    - r-htmltools
    - r-htmlwidgets >=1.2
    - r-jsonlite
    - r-rstudioapi
  run:
    - r-base
    - r-htmltools
    - r-htmlwidgets >=1.2
    - r-jsonlite
    - r-rstudioapi

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

about:
  home: https://github.com/rstudio/r2d3
  license: BSD_3_clause
  summary: Suite of tools for using 'D3', a library for producing dynamic, interactive data visualizations.
    Supports translating objects into 'D3' friendly data structures, rendering 'D3'
    scripts, publishing 'D3' visualizations, incorporating 'D3' in R Markdown, creating
    interactive 'D3' applications with Shiny, and distributing 'D3' based 'htmlwidgets'
    in R packages.
  license_family: BSD

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
    - cbrueffer
    - dbast
