{% set version = '0.1.3' %}

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

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

source:
  fn: RcppTOML_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/RcppTOML_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/RcppTOML/RcppTOML_{{ version }}.tar.gz
  sha256: 0568b5fc5cb305a979de2e48e241cb4b015ce81402ab519c7fb9a14a40203c4f

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

  rpaths:
    - lib/R/lib/
    - lib/
requirements:
  build:
    - r-base
    - r-rcpp >=0.11.5
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]
  run:
    - r-base
    - r-rcpp >=0.11.5
    - libgcc  # [not win]

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

about:
  home: http://dirk.eddelbuettel.com/code/rcpp.toml.html
  license: GPL (>= 2)
  summary: |
    The configuration format defined by ''TOML'' (which expands to "Tom''s Obvious Markup
    Language") specifies an excellent format (described at <https://github.com/toml-lang/toml>)
    suitable for both human editing as well as the common uses of a machine-readable
    format. This package uses ''Rcpp'' to connect the ''cpptoml'' parser written by
    Chase Geigle (in modern C++11) to R.
  license_family: GPL3

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