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

{% 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: 21145a8b621c7dce769549d3c4e37aecda97b62d3902e4749e5a0e0527286fee

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
