{% set version = '1.4-0' %}

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

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

source:
  fn: MCMCpack_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/MCMCpack_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/MCMCpack/MCMCpack_{{ version }}.tar.gz
  sha256: d01f04b6d07e54a1f5c4f00b88ed9d96d660a9c9c02afe3429dbf5e0aa6ce533

build:
  number: 0
  skip: true  # [win32]

  rpaths:
    - lib/R/lib/
    - lib/
requirements:
  build:
    - r-base
    - r-mass
    - r-coda >=0.11_3
    - r-lattice
    - r-mcmc
    - r-quantreg
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]

  run:
    - r-base
    - r-mass
    - r-coda >=0.11_3
    - r-lattice
    - r-mcmc
    - r-quantreg
    - {{native}}gcc-libs   # [win]
    - libgcc               # [not win]

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

about:
  home: http://mcmcpack.berkeley.edu
  license: GPL-3
  summary: Contains functions to perform Bayesian inference using posterior simulation for a
    number of statistical models. Most simulation is done in compiled C++ written in
    the Scythe Statistical Library Version 1.0.3. All models return coda mcmc objects
    that can then be summarized using the coda package. Some useful utility functions
    such as density functions, pseudo-random number generators for statistical distributions,
    a general purpose Metropolis sampling algorithm, and tools for visualization are
    provided.
  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
