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

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

source:
  fn: mixtools_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/mixtools_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/mixtools/mixtools_{{ version }}.tar.gz
  sha256: ef033ef13625209065d26767bf70d129972e6808927f755629f1d70a118b9023

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

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

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

about:
  home: https://CRAN.R-project.org/package=mixtools
  license: GPL (>= 2)
  summary: Analyzes finite mixture models for various parametric and semiparametric settings.  This
    includes mixtures of parametric distributions (normal, multivariate normal, multinomial,
    gamma), various Reliability Mixture Models (RMMs), mixtures-of-regressions settings
    (linear regression, logistic regression, Poisson regression, linear regression with
    changepoints, predictor-dependent mixing proportions, random effects regressions,
    hierarchical mixtures-of-experts), and tools for selecting the number of components
    (bootstrapping the likelihood ratio test statistic and model selection criteria).  Bayesian
    estimation of mixtures-of-linear-regressions models is available as well as a novel
    data depth method for obtaining credible bands.  This package is based upon work
    supported by the National Science Foundation under Grant No. SES-0518772.
  license_family: GPL3
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'

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