{% set version = '2.0-5' %}

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

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

source:
  fn: glmnet_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/glmnet_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/glmnet/glmnet_{{ version }}.tar.gz
  sha256: 2ca95352c8fbd93aa7800f3d972ee6c1a5fcfeabc6be8c10deee0cb457fd77b1

build:
  number: 0
  skip: true  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - r-base
    - r-matrix >=1.0_6
    - r-foreach
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]

  run:
    - r-base
    - r-matrix >=1.0_6
    - r-foreach
    - libgcc  # [not win]

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

about:
  home: http://www.jstatsoft.org/v33/i01/.
  license: GPL-2
  summary: 'Extremely efficient procedures for fitting the entire lasso or elastic-net regularization
    path for linear regression, logistic and multinomial regression models, Poisson
    regression and the Cox model. Two recent additions are the multiple-response Gaussian,
    and the grouped multinomial. The algorithm uses cyclical coordinate descent in a
    path-wise fashion, as described in the paper linked to via the URL below. '

  license_family: GPL2

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
