{% set version = "2018.04.18" %}

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

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

source:
  fn: prodlim_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/prodlim_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/prodlim/prodlim_{{ version }}.tar.gz
  sha256: 4b22b54fdf712439309be0ff74f63cde9080464667b00e19823372ac0fc254ab

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

requirements:
  build:
    - r-base
    - r-kernsmooth
    - r-rcpp >=0.11.5
    - r-lava
    - r-survival
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]

  run:
    - r-base
    - r-kernsmooth
    - r-rcpp >=0.11.5
    - r-lava
    - r-survival
    - libgcc  # [not win]

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

about:
  home: https://CRAN.R-project.org/package=prodlim
  license: GPL (>= 2)
  summary: Fast and user friendly implementation of nonparametric estimators for censored event
    history (survival) analysis. Kaplan-Meier and Aalen-Johansen method.
  license_family: GPL3
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'  # [unix]
  license_file: '{{ environ["PREFIX"] }}\R\share\licenses\GPL-3'  # [win]

extra:
  recipe-maintainers:
    - cbrueffer
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
