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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/survivalmodels_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/survivalmodels/survivalmodels_{{ version }}.tar.gz
  sha256: 477df5052a2b234466d62cec7fed174949ba0bc659b252630c7138ee7675ab34

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

requirements:
  build:
    - {{ compiler('c') }}              # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ compiler('cxx') }}            # [not win]
    - {{ compiler('m2w64_cxx') }}      # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}make
    - {{ posix }}sed               # [win]
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [win]
    - cross-r-base {{ r_base }}    # [build_platform != target_platform]
  host:
    - r-base
    - r-rcpp >=1.0.5
  run:
    - r-base
    - {{ native }}gcc-libs         # [win]
    - r-rcpp >=1.0.5

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

about:
  home: https://github.com/RaphaelS1/survivalmodels/
  license: MIT
  summary: Implementations of classical and machine learning models for survival analysis, including
    deep neural networks via 'keras' and 'tensorflow'. Each model includes a separated
    fit and predict interface with consistent prediction types for predicting risk,
    survival probabilities, or survival distributions with 'distr6' <https://CRAN.R-project.org/package=distr6>.
    Models are either implemented from 'Python' via 'reticulate' <https://CRAN.R-project.org/package=reticulate>,
    from code in GitHub packages, or novel implementations using 'Rcpp' <https://CRAN.R-project.org/package=Rcpp>.
    Novel machine learning survival models wil be included in the package in near-future
    updates. Neural networks are implemented from the 'Python' package 'pycox' <https://github.com/havakv/pycox>
    and are detailed by Kvamme et al. (2019) <https://jmlr.org/papers/v20/18-424.html>.
    The 'Akritas' estimator is defined in Akritas (1994) <doi:10.1214/aos/1176325630>.
    'DNNSurv' is defined in Zhao and Feng (2020) <arXiv:1908.02337>.
  license_family: MIT
  license_file:
    - {{ environ["PREFIX"] }}/lib/R/share/licenses/MIT
    - LICENSE

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