{% set version = '1.3-3' %}

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

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

source:
  fn: cobs_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/cobs_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/cobs/cobs_{{ version }}.tar.gz
  sha256: 6b1e760cf8dec6b6e63f042cdc3e5e633de5f982e8bc743a891932f6d9f91bdf

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

requirements:
  build:
    - posix                # [win]
    - {{ compiler('c') }}        # [unix]
    - {{ compiler('m2w64_c') }}  # [win]
  host:
    - r-base
    - r-sparsem >=1.6
    - r-quantreg >=4.65

  run:
    - r-base
    - r-sparsem >=1.6
    - r-quantreg >=4.65

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

about:
  home: http://curves-etc.r-forge.r-project.org
  license: GPL (>= 2)
  summary: Qualitatively Constrained (Regression) Smoothing Splines via Linear Programming and
    Sparse Matrices.
  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
