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

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

source:
  fn: genlasso_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/genlasso_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/genlasso/genlasso_{{ version }}.tar.gz
  sha256: a7a8b6141350a6211bc652c7fddee59d3692b0886735ce3dc716dedfd15b9ee0

build:
  merge_build_host: True  # [win]
  number: 2
  skip: true  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{ compiler('c') }}        # [not win]
    - {{native}}toolchain        # [win]
    - {{posix}}filesystem        # [win]
    - {{posix}}make
    - {{posix}}sed               # [win]
    - {{posix}}coreutils         # [win]
    - {{posix}}zip               # [win]
  host:
    - r-base
    - r-mass
    - r-matrix
    - r-igraph
  run:
    - r-base
    - r-mass
    - r-matrix
    - r-igraph

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

about:
  home: https://github.com/statsmaths/genlasso
  license: GPL (>= 2.0)
  summary: This package computes the solution path for generalized lasso problems. Important
    use cases are the fused lasso over an arbitrary graph, and trend fitting of any
    given polynomial order. Specialized implementations for the latter two subproblems
    are given to improve stability and speed.
  license_family: GPL3
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3'  # [unix]
  license_file: '{{ environ["PREFIX"] }}\R\share\licenses\GPL-3'  # [win]

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