{% set version = "1.4.0" %}
{% 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: 02b1188aab8b2bc3f3d2bba5b946bd299610e87f3f7660c88b60b444093c46b9

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]
  host:
    - r-base
    - r-bh
    - r-r6
    - r-cli
    - r-clipr
    - r-cpp11
    - r-crayon
    - r-hms >=0.4.1
    - r-lifecycle
    - r-rlang
    - r-tibble
  run:
    - r-base
    - {{ native }}gcc-libs         # [win]
    - r-r6
    - r-cli
    - r-clipr
    - r-cpp11
    - r-crayon
    - r-hms >=0.4.1
    - r-lifecycle
    - r-rlang
    - r-tibble

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: GPL-2.0-or-later
  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: GPL3
  license_file:
    - {{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3

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