{% set version = "2.1.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: 94afd03a1fa4abcf2985ec903bbf5995d7c590e1a50512ed80d081ef4fe10c1b

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

requirements:
  build:
    - cross-r-base {{ r_base }}  # [build_platform != target_platform]
    - r-tibble                   # [build_platform != target_platform]
    - r-cpp11                    # [build_platform != target_platform]
    - r-lifecycle                # [build_platform != target_platform]
    - r-r6                       # [build_platform != target_platform]
    - r-rlang                    # [build_platform != target_platform]
    - r-tzdb                     # [build_platform != target_platform]
    - r-clipr                    # [build_platform != target_platform]
    - r-crayon                   # [build_platform != target_platform]
    - r-hms                      # [build_platform != target_platform]
    - r-cli                      # [build_platform != target_platform]
    - r-vroom                    # [build_platform != target_platform]
    - {{ 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
