{% set version = '0.6.0' %}

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

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

source:
  fn: pbivnorm_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/pbivnorm_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/pbivnorm/pbivnorm_{{ version }}.tar.gz
  sha256: 07c37d507cb8f8d2d9ae51a9a6d44dfbebd8a53e93c242c4378eaddfb1cc5f16

build:
  number: 0
  skip: true  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - r-base
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]

  run:
    - r-base
    - libgcc  # [not win]

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

about:
  home: https://github.com/brentonk/pbivnorm
  license: GPL (>= 2)
  summary: Provides a vectorized R function for calculating probabilities from a standard bivariate
    normal CDF.
  license_family: GPL3
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'  # [unix]
  license_file: '{{ environ["PREFIX"] }}\R\share\licenses\GPL-3'  # [win]

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