summaryrefslogtreecommitdiff
path: root/dev-libs/libxml2
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-03-12 21:55:15 +0000
committerV3n3RiX <venerix@redcorelinux.org>2021-03-12 21:55:15 +0000
commit7218e1b46bceac05841e90472501742d905fb3fc (patch)
tree56fae051db521b8fce8014cbc8b11484885b14b3 /dev-libs/libxml2
parent6d691ad5b6239929063441bbd14c489e92e7396e (diff)
gentoo resync : 12.03.2021
Diffstat (limited to 'dev-libs/libxml2')
-rw-r--r--dev-libs/libxml2/Manifest2
-rw-r--r--dev-libs/libxml2/files/libxml2-2.9.10-xmllint-utf8.patch38
-rw-r--r--dev-libs/libxml2/libxml2-2.9.10-r5.ebuild240
3 files changed, 280 insertions, 0 deletions
diff --git a/dev-libs/libxml2/Manifest b/dev-libs/libxml2/Manifest
index 577848fa4c58..7ac395e52bc7 100644
--- a/dev-libs/libxml2/Manifest
+++ b/dev-libs/libxml2/Manifest
@@ -1,5 +1,6 @@
AUX libxml2-2.7.1-catalog_path.patch 2225 BLAKE2B 9a9c5836e5227e51de05d1e19c27b828c3c082c671d9b9bfb30afbe971fca580fb87cd86560e2ed431b4dc1495585c62f01da0f36e401d4dbdc4d8be2269cca5 SHA512 bcad080ee84c926c75df8baa47937bdfcfa207235263249f4025e64cbb5ac9be883e1ac4dc1ee55944116da2f84ced27b7cae781aa855579796f3f53a54aacb1
AUX libxml2-2.9.10-remove-TRUE.patch 942 BLAKE2B bd5272551189d21162366318b211965aca2da947e5bbadaa8a487821369c3f552005de243c4b110392908277144317bd64c86d8641b972cbdb338d7eaf93dd08 SHA512 6abc43b95baa5540c78435654f391858c8e72667afdf00c993907510204441aee4367d1d8a038961e65e9d4d25ac8d0c4f5b7a2ee8d8357737dce5b643898502
+AUX libxml2-2.9.10-xmllint-utf8.patch 1082 BLAKE2B 166f408a9c8bd01a000362845beb77b3bff1736f4d13296330d074a9e3fedb242381cdd63363500632dc8b21ff3c8a9800f6e9ee9c476b36355d7307979d2bb3 SHA512 99f6b54898f12c42579c868fe963f8ad164d81c0f3f4f20800a2b809423b46f11d792794354d3ac77e3b545f15f1cc2a5163a940288e40a6ac0292f7a7467b72
AUX libxml2-2.9.2-python-ABIFLAG.patch 728 BLAKE2B d81b042b5000717d5aa88ac4cebf78749f5a4ef661c227537171c5695d97a16ca75c790c8b540e3481a54dc2d935112b46e0a23509c887e16e3f2886c08f1d69 SHA512 2f801329ad4e13dc70450d41f7659a510fe429b3aa9b66859fed25c4e3d95381d6f253f3a60a54002a16999296d3bd2adaca5e4cca92186492bfc7de3ac84426
AUX libxml2-2.9.8-out-of-tree-test.patch 1311 BLAKE2B 7b3e7abf273c1ab2cbc42b1fcd4ff7bef365503d8c04b315b0857574054409ac76c367f7ef0c944d448ef3ca84268082f59424758894cffa31a93925a81972c8 SHA512 4b665c7c4bea2d938f7b2021a38f274b9e40dd38c5e2085716cae02c60cd3ff9aa109185e7bfdd38d2724d76500c99da0db0968f634b56f7ef418a7a72ef144a
AUX libxml2-2.9.8-python3-unicode-errors.patch 1259 BLAKE2B 4425728c1e7a16c3b7faafba02468c01b9b87fe21dc6e2488d56f599573bc442f78386f64477a89c3332cd25f9b5ef3b4fedc47b51915c727a1b8eba06e7776d SHA512 a205c97fa1488fb8907cfa08b5f82e2055c80b86213dc3cc5c4b526fe6aa786bcc4e4eeb226c44635a1d021307b39e3940f706c42fb60e9e3e9b490a84164df7
@@ -9,4 +10,5 @@ DIST xmlts20080827.tar.gz 638940 BLAKE2B c5aab959c6e0698acd5b9be82b48a8ac26f4d01
DIST xsts-2002-01-16.tar.gz 6894439 BLAKE2B 1e9ec63d2c104655e64249e07440a04d862fcbcd4d4e19745d81b34994319b510a531c9d6df1491fae1e90b5d0764f0f1a827251ca8df5d613178b0eab01ef25 SHA512 43300af6d39c1e2221b0ed7318fe14c7464eeb6eb030ed1e22eb29b4ab17f014e2a4c8887c3a46ae5d243e3072da27f00f4e285498ae6f1288177d38d1108288
DIST xsts-2004-01-14.tar.gz 2761085 BLAKE2B 41545995fb3a65d053257c376c07d45ffd1041a433bfbdb46d4dd87a5afb60c18c8629a3d988323f9e7a1d709775b5a7e5930276a7121c0725a22705c0976e36 SHA512 32854388d7e720ad67156baf50bf2bae7bd878ca3e35fd7e44e57cad3f434f69d56bbbedd61509f8a1faf01c9eae74a078df8fe130780b182c05c05cb1c39ebe
EBUILD libxml2-2.9.10-r4.ebuild 6409 BLAKE2B 82a43ea7f6ffcf9e648c711db4beec9c6b82ab825fe0f676484fff6529bc00ed948758130919877ac01d12f16ba074f1036e940167e125069183726097ad4d50 SHA512 fea86142743f481018290de2282a06d1a7abe6a838ff745b563a01563db4c0272ae837e562c98ffaed6ba2ecac98f3569016ace7639d6b07194232c900ba0390
+EBUILD libxml2-2.9.10-r5.ebuild 6660 BLAKE2B dfe1ec621c431e4e1bdb28c833c0e701ebefce8b40f51465ce674d0279bd84b82abe38a83d268311aa6c6aec76ecb6bb8942be71b70661ca8db95781b120b0e2 SHA512 d55888cbbc77eac044e358689905845f533e3986a7f9fb46ed0025ee8c006ae389a44065122ecbc45a6a7edab2301d98e40b2cf8ad0ada262e53c0d8bb40bff0
MISC metadata.xml 457 BLAKE2B d83c1b1fbb559e371c443c5ddcbf68ad857290b583b1a3129e4c635fea981658614be234879f42111fa02704bab6477fda3bc474ea2831743720c4f368306489 SHA512 4d2640aa0935f0101a4bfee0ee3fef776cb163c9fc7535ed962619f4f319f93eb0fb168518f3e8d38742e9735c9c777292ce4d0e2b165e834bbb04fa3f07cd9a
diff --git a/dev-libs/libxml2/files/libxml2-2.9.10-xmllint-utf8.patch b/dev-libs/libxml2/files/libxml2-2.9.10-xmllint-utf8.patch
new file mode 100644
index 000000000000..179f3a8c3847
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.9.10-xmllint-utf8.patch
@@ -0,0 +1,38 @@
+https://bugs.gentoo.org/749849
+
+From 50f06b3efb638efb0abd95dc62dca05ae67882c2 Mon Sep 17 00:00:00 2001
+From: Nick Wellnhofer <wellnhofer@aevum.de>
+Date: Fri, 7 Aug 2020 21:54:27 +0200
+Subject: [PATCH] Fix out-of-bounds read with 'xmllint --htmlout'
+
+Make sure that truncated UTF-8 sequences don't cause an out-of-bounds
+array access.
+
+Thanks to @SuhwanSong and the Agency for Defense Development (ADD) for
+the report.
+
+Fixes #178.
+---
+ xmllint.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/xmllint.c b/xmllint.c
+index f6a8e463..c647486f 100644
+--- a/xmllint.c
++++ b/xmllint.c
+@@ -528,6 +528,12 @@ static void
+ xmlHTMLEncodeSend(void) {
+ char *result;
+
++ /*
++ * xmlEncodeEntitiesReentrant assumes valid UTF-8, but the buffer might
++ * end with a truncated UTF-8 sequence. This is a hack to at least avoid
++ * an out-of-bounds read.
++ */
++ memset(&buffer[sizeof(buffer)-4], 0, 4);
+ result = (char *) xmlEncodeEntitiesReentrant(NULL, BAD_CAST buffer);
+ if (result) {
+ xmlGenericError(xmlGenericErrorContext, "%s", result);
+--
+GitLab
+
diff --git a/dev-libs/libxml2/libxml2-2.9.10-r5.ebuild b/dev-libs/libxml2/libxml2-2.9.10-r5.ebuild
new file mode 100644
index 000000000000..374ad6c9ad91
--- /dev/null
+++ b/dev-libs/libxml2/libxml2-2.9.10-r5.ebuild
@@ -0,0 +1,240 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python3_{7,8,9} )
+PYTHON_REQ_USE="xml"
+
+inherit autotools libtool flag-o-matic python-r1 prefix multilib-minimal
+
+# Note: Please bump in sync with dev-libs/libxslt
+XSTS_HOME="http://www.w3.org/XML/2004/xml-schema-test-suite"
+XSTS_NAME_1="xmlschema2002-01-16"
+XSTS_NAME_2="xmlschema2004-01-14"
+XSTS_TARBALL_1="xsts-2002-01-16.tar.gz"
+XSTS_TARBALL_2="xsts-2004-01-14.tar.gz"
+XMLCONF_TARBALL="xmlts20080827.tar.gz"
+DESCRIPTION="XML C parser and toolkit"
+HOMEPAGE="http://www.xmlsoft.org/ https://gitlab.gnome.org/GNOME/libxml2"
+SRC_URI="
+ ftp://xmlsoft.org/${PN}/${PN}-${PV/_rc/-rc}.tar.gz
+ https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}-r1-patchset.tar.xz
+ test? (
+ ${XSTS_HOME}/${XSTS_NAME_1}/${XSTS_TARBALL_1}
+ ${XSTS_HOME}/${XSTS_NAME_2}/${XSTS_TARBALL_2}
+ http://www.w3.org/XML/Test/${XMLCONF_TARBALL}
+ )
+"
+S="${WORKDIR}/${PN}-${PV%_rc*}"
+
+LICENSE="MIT"
+SLOT="2"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+
+IUSE="debug examples icu ipv6 lzma +python readline static-libs test"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+RESTRICT="!test? ( test )"
+
+BDEPEND="
+ dev-util/gtk-doc-am
+ virtual/pkgconfig
+"
+RDEPEND="
+ >=sys-libs/zlib-1.2.8-r1:=[${MULTILIB_USEDEP}]
+ icu? ( >=dev-libs/icu-51.2-r1:=[${MULTILIB_USEDEP}] )
+ lzma? ( >=app-arch/xz-utils-5.0.5-r1:=[${MULTILIB_USEDEP}] )
+ python? ( ${PYTHON_DEPS} )
+ readline? ( sys-libs/readline:= )
+"
+DEPEND="${RDEPEND}"
+
+MULTILIB_CHOST_TOOLS=(
+ /usr/bin/xml2-config
+)
+
+src_unpack() {
+ # ${A} isn't used to avoid unpacking of test tarballs into $WORKDIR,
+ # as they are needed as tarballs in ${S}/xstc instead and not unpacked
+ unpack ${P/_rc/-rc}.tar.gz
+ unpack ${P}-r1-patchset.tar.xz
+ cd "${S}" || die
+
+ if use test ; then
+ cp "${DISTDIR}/${XSTS_TARBALL_1}" \
+ "${DISTDIR}/${XSTS_TARBALL_2}" \
+ "${S}"/xstc/ \
+ || die "Failed to install test tarballs"
+ unpack ${XMLCONF_TARBALL}
+ fi
+}
+
+src_prepare() {
+ default
+
+ DOCS=( AUTHORS ChangeLog NEWS README* TODO* )
+
+ # Selective cherry-picks from master up to 2019-02-28 (commit 8161b463f5)
+ eapply "${WORKDIR}"/patches
+
+ # Patches needed for prefix support
+ eapply "${FILESDIR}"/${PN}-2.7.1-catalog_path.patch
+
+ eapply "${FILESDIR}"/${P}-remove-TRUE.patch
+
+ eprefixify catalog.c xmlcatalog.c runtest.c xmllint.c
+
+ # Fix python detection, bug #567066
+ # https://bugzilla.gnome.org/show_bug.cgi?id=760458
+ eapply "${FILESDIR}"/${PN}-2.9.2-python-ABIFLAG.patch
+
+ # Fix python tests when building out of tree #565576
+ eapply "${FILESDIR}"/${PN}-2.9.8-out-of-tree-test.patch
+
+ # bug #745162
+ eapply "${FILESDIR}"/${PN}-2.9.8-python3-unicode-errors.patch
+
+ # bug #749849
+ eapply "${FILESDIR}"/${PN}-2.9.10-xmllint-utf8.patch
+
+ if [[ ${CHOST} == *-darwin* ]] ; then
+ # Avoid final linking arguments for python modules
+ sed -i -e '/PYTHON_LIBS/s/ldflags/libs/' configure.ac || die
+ # gcc-apple doesn't grok -Wno-array-bounds
+ sed -i -e 's/-Wno-array-bounds//' configure.ac || die
+ fi
+
+ # Please do not remove, as else we get references to PORTAGE_TMPDIR
+ # in /usr/lib/python?.?/site-packages/libxml2mod.la among things.
+ # We now need to run eautoreconf at the end to prevent maintainer mode.
+ # elibtoolize
+ # If we don't eautoreconf, we need this instead
+ # epunt_cxx
+
+ eautoreconf
+}
+
+multilib_src_configure() {
+ # Filter seemingly problematic CFLAGS (#26320)
+ filter-flags -fprefetch-loop-arrays -funroll-loops
+
+ # Notes:
+ # 1) USE zlib support breaks gnome2
+ # (libgnomeprint for instance fails to compile with
+ # fresh install, and existing) - <azarah@gentoo.org> (22 Dec 2002).
+ #
+ # 2) The meaning of the 'debug' USE flag does not apply to the --with-debug
+ # switch (enabling the libxml2 debug module). See bug #100898.
+ #
+ # 3) --with-mem-debug causes unusual segmentation faults (bug #105120).
+
+ libxml2_configure() {
+ ECONF_SOURCE="${S}" econf \
+ --with-html-subdir=${PF}/html \
+ $(use_with debug run-debug) \
+ $(use_with icu) \
+ $(use_with lzma) \
+ $(use_enable ipv6) \
+ $(use_enable static-libs static) \
+ $(multilib_native_use_with readline) \
+ $(multilib_native_use_with readline history) \
+ "$@"
+ }
+
+ libxml2_py_configure() {
+ # Ensure python build dirs exist
+ mkdir -p "${BUILD_DIR}" || die
+
+ # Odd build system, also see bug #582130
+ run_in_build_dir libxml2_configure \
+ "--with-python=${EPYTHON}" \
+ "--with-python-install-dir=$(python_get_sitedir)"
+ }
+
+ # Build python bindings separately
+ libxml2_configure --without-python
+
+ if multilib_is_native_abi && use python ; then
+ python_foreach_impl libxml2_py_configure
+ fi
+}
+
+libxml2_py_emake() {
+ pushd "${BUILD_DIR}/python" > /dev/null || die
+
+ emake "$@"
+
+ popd > /dev/null || die
+}
+
+multilib_src_compile() {
+ default
+
+ if multilib_is_native_abi && use python ; then
+ local native_builddir="${BUILD_DIR}"
+
+ python_foreach_impl libxml2_py_emake \
+ top_builddir="${native_builddir}" \
+ all
+ fi
+}
+
+multilib_src_test() {
+ ln -s "${S}"/xmlconf || die
+
+ emake check
+
+ if multilib_is_native_abi && use python ; then
+ python_foreach_impl libxml2_py_emake test
+ fi
+}
+
+multilib_src_install() {
+ emake \
+ DESTDIR="${D}" \
+ EXAMPLES_DIR="${EPREFIX}"/usr/share/doc/${PF}/examples \
+ install
+
+ if multilib_is_native_abi && use python ; then
+ python_foreach_impl libxml2_py_emake \
+ DESTDIR="${D}" \
+ docsdir="${EPREFIX}"/usr/share/doc/${PF}/python \
+ exampledir="${EPREFIX}"/usr/share/doc/${PF}/python/examples \
+ install
+
+ python_foreach_impl python_optimize
+ fi
+}
+
+multilib_src_install_all() {
+ rm -rf "${ED}"/usr/share/doc/${P}
+
+ einstalldocs
+
+ if ! use examples ; then
+ rm -rf "${ED}"/usr/share/doc/${PF}/examples
+ rm -rf "${ED}"/usr/share/doc/${PF}/python/examples
+ fi
+
+ find "${D}" -name '*.la' -delete || die
+}
+
+pkg_postinst() {
+ # We don't want to do the xmlcatalog during stage1, as xmlcatalog will not
+ # be in / and stage1 builds to ROOT=/tmp/stage1root. This fixes bug #208887.
+ if [[ -n "${ROOT}" ]]; then
+ elog "Skipping XML catalog creation for stage building (bug #208887)."
+ else
+ # Need an XML catalog, so no-one writes to a non-existent one
+ CATALOG="${EROOT}/etc/xml/catalog"
+
+ # We don't want to clobber an existing catalog though,
+ # only ensure that one is there
+ # <obz@gentoo.org>
+ if [[ ! -e "${CATALOG}" ]]; then
+ [[ -d "${EROOT}/etc/xml" ]] || mkdir -p "${EROOT}/etc/xml"
+ "${EPREFIX}"/usr/bin/xmlcatalog --create > "${CATALOG}"
+ einfo "Created XML catalog in ${CATALOG}"
+ fi
+ fi
+}