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

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

source:
  fn: piton_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/piton_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/piton/piton_{{ version }}.tar.gz
  sha256: 993266f43f565555698b2d439de0eb77c7cafb9450e92260e6b654b129f1c588

build:
  merge_build_host: True  # [win]
  number: 2
  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
  run:
    - r-base
    - {{native}}gcc-libs         # [win]
    - r-rcpp

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

about:
  home: https://www.github.com/Ironholds/piton
  license: MIT
  summary: A wrapper around the 'Parsing Expression Grammar Template Library', a C++11 library
    for generating Parsing Expression Grammars, that makes it accessible within Rcpp.
    With this, developers can implement their own grammars and easily expose them in
    R packages.
  license_family: MIT

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