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

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

source:
  fn: pec_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/pec_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/pec/pec_{{ version }}.tar.gz
  sha256: c00cdadd5cc0b1d9d9c6660074ac0154db7276fba1ce0d714f2a189ee698cec0

build:
  merge_build_host: True  # [win]
  number: 0
  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-foreach >=1.4.2
    - r-prodlim >=1.4.9
    - r-rms >=4.2_0
    - r-survival >=2.37_7
    - r-timereg >=1.8.9
  run:
    - r-base
    - {{native}}gcc-libs         # [win]
    - r-foreach >=1.4.2
    - r-prodlim >=1.4.9
    - r-rms >=4.2_0
    - r-survival >=2.37_7
    - r-timereg >=1.8.9

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

about:
  home: https://CRAN.R-project.org/package=pec
  license: GPL (>= 2)
  summary: Validation of risk predictions obtained from survival models and competing risk models
    based on censored data using inverse weighting and cross-validation.
  license_family: GPL3
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'

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