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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/coxphf_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/coxphf/coxphf_{{ version }}.tar.gz
  sha256: 657e30bff5af9d7ce90a213d56d7a2ce4d81b1bf815aca5440f5df4cc71e8819

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

requirements:
  build:
    - {{ compiler('c') }}        # [not win]
    - {{ compiler('fortran') }}  # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ compiler('m2w64_fortran') }}        # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}make
    - {{ posix }}sed               # [win]
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [win]
  host:
    - r-base
    - r-survival
  run:
    - r-base
    - {{ native }}gcc-libs         # [win]
    - r-survival

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

about:
  home: http://cemsiis.meduniwien.ac.at/kb/wf/software/statistische-software/fccoxphf/
  license: GPL-2 and GPL-3
  summary: Implements Firth's penalized maximum likelihood bias reduction method  for Cox regression which has been shown to provide a solution in case of monotone likelihood (nonconvergence of likelihood function). The program fits profile penalized likelihood confidence intervals which were proved to outperform Wald confidence
    intervals.
  license_family: GPL
  license_file: {{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-2

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