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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/bfa_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/bfa/bfa_{{ version }}.tar.gz
  sha256: 66e4efbc87cb5f565e5f791bdeb323e45c962e14db44ac33f8880bda0d21c622

build:
  merge_build_host: True  # [win]
  number: 0

  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{ compiler('c') }}        # [not win]
    - {{ compiler('cxx') }}      # [not win]
    - {{native}}toolchain        # [win]
    - {{posix}}filesystem        # [win]
    - {{posix}}make
    - {{posix}}sed               # [win]
    - {{posix}}coreutils         # [win]
    - {{posix}}zip               # [win]

  host:
    - r-base
    - r-rcpp >=0.10.6
    - r-rcpparmadillo
    - r-coda

  run:
    - r-base
    - {{native}}gcc-libs         # [win]
    - r-rcpp >=0.10.6
    - r-rcpparmadillo
    - r-coda

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

about:
  home: https://CRAN.R-project.org/package=bfa
  license: GPL-3
  summary: Provides model fitting for several Bayesian factor models including Gaussian, ordinal
    probit, mixed and semiparametric Gaussian copula factor models under a range of
    priors.
  license_family: GPL3
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'

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

# The original CRAN metadata for this package was:

# Package: bfa
# Maintainer: Jared Murray <jsmurray@stat.cmu.edu>
# License: GPL-3
# Title: Bayesian Factor Analysis
# LinkingTo: Rcpp, RcppArmadillo
# Type: Package
# LazyLoad: yes
# Author: Jared Murray
# Description: Provides model fitting for several Bayesian factor models including Gaussian, ordinal probit, mixed and semiparametric Gaussian copula factor models under a range of priors.
# SystemRequirements: GNU make
# Version: 0.4
# Date: 2016-09-07
# Imports: coda, Rcpp (>= 0.10.6)
# Collate: 'bfa-package.R' 'main.R' 'bfa_copula.R' 'bfa_gauss.R' 'bfa_mixed.R' 'rng.R' 'postproc.R' 'class.R' 'get_coda.R' 'plots.R' 'ratings08.R' 'wrappers.R'
# RoxygenNote: 5.0.1
# NeedsCompilation: yes
# Packaged: 2016-09-28 01:57:15 UTC; jared
# Repository: CRAN
# Date/Publication: 2016-09-29 08:04:45
