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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/brms_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/brms/brms_{{ version }}.tar.gz
  sha256: 12da78716f07644e5a56aafeb6f8797fa1cf16928804254e88529b59ae61507d

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

requirements:
  build:
    - {{ compiler('c') }}        # [not win]
    - {{ compiler('cxx') }}      # [not win]
    - {{native}}toolchain        # [win]
    - {{posix}}zip               # [win]
  host:
    - r-base
    - r-matrix >=1.1.1
    - r-rcpp >=0.12.0
    - r-abind
    - r-backports
    - r-bayesplot >=1.5.0
    - r-bridgesampling >=0.3_0
    - r-coda
    - r-ggplot2 >=2.0.0
    - r-loo >=2.0.0
    - r-matrixstats
    - r-mgcv >=1.8_13
    - r-nleqslv
    - r-nlme
    - r-rstan >=2.17.2
    - r-rstantools >=1.3.0
    - r-shinystan >=2.4.0
  run:
    - r-base
    - {{native}}gcc-libs         # [win]
    - r-matrix >=1.1.1
    - r-rcpp >=0.12.0
    - r-abind
    - r-backports
    - r-bayesplot >=1.5.0
    - r-bridgesampling >=0.3_0
    - r-coda
    - r-ggplot2 >=2.0.0
    - r-loo >=2.0.0
    - r-matrixstats
    - r-mgcv >=1.8_13
    - r-nleqslv
    - r-nlme
    - r-rstan >=2.17.2
    - r-rstantools >=1.3.0
    - r-shinystan >=2.4.0

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

about:
  home: https://github.com/paul-buerkner/brms, http://discourse.mc-stan.org
  license: GPL (>= 3)
  summary: "Fit Bayesian generalized (non-)linear multivariate multilevel models using 'Stan'
    for full Bayesian inference. A wide range of distributions  and link functions are
    supported, allowing users to fit -- among others --  linear, robust linear, count
    data, survival, response times, ordinal,  zero-inflated, hurdle, and even self-defined
    mixture models all in a  multilevel context. Further modeling options include non-linear
    and  smooth terms, auto-correlation structures, censored data, meta-analytic  standard
    errors, and quite a few more. In addition, all parameters of the  response distribution
    can be predicted in order to perform distributional  regression. Prior specifications
    are flexible and explicitly encourage  users to apply prior distributions that actually
    reflect their beliefs. Model fit can easily be assessed and compared with posterior
    predictive checks and leave-one-out cross-validation. References: Bürkner (2017)
    <doi:10.18637/jss.v080.i01>; Carpenter et al. (2017) <doi:10.18637/jss.v076.i01>."
  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
    - dbast
