{% set version = '0.3.2' %}

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

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

source:
  fn: RcppGSL_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/RcppGSL_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/RcppGSL/RcppGSL_{{ version }}.tar.gz
  sha256: 8153b1b49c3b4afff5246629a6fb6b9be4d0285ddc8567bc9f501311d41ee139

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

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

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

  run:
    - r-base
    - r-rcpp >=0.11.0
    - libgcc  # [not win]

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

about:
  home: https://CRAN.R-project.org/package=RcppGSL
  license: GPL (>= 2)
  summary: '''Rcpp'' integration for ''GNU GSL'' vectors and matrices The ''GNU Scientific Library''
    (or ''GSL'') is a collection of numerical routines for scientific computing. It
    is particularly useful for C and C++ programs as it provides a standard C interface
    to a wide range of mathematical routines. There are over 1000 functions in total
    with an extensive test suite. The ''RcppGSL'' package provides an easy-to-use interface
    between ''GSL'' data structures and R using concepts from ''Rcpp'' which is itself
    a package that eases the interfaces between R and C++. This package also serves
    as a prime example of how to build a package that uses ''Rcpp'' to connect to another
    third-party library. The ''autoconf'' script, ''inline'' plugin and example package
    can all be used as a stanza to  write a similar package against another library.'

  license_family: GPL3

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
