{% set version = '3.8.4' %}

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

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

source:
  fn: Deriv_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/Deriv_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/Deriv/Deriv_{{ version }}.tar.gz
  sha256: de4b7dfd4653dec9ae49987b8588c5ecfd7ef59081d9a1c55834da94bb5342d1

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

requirements:
  build:
    - r-base

  run:
    - r-base

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

about:
  home: https://CRAN.R-project.org/package=Deriv
  license: GPL (>= 3)
  summary: R-based solution for symbolic differentiation. It admits user-defined function as
    well as function substitution in arguments of functions to be differentiated. Some
    symbolic simplification is part of the work.
  license_family: GPL3
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'  # [unix]
  license_file: '{{ environ["PREFIX"] }}\R\share\licenses\GPL-3'  # [win]

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