{% set version = '2016-8.8' %}

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

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

source:
  fn: optextras_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/optextras_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/optextras/optextras_{{ version }}.tar.gz
  sha256: 8c91d0dadfbd545610bcfb84e7b205be3ca05c2005062266b3c04e844df8980f

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

requirements:
  build:
    - r-base
    - r-numderiv

  run:
    - r-base
    - r-numderiv

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

about:
  home: https://CRAN.R-project.org/package=optextras
  license: GPL-2
  summary: Tools to assist in safely applying user generated objective and  derivative function
    to optimization programs. These are primarily function  minimization methods with
    at most bounds and masks on the parameters. Provides a way to check the basic computation
    of objective functions that  the user provides, along with proposed gradient and
    Hessian functions,  as well as to wrap such functions to avoid failures when inadmissible
    parameters  are provided. Check bounds and masks. Check scaling or optimality conditions.  Perform
    an axial search to seek lower points on the objective function surface.  Includes
    forward, central and backward gradient approximation codes.
  license_family: GPL2
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-2'  # [unix]
  license_file: '{{ environ["PREFIX"] }}\R\share\licenses\GPL-2'  # [win]

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