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

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

source:
  fn: haven_{{ version }}.tar.gz
  url:
    - {{ cran_mirror }}/src/contrib/haven_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/haven/haven_{{ version }}.tar.gz
  sha256: c0a1cf1b039549fb3ad833f9644ed3f142790236ad755d2ee7bd3d8109e3ae74

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

requirements:
  build:
    - {{ compiler('c') }}        # [not win]
    - {{ compiler('cxx') }}      # [not win]
    - {{native}}toolchain        # [win]
    - {{posix}}filesystem        # [win]
    - {{posix}}make
    - {{posix}}sed               # [win]
    - {{posix}}coreutils         # [win]
    - {{posix}}zip               # [win]
  host:
    - r-base
    - r-rcpp >=0.11.4
    - r-forcats >=0.2.0
    - r-hms
    - r-readr >=0.1.0
    - r-tibble
  run:
    - r-base
    - {{native}}gcc-libs         # [win]
    - r-rcpp >=0.11.4
    - r-forcats >=0.2.0
    - r-hms
    - r-readr >=0.1.0
    - r-tibble

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

about:
  home: http://haven.tidyverse.org
  license: MIT
  summary: Import foreign statistical formats into R via the embedded 'ReadStat' C library, <https://github.com/WizardMac/ReadStat>.
  license_family: MIT

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