{% set version = '1.0.0' %}

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

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

source:
  fn: readxl_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/readxl_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/readxl/readxl_{{ version }}.tar.gz
  sha256: fbd62f07fed7946363698a57be88f4ef3fa254ecf456ef292535849c787fc7ad

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

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

requirements:
  build:
    - r-base
    - r-rcpp
    - r-cellranger
    - r-tibble >=1.1
    - posix                # [win]
    - {{native}}toolchain  # [win]
    - gcc                  # [not win]

  run:
    - r-base
    - r-rcpp
    - r-cellranger
    - r-tibble >=1.1

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

about:
  home: http://readxl.tidyverse.org, https://github.com/tidyverse/readxl
  license: GPL-3
  summary: Import excel files into R. Supports '.xls' via the embedded 'libxls' C library <https://sourceforge.net/projects/libxls/>
    and '.xlsx' via the embedded 'RapidXML' C++ library <https://rapidxml.sourceforge.net>.
    Works on Windows, Mac and Linux without external dependencies.
  license_family: GPL3

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
