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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/glmpath_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/glmpath/glmpath_{{ version }}.tar.gz
  sha256: c83e1277cb05fc47fe087d21eea4875bf1473f28dd7bd8024971241d1ac671c9

build:
  merge_build_host: True  # [win]
  number: 0
  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]
    - cross-r-base {{ r_base }}    # [build_platform != target_platform]
  host:
    - r-base
    - r-survival
  run:
    - r-base
    - {{ native }}gcc-libs         # [win]
    - r-survival

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

about:
  home: https://CRAN.R-project.org/package=glmpath
  license: GPL-2.0-or-later
  summary: A path-following algorithm for L1 regularized generalized linear models and Cox proportional
    hazards model.
  license_family: GPL2
  license_file:
    - '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-2'

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

# Package: glmpath
# Version: 0.98
# Date: 2018-01-27
# Title: L1 Regularization Path for Generalized Linear Models and Cox Proportional Hazards Model
# Author: Mee Young Park, Trevor Hastie
# Maintainer: Mee Young Park <meeyoung@google.com>
# Depends: survival, R (>= 2.0)
# Description: A path-following algorithm for L1 regularized generalized linear models and Cox proportional hazards model.
# License: GPL (>= 2)
# Packaged: 2018-01-28 00:56:02 UTC; meeyoung
# Repository: CRAN
# Date/Publication: 2018-01-28 16:09:29 UTC
# NeedsCompilation: yes
