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

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

source:
  fn: DEoptimR_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/DEoptimR_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/DEoptimR/DEoptimR_{{ version }}.tar.gz
  sha256: 846911c1b2561a9fae73a8c60a21a5680963ebb0050af3c1f1147ae9a121e5ef

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

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

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

about:
  home: https://CRAN.R-project.org/package=DEoptimR
  license: GPL (>= 2)
  summary: Differential Evolution (DE) stochastic algorithms for global optimization of problems
    with and without constraints. The aim is to curate a collection of its state-of-the-art
    variants that (1) do not sacrifice simplicity of design, (2) are essentially tuning-free,
    and (3) can be efficiently implemented directly in the R language. Currently, it
    only provides an implementation of the 'jDE' algorithm by Brest et al. (2006) <doi:10.1109/TEVC.2006.872133>.
  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
