{% set version = '1.9-10.3' %}

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

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

source:
  fn: gsl_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/gsl_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/gsl/gsl_{{ version }}.tar.gz
  sha256: 4f9fc4dc8170ba93c9b45940448da089ce9ad4c45ba39c8f264e1505a3e03a02

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

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

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

  run:
    - r-base
    - {{native}}gsl

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

about:
  home: https://CRAN.R-project.org/package=gsl
  license: GPL (>= 2)
  summary: ' An R wrapper for the special functions and quasi random number generators of the
    Gnu Scientific Library (http://www.gnu.org/software/gsl/).  See gsl-package.Rd for
    details of  overall package organization, and Misc.Rd for some functions that are
    widely used in the package, and some tips on installation.'

  license_family: GPL3

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
