{% set version = '2.5.3' %}

{% 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: 9a5999afad09f0cf80515241b2ff19a0c480658c4bd3810638ad52762e04b7e3

build:
  merge_build_host: True  # [win]
  # If this is a new build for the same version, increment the build number.
  number: 0
  # no skip

  # This is required to make R link correctly on Linux.
  rpaths:
    - lib/R/lib/
    - lib/

# Suggests: covr, crayon, fs, knitr, pillar (>= 1.4.0), rmarkdown, testthat (>= 3.0.0), utf8
requirements:
  build:
    - {{ compiler('c') }}              # [not win]
    - {{ compiler('m2w64_c') }}        # [win]
    - {{ compiler('cxx') }}            # [not win]
    - {{ compiler('m2w64_cxx') }}      # [win]
    - {{ posix }}filesystem        # [win]
    - {{ posix }}sed               # [win]
    - {{ posix }}grep              # [win]
    - {{ posix }}autoconf
    - {{ posix }}automake          # [not win]
    - {{ posix }}automake-wrapper  # [win]
    - {{ posix }}pkg-config
    - {{ posix }}make
    - {{ 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
    - zlib

  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
    - zlib

test:
  commands:
    # You can put additional test commands to be run here.
    - $R -e "library('haven')"           # [not win]
    - "\"%R%\" -e \"library('haven')\""  # [win]

  # You can also put a file called run_test.py, run_test.sh, or run_test.bat
  # in the recipe that will be run at test time.

  # requires:
    # Put any additional test requirements here.

about:
  home: https://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:
    - johanneskoester
    - bgruening
    - mingwandroid

# The original CRAN metadata for this package was:

# Package: haven
# Title: Import and Export 'SPSS', 'Stata' and 'SAS' Files
# Version: 2.5.3
# Authors@R: c( person("Hadley", "Wickham", , "hadley@posit.co", role = c("aut", "cre")), person("Evan", "Miller", role = c("aut", "cph"), comment = "Author of included ReadStat code"), person("Danny", "Smith", role = "aut"), person("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: https://haven.tidyverse.org, https://github.com/tidyverse/haven, https://github.com/WizardMac/ReadStat
# BugReports: https://github.com/tidyverse/haven/issues
# Depends: R (>= 3.6)
# Imports: cli (>= 3.0.0), forcats (>= 0.2.0), hms, lifecycle, methods, readr (>= 0.1.0), rlang (>= 0.4.0), tibble, tidyselect, vctrs (>= 0.3.0)
# Suggests: covr, crayon, fs, knitr, pillar (>= 1.4.0), rmarkdown, testthat (>= 3.0.0), utf8
# LinkingTo: cpp11
# VignetteBuilder: knitr
# Config/Needs/website: tidyverse/tidytemplate
# Config/testthat/edition: 3
# Encoding: UTF-8
# RoxygenNote: 7.2.3
# SystemRequirements: GNU make, zlib: zlib1g-dev (deb), zlib-devel (rpm)
# NeedsCompilation: yes
# Packaged: 2023-06-29 21:30:23 UTC; hadleywickham
# Author: Hadley Wickham [aut, cre], Evan Miller [aut, cph] (Author of included ReadStat code), Danny Smith [aut], RStudio [cph, fnd]
# Maintainer: Hadley Wickham <hadley@posit.co>
# Repository: CRAN
# Date/Publication: 2023-06-30 20:00:02 UTC

# See
# https://docs.conda.io/projects/conda-build for
# more information about meta.yaml
