{% set version = '2.3-3' %}

{% 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: 2fc5ef2e0c3a2a9392425ddd45914445497433d90fb80b8c363877baee4559b4

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

# Suggests: akima
requirements:
  build:
    - {{ compiler('c') }}        # [not win]
    - {{native}}toolchain        # [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
  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:
    - dpryan79
    - daf
