{% set version = '0.5.10' %}

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

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

source:
  fn: rio_{{ version }}.tar.gz
  url:
    - https://cran.r-project.org/src/contrib/rio_{{ version }}.tar.gz
    - https://cran.r-project.org/src/contrib/Archive/rio/rio_{{ version }}.tar.gz
  sha256: 3dc2898ca3c5bbf62295b5b961a759a27a5739f7ce444eb51b933e20f7781d95

build:
  number: 0
  skip: true  # [win32]
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - r-base
    - r-curl >=0.6
    - r-data.table >=1.9.8
    - r-foreign
    - r-haven >=1.1.0
    - r-openxlsx
    - r-readxl >=0.1.1
    - r-tibble

  run:
    - r-base
    - r-curl >=0.6
    - r-data.table >=1.9.8
    - r-foreign
    - r-haven >=1.1.0
    - r-openxlsx
    - r-readxl >=0.1.1
    - r-tibble

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

about:
  home: https://github.com/leeper/rio
  license: GPL-2
  summary: "Streamlined data import and export by making assumptions that the user is probably
    willing to make: 'import()' and 'export()' determine the data structure from the file extension,
    reasonable defaults are used for data import and export (e.g., 'stringsAsFactors=FALSE'),
    web-based import is natively supported (including from SSL/HTTPS), compressed files can be read
    directly without explicit decompression, and fast import packages are used where appropriate.
    An additional convenience function, 'convert()', provides a simple method for converting
    between file types."
  license_family: GPL2
  license_file: '{{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-2'  # [unix]
  license_file: '{{ environ["PREFIX"] }}\R\share\licenses\GPL-2'  # [win]

extra:
  recipe-maintainers:
    - johanneskoester
    - bgruening
    - daler
    - jdblischak
    - cbrueffer
