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

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

source:
  fn: optimx_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/optimx_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/optimx/optimx_{{ version }}.tar.gz
  sha256: 1a8c16f327be5af4b938c4ce71f9fe1c7704800b355412af2542ea28803e6d5d

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

requirements:
  build:
    - {{posix}}zip               # [win]
  host:
    - r-base
    - r-bb
    - r-rcgmin
    - r-rvmmin
    - r-dfoptim
    - r-minqa
    - r-numderiv
    - r-setrng
    - r-svunit
    - r-ucminf
  run:
    - r-base
    - r-bb
    - r-rcgmin
    - r-rvmmin
    - r-dfoptim
    - r-minqa
    - r-numderiv
    - r-setrng
    - r-svunit
    - r-ucminf

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

about:
  home: https://CRAN.R-project.org/package=optimx
  license: GPL-2
  summary: Provides a replacement and extension of the optim() function to unify and streamline
    optimization capabilities in R for smooth, possibly box constrained functions of
    several or many parameters. This is the CRAN version of the package.
  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:
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
    - cbrueffer
    - dbast
