{% set version = '0.12.13' %}

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

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

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


  sha256: a570ad88282fb961ba32c867c49dbd3dce6f4dfc7b59ab1fbde510449827a8ae
  patches:
    - 0001-Add-CXX1XSTD-to-PKG_CPPFLAGS.patch
    - 0002-macOS-When-target-lt-10.9-libstdc-supports-only-some.patch

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('Rcpp')"  # [not win]
    - "\"%R%\" -e \"library('Rcpp')\""  # [win]

about:
  home: http://www.rcpp.org, http://dirk.eddelbuettel.com/code/rcpp.html, https://github.com/RcppCore/Rcpp
  license: GPL 2.0
  license_family: GPL
  summary: The 'Rcpp' package provides R functions as well as C++ classes which offer a seamless
    integration of R and C++. Many R data types and objects can be mapped back and forth
    to C++ equivalents which facilitates both writing of new code as well as easier
    integration of third-party libraries. Documentation  about 'Rcpp' is provided by
    several vignettes included in this package, via the  'Rcpp Gallery' site at <http://gallery.rcpp.org>,
    the paper by Eddelbuettel and  Francois (2011, JSS), and the book by Eddelbuettel
    (2013, Springer); see  'citation("Rcpp")' for details on these last two.

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
