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

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

source:
  fn: mclust_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/mclust_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/mclust/mclust_{{ version }}.tar.gz
  sha256: a4a31e9a832dafc860369bd4b05fdc3defd767599c159c2bfc6ea8ebb8162524

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

requirements:
  build:
    - {{ compiler('c') }}        # [not win]
    - {{ compiler('fortran') }}  # [not win]
    - {{native}}toolchain        # [win]
    - {{posix}}filesystem        # [win]
    - {{posix}}make
    - {{posix}}sed               # [win]
    - {{posix}}coreutils         # [win]
    - {{posix}}zip               # [win]
  host:
    - r-base
  run:
    - r-base
    - {{native}}gcc-libs         # [win]

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

about:
  home: http://www.stat.washington.edu/mclust/
  license: GPL (>= 2)
  summary: Gaussian finite mixture models fitted via EM algorithm for model-based clustering,
    classification, and density estimation, including Bayesian regularization, dimension
    reduction for visualisation, and resampling-based inference.
  license_family: GPL3
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'

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