blob: 288631504cea1e4bed11be0ffc151b18015fe78b [file] [log] [blame]
Andrew Geissler517393d2023-01-13 08:55:19 -06001SUMMARY = "XML C Parser Library and Toolkit"
2DESCRIPTION = "The XML Parser Library allows for manipulation of XML files. Libxml2 exports Push and Pull type parser interfaces for both XML and HTML. It can do DTD validation at parse time, on a parsed document instance or with an arbitrary DTD. Libxml2 includes complete XPath, XPointer and Xinclude implementations. It also has a SAX like interface, which is designed to be compatible with Expat."
3HOMEPAGE = "https://gitlab.gnome.org/GNOME/libxml2"
4BUGTRACKER = "http://bugzilla.gnome.org/buglist.cgi?product=libxml2"
5SECTION = "libs"
6LICENSE = "MIT"
7LIC_FILES_CHKSUM = "file://Copyright;md5=2044417e2e5006b65a8b9067b683fcf1 \
8 file://hash.c;beginline=6;endline=15;md5=e77f77b12cb69e203d8b4090a0eee879 \
9 file://list.c;beginline=4;endline=13;md5=b9c25b021ccaf287e50060602d20f3a7 \
10 file://trio.c;beginline=5;endline=14;md5=cd4f61e27f88c1d43df112966b1cd28f"
11
12DEPENDS = "zlib virtual/libiconv"
13
14inherit gnomebase
15
16SRC_URI += "http://www.w3.org/XML/Test/xmlts20130923.tar;subdir=${BP};name=testtar \
17 file://run-ptest \
18 file://libxml-64bit.patch \
19 file://fix-tests.patch \
20 file://install-tests.patch \
21 file://libxml-m4-use-pkgconfig.patch \
22 "
23
Patrick Williams8e7b46e2023-05-01 14:19:06 -050024SRC_URI[archive.sha256sum] = "ed0c91c5845008f1936739e4eee2035531c1c94742c6541f44ee66d885948d45"
Andrew Geissler517393d2023-01-13 08:55:19 -060025SRC_URI[testtar.sha256sum] = "c6b2d42ee50b8b236e711a97d68e6c4b5c8d83e69a2be4722379f08702ea7273"
26
27BINCONFIG = "${bindir}/xml2-config"
28
29# Fixed since 2.9.11 via
30# https://gitlab.gnome.org/GNOME/libxml2/-/commit/c1ba6f54d32b707ca6d91cb3257ce9de82876b6f
31CVE_CHECK_IGNORE += "CVE-2016-3709"
32
33PACKAGECONFIG ??= "python \
34 ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \
35"
36PACKAGECONFIG[python] = "--with-python=${PYTHON},--without-python,python3"
37PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
38
39inherit autotools pkgconfig binconfig-disabled ptest
40
41inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3targetconfig', '', d)}
42
Patrick Williams8e7b46e2023-05-01 14:19:06 -050043RDEPENDS:${PN}-ptest += "bash make locale-base-en-us ${@bb.utils.contains('PACKAGECONFIG', 'python', 'libgcc python3-core python3-logging python3-shell python3-stringold python3-threading python3-unittest ${PN}-python', '', d)}"
Andrew Geissler517393d2023-01-13 08:55:19 -060044
45RDEPENDS:${PN}-python += "${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3-core', '', d)}"
46
Patrick Williams8e7b46e2023-05-01 14:19:06 -050047RDEPENDS:${PN}-ptest:append:libc-musl = " musl-locales"
Andrew Geissler517393d2023-01-13 08:55:19 -060048RDEPENDS:${PN}-ptest:append:libc-glibc = " glibc-gconv-ebcdic-us \
49 glibc-gconv-ibm1141 \
50 glibc-gconv-iso8859-5 \
51 glibc-gconv-euc-jp \
Andrew Geissler517393d2023-01-13 08:55:19 -060052 "
53
54# WARNING: zlib is required for RPM use
55EXTRA_OECONF = "--without-debug --without-legacy --with-catalog --with-c14n --without-lzma --with-fexceptions"
56EXTRA_OECONF:class-native = "--without-legacy --with-c14n --without-lzma --with-zlib"
57EXTRA_OECONF:class-nativesdk = "--without-legacy --with-c14n --without-lzma --with-zlib"
58EXTRA_OECONF:linuxstdbase = "--with-debug --with-legacy --with-c14n --without-lzma --with-zlib"
59
60python populate_packages:prepend () {
61 # autonamer would call this libxml2-2, but we don't want that
62 if d.getVar('DEBIAN_NAMES'):
63 d.setVar('PKG:libxml2', '${MLPREFIX}libxml2')
64}
65
66PACKAGE_BEFORE_PN += "${PN}-utils"
67PACKAGES += "${PN}-python"
68
69FILES:${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a"
70FILES:${PN}-utils = "${bindir}/*"
71FILES:${PN}-python = "${PYTHON_SITEPACKAGES_DIR}"
72
73do_configure:prepend () {
74 # executables take longer to package: these should not be executable
75 find ${S}/xmlconf/ -type f -exec chmod -x {} \+
76}
77
78do_install_ptest () {
79 oe_runmake DESTDIR=${D} ptestdir=${PTEST_PATH} install-test-data
80
81 cp -r ${S}/xmlconf ${D}${PTEST_PATH}
82
83 if ! ${@bb.utils.contains('PACKAGECONFIG', 'python', 'true', 'false', d)}; then
84 rm -rf ${D}${PTEST_DIR}/python
85 fi
86}
87
Patrick Williams8e7b46e2023-05-01 14:19:06 -050088# with musl we need to enable icu support explicitly for these tests
89do_install_ptest:append:libc-musl () {
90 rm -rf ${D}/${PTEST_PATH}/test/icu_parse_test.xml
91}
92
Andrew Geissler517393d2023-01-13 08:55:19 -060093do_install:append:class-native () {
94 # Docs are not needed in the native case
95 rm ${D}${datadir}/gtk-doc -rf
96
97 create_wrapper ${D}${bindir}/xmllint 'XML_CATALOG_FILES=${XML_CATALOG_FILES:-${sysconfdir}/xml/catalog}'
98}
99do_install[vardepsexclude] += "XML_CATALOG_FILES:-${sysconfdir}/xml/catalog"
100
101BBCLASSEXTEND = "native nativesdk"