{% set version = '2016.8-1' %}

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

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

source:
  fn: numDeriv_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/numDeriv_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/numDeriv/numDeriv_{{ version }}.tar.gz
  sha256: 1b681d273697dc780a3ac5bedabb4a257785732d9ca4ef68e4e4aac8b328d11e

build:
  number: 0
  skip: true  # [win32]

  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - r-base

  run:
    - r-base

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

about:
  home: http://optimizer.r-forge.r-project.org/
  license: GPL-2
  summary: 'Methods for calculating (usually) accurate numerical first and second order derivatives.
    Accurate calculations  are done using ''Richardson''''s'' extrapolation or, when
    applicable, a complex step derivative is available. A simple difference  method
    is also provided. Simple difference is (usually) less accurate but is much quicker
    than ''Richardson''''s'' extrapolation and provides a  useful cross-check.  Methods
    are provided for real scalar and vector valued functions. '

  license_family: GPL2

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
