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

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

source:
  fn: timereg_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/timereg_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/timereg/timereg_{{ version }}.tar.gz
  sha256: fbf4eeee1648fceb98773156764c32b3a9481f0fb9f8dc3a9d0331a9051cb54b

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-lava
    - r-numderiv
    - r-survival
  run:
    - r-base
    - {{ native }}gcc-libs         # [win]
    - r-lava
    - r-numderiv
    - r-survival

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

about:
  home: https://github.com/scheike/timereg.git
  license: GPL (>= 2)
  summary: Programs for Martinussen and Scheike (2006), `Dynamic Regression Models for Survival
    Data', Springer Verlag.  Plus more recent developments. Additive survival model,
    semiparametric proportional odds model, fast cumulative residuals, excess risk models
    and more. Flexible competing risks regression including GOF-tests. Two-stage frailty
    modelling. PLS for the additive risk model. Lasso in the 'ahaz' package.
  license_family: GPL3
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'

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