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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/haven_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/haven/haven_{{ version }}.tar.gz
  sha256: 9e1531bb37aa474abd91db5e0ed9e3a355c03faa65f4e653b3ea68b7c61ea835
  #patches:
  #  - r-haven-libiconv.patch

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

requirements:
  build:
    - cross-r-base {{ r_base }}  # [build_platform != target_platform]
    - r-cpp11                    # [build_platform != target_platform]
    - r-readr                    # [build_platform != target_platform]
    - r-tibble                   # [build_platform != target_platform]
    - r-rlang                    # [build_platform != target_platform]
    - r-tidyselect               # [build_platform != target_platform]
    - r-hms                      # [build_platform != target_platform]
    - r-forcats                  # [build_platform != target_platform]
    - {{ compiler('c') }}              # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ compiler('cxx') }}            # [not win]
    - {{ compiler('m2w64_cxx') }}      # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}make
    - {{ posix }}sed               # [win]
    - {{ posix }}coreutils         # [win]
    - {{ posix }}zip               # [win]
  host:
    - r-base
    - r-cli >=3.0.0
    - r-cpp11
    - r-forcats >=0.2.0
    - r-hms
    - r-lifecycle
    - r-readr >=0.1.0
    - r-rlang >=0.4.0
    - r-tibble
    - r-tidyselect
    - r-vctrs >=0.3.0
  run:
    - r-base
    - {{ native }}gcc-libs         # [win]
    - r-cli >=3.0.0
    - r-cpp11
    - r-forcats >=0.2.0
    - r-hms
    - r-lifecycle
    - r-readr >=0.1.0
    - r-rlang >=0.4.0
    - r-tibble
    - r-tidyselect
    - r-vctrs >=0.3.0

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

about:
  home: http://haven.tidyverse.org, https://github.com/tidyverse/haven, https://github.com/WizardMac/ReadStat
  license: MIT
  summary: Import foreign statistical formats into R via the embedded 'ReadStat' C library, <https://github.com/WizardMac/ReadStat>.
  license_family: MIT
  license_file:
    - {{ environ["PREFIX"] }}/lib/R/share/licenses/MIT
    - LICENSE

extra:
  recipe-maintainers:
    - conda-forge/r

# Package: haven
# Title: Import and Export 'SPSS', 'Stata' and 'SAS' Files
# Version: 2.1.1
# Authors@R:  c(person(given = "Hadley", family = "Wickham", role = c("aut", "cre"), email = "hadley@rstudio.com"), person(given = "Evan", family = "Miller", role = c("aut", "cph"), comment = "Author of included ReadStat code"), person(given = "RStudio", role = c("cph", "fnd")))
# Description: Import foreign statistical formats into R via the embedded 'ReadStat' C library, <https://github.com/WizardMac/ReadStat>.
# License: MIT + file LICENSE
# URL: http://haven.tidyverse.org, https://github.com/tidyverse/haven, https://github.com/WizardMac/ReadStat
# BugReports: https://github.com/tidyverse/haven/issues
# Depends: R (>= 3.2)
# Imports: forcats (>= 0.2.0), hms, Rcpp (>= 0.11.4), readr (>= 0.1.0), tibble
# Suggests: covr, fs, knitr, rmarkdown, testthat, pillar (>= 1.1.1), cli, crayon
# LinkingTo: Rcpp
# VignetteBuilder: knitr
# Encoding: UTF-8
# LazyData: true
# RoxygenNote: 6.1.1
# SystemRequirements: GNU make
# NeedsCompilation: yes
# Packaged: 2019-07-04 14:20:24 UTC; hadley
# Author: Hadley Wickham [aut, cre], Evan Miller [aut, cph] (Author of included ReadStat code), RStudio [cph, fnd]
# Maintainer: Hadley Wickham <hadley@rstudio.com>
# Repository: CRAN
# Date/Publication: 2019-07-04 14:50:03 UTC
