{% set version = '3.5-7' %}

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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/survival_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/survival/survival_{{ version }}.tar.gz
  sha256: d50e2dd32add39f0d148c17ec301eeff1ba9b74d9f9674324a9acd5ef234272e

build:
  merge_build_host: True  # [win]
  # If this is a new build for the same version, increment the build number.
  number: 0
  # no skip

  # This is required to make R link correctly on Linux.
  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-matrix

  run:
    - r-base
    - {{native}}gcc-libs         # [win]
    - r-matrix

test:
  commands:
    # You can put additional test commands to be run here.
    - $R -e "library('survival')"           # [not win]
    - "\"%R%\" -e \"library('survival')\""  # [win]

  # You can also put a file called run_test.py, run_test.sh, or run_test.bat
  # in the recipe that will be run at test time.

  # requires:
    # Put any additional test requirements here.

about:
  home: https://github.com/therneau/survival
  license: LGPL-2
  summary: Contains the core survival analysis routines, including definition of Surv objects,
    Kaplan-Meier and Aalen-Johansen (multi-state) curves, Cox models, and parametric
    accelerated failure time models.
  license_family: LGPL
  license_file:
    - '{{ environ["PREFIX"] }}/lib/R/share/licenses/LGPL-2'

extra:
  recipe-maintainers:
    - ocefpaf
    - mingwandroid

# The original CRAN metadata for this package was:

# Title: Survival Analysis
# Priority: recommended
# Package: survival
# Version: 3.5-7
# Date: 2023-08-12
# Depends: R (>= 3.5.0)
# Imports: graphics, Matrix, methods, splines, stats, utils
# LazyData: Yes
# LazyDataCompression: xz
# ByteCompile: Yes
# Authors@R: c(person(c("Terry", "M"), "Therneau", email="therneau.terry@mayo.edu", role=c("aut", "cre")), person("Thomas", "Lumley", role=c("ctb", "trl"), comment="original S->R port and R maintainer until 2009"), person("Atkinson", "Elizabeth", role="ctb"), person("Crowson", "Cynthia", role="ctb"))
# Description: Contains the core survival analysis routines, including definition of Surv objects, Kaplan-Meier and Aalen-Johansen (multi-state) curves, Cox models, and parametric accelerated failure time models.
# License: LGPL (>= 2)
# URL: https://github.com/therneau/survival
# NeedsCompilation: yes
# Packaged: 2023-08-13 13:14:48 UTC; therneau
# Author: Terry M Therneau [aut, cre], Thomas Lumley [ctb, trl] (original S->R port and R maintainer until 2009), Atkinson Elizabeth [ctb], Crowson Cynthia [ctb]
# Maintainer: Terry M Therneau <therneau.terry@mayo.edu>
# Repository: CRAN
# Date/Publication: 2023-08-14 07:10:03 UTC

# See
# https://docs.conda.io/projects/conda-build for
# more information about meta.yaml
