{% set version = '0.9-50' %}

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

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

source:
  fn: penalized_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/penalized_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/penalized/penalized_{{ version }}.tar.gz
  sha256: 66ed84b967f70fd49702318e43e129c2ff60bb0631b81fe2617671d1ebbbc060

build:
  number: 0
  skip: true  # [win32]

  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - r-base
    - r-rcpp
    - r-rcpparmadillo
    - r-survival
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]

  run:
    - r-base
    - r-rcpp
    - r-rcpparmadillo
    - r-survival
    - libgcc  # [not win]

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

about:
  home: https://CRAN.R-project.org/package=penalized
  license: GPL (>= 2)
  summary: Fitting possibly high dimensional penalized regression models. The penalty structure
    can be any combination of an L1 penalty (lasso and fused lasso), an L2 penalty (ridge)
    and a positivity constraint on the regression coefficients. The supported regression
    models are linear, logistic and Poisson regression and the Cox Proportional Hazards
    model. Cross-validation routines allow optimization of the tuning parameters.
  license_family: GPL3

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