{% set version = "2.2.0" %}
{% 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: 199ee9b14e1ff70a0b0c3b9ce33dfdec8ed3b5e857a2a36bfb82e78a7b352d3d
  patches:
    - r-haven-libiconv.patch

build:
  merge_build_host: True  # [win]
  number: 1
  rpaths:
    - lib/R/lib/
    - lib/

requirements:
  build:
    - {{ 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-rcpp >=0.11.4
    - r-forcats >=0.2.0
    - r-hms
    - r-readr >=0.1.0
    - r-rlang
    - r-tibble
    - r-tidyselect
    - libiconv
  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-rlang
    - r-tibble
    - r-tidyselect

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
