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

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

source:
  fn: dfoptim_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/dfoptim_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/dfoptim/dfoptim_{{ version }}.tar.gz
  sha256: 63fd151797219baab932ccf9da42e6ade79baa6906e8c6f424c04b85ba06cabf

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

requirements:
  build:
    - {{posix}}zip               # [win]
  host:
    - r-base
  run:
    - r-base

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

about:
  home: http://www.jhsph.edu/agingandhealth/People/Faculty_personal_pages/Varadhan.html
  license: GPL (>= 2)
  summary: Derivative-Free optimization algorithms. These algorithms do not require gradient
    information. More importantly, they can be used to solve non-smooth optimization
    problems.
  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
    - dbast
