{% set version = '2.1.18' %}

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

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

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


  sha256: 1bb54d5f28f0adc24a5f3cfbf5cda4a71ca2ad7922a687f756e0619767c1a496

build:
  number: 0

  rpaths:
    - lib/R/lib/
    - lib/
  skip: True  # [win32]

requirements:
  build:
    - r-base
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]
  run:
    - r-base
    - libgcc               # [not win]

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



about:
  home: https://CRAN.R-project.org/package=yaml
  license: BSD_3_clause
  summary: Implements the 'libyaml' 'YAML' 1.1 parser and emitter (<http://pyyaml.org/wiki/LibYAML>) for R.
  license_family: BSD
  license_file: LICENSE



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