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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/abtest_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/abtest/abtest_{{ version }}.tar.gz
  sha256: 0f3b2952fb5892cc564acf691543eb97766499d74595493b82e812338acfe24b

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

requirements:
  build:
    - {{ compiler('c') }}              # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ compiler('cxx') }}            # [not win]
    - {{ compiler('m2w64_cxx') }}      # [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-matrix
    - r-rcolorbrewer
    - r-rcpp >=0.12.14
    - r-mvtnorm
    - r-plotrix
    - r-qgam
    - r-sn
    - r-truncnorm
  run:
    - r-base
    - {{ native }}gcc-libs         # [win]
    - r-matrix
    - r-rcolorbrewer
    - r-rcpp >=0.12.14
    - r-mvtnorm
    - r-plotrix
    - r-qgam
    - r-sn
    - r-truncnorm

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

about:
  home: https://CRAN.R-project.org/package=abtest
  license: GPL-2.0-or-later
  summary: Provides functions for Bayesian A/B testing including prior elicitation options based on Kass and Vaidyanathan (1992) <doi:10.1111/j.2517-6161.1992.tb01868.x>.
  license_family: GPL2
  license_file:
    - {{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-2

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