{% set version = '1.1.1.4' %}

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

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

source:
  fn: dygraphs_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/dygraphs_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/dygraphs/dygraphs_{{ version }}.tar.gz
  sha256: 69d1c97573b650cfbf24d11948e5904b103fdb4b3396d244aab3f3dc0f4e8f6f

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

requirements:
  build:
    - r-base
    - r-htmltools >=0.3.5
    - r-htmlwidgets >=0.6
    - r-magrittr
    - r-xts >=0.9_7
    - r-zoo >=1.7_10

  run:
    - r-base
    - r-htmltools >=0.3.5
    - r-htmlwidgets >=0.6
    - r-magrittr
    - r-xts >=0.9_7
    - r-zoo >=1.7_10

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

about:
  home: https://github.com/rstudio/dygraphs
  license: MIT
  summary: An R interface to the 'dygraphs' JavaScript charting library (a copy of which is included
    in the package). Provides rich facilities for charting time-series data in R, including
    highly configurable series- and axis-display and interactive features like zoom/pan
    and series/point highlighting.
  license_family: MIT

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
