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

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

source:
  fn: bindrcpp_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/bindrcpp_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/bindrcpp/bindrcpp_{{ version }}.tar.gz
  sha256: 48130709eba9d133679a0e959e49a7b14acbce4f47c1e15c4ab46bd9e48ae467

build:
  merge_build_host: True  # [win]
  number: 1001
  skip: true  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{ compiler('c') }}        # [not win]
    - {{ compiler('cxx') }}      # [not win]
    - {{native}}toolchain        # [win]
    - {{posix}}filesystem        # [win]
    - {{posix}}make
    - {{posix}}sed               # [win]
    - {{posix}}coreutils         # [win]
    - {{posix}}zip               # [win]
  host:
    - r-base
    - r-rcpp >=0.12.16
    - r-bindr >=0.1.1
    - r-plogr
  run:
    - r-base
    - {{native}}gcc-libs         # [win]
    - r-rcpp >=0.12.16
    - r-bindr >=0.1.1
    - r-plogr

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

about:
  home: https://github.com/krlmlr/bindrcpp, https://krlmlr.github.io/bindrcpp
  license: MIT
  summary: Provides an easy way to fill an environment with active bindings that call a C++ function.
  license_family: MIT

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