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

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

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

source:
  fn: mgcv_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/mgcv_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/mgcv/mgcv_{{ version }}.tar.gz
  sha256: 8ff3eb28c83ba7c9003005e7fe08028627fb673b9b07c0462b410e45e81042fe

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

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

requirements:
  build:
    - r-base
    - r-matrix
    - r-nlme >=3.1_64
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]

  run:
    - r-base
    - r-matrix
    - r-nlme >=3.1_64

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

about:
  home: https://CRAN.R-project.org/package=mgcv
  license: GPL (>= 2)
  summary: GAMs, GAMMs and other generalized ridge regression with  multiple smoothing parameter
    estimation by GCV, REML or UBRE/AIC.  Includes a gam() function, a wide variety
    of smoothers, JAGS  support and distributions beyond the exponential family.
  license_family: GPL3

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
