{% set version = '2013-2.21' %}

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

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

source:
  fn: Rcgmin_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/Rcgmin_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/Rcgmin/Rcgmin_{{ version }}.tar.gz
  sha256: a824a09c32d7565a3e30607c71333506d5b7197478fbe8b43f8a77dad6c12f0a

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('Rcgmin')"  # [not win]
    - "\"%R%\" -e \"library('Rcgmin')\""  # [win]

about:
  home: https://CRAN.R-project.org/package=Rcgmin
  license: GPL (>= 2)
  summary: Conjugate gradient minimization of nonlinear functions with box constraints incorporating
    the Dai/Yuan update. This implementation should be used in place of the "CG" algorithm
    of the optim() function.
  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:
    - cbrueffer
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
