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

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

source:
  url:
    - {{ cran_mirror }}/src/contrib/xml2_{{ version }}.tar.gz
    - {{ cran_mirror }}/src/contrib/Archive/xml2/xml2_{{ version }}.tar.gz
  sha256: cb4e9c0d31618ed67d2bfa4c7b5e52680e11612ed356a8164b541d44163c1c8d

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

requirements:
  build:
    - cross-r-base {{ r_base }}    # [build_platform != target_platform]
    - gnuconfig                    # [unix]
    - {{ 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-rcpp
    - {{ native }}libxml2
  run:
    - r-base
    - {{ native }}gcc-libs         # [win]
    - r-rcpp
    - libxml2

test:
  requires:
    - r-testthat
    - r-mockery
  commands:
    - $R -e "library('xml2')"                          # [not win]
    - $R -e "testthat::test_package('xml2')"           # [not win]
    - "\"%R%\" -e \"library('xml2')\""                 # [win]
    - "\"%R%\" -e \"testthat::test_package('xml2')\""  # [win]

about:
  home: https://xml2.r-lib.org/, https://github.com/r-lib/xml2
  license: GPL-2.0-or-later
  summary: Work with XML files using a simple, consistent interface. Built on top of the 'libxml2' C library.
  license_family: GPL2
  license_file:
    - {{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-2
    - {{ environ["PREFIX"] }}/lib/R/share/licenses/GPL-3

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

# Package: xml2
# Title: Parse XML
# Version: 1.2.2
# Authors@R:  c(person(given = "Hadley", family = "Wickham", role = "aut", email = "hadley@rstudio.com"), person(given = "Jim", family = "Hester", role = c("aut", "cre"), email = "jim.hester@rstudio.com"), person(given = "Jeroen", family = "Ooms", role = "aut"), person(given = "RStudio", role = "cph"), person(given = "R Foundation", role = "ctb", comment = "Copy of R-project homepage cached as example"))
# Description: Work with XML files using a simple, consistent interface. Built on top of the 'libxml2' C library.
# License: GPL (>= 2)
# URL: https://xml2.r-lib.org/, https://github.com/r-lib/xml2
# BugReports: https://github.com/r-lib/xml2/issues
# Depends: R (>= 3.1.0)
# Imports: Rcpp, methods
# Suggests: covr, curl, httr, knitr, magrittr, mockery, rmarkdown, testthat (>= 2.1.0)
# LinkingTo: Rcpp (>= 0.12.12)
# VignetteBuilder: knitr
# Encoding: UTF-8
# RoxygenNote: 6.1.1
# SystemRequirements: libxml2: libxml2-dev (deb), libxml2-devel (rpm)
# Collate: 'RcppExports.R' 'S4.R' 'as_list.R' 'xml_parse.R' 'as_xml_document.R' 'classes.R' 'init.R' 'paths.R' 'utils.R' 'xml_attr.R' 'xml_children.R' 'xml_find.R' 'xml_modify.R' 'xml_name.R' 'xml_namespaces.R' 'xml_path.R' 'xml_schema.R' 'xml_serialize.R' 'xml_structure.R' 'xml_text.R' 'xml_type.R' 'xml_url.R' 'xml_write.R' 'zzz.R'
# NeedsCompilation: yes
# Packaged: 2019-08-06 20:54:39 UTC; jhester
# Author: Hadley Wickham [aut], Jim Hester [aut, cre], Jeroen Ooms [aut], RStudio [cph], R Foundation [ctb] (Copy of R-project homepage cached as example)
# Maintainer: Jim Hester <jim.hester@rstudio.com>
# Repository: CRAN
# Date/Publication: 2019-08-09 12:10:03 UTC
