{% set version = '1.6.6' %}

{% 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: fd12512d3cdca5fab634bf6222d896482bd1876192939da475f251b3a873a71a

build:
  merge_build_host: True  # [win]

  number: 2

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

requirements:
  build:
    - {{ compiler('c') }}        # [not win]
    - {{native}}toolchain        # [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')"           # [not win]
    - "\"%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
extra:
  recipe-maintainers:
    - MathiasHaudgaard
    - FrodePedersen
    - ArneKr
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
