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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/readr_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/readr/readr_{{ version }}.tar.gz
  sha256: 98b05ed751dda2bcf7a29d070ce3d3e8475e0138a3e3ec68941dc45218db7615

build:
  merge_build_host: true  # [win]
  number: 0
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{ compiler('c') }}              # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ compiler('cxx') }}            # [not win]
    - {{ compiler('m2w64_cxx') }}      # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}make
    - {{ posix }}sed               # [win]
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [win]
    - cross-r-base {{ r_base }}    # [build_platform != target_platform]
  host:
    - r-base
    - r-r6
    - r-cli
    - r-clipr
    - r-cpp11
    - r-crayon
    - r-hms >=0.4.1
    - r-lifecycle >=0.2.0
    - r-rlang
    - r-tibble
    - r-tzdb >=0.1.1
    - r-vroom >=1.5.4
  run:
    - r-base
    - {{ native }}gcc-libs         # [win]
    - r-r6
    - r-cli
    - r-clipr
    - r-cpp11
    - r-crayon
    - r-hms >=0.4.1
    - r-lifecycle >=0.2.0
    - r-rlang
    - r-tibble
    - r-tzdb >=0.1.1
    - r-vroom >=1.5.4

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

about:
  home: http://readr.tidyverse.org, https://github.com/tidyverse/readr
  license: MIT
  summary: The goal of 'readr' is to provide a fast and friendly way to read rectangular data (like 'csv', 'tsv', and 'fwf'). It is designed to flexibly parse many types of data found in the wild, while still cleanly failing when data unexpectedly changes.
  license_family: MIT
  license_file:
    - {{ environ["PREFIX"] }}/lib/R/share/licenses/MIT

extra:
  recipe-maintainers:
    - conda-forge/r
