{% set version = '1.1.1' %}

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

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

source:
  fn: readr_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/readr_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/readr/readr_{{ version }}.tar.gz
  sha256: 1a29b99009a06f2cee18d08bc6201fd4985b6d45c76cefca65084dcc1a2f7cb3

build:
  number: 0
  skip: true  # [win32]

  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - r-base
    - r-bh
    - r-r6
    - r-rcpp >=0.12.0.5
    - r-hms
    - r-tibble
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]

  run:
    - r-base
    - r-bh
    - r-r6
    - r-rcpp >=0.12.0.5
    - r-hms
    - r-tibble
    - libgcc  # [not win]

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)
  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

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
