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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/msm_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/msm/msm_{{ version }}.tar.gz
  sha256: f3f18a9ea622a6d56f0f6d675b4890081d6def8b91a694c6764dac0d1cf262b4

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

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

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

about:
  home: https://github.com/chjackson/msm
  license: GPL (>= 2)
  summary: Functions for fitting continuous-time Markov and hidden Markov multi-state models
    to longitudinal data.  Designed for processes observed at arbitrary times in continuous
    time (panel data) but some other observation schemes are supported. Both Markov
    transition rates and the hidden Markov output process can be modelled in terms of
    covariates, which may be constant or piecewise-constant in time.
  license_family: GPL3
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-2'

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