{% set version = '1.1.0' %}

{% 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: 47633f022c7b5398e7c3d62493bc06823034e608d119ae1592f6e05ddb1befbc

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
