Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 1 | SUMMARY = "XML C Parser Library and Toolkit" |
| 2 | DESCRIPTION = "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 Williams | ab475af | 2022-04-21 14:30:30 -0500 | [diff] [blame] | 3 | HOMEPAGE = "https://gitlab.gnome.org/GNOME/libxml2" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 4 | BUGTRACKER = "http://bugzilla.gnome.org/buglist.cgi?product=libxml2" |
| 5 | SECTION = "libs" |
| 6 | LICENSE = "MIT" |
| 7 | LIC_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 | |
| 12 | DEPENDS = "zlib virtual/libiconv" |
| 13 | |
Patrick Williams | ab475af | 2022-04-21 14:30:30 -0500 | [diff] [blame] | 14 | inherit gnomebase |
| 15 | |
| 16 | SRC_URI += "http://www.w3.org/XML/Test/xmlts20080827.tar.gz;subdir=${BP};name=testtar \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 17 | 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 Williams | 94a70a0 | 2020-12-01 11:48:33 -0600 | [diff] [blame] | 26 | file://CVE-2020-24977.patch \ |
Patrick Williams | 043e75a | 2021-07-08 11:39:47 -0500 | [diff] [blame] | 27 | file://CVE-2021-3517.patch \ |
| 28 | file://CVE-2021-3537.patch \ |
| 29 | file://CVE-2021-3518.patch \ |
Patrick Williams | fff6b34 | 2021-08-30 15:19:52 -0500 | [diff] [blame] | 30 | file://CVE-2021-3541.patch \ |
Patrick Williams | ab475af | 2022-04-21 14:30:30 -0500 | [diff] [blame] | 31 | file://CVE-2022-23308.patch \ |
| 32 | file://CVE-2022-23308-fix-regression.patch \ |
Patrick Williams | cddccf4 | 2022-08-22 15:51:32 -0500 | [diff] [blame] | 33 | file://CVE-2022-29824-dependent.patch \ |
| 34 | file://CVE-2022-29824.patch \ |
| 35 | file://0001-Port-gentest.py-to-Python-3.patch \ |
Patrick Williams | 61a2d43 | 2022-10-18 12:43:19 -0500 | [diff] [blame] | 36 | file://CVE-2016-3709.patch \ |
Patrick Williams | 841583d | 2023-05-03 21:37:45 -0500 | [diff] [blame^] | 37 | file://CVE-2022-40303.patch \ |
| 38 | file://CVE-2022-40304.patch \ |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 39 | " |
| 40 | |
Patrick Williams | ab475af | 2022-04-21 14:30:30 -0500 | [diff] [blame] | 41 | SRC_URI[archive.sha256sum] = "593b7b751dd18c2d6abcd0c4bcb29efc203d0b4373a6df98e3a455ea74ae2813" |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 42 | SRC_URI[testtar.md5sum] = "ae3d1ebe000a3972afa104ca7f0e1b4a" |
| 43 | SRC_URI[testtar.sha256sum] = "96151685cec997e1f9f3387e3626d61e6284d4d6e66e0e440c209286c03e9cc7" |
| 44 | |
| 45 | BINCONFIG = "${bindir}/xml2-config" |
| 46 | |
| 47 | PACKAGECONFIG ??= "python \ |
| 48 | ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} \ |
| 49 | " |
| 50 | PACKAGECONFIG[python] = "--with-python=${PYTHON},--without-python,python3" |
| 51 | PACKAGECONFIG[ipv6] = "--enable-ipv6,--disable-ipv6," |
| 52 | |
| 53 | inherit autotools pkgconfig binconfig-disabled ptest features_check |
| 54 | |
Patrick Williams | 23c9e5d | 2022-02-08 13:42:21 -0600 | [diff] [blame] | 55 | inherit ${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3targetconfig', '', d)} |
Andrew Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 56 | |
Patrick Williams | 043e75a | 2021-07-08 11:39:47 -0500 | [diff] [blame] | 57 | RDEPENDS_${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 Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 58 | |
| 59 | RDEPENDS_${PN}-python += "${@bb.utils.contains('PACKAGECONFIG', 'python', 'python3-core', '', d)}" |
| 60 | |
| 61 | RDEPENDS_${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 | |
| 68 | export PYTHON_SITE_PACKAGES="${PYTHON_SITEPACKAGES_DIR}" |
| 69 | |
| 70 | # WARNING: zlib is required for RPM use |
| 71 | EXTRA_OECONF = "--without-debug --without-legacy --with-catalog --without-docbook --with-c14n --without-lzma --with-fexceptions" |
| 72 | EXTRA_OECONF_class-native = "--without-legacy --without-docbook --with-c14n --without-lzma --with-zlib" |
| 73 | EXTRA_OECONF_class-nativesdk = "--without-legacy --without-docbook --with-c14n --without-lzma --with-zlib" |
| 74 | EXTRA_OECONF_linuxstdbase = "--with-debug --with-legacy --with-docbook --with-c14n --without-lzma --with-zlib" |
| 75 | |
| 76 | python 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 | |
| 82 | PACKAGE_BEFORE_PN += "${PN}-utils" |
| 83 | PACKAGES += "${PN}-python" |
| 84 | |
| 85 | FILES_${PN}-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a" |
| 86 | FILES_${PN}-dev += "${libdir}/xml2Conf.sh ${libdir}/cmake/*" |
| 87 | FILES_${PN}-utils = "${bindir}/*" |
| 88 | FILES_${PN}-python = "${PYTHON_SITEPACKAGES_DIR}" |
| 89 | |
| 90 | do_configure_prepend () { |
| 91 | # executables take longer to package: these should not be executable |
| 92 | find ${S}/xmlconf/ -type f -exec chmod -x {} \+ |
| 93 | } |
| 94 | |
| 95 | do_compile_ptest() { |
Patrick Williams | cddccf4 | 2022-08-22 15:51:32 -0500 | [diff] [blame] | 96 | # 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 Geissler | 82c905d | 2020-04-13 13:39:40 -0500 | [diff] [blame] | 106 | oe_runmake check-am |
| 107 | } |
| 108 | |
| 109 | do_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 | |
| 130 | do_install_append_class-native () { |
| 131 | # Docs are not needed in the native case |
| 132 | rm ${D}${datadir}/gtk-doc -rf |
| 133 | } |
| 134 | |
| 135 | BBCLASSEXTEND = "native nativesdk" |