{% set version = '1.0-17' %}

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

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

source:
  fn: pspline_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/pspline_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/pspline/pspline_{{ version }}.tar.gz

  sha256: 39b859bc5a96784842d7a05c5e081a9ec1d88e8892afd9d1143ba8838d8475d8

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

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

  run:
    - r-base

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

about:
  home: https://CRAN.R-project.org/package=pspline
  license: Unlimited
  summary: Smoothing splines with penalties on order m derivatives.

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
