{% set version = "2.2-2" %}

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

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

source:
  fn: gss_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/gss_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/gss/gss_{{ version }}.tar.gz
  sha256: 1da4da894378ee730cff9628e8b4d2a0d7dfa344b94e5bce6953e66723c21fe4

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

requirements:
  build:
    - posix                # [win]
    - {{ compiler('fortran') }}        # [unix]
    - {{ compiler('m2w64_fortran') }}  # [win]
    - {{ compiler('c') }}        # [unix]
    - {{ compiler('m2w64_c') }}  # [win]
  host:
    - r-base

  run:
    - r-base

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

about:
  home: https://CRAN.R-project.org/package=gss
  license: GPL-2.0-or-later
  summary: A comprehensive package for structural multivariate function estimation using smoothing splines.
  license_family: GPL2
  license_file: {{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-2

extra:
  recipe-maintainers:
    - conda-forge/r
