blob: 40e3434ead95b0aa86fc427bb046ee08b34bd24e [file] [log] [blame]
Andrew Geissler82c905d2020-04-13 13:39:40 -05001SUMMARY = "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."
Patrick Williamsab475af2022-04-21 14:30:30 -05003HOMEPAGE = "https://gitlab.gnome.org/GNOME/libxml2"
Andrew Geissler82c905d2020-04-13 13:39:40 -05004BUGTRACKER = "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=96f7296605eae807670fb08947829969 \
9 file://list.c;beginline=4;endline=13;md5=cdbfa3dee51c099edb04e39f762ee907 \
10 file://trio.c;beginline=5;endline=14;md5=6c025753c86d958722ec76e94cae932e"
11
12DEPENDS = "zlib virtual/libiconv"
13
Patrick Williamsab475af2022-04-21 14:30:30 -050014inherit gnomebase
15
16SRC_URI += "http://www.w3.org/XML/Test/xmlts20080827.tar.gz;subdir=${BP};name=testtar \
Andrew Geissler82c905d2020-04-13 13:39:40 -050017 file://libxml-64bit.patch \
18 file://runtest.patch \
19 file://run-ptest \
20 file://python-sitepackages-dir.patch \
21 file://libxml-m4-use-pkgconfig.patch \
22 file://0001-Make-ptest-run-the-python-tests-if-python-is-enabled.patch \
23 file://fix-execution-of-ptests.patch \
24 file://CVE-2020-7595.patch \
25 file://CVE-2019-20388.patch \
Patrick Williams94a70a02020-12-01 11:48:33 -060026 file://CVE-2020-24977.patch \
Patrick Williams043e75a2021-07-08 11:39:47 -050027 file://CVE-2021-3517.patch \
28 file://CVE-2021-3537.patch \
29 file://CVE-2021-3518.patch \
Patrick Williamsfff6b342021-08-30 15:19:52 -050030 file://CVE-2021-3541.patch \
Patrick Williamsab475af2022-04-21 14:30:30 -050031 file://CVE-2022-23308.patch \
32 file://CVE-2022-23308-fix-regression.patch \
Patrick Williamscddccf42022-08-22 15:51:32 -050033 file://CVE-2022-29824-dependent.patch \
34 file://CVE-2022-29824.patch \
35 file://0001-Port-gentest.py-to-Python-3.patch \
Patrick Williams61a2d432022-10-18 12:43:19 -050036 file://CVE-2016-3709.patch \
Patrick Williams841583d2023-05-03 21:37:45 -050037 file://CVE-2022-40303.patch \
38 file://CVE-2022-40304.patch \
Andrew Geissler82c905d2020-04-13 13:39:40 -050039 "
40
Patrick Williamsab475af2022-04-21 14:30:30 -050041SRC_URI[archive.sha256sum] = "593b7b751dd18c2d6abcd0c4bcb29efc203d0b4373a6df98e3a455ea74ae2813"
Andrew Geissler82c905d2020-04-13 13:39:40 -050042SRC_URI[testtar.md5sum] = "ae3d1ebe000a3972afa104ca7f0e1b4a"
43SRC_URI[testtar.sha256sum] = "96151685cec997e1f9f3387e3626d61e6284d4d6e66e0e440c209286c03e9cc7"
44
45BINCONFIG = "${bindir}/xml2-config"
46
47PACKAGECONFIG ??= "python \
48 ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \
49"
50PACKAGECONFIG[python] = "--with-python=${PYTHON},--without-python,python3"
51PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6,"
52
53inherit autotools pkgconfig binconfig-disabled ptest features_check
54
Patrick Williams23c9e5d2022-02-08 13:42:21 -060055inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3targetconfig', '', d)}
Andrew Geissler82c905d2020-04-13 13:39:40 -050056
Patrick Williams043e75a2021-07-08 11:39:47 -050057RDEPENDS_${PN}-ptest += "bash make ${@bb.utils.contains('PACKAGECONFIG', 'python', 'libgcc python3-core python3-logging python3-shell python3-stringold python3-threading python3-unittest ${PN}-python', '', d)}"
Andrew Geissler82c905d2020-04-13 13:39:40 -050058
59RDEPENDS_${PN}-python += "${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3-core', '', d)}"
60
61RDEPENDS_${PN}-ptest_append_libc-glibc = " glibc-gconv-ebcdic-us \
62 glibc-gconv-ibm1141 \
63 glibc-gconv-iso8859-5 \
64 glibc-gconv-euc-jp \
65 locale-base-en-us \
66 "
67
68export PYTHON_SITE_PACKAGES="${PYTHON_SITEPACKAGES_DIR}"
69
70# WARNING: zlib is required for RPM use
71EXTRA_OECONF = "--without-debug --without-legacy --with-catalog --without-docbook --with-c14n --without-lzma --with-fexceptions"
72EXTRA_OECONF_class-native = "--without-legacy --without-docbook --with-c14n --without-lzma --with-zlib"
73EXTRA_OECONF_class-nativesdk = "--without-legacy --without-docbook --with-c14n --without-lzma --with-zlib"
74EXTRA_OECONF_linuxstdbase = "--with-debug --with-legacy --with-docbook --with-c14n --without-lzma --with-zlib"
75
76python populate_packages_prepend () {
77 # autonamer would call this libxml2-2, but we don't want that
78 if d.getVar('DEBIAN_NAMES'):
79 d.setVar('PKG_libxml2', '${MLPREFIX}libxml2')
80}
81
82PACKAGE_BEFORE_PN += "${PN}-utils"
83PACKAGES += "${PN}-python"
84
85FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a"
86FILES_${PN}-dev += "${libdir}/xml2Conf.sh ${libdir}/cmake/*"
87FILES_${PN}-utils = "${bindir}/*"
88FILES_${PN}-python = "${PYTHON_SITEPACKAGES_DIR}"
89
90do_configure_prepend () {
91 # executables take longer to package: these should not be executable
92 find ${S}/xmlconf/ -type f -exec chmod -x {} \+
93}
94
95do_compile_ptest() {
Patrick Williamscddccf42022-08-22 15:51:32 -050096 # Make sure that testapi.c is newer than gentests.py, because
97 # with reproducible builds, they will both get e.g. Jan 1 1970
98 # modification time from SOURCE_DATE_EPOCH and then check-am
99 # might try to rebuild_testapi, which will fail even with
100 # 0001-Port-gentest.py-to-Python-3.patch, because it needs
101 # libxml2 module (libxml2-native dependency and correctly
102 # set PYTHON_SITE_PACKAGES), it's easier to
103 # just rely on pre-generated testapi.c from the release
104 touch ${S}/testapi.c
105
Andrew Geissler82c905d2020-04-13 13:39:40 -0500106 oe_runmake check-am
107}
108
109do_install_ptest () {
110 cp -r ${S}/xmlconf ${D}${PTEST_PATH}
111 if [ "${@bb.utils.filter('PACKAGECONFIG', 'python', d)}" ]; then
112 sed -i -e 's|^\(PYTHON = \).*|\1${USRBINPATH}/${PYTHON_PN}|' \
113 ${D}${PTEST_PATH}/python/tests/Makefile
114 grep -lrZ '#!/usr/bin/python' ${D}${PTEST_PATH}/python |
115 xargs -0 sed -i -e 's|/usr/bin/python|${USRBINPATH}/${PYTHON_PN}|'
116 fi
117 #Remove build host references from various Makefiles
118 find "${D}${PTEST_PATH}" -name Makefile -type f -exec \
119 sed -i \
120 -e 's,--sysroot=${STAGING_DIR_TARGET},,g' \
121 -e 's|${DEBUG_PREFIX_MAP}||g' \
122 -e 's:${HOSTTOOLS_DIR}/::g' \
123 -e 's:${RECIPE_SYSROOT_NATIVE}::g' \
124 -e 's:${RECIPE_SYSROOT}::g' \
125 -e 's:${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}::g' \
126 -e '/^RELDATE/d' \
127 {} +
128}
129
130do_install_append_class-native () {
131 # Docs are not needed in the native case
132 rm ${D}${datadir}/gtk-doc -rf
133}
134
135BBCLASSEXTEND = "native nativesdk"