{% set version = '2.3.7' %}

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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/yaml_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/yaml/yaml_{{ version }}.tar.gz
  sha256: d20cb219e0f9c48aba02f132f81cfa9ecda5e22c925e36726840218ed56680ab

build:
  merge_build_host: True  # [win]
  # If this is a new build for the same version, increment the build number.
  number: 0
  # no skip

  # This is required to make R link correctly on Linux.
  rpaths:
    - lib/R/lib/
    - lib/

# Suggests: RUnit
requirements:
  build:
    - {{ compiler('c') }}              # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}make
    - {{ posix }}sed               # [win]
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [win]

  host:
    - r-base

  run:
    - r-base
    - {{native}}gcc-libs         # [win]

test:
  commands:
    # You can put additional test commands to be run here.
    - $R -e "library('yaml')"           # [not win]
    - "\"%R%\" -e \"library('yaml')\""  # [win]

  # You can also put a file called run_test.py, run_test.sh, or run_test.bat
  # in the recipe that will be run at test time.

  # requires:
    # Put any additional test requirements here.

about:
  home: https://github.com/vubiostat/r-yaml/
  license: BSD_3_clause
  summary: Implements the 'libyaml' 'YAML' 1.1 parser and emitter (<https://pyyaml.org/wiki/LibYAML>)
    for R.
  license_family: BSD
  license_file:
    - '{{ environ["PREFIX"] }}/lib/R/share/licenses/BSD_3_clause'
    - LICENSE

extra:
  recipe-maintainers:
    - croth1
    - mingwandroid

# The original CRAN metadata for this package was:

# Package: yaml
# Type: Package
# Title: Methods to Convert R Data to YAML and Back
# Date: 2023-01-18
# Version: 2.3.7
# Suggests: RUnit
# Author: Shawn P Garbett [aut], Jeremy Stephens [aut, cre], Kirill Simonov [aut], Yihui Xie [ctb], Zhuoer Dong [ctb], Hadley Wickham [ctb], Jeffrey Horner [ctb], reikoch [ctb], Will Beasley [ctb], Brendan O'Connor [ctb], Gregory R. Warnes [ctb], Michael Quinn [ctb], Zhian N. Kamvar [ctb]
# Maintainer: Shawn Garbett <shawn.garbett@vumc.org>
# License: BSD_3_clause + file LICENSE
# Description: Implements the 'libyaml' 'YAML' 1.1 parser and emitter (<https://pyyaml.org/wiki/LibYAML>) for R.
# URL: https://github.com/vubiostat/r-yaml/
# BugReports: https://github.com/vubiostat/r-yaml/issues
# NeedsCompilation: yes
# Packaged: 2023-01-18 17:20:16 UTC; garbetsp
# Repository: CRAN
# Date/Publication: 2023-01-23 18:40:02 UTC

# See
# https://docs.conda.io/projects/conda-build for
# more information about meta.yaml
