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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/hdrcde_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/hdrcde/hdrcde_{{ version }}.tar.gz
  sha256: 4341c6a021da46dcae3b1ef6d580e84dcf625c2b2139f537d0c26ec90899149b

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

requirements:
  build:
    - {{ compiler('c') }}        # [not win]
    - {{ compiler('fortran') }}  # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ compiler('m2w64_fortran') }}        # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}make
    - {{ posix }}sed  # [win]
    - {{ posix }}coreutils  # [win]
    - {{ posix }}sed               # [win]
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [win]
  host:
    - r-base
    - r-kernsmooth
    - r-rcolorbrewer
    - r-ash
    - r-ggplot2
    - r-ks
    - r-locfit
  run:
    - r-base
    - {{ native }}gcc-libs         # [win]
    - r-kernsmooth
    - r-rcolorbrewer
    - r-ash
    - r-ggplot2
    - r-ks
    - r-locfit

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

about:
  home: https://github.com/robjhyndman/hdrcde
  license: GPL-3.0-only
  summary: Computation of highest density regions in one and two dimensions, kernel estimation of univariate density functions conditional on one covariate, and multimodal regression.
  license_family: GPL3
  license_file:
    - {{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3

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