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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/DPQ_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/DPQ/DPQ_{{ version }}.tar.gz
  sha256: 5aebad12439522b8ab789f34158f38f541e56f2656d26814997b3d7e5e1a01f4

build:
  merge_build_host: True  # [win]
  number: 0

  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{ compiler('c') }}              # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ compiler('fortran') }}        # [not win]
    - {{ compiler('m2w64_fortran') }}  # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}make
    - {{ posix }}sed               # [win]
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [win]
    - cross-r-base {{ r_base }}    # [build_platform != target_platform]

  host:
    - r-base
    - r-sfsmisc >=1.1_9

  run:
    - r-base
    - {{ native }}gcc-libs         # [win]
    - r-sfsmisc >=1.1_9

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

about:
  home: https://CRAN.R-project.org/package=DPQ
  license: GPL-2.0-or-later
  summary: 'Computations for approximations and alternatives for the ''DPQ'' (Density (pdf),
    Probability (cdf) and Quantile) functions for probability distributions in R. Primary
    focus is on (central and non-central) beta, gamma and related distributions such
    as the chi-squared, F, and t. -- This is for the use of researchers in these numerical
    approximation implementations, notably for my own use in order to improve standard
    R pbeta(), qgamma(), ..., etc: {''"dpq"''-functions}.'

  license_family: GPL2
  license_file:
    - '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-2'

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