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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/dcurver_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/dcurver/dcurver_{{ version }}.tar.gz
  sha256: cc6c55090d3607910515981ea0c7221e40e7a29e0da0c5a5f42c3847012290ec

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

requirements:
  build:
    - {{ compiler('c') }}          # [not win]
    - {{ compiler('cxx') }}        # [not win]
    - {{ compiler('m2w64_c') }}    # [win]
    - {{ compiler('m2w64_cxx') }}  # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}make
    - {{ posix }}sed               # [win]
    - {{ posix }}coreutils         # [win]
    - llvm-openmp                  # [osx]
  host:
    - r-base
    - r-rcpp >=0.12.14
    - r-rcpparmadillo
  run:
    - r-base
    - llvm-openmp                # [osx]
    - r-rcpp >=0.12.14
    - r-rcpparmadillo

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

about:
  home: https://github.com/oguzhanogreden/dcurver
  license: GPL-3.0-only
  summary: A Davidian curve defines a seminonparametric density, whose shape and flexibility can be tuned by easy to estimate parameters. Since a special case of a Davidian curve is the standard normal density, Davidian curves can be used for relaxing normality assumption in statistical applications (Zhang & Davidian, 2001)
    <doi:10.1111/j.0006-341X.2001.00795.x>. This package provides the density function, the gradient of the loglikelihood and a random generator for Davidian curves.
  license_family: GPL3
  license_file:
    - {{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3

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