{% set version = "2.3-5" %}

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

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

source:
  fn: evd_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/evd_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/evd/evd_{{ version }}.tar.gz
  sha256: 6ab1a0c389a753fefcbdc626090cf56ee69c8373b3860e97c9c895ec1eb73aae

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

# Suggests: akima
requirements:
  build:
    - {{ compiler('c') }}        # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}make
    - {{ posix }}sed               # [win]
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [win]

  host:
    - r-base

  run:
    - r-base
    - {{ native }}gcc-libs         # [win]

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

about:
  home: https://CRAN.R-project.org/package=evd
  license: GPL-3
  license_file: {{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3
  summary: Extends simulation, distribution, quantile and density functions to univariate and multivariate parametric extreme value distributions, and provides fitting functions which calculate maximum likelihood estimates for univariate and bivariate maxima models, and for univariate and bivariate threshold models.
  license_family: GPL3

extra:
  recipe-maintainers:
    - conda-forge/r
    - daf
