{% set version = '1.0-7' %}

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

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

source:
  fn: truncnorm_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/truncnorm_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/truncnorm/truncnorm_{{ version }}.tar.gz
  sha256: c7d775d09e2dcbcc543c03a207b4407b8548b5fdfeb4c017f12818507e014ce1

build:
  merge_build_host: True  # [win]
  number: 2
  skip: true  # [win32]

  rpaths:
    - lib/R/lib/
    - lib/
requirements:
  build:
    - posix                # [win]
    - {{ compiler('c') }}        # [unix]
    - {{ compiler('m2w64_c') }}  # [win]
  host:
    - r-base

  run:
    - r-base

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

about:
  home: https://CRAN.R-project.org/package=truncnorm
  license: GPL-2
  summary: r/d/p/q functions for the truncated normal distribution
  license_family: GPL2

extra:
  recipe-maintainers:
    - dpryan79
    - jdblischak
    - johanneskoester
    - bgruening
    - daler
