{% set version = '0.4.16' %}

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

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

source:
  fn: mhsmm_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/mhsmm_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/mhsmm/mhsmm_{{ version }}.tar.gz
  sha256: fab573abdc0dd44e8c8bc7242a1428df20b3ec64c4c194e5f1f907393f902d01

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

requirements:
  build:
    - r-base
    - r-mvtnorm
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]
  run:
    - r-base
    - r-mvtnorm
    - libgcc  # [not win]

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

about:
  home: https://github.com/jaredo/mhsmm
  license: GPL (>= 2)
  summary: |
    Parameter estimation and prediction for hidden Markov and semi-Markov models for data
    with multiple observation sequences.  Suitable for equidistant time series data,
    with multivariate and/or missing data. Allows user defined emission distributions.
  license_family: GPL

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
