public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: dev-libs/libxml2/, dev-libs/libxml2/files/
@ 2015-11-29 11:58 Justin Lecher
  0 siblings, 0 replies; 15+ messages in thread
From: Justin Lecher @ 2015-11-29 11:58 UTC (permalink / raw
  To: gentoo-commits

commit:     be2fe913ffa1d4acfeeba02f88adfb3d06481095
Author:     Justin Lecher <jlec <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 29 11:58:28 2015 +0000
Commit:     Justin Lecher <jlec <AT> gentoo <DOT> org>
CommitDate: Sun Nov 29 11:58:44 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=be2fe913

dev-libs/libxml2: Fix python ABI detection

Gentoo recently moved closer to upstream in terms of naming python
with regards to the build ABI. This patch adopts the buildsystem
to this change

Gentoo-Bug: https://bugs.gentoo.org/show_bug.cgi?id=567066

Package-Manager: portage-2.2.25
Signed-off-by: Justin Lecher <jlec <AT> gentoo.org>

 .../libxml2/files/libxml2-2.9.2-python-ABIFLAG.patch     | 16 ++++++++++++++++
 dev-libs/libxml2/libxml2-2.9.2-r4.ebuild                 |  2 ++
 2 files changed, 18 insertions(+)

diff --git a/dev-libs/libxml2/files/libxml2-2.9.2-python-ABIFLAG.patch b/dev-libs/libxml2/files/libxml2-2.9.2-python-ABIFLAG.patch
new file mode 100644
index 0000000..14dd5bc
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.9.2-python-ABIFLAG.patch
@@ -0,0 +1,16 @@
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 14ac0a8..f787b12 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -844,7 +844,7 @@ if test "$with_python" != "no" ; then
+     fi
+     if test "$PYTHON" != ""
+     then
+-        PYTHON_VERSION=`$PYTHON -c "from distutils import sysconfig; print(sysconfig.get_python_version())"`
++        PYTHON_VERSION=`$PYTHON -c "import sysconfig; print(sysconfig.get_config_var('LDVERSION') or sysconfig.get_config_var('py_version_short'))"`
+ 	PYTHON_INCLUDES=`$PYTHON -c "from distutils import sysconfig; print(sysconfig.get_python_inc())"`
+ # does not work as it produce a /usr/lib/python path instead of/usr/lib64/python
+ #

diff --git a/dev-libs/libxml2/libxml2-2.9.2-r4.ebuild b/dev-libs/libxml2/libxml2-2.9.2-r4.ebuild
index d1f80f0..421a205 100644
--- a/dev-libs/libxml2/libxml2-2.9.2-r4.ebuild
+++ b/dev-libs/libxml2/libxml2-2.9.2-r4.ebuild
@@ -90,6 +90,8 @@ src_prepare() {
https://bugs.gentoo.org/show_bug.cgi?id=738751
 	epatch "${FILESDIR}"/${PN}-2.9.2-icu-pkgconfig.patch
 
+	epatch "${FILESDIR}"/${P}-python-ABIFLAG.patch
+
 	# Important patches from master
 	epatch \
 		"${FILESDIR}"/${PN}-2.9.2-revert-missing-initialization.patch \


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/libxml2/, dev-libs/libxml2/files/
@ 2018-07-25 16:47 Mart Raudsepp
  0 siblings, 0 replies; 15+ messages in thread
From: Mart Raudsepp @ 2018-07-25 16:47 UTC (permalink / raw
  To: gentoo-commits

commit:     2bea1ac35a4e6955517315078a2176c94cb4388d
Author:     Mart Raudsepp <leio <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 25 13:17:56 2018 +0000
Commit:     Mart Raudsepp <leio <AT> gentoo <DOT> org>
CommitDate: Wed Jul 25 16:47:08 2018 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2bea1ac3

dev-libs/libxml2: remove old

Package-Manager: Portage-2.3.43, Repoman-2.3.10

 dev-libs/libxml2/Manifest                          |   2 -
 .../libxml2/files/libxml2-2.8.0_rc1-winnt.patch    |  91 ---------
 dev-libs/libxml2/libxml2-2.9.6.ebuild              | 208 ---------------------
 dev-libs/libxml2/libxml2-2.9.7.ebuild              | 208 ---------------------
 4 files changed, 509 deletions(-)

diff --git a/dev-libs/libxml2/Manifest b/dev-libs/libxml2/Manifest
index b8be3f373f7..aed8b4f5a34 100644
--- a/dev-libs/libxml2/Manifest
+++ b/dev-libs/libxml2/Manifest
@@ -1,5 +1,3 @@
-DIST libxml2-2.9.6.tar.gz 5469624 BLAKE2B cb8fc74044876b2ddf9742a4a84d685ce6cd1e41a991ee79fd70a9175c54d2a9a3d3a2c3229a4ce177fcd4e30b0cee08c7cf3a36fef68b179db0ce521fbbf3b0 SHA512 5ef80f895374bd5dd3bcd5f00c715795f026bf45d998f8f762c0cdb739b8755e01de40cf853d98a3826eacef95c4adebe4777db11020e8d98d0bda921f55a0ed
-DIST libxml2-2.9.7.tar.gz 5467389 BLAKE2B e15082fb87fb41a7aab6f39120b1d1bbd0325af8009bb3b74c69a98bf7347a39f59055762df157dcf223a79ac84f17535cb40af0a9a461ee3d2c1d55f4832e1b SHA512 da06cb7c5032ef4b7c8e902fabb9d2c74634c42c161be07a7c66a00d53a68029f89b0d4de32a6b9d4ff338c2d1d9c4e53aefb9cf50cb1c2d6c6b06b442ef42d5
 DIST libxml2-2.9.8.tar.gz 5469097 BLAKE2B 0b7836db46edebf6e7108c28da4bb7e3fb5ddc695aaa3e456ba51a66c0294a741d7b60eb4c31c7040443bbd54712c019424078bd533856a9650b39a703a926d5 SHA512 28903282c7672206effa1362fd564cbe4cf5be44264b083a7d14e383f73bccd1b81bcafb5f4f2f56f5e7e05914c660e27668c9ce91b1b9f256ef5358d55ba917
 DIST xmlts20080827.tar.gz 638940 BLAKE2B c5aab959c6e0698acd5b9be82b48a8ac26f4d01cc03f9acfff20d344f97f4711fc6d4a524ae70457147e8e30c72e27b6726829e1dd21896286aa974ed60774e7 SHA512 7325d0977c4427fc4944b291ccf896a665f654cc24399e5565c12a849c2bc3aef4fa3ee42a09ac115abcb6570c51a8fbd052c38d64d164279ecdecad5a4e884d
 DIST xsts-2002-01-16.tar.gz 6894439 BLAKE2B 1e9ec63d2c104655e64249e07440a04d862fcbcd4d4e19745d81b34994319b510a531c9d6df1491fae1e90b5d0764f0f1a827251ca8df5d613178b0eab01ef25 SHA512 43300af6d39c1e2221b0ed7318fe14c7464eeb6eb030ed1e22eb29b4ab17f014e2a4c8887c3a46ae5d243e3072da27f00f4e285498ae6f1288177d38d1108288

diff --git a/dev-libs/libxml2/files/libxml2-2.8.0_rc1-winnt.patch b/dev-libs/libxml2/files/libxml2-2.8.0_rc1-winnt.patch
deleted file mode 100644
index cce3ecb058a..00000000000
--- a/dev-libs/libxml2/files/libxml2-2.8.0_rc1-winnt.patch
+++ /dev/null
@@ -1,91 +0,0 @@
-From 168e20836fe9614dd2dd4b42006c17a783f11c48 Mon Sep 17 00:00:00 2001
-From: Markus Duft <mduft@gentoo.org>
-Date: Thu, 20 Nov 2008 11:04:33 -0500
-Subject: [PATCH] Fix for ~x86-winnt
-
-[Alexandre Rostovtsev <tetromino@gentoo.org>: port to 2.8.0-rc1]
----
- dict.c                |    2 +-
- include/wsockcompat.h |    2 +-
- nanohttp.c            |    2 +-
- xmlIO.c               |    4 ++++
- 4 files changed, 7 insertions(+), 3 deletions(-)
-
-diff --git a/dict.c b/dict.c
-index 3579f64..71e7bc6 100644
---- a/dict.c
-+++ b/dict.c
-@@ -47,7 +47,7 @@
- #else
- #ifdef HAVE_INTTYPES_H
- #include <inttypes.h>
--#elif defined(WIN32)
-+#elif defined(WIN32) || defined (__PARITY__)
- typedef unsigned __int32 uint32_t;
- #endif
- #endif
-diff --git a/include/wsockcompat.h b/include/wsockcompat.h
-index c762a64..1ed822b 100644
---- a/include/wsockcompat.h
-+++ b/include/wsockcompat.h
-@@ -27,7 +27,7 @@
- #endif
- #endif
- 
--#if defined( __MINGW32__ ) || defined( _MSC_VER )
-+#if defined( __MINGW32__ ) || defined( _MSC_VER ) || defined(__PARITY__)
- /* Include <errno.h> here to ensure that it doesn't get included later
-  * (e.g. by iconv.h) and overwrites the definition of EWOULDBLOCK. */
- #include <errno.h>
-diff --git a/nanohttp.c b/nanohttp.c
-index 2437fed..dbe97a7 100644
---- a/nanohttp.c
-+++ b/nanohttp.c
-@@ -74,7 +74,7 @@
- #define XML_SOCKLEN_T unsigned int
- #endif
- 
--#if defined(__MINGW32__) || defined(_WIN32_WCE)
-+#if defined(__MINGW32__) || defined(_WIN32_WCE) || defined(__PARITY__)
- #ifndef _WINSOCKAPI_
- #define _WINSOCKAPI_
- #endif
-diff --git a/xmlIO.c b/xmlIO.c
-index 73a995d..99562f6 100644
---- a/xmlIO.c
-+++ b/xmlIO.c
-@@ -47,6 +47,7 @@
- #include <winnls.h> /* for CP_UTF8 */
- #endif
- 
-+#ifndef __PARITY__
- /* Figure a portable way to know if a file is a directory. */
- #ifndef HAVE_STAT
- #  ifdef HAVE__STAT
-@@ -82,6 +83,7 @@
- #    endif
- #  endif
- #endif
-+#endif /* __PARITY__ */
- 
- #include <libxml/xmlmemory.h>
- #include <libxml/parser.h>
-@@ -657,6 +659,7 @@ xmlWrapStatUtf8(const char *path,struct stat *info)
- {
- #ifdef HAVE_STAT
-     int retval = -1;
-+#ifndef __PARITY__
-     wchar_t *wPath;
- 
-     wPath = __xmlIOWin32UTF8ToWChar(path);
-@@ -665,6 +668,7 @@ xmlWrapStatUtf8(const char *path,struct stat *info)
-        retval = _wstat(wPath,info);
-        xmlFree(wPath);
-     }
-+#endif
-     /* maybe path in native encoding */
-     if(retval < 0)
-        retval = stat(path,info);
--- 
-1.7.8.6
-

diff --git a/dev-libs/libxml2/libxml2-2.9.6.ebuild b/dev-libs/libxml2/libxml2-2.9.6.ebuild
deleted file mode 100644
index e1b36acddb4..00000000000
--- a/dev-libs/libxml2/libxml2-2.9.6.ebuild
+++ /dev/null
@@ -1,208 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
-PYTHON_REQ_USE="xml"
-
-inherit libtool flag-o-matic ltprune python-r1 autotools prefix multilib-minimal
-
-DESCRIPTION="Version 2 of the library to manipulate XML files"
-HOMEPAGE="http://www.xmlsoft.org/"
-
-LICENSE="MIT"
-SLOT="2"
-KEYWORDS="alpha amd64 arm ~arm64 hppa ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh sparc x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
-IUSE="debug examples icu ipv6 lzma python readline static-libs test"
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
-
-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"
-
-SRC_URI="ftp://xmlsoft.org/${PN}/${PN}-${PV/_rc/-rc}.tar.gz
-	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} )"
-
-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}
-	dev-util/gtk-doc-am
-	virtual/pkgconfig
-	hppa? ( >=sys-devel/binutils-2.15.92.0.2 )
-"
-
-S="${WORKDIR}/${PN}-${PV%_rc*}"
-
-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
-	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* )
-
-	# Patches needed for prefix support
-	eapply "${FILESDIR}"/${PN}-2.7.1-catalog_path.patch
-
-	eprefixify catalog.c xmlcatalog.c runtest.c xmllint.c
-
-	# Fix build for Windows platform
-	# https://bugzilla.gnome.org/show_bug.cgi?id=760456
-	eapply "${FILESDIR}"/${PN}-2.8.0_rc1-winnt.patch
-
-	# Fix python detection, bug #567066
-	# https://bugzilla.gnome.org/show_bug.cgi?id=760458
-	eapply "${FILESDIR}"/${PN}-2.9.2-python-ABIFLAG.patch
-
-	# Avoid final linking arguments for python modules
-	if [[ ${CHOST} == *-darwin* ]] ; then
-		sed -i -e '/PYTHON_LIBS/s/ldflags/libs/' 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
-#	epunt_cxx # if we don't eautoreconf
-
-	eautoreconf
-}
-
-multilib_src_configure() {
-	# filter seemingly problematic CFLAGS (#26320)
-	filter-flags -fprefetch-loop-arrays -funroll-loops
-
-	# USE zlib support breaks gnome2
-	# (libgnomeprint for instance fails to compile with
-	# fresh install, and existing) - <azarah@gentoo.org> (22 Dec 2002).
-
-	# The meaning of the 'debug' USE flag does not apply to the --with-debug
-	# switch (enabling the libxml2 debug module). See bug #100898.
-
-	# --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() {
-		mkdir -p "${BUILD_DIR}" || die # ensure python build dirs exist
-		run_in_build_dir libxml2_configure "--with-python=${ROOT%/}${PYTHON}" # odd build system, also see bug #582130
-	}
-
-	libxml2_configure --without-python # build python bindings separately
-
-	if multilib_is_native_abi && use python; then
-		python_foreach_impl libxml2_py_configure
-	fi
-}
-
-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() {
-	emake check
-	multilib_is_native_abi && use python && python_foreach_impl libxml2_py_emake test
-}
-
-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() {
-	# on windows, xmllint is installed by interix libxml2 in parent prefix.
-	# this is the version to use. the native winnt version does not support
-	# symlinks, which makes repoman fail if the portage tree is linked in
-	# from another location (which is my default). -- mduft
-	if [[ ${CHOST} == *-winnt* ]]; then
-		rm -rf "${ED}"/usr/bin/xmllint
-		rm -rf "${ED}"/usr/bin/xmlcatalog
-	fi
-
-	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
-
-	prune_libtool_files --modules
-}
-
-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 [[ "${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 dont 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
-}
-
-libxml2_py_emake() {
-	pushd "${BUILD_DIR}/python" > /dev/null || die
-	emake "$@"
-	popd > /dev/null
-}

diff --git a/dev-libs/libxml2/libxml2-2.9.7.ebuild b/dev-libs/libxml2/libxml2-2.9.7.ebuild
deleted file mode 100644
index bac5bf78210..00000000000
--- a/dev-libs/libxml2/libxml2-2.9.7.ebuild
+++ /dev/null
@@ -1,208 +0,0 @@
-# Copyright 1999-2018 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-PYTHON_COMPAT=( python2_7 python3_{4,5,6} )
-PYTHON_REQ_USE="xml"
-
-inherit libtool flag-o-matic ltprune python-r1 autotools prefix multilib-minimal
-
-DESCRIPTION="Version 2 of the library to manipulate XML files"
-HOMEPAGE="http://www.xmlsoft.org/"
-
-LICENSE="MIT"
-SLOT="2"
-KEYWORDS="alpha amd64 arm arm64 hppa ia64 m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~arm-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~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} )"
-
-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"
-
-SRC_URI="ftp://xmlsoft.org/${PN}/${PN}-${PV/_rc/-rc}.tar.gz
-	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} )"
-
-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}
-	dev-util/gtk-doc-am
-	virtual/pkgconfig
-	hppa? ( >=sys-devel/binutils-2.15.92.0.2 )
-"
-
-S="${WORKDIR}/${PN}-${PV%_rc*}"
-
-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
-	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* )
-
-	# Patches needed for prefix support
-	eapply "${FILESDIR}"/${PN}-2.7.1-catalog_path.patch
-
-	eprefixify catalog.c xmlcatalog.c runtest.c xmllint.c
-
-	# Fix build for Windows platform
-	# https://bugzilla.gnome.org/show_bug.cgi?id=760456
-	# eapply "${FILESDIR}"/${PN}-2.8.0_rc1-winnt.patch
-
-	# Fix python detection, bug #567066
-	# https://bugzilla.gnome.org/show_bug.cgi?id=760458
-	eapply "${FILESDIR}"/${PN}-2.9.2-python-ABIFLAG.patch
-
-	# Avoid final linking arguments for python modules
-	if [[ ${CHOST} == *-darwin* ]] ; then
-		sed -i -e '/PYTHON_LIBS/s/ldflags/libs/' 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
-#	epunt_cxx # if we don't eautoreconf
-
-	eautoreconf
-}
-
-multilib_src_configure() {
-	# filter seemingly problematic CFLAGS (#26320)
-	filter-flags -fprefetch-loop-arrays -funroll-loops
-
-	# USE zlib support breaks gnome2
-	# (libgnomeprint for instance fails to compile with
-	# fresh install, and existing) - <azarah@gentoo.org> (22 Dec 2002).
-
-	# The meaning of the 'debug' USE flag does not apply to the --with-debug
-	# switch (enabling the libxml2 debug module). See bug #100898.
-
-	# --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() {
-		mkdir -p "${BUILD_DIR}" || die # ensure python build dirs exist
-		run_in_build_dir libxml2_configure "--with-python=${ROOT%/}${PYTHON}" # odd build system, also see bug #582130
-	}
-
-	libxml2_configure --without-python # build python bindings separately
-
-	if multilib_is_native_abi && use python; then
-		python_foreach_impl libxml2_py_configure
-	fi
-}
-
-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() {
-	emake check
-	multilib_is_native_abi && use python && python_foreach_impl libxml2_py_emake test
-}
-
-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() {
-	# on windows, xmllint is installed by interix libxml2 in parent prefix.
-	# this is the version to use. the native winnt version does not support
-	# symlinks, which makes repoman fail if the portage tree is linked in
-	# from another location (which is my default). -- mduft
-	if [[ ${CHOST} == *-winnt* ]]; then
-		rm -rf "${ED}"/usr/bin/xmllint
-		rm -rf "${ED}"/usr/bin/xmlcatalog
-	fi
-
-	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
-
-	prune_libtool_files --modules
-}
-
-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 [[ "${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 dont 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
-}
-
-libxml2_py_emake() {
-	pushd "${BUILD_DIR}/python" > /dev/null || die
-	emake "$@"
-	popd > /dev/null
-}


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/libxml2/, dev-libs/libxml2/files/
@ 2019-01-03 11:22 Mike Frysinger
  0 siblings, 0 replies; 15+ messages in thread
From: Mike Frysinger @ 2019-01-03 11:22 UTC (permalink / raw
  To: gentoo-commits

commit:     2ad6bf6d6f3dbe00df33a5399c6762fb0ae1867f
Author:     Mike Frysinger <vapier <AT> chromium <DOT> org>
AuthorDate: Thu Jan  3 11:08:40 2019 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Jan  3 11:21:38 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2ad6bf6d

dev-libs/libxml2: fix CVE-2017-8872 #618110

Bug: https://bugs.gentoo.org/618110
Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>

 .../files/libxml2-2.9.8-CVE-2017-8872.patch        |  65 ++++++
 dev-libs/libxml2/libxml2-2.9.8-r1.ebuild           | 217 +++++++++++++++++++++
 2 files changed, 282 insertions(+)

diff --git a/dev-libs/libxml2/files/libxml2-2.9.8-CVE-2017-8872.patch b/dev-libs/libxml2/files/libxml2-2.9.8-CVE-2017-8872.patch
new file mode 100644
index 00000000000..6062f63df9e
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.9.8-CVE-2017-8872.patch
@@ -0,0 +1,65 @@
+https://bugs.gentoo.org/618110
+https://bugzilla.gnome.org/show_bug.cgi?id=775200
+https://gitlab.gnome.org/GNOME/libxml2/issues/26
+
+From 123234f2cfcd9e9b9f83047eee1dc17b4c3f4407 Mon Sep 17 00:00:00 2001
+From: Nick Wellnhofer <wellnhofer@aevum.de>
+Date: Tue, 11 Sep 2018 14:52:07 +0200
+Subject: [PATCH] Free input buffer in xmlHaltParser
+
+This avoids miscalculation of available bytes.
+
+Thanks to Yunho Kim for the report.
+
+Closes: #26
+---
+ parser.c                     |  5 +++++
+ result/errors/759573.xml.err | 17 +++++++----------
+ 2 files changed, 12 insertions(+), 10 deletions(-)
+
+diff --git a/parser.c b/parser.c
+index ca9fde2c8758..5813a6643e15 100644
+--- a/parser.c
++++ b/parser.c
+@@ -12462,7 +12462,12 @@ xmlHaltParser(xmlParserCtxtPtr ctxt) {
+ 	    ctxt->input->free((xmlChar *) ctxt->input->base);
+ 	    ctxt->input->free = NULL;
+ 	}
++        if (ctxt->input->buf != NULL) {
++            xmlFreeParserInputBuffer(ctxt->input->buf);
++            ctxt->input->buf = NULL;
++        }
+ 	ctxt->input->cur = BAD_CAST"";
++        ctxt->input->length = 0;
+ 	ctxt->input->base = ctxt->input->cur;
+         ctxt->input->end = ctxt->input->cur;
+     }
+diff --git a/result/errors/759573.xml.err b/result/errors/759573.xml.err
+index 554039f65b91..38ef5c40b8e3 100644
+--- a/result/errors/759573.xml.err
++++ b/result/errors/759573.xml.err
+@@ -21,14 +21,11 @@ Entity: line 1:
+             ^
+ ./test/errors/759573.xml:1: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration
+ 
+-<?h?><!DOCTYPEt[<!ELEMENT t (A)><!ENTITY % xx '&#37;<![INCLUDE[000&#37;&#3000;00
+-     ^
++
++^
+ ./test/errors/759573.xml:1: parser error : DOCTYPE improperly terminated
+-<?h?><!DOCTYPEt[<!ELEMENT t (A)><!ENTITY % xx '&#37;<![INCLUDE[000&#37;&#3000;00
+-     ^
+-./test/errors/759573.xml:1: parser error : StartTag: invalid element name
+-<?h?><!DOCTYPEt[<!ELEMENT t (A)><!ENTITY % xx '&#37;<![INCLUDE[000&#37;&#3000;00
+-      ^
+-./test/errors/759573.xml:1: parser error : Extra content at the end of the document
+-<?h?><!DOCTYPEt[<!ELEMENT t (A)><!ENTITY % xx '&#37;<![INCLUDE[000&#37;&#3000;00
+-      ^
++
++^
++./test/errors/759573.xml:1: parser error : Start tag expected, '<' not found
++
++^
+-- 
+2.19.1
+

diff --git a/dev-libs/libxml2/libxml2-2.9.8-r1.ebuild b/dev-libs/libxml2/libxml2-2.9.8-r1.ebuild
new file mode 100644
index 00000000000..1a798958bcb
--- /dev/null
+++ b/dev-libs/libxml2/libxml2-2.9.8-r1.ebuild
@@ -0,0 +1,217 @@
+# Copyright 1999-2018 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+PYTHON_COMPAT=( python2_7 python3_{4,5,6,7} )
+PYTHON_REQ_USE="xml"
+
+inherit libtool flag-o-matic ltprune python-r1 autotools prefix multilib-minimal
+
+DESCRIPTION="XML C parser and toolkit"
+HOMEPAGE="http://www.xmlsoft.org/"
+
+LICENSE="MIT"
+SLOT="2"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~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} )"
+
+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"
+
+SRC_URI="ftp://xmlsoft.org/${PN}/${PN}-${PV/_rc/-rc}.tar.gz
+	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} )"
+
+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}
+	dev-util/gtk-doc-am
+	virtual/pkgconfig
+	hppa? ( >=sys-devel/binutils-2.15.92.0.2 )
+"
+
+S="${WORKDIR}/${PN}-${PV%_rc*}"
+
+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
+	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* )
+
+	# Patches needed for prefix support
+	eapply "${FILESDIR}"/${PN}-2.7.1-catalog_path.patch
+
+	eprefixify catalog.c xmlcatalog.c runtest.c xmllint.c
+
+	# Fix build for Windows platform
+	# https://bugzilla.gnome.org/show_bug.cgi?id=760456
+	# eapply "${FILESDIR}"/${PN}-2.8.0_rc1-winnt.patch
+
+	# 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
+
+	# CVE-2017-8872 #618110
+	# https://bugzilla.gnome.org/show_bug.cgi?id=775200
+	eapply "${FILESDIR}"/${PN}-2.9.8-CVE-2017-8872.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
+#	epunt_cxx # if we don't eautoreconf
+
+	eautoreconf
+}
+
+multilib_src_configure() {
+	# filter seemingly problematic CFLAGS (#26320)
+	filter-flags -fprefetch-loop-arrays -funroll-loops
+
+	# USE zlib support breaks gnome2
+	# (libgnomeprint for instance fails to compile with
+	# fresh install, and existing) - <azarah@gentoo.org> (22 Dec 2002).
+
+	# The meaning of the 'debug' USE flag does not apply to the --with-debug
+	# switch (enabling the libxml2 debug module). See bug #100898.
+
+	# --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() {
+		mkdir -p "${BUILD_DIR}" || die # ensure python build dirs exist
+		run_in_build_dir libxml2_configure "--with-python=${ROOT%/}${PYTHON}" # odd build system, also see bug #582130
+	}
+
+	libxml2_configure --without-python # build python bindings separately
+
+	if multilib_is_native_abi && use python; then
+		python_foreach_impl libxml2_py_configure
+	fi
+}
+
+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() {
+	emake check
+	multilib_is_native_abi && use python && python_foreach_impl libxml2_py_emake test
+}
+
+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() {
+	# on windows, xmllint is installed by interix libxml2 in parent prefix.
+	# this is the version to use. the native winnt version does not support
+	# symlinks, which makes repoman fail if the portage tree is linked in
+	# from another location (which is my default). -- mduft
+	if [[ ${CHOST} == *-winnt* ]]; then
+		rm -rf "${ED}"/usr/bin/xmllint
+		rm -rf "${ED}"/usr/bin/xmlcatalog
+	fi
+
+	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
+
+	prune_libtool_files --modules
+}
+
+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 [[ "${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 dont 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
+}
+
+libxml2_py_emake() {
+	pushd "${BUILD_DIR}/python" > /dev/null || die
+	emake "$@"
+	popd > /dev/null
+}


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/libxml2/, dev-libs/libxml2/files/
@ 2019-01-03 11:22 Mike Frysinger
  0 siblings, 0 replies; 15+ messages in thread
From: Mike Frysinger @ 2019-01-03 11:22 UTC (permalink / raw
  To: gentoo-commits

commit:     3e81bfb6899b407dba3dca6aa76f4cd2a30d6dd7
Author:     Xiaoyong Zhou <xzhou <AT> google <DOT> com>
AuthorDate: Tue Dec  4 22:53:14 2018 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Jan  3 11:21:46 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3e81bfb6

dev-libs/libxml2: fix CVE-2018-14404

Signed-off-by: Xiaoyong Zhou <xzhou <AT> google.com>
Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>

 .../files/libxml2-2.9.8-CVE-2018-14404.patch       | 54 ++++++++++++++++++++++
 dev-libs/libxml2/libxml2-2.9.8-r1.ebuild           |  4 ++
 2 files changed, 58 insertions(+)

diff --git a/dev-libs/libxml2/files/libxml2-2.9.8-CVE-2018-14404.patch b/dev-libs/libxml2/files/libxml2-2.9.8-CVE-2018-14404.patch
new file mode 100644
index 00000000000..59bfc0fa9b8
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.9.8-CVE-2018-14404.patch
@@ -0,0 +1,54 @@
+From a436374994c47b12d5de1b8b1d191a098fa23594 Mon Sep 17 00:00:00 2001
+From: Nick Wellnhofer <wellnhofer@aevum.de>
+Date: Mon, 30 Jul 2018 12:54:38 +0200
+Subject: [PATCH] Fix nullptr deref with XPath logic ops
+
+If the XPath stack is corrupted, for example by a misbehaving extension
+function, the "and" and "or" XPath operators could dereference NULL
+pointers. Check that the XPath stack isn't empty and optimize the
+logic operators slightly.
+
+Closes: https://gitlab.gnome.org/GNOME/libxml2/issues/5
+
+Also see
+https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=901817
+https://bugzilla.redhat.com/show_bug.cgi?id=1595985
+
+This is CVE-2018-14404.
+
+Thanks to Guy Inbar for the report.
+---
+ xpath.c | 10 ++++------
+ 1 file changed, 4 insertions(+), 6 deletions(-)
+
+diff --git a/xpath.c b/xpath.c
+index 3fae0bf4e0a0..5e3bb9ff6401 100644
+--- a/xpath.c
++++ b/xpath.c
+@@ -13234,9 +13234,8 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op)
+ 		return(0);
+ 	    }
+             xmlXPathBooleanFunction(ctxt, 1);
+-            arg1 = valuePop(ctxt);
+-            arg1->boolval &= arg2->boolval;
+-            valuePush(ctxt, arg1);
++            if (ctxt->value != NULL)
++                ctxt->value->boolval &= arg2->boolval;
+ 	    xmlXPathReleaseObject(ctxt->context, arg2);
+             return (total);
+         case XPATH_OP_OR:
+@@ -13252,9 +13251,8 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op)
+ 		return(0);
+ 	    }
+             xmlXPathBooleanFunction(ctxt, 1);
+-            arg1 = valuePop(ctxt);
+-            arg1->boolval |= arg2->boolval;
+-            valuePush(ctxt, arg1);
++            if (ctxt->value != NULL)
++                ctxt->value->boolval |= arg2->boolval;
+ 	    xmlXPathReleaseObject(ctxt->context, arg2);
+             return (total);
+         case XPATH_OP_EQUAL:
+-- 
+2.19.1
+

diff --git a/dev-libs/libxml2/libxml2-2.9.8-r1.ebuild b/dev-libs/libxml2/libxml2-2.9.8-r1.ebuild
index 43da94cafed..86521ab289a 100644
--- a/dev-libs/libxml2/libxml2-2.9.8-r1.ebuild
+++ b/dev-libs/libxml2/libxml2-2.9.8-r1.ebuild
@@ -92,6 +92,10 @@ src_prepare() {
 	# https://bugzilla.gnome.org/show_bug.cgi?id=794914
 	eapply "${FILESDIR}"/${PN}-2.9.8-CVE-2018-14567.patch
 
+	# CVE-2018-14404
+	# https://gitlab.gnome.org/GNOME/libxml2/issues/5
+	eapply "${FILESDIR}"/${PN}-2.9.8-CVE-2018-14404.patch
+
 	if [[ ${CHOST} == *-darwin* ]] ; then
 		# Avoid final linking arguments for python modules
 		sed -i -e '/PYTHON_LIBS/s/ldflags/libs/' configure.ac || die


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/libxml2/, dev-libs/libxml2/files/
@ 2019-01-03 11:22 Mike Frysinger
  0 siblings, 0 replies; 15+ messages in thread
From: Mike Frysinger @ 2019-01-03 11:22 UTC (permalink / raw
  To: gentoo-commits

commit:     2acfef7fc1cc4d4ccff0783c4b4fc38dfc989226
Author:     Micah Morton <mortonm <AT> chromium <DOT> org>
AuthorDate: Fri Oct 19 18:01:18 2018 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Jan  3 11:21:44 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2acfef7f

dev-libs/libxml2: fix CVE-2018-14567

Signed-off-by: Micah Morton <mortonm <AT> chromium.org>
Signed-off-by: Mike Frysinger <vapier <AT> gentoo.org>

 .../files/libxml2-2.9.8-CVE-2018-14567.patch       | 50 ++++++++++++++++++++++
 dev-libs/libxml2/libxml2-2.9.8-r1.ebuild           |  4 ++
 2 files changed, 54 insertions(+)

diff --git a/dev-libs/libxml2/files/libxml2-2.9.8-CVE-2018-14567.patch b/dev-libs/libxml2/files/libxml2-2.9.8-CVE-2018-14567.patch
new file mode 100644
index 00000000000..0d289352d2f
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.9.8-CVE-2018-14567.patch
@@ -0,0 +1,50 @@
+From 2240fbf5912054af025fb6e01e26375100275e74 Mon Sep 17 00:00:00 2001
+From: Nick Wellnhofer <wellnhofer@aevum.de>
+Date: Mon, 30 Jul 2018 13:14:11 +0200
+Subject: [PATCH] Fix infinite loop in LZMA decompression
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Check the liblzma error code more thoroughly to avoid infinite loops.
+
+Closes: https://gitlab.gnome.org/GNOME/libxml2/issues/13
+Closes: https://bugzilla.gnome.org/show_bug.cgi?id=794914
+
+This is CVE-2018-9251 and CVE-2018-14567.
+
+Thanks to Dongliang Mu and Simon Wörner for the reports.
+---
+ xzlib.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/xzlib.c b/xzlib.c
+index a839169ef2ec..0ba88cfa849d 100644
+--- a/xzlib.c
++++ b/xzlib.c
+@@ -562,6 +562,10 @@ xz_decomp(xz_statep state)
+                          "internal error: inflate stream corrupt");
+                 return -1;
+             }
++            /*
++             * FIXME: Remapping a couple of error codes and falling through
++             * to the LZMA error handling looks fragile.
++             */
+             if (ret == Z_MEM_ERROR)
+                 ret = LZMA_MEM_ERROR;
+             if (ret == Z_DATA_ERROR)
+@@ -587,6 +591,11 @@ xz_decomp(xz_statep state)
+             xz_error(state, LZMA_PROG_ERROR, "compression error");
+             return -1;
+         }
++        if ((state->how != GZIP) &&
++            (ret != LZMA_OK) && (ret != LZMA_STREAM_END)) {
++            xz_error(state, ret, "lzma error");
++            return -1;
++        }
+     } while (strm->avail_out && ret != LZMA_STREAM_END);
+ 
+     /* update available output and crc check value */
+-- 
+2.19.1
+

diff --git a/dev-libs/libxml2/libxml2-2.9.8-r1.ebuild b/dev-libs/libxml2/libxml2-2.9.8-r1.ebuild
index 1a798958bcb..43da94cafed 100644
--- a/dev-libs/libxml2/libxml2-2.9.8-r1.ebuild
+++ b/dev-libs/libxml2/libxml2-2.9.8-r1.ebuild
@@ -88,6 +88,10 @@ src_prepare() {
 	# https://bugzilla.gnome.org/show_bug.cgi?id=775200
 	eapply "${FILESDIR}"/${PN}-2.9.8-CVE-2017-8872.patch
 
+	# CVE-2018-14567
+	# https://bugzilla.gnome.org/show_bug.cgi?id=794914
+	eapply "${FILESDIR}"/${PN}-2.9.8-CVE-2018-14567.patch
+
 	if [[ ${CHOST} == *-darwin* ]] ; then
 		# Avoid final linking arguments for python modules
 		sed -i -e '/PYTHON_LIBS/s/ldflags/libs/' configure.ac || die


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/libxml2/, dev-libs/libxml2/files/
@ 2019-03-30 20:57 Mart Raudsepp
  0 siblings, 0 replies; 15+ messages in thread
From: Mart Raudsepp @ 2019-03-30 20:57 UTC (permalink / raw
  To: gentoo-commits

commit:     588a79fdf708601c7f512ddbb52394c4cc425f95
Author:     Mart Raudsepp <leio <AT> gentoo <DOT> org>
AuthorDate: Sat Mar 30 20:56:45 2019 +0000
Commit:     Mart Raudsepp <leio <AT> gentoo <DOT> org>
CommitDate: Sat Mar 30 20:56:45 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=588a79fd

dev-libs/libxml2: remove old

Package-Manager: Portage-2.3.52, Repoman-2.3.12
Signed-off-by: Mart Raudsepp <leio <AT> gentoo.org>

 dev-libs/libxml2/Manifest                          |   1 -
 .../files/libxml2-2.9.8-CVE-2017-8872.patch        |  65 ------
 .../files/libxml2-2.9.8-CVE-2018-14404.patch       |  54 -----
 .../files/libxml2-2.9.8-CVE-2018-14567.patch       |  50 -----
 dev-libs/libxml2/libxml2-2.9.8-r1.ebuild           | 225 ---------------------
 dev-libs/libxml2/libxml2-2.9.8.ebuild              | 213 -------------------
 6 files changed, 608 deletions(-)

diff --git a/dev-libs/libxml2/Manifest b/dev-libs/libxml2/Manifest
index 34ec74aa101..7c58d04e3ed 100644
--- a/dev-libs/libxml2/Manifest
+++ b/dev-libs/libxml2/Manifest
@@ -1,4 +1,3 @@
-DIST libxml2-2.9.8.tar.gz 5469097 BLAKE2B 0b7836db46edebf6e7108c28da4bb7e3fb5ddc695aaa3e456ba51a66c0294a741d7b60eb4c31c7040443bbd54712c019424078bd533856a9650b39a703a926d5 SHA512 28903282c7672206effa1362fd564cbe4cf5be44264b083a7d14e383f73bccd1b81bcafb5f4f2f56f5e7e05914c660e27668c9ce91b1b9f256ef5358d55ba917
 DIST libxml2-2.9.9-patchset.tar.xz 16792 BLAKE2B f761b5cda41d57543dadf2cdd8915b69727a818f31badc1092903a9e4341b807852fed0887e9ec7a06a0c19c4a49f9afc2f3c048947f21a09006bb51ef8399ef SHA512 c8c0ee6d0a2833e5664aa7549999f8ba63b9f0bbfda4651050eeee7d3a958c33ef55daba8cfb1ca73ebffeb44d411b5f4259fe6e11ef0204ad2deebd1708ebfb
 DIST libxml2-2.9.9.tar.gz 5476717 BLAKE2B 00a67c38084f2effd5d68d7d3e68f0c96cf4f52eab6d8d9b96dc91f03a84baa132abeaf303a836ff9bbf04f832432a036077316c464398e433c9779d8519074b SHA512 cb7784ba4e72e942614e12e4f83f4ceb275f3d738b30e3b5c1f25edf8e9fa6789e854685974eed95b362049dbf6c8e7357e0327d64c681ed390534ac154e6810
 DIST xmlts20080827.tar.gz 638940 BLAKE2B c5aab959c6e0698acd5b9be82b48a8ac26f4d01cc03f9acfff20d344f97f4711fc6d4a524ae70457147e8e30c72e27b6726829e1dd21896286aa974ed60774e7 SHA512 7325d0977c4427fc4944b291ccf896a665f654cc24399e5565c12a849c2bc3aef4fa3ee42a09ac115abcb6570c51a8fbd052c38d64d164279ecdecad5a4e884d

diff --git a/dev-libs/libxml2/files/libxml2-2.9.8-CVE-2017-8872.patch b/dev-libs/libxml2/files/libxml2-2.9.8-CVE-2017-8872.patch
deleted file mode 100644
index 6062f63df9e..00000000000
--- a/dev-libs/libxml2/files/libxml2-2.9.8-CVE-2017-8872.patch
+++ /dev/null
@@ -1,65 +0,0 @@
-https://bugs.gentoo.org/618110
-https://bugzilla.gnome.org/show_bug.cgi?id=775200
-https://gitlab.gnome.org/GNOME/libxml2/issues/26
-
-From 123234f2cfcd9e9b9f83047eee1dc17b4c3f4407 Mon Sep 17 00:00:00 2001
-From: Nick Wellnhofer <wellnhofer@aevum.de>
-Date: Tue, 11 Sep 2018 14:52:07 +0200
-Subject: [PATCH] Free input buffer in xmlHaltParser
-
-This avoids miscalculation of available bytes.
-
-Thanks to Yunho Kim for the report.
-
-Closes: #26
----
- parser.c                     |  5 +++++
- result/errors/759573.xml.err | 17 +++++++----------
- 2 files changed, 12 insertions(+), 10 deletions(-)
-
-diff --git a/parser.c b/parser.c
-index ca9fde2c8758..5813a6643e15 100644
---- a/parser.c
-+++ b/parser.c
-@@ -12462,7 +12462,12 @@ xmlHaltParser(xmlParserCtxtPtr ctxt) {
- 	    ctxt->input->free((xmlChar *) ctxt->input->base);
- 	    ctxt->input->free = NULL;
- 	}
-+        if (ctxt->input->buf != NULL) {
-+            xmlFreeParserInputBuffer(ctxt->input->buf);
-+            ctxt->input->buf = NULL;
-+        }
- 	ctxt->input->cur = BAD_CAST"";
-+        ctxt->input->length = 0;
- 	ctxt->input->base = ctxt->input->cur;
-         ctxt->input->end = ctxt->input->cur;
-     }
-diff --git a/result/errors/759573.xml.err b/result/errors/759573.xml.err
-index 554039f65b91..38ef5c40b8e3 100644
---- a/result/errors/759573.xml.err
-+++ b/result/errors/759573.xml.err
-@@ -21,14 +21,11 @@ Entity: line 1:
-             ^
- ./test/errors/759573.xml:1: parser error : internal error: xmlParseInternalSubset: error detected in Markup declaration
- 
--<?h?><!DOCTYPEt[<!ELEMENT t (A)><!ENTITY % xx '&#37;<![INCLUDE[000&#37;&#3000;00
--     ^
-+
-+^
- ./test/errors/759573.xml:1: parser error : DOCTYPE improperly terminated
--<?h?><!DOCTYPEt[<!ELEMENT t (A)><!ENTITY % xx '&#37;<![INCLUDE[000&#37;&#3000;00
--     ^
--./test/errors/759573.xml:1: parser error : StartTag: invalid element name
--<?h?><!DOCTYPEt[<!ELEMENT t (A)><!ENTITY % xx '&#37;<![INCLUDE[000&#37;&#3000;00
--      ^
--./test/errors/759573.xml:1: parser error : Extra content at the end of the document
--<?h?><!DOCTYPEt[<!ELEMENT t (A)><!ENTITY % xx '&#37;<![INCLUDE[000&#37;&#3000;00
--      ^
-+
-+^
-+./test/errors/759573.xml:1: parser error : Start tag expected, '<' not found
-+
-+^
--- 
-2.19.1
-

diff --git a/dev-libs/libxml2/files/libxml2-2.9.8-CVE-2018-14404.patch b/dev-libs/libxml2/files/libxml2-2.9.8-CVE-2018-14404.patch
deleted file mode 100644
index 59bfc0fa9b8..00000000000
--- a/dev-libs/libxml2/files/libxml2-2.9.8-CVE-2018-14404.patch
+++ /dev/null
@@ -1,54 +0,0 @@
-From a436374994c47b12d5de1b8b1d191a098fa23594 Mon Sep 17 00:00:00 2001
-From: Nick Wellnhofer <wellnhofer@aevum.de>
-Date: Mon, 30 Jul 2018 12:54:38 +0200
-Subject: [PATCH] Fix nullptr deref with XPath logic ops
-
-If the XPath stack is corrupted, for example by a misbehaving extension
-function, the "and" and "or" XPath operators could dereference NULL
-pointers. Check that the XPath stack isn't empty and optimize the
-logic operators slightly.
-
-Closes: https://gitlab.gnome.org/GNOME/libxml2/issues/5
-
-Also see
-https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=901817
-https://bugzilla.redhat.com/show_bug.cgi?id=1595985
-
-This is CVE-2018-14404.
-
-Thanks to Guy Inbar for the report.
----
- xpath.c | 10 ++++------
- 1 file changed, 4 insertions(+), 6 deletions(-)
-
-diff --git a/xpath.c b/xpath.c
-index 3fae0bf4e0a0..5e3bb9ff6401 100644
---- a/xpath.c
-+++ b/xpath.c
-@@ -13234,9 +13234,8 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op)
- 		return(0);
- 	    }
-             xmlXPathBooleanFunction(ctxt, 1);
--            arg1 = valuePop(ctxt);
--            arg1->boolval &= arg2->boolval;
--            valuePush(ctxt, arg1);
-+            if (ctxt->value != NULL)
-+                ctxt->value->boolval &= arg2->boolval;
- 	    xmlXPathReleaseObject(ctxt->context, arg2);
-             return (total);
-         case XPATH_OP_OR:
-@@ -13252,9 +13251,8 @@ xmlXPathCompOpEval(xmlXPathParserContextPtr ctxt, xmlXPathStepOpPtr op)
- 		return(0);
- 	    }
-             xmlXPathBooleanFunction(ctxt, 1);
--            arg1 = valuePop(ctxt);
--            arg1->boolval |= arg2->boolval;
--            valuePush(ctxt, arg1);
-+            if (ctxt->value != NULL)
-+                ctxt->value->boolval |= arg2->boolval;
- 	    xmlXPathReleaseObject(ctxt->context, arg2);
-             return (total);
-         case XPATH_OP_EQUAL:
--- 
-2.19.1
-

diff --git a/dev-libs/libxml2/files/libxml2-2.9.8-CVE-2018-14567.patch b/dev-libs/libxml2/files/libxml2-2.9.8-CVE-2018-14567.patch
deleted file mode 100644
index 0d289352d2f..00000000000
--- a/dev-libs/libxml2/files/libxml2-2.9.8-CVE-2018-14567.patch
+++ /dev/null
@@ -1,50 +0,0 @@
-From 2240fbf5912054af025fb6e01e26375100275e74 Mon Sep 17 00:00:00 2001
-From: Nick Wellnhofer <wellnhofer@aevum.de>
-Date: Mon, 30 Jul 2018 13:14:11 +0200
-Subject: [PATCH] Fix infinite loop in LZMA decompression
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-Check the liblzma error code more thoroughly to avoid infinite loops.
-
-Closes: https://gitlab.gnome.org/GNOME/libxml2/issues/13
-Closes: https://bugzilla.gnome.org/show_bug.cgi?id=794914
-
-This is CVE-2018-9251 and CVE-2018-14567.
-
-Thanks to Dongliang Mu and Simon Wörner for the reports.
----
- xzlib.c | 9 +++++++++
- 1 file changed, 9 insertions(+)
-
-diff --git a/xzlib.c b/xzlib.c
-index a839169ef2ec..0ba88cfa849d 100644
---- a/xzlib.c
-+++ b/xzlib.c
-@@ -562,6 +562,10 @@ xz_decomp(xz_statep state)
-                          "internal error: inflate stream corrupt");
-                 return -1;
-             }
-+            /*
-+             * FIXME: Remapping a couple of error codes and falling through
-+             * to the LZMA error handling looks fragile.
-+             */
-             if (ret == Z_MEM_ERROR)
-                 ret = LZMA_MEM_ERROR;
-             if (ret == Z_DATA_ERROR)
-@@ -587,6 +591,11 @@ xz_decomp(xz_statep state)
-             xz_error(state, LZMA_PROG_ERROR, "compression error");
-             return -1;
-         }
-+        if ((state->how != GZIP) &&
-+            (ret != LZMA_OK) && (ret != LZMA_STREAM_END)) {
-+            xz_error(state, ret, "lzma error");
-+            return -1;
-+        }
-     } while (strm->avail_out && ret != LZMA_STREAM_END);
- 
-     /* update available output and crc check value */
--- 
-2.19.1
-

diff --git a/dev-libs/libxml2/libxml2-2.9.8-r1.ebuild b/dev-libs/libxml2/libxml2-2.9.8-r1.ebuild
deleted file mode 100644
index 86521ab289a..00000000000
--- a/dev-libs/libxml2/libxml2-2.9.8-r1.ebuild
+++ /dev/null
@@ -1,225 +0,0 @@
-# Copyright 1999-2018 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-PYTHON_COMPAT=( python2_7 python3_{4,5,6,7} )
-PYTHON_REQ_USE="xml"
-
-inherit libtool flag-o-matic ltprune python-r1 autotools prefix multilib-minimal
-
-DESCRIPTION="XML C parser and toolkit"
-HOMEPAGE="http://www.xmlsoft.org/"
-
-LICENSE="MIT"
-SLOT="2"
-KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~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} )"
-
-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"
-
-SRC_URI="ftp://xmlsoft.org/${PN}/${PN}-${PV/_rc/-rc}.tar.gz
-	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} )"
-
-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}
-	dev-util/gtk-doc-am
-	virtual/pkgconfig
-	hppa? ( >=sys-devel/binutils-2.15.92.0.2 )
-"
-
-S="${WORKDIR}/${PN}-${PV%_rc*}"
-
-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
-	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* )
-
-	# Patches needed for prefix support
-	eapply "${FILESDIR}"/${PN}-2.7.1-catalog_path.patch
-
-	eprefixify catalog.c xmlcatalog.c runtest.c xmllint.c
-
-	# Fix build for Windows platform
-	# https://bugzilla.gnome.org/show_bug.cgi?id=760456
-	# eapply "${FILESDIR}"/${PN}-2.8.0_rc1-winnt.patch
-
-	# 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
-
-	# CVE-2017-8872 #618110
-	# https://bugzilla.gnome.org/show_bug.cgi?id=775200
-	eapply "${FILESDIR}"/${PN}-2.9.8-CVE-2017-8872.patch
-
-	# CVE-2018-14567
-	# https://bugzilla.gnome.org/show_bug.cgi?id=794914
-	eapply "${FILESDIR}"/${PN}-2.9.8-CVE-2018-14567.patch
-
-	# CVE-2018-14404
-	# https://gitlab.gnome.org/GNOME/libxml2/issues/5
-	eapply "${FILESDIR}"/${PN}-2.9.8-CVE-2018-14404.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
-#	epunt_cxx # if we don't eautoreconf
-
-	eautoreconf
-}
-
-multilib_src_configure() {
-	# filter seemingly problematic CFLAGS (#26320)
-	filter-flags -fprefetch-loop-arrays -funroll-loops
-
-	# USE zlib support breaks gnome2
-	# (libgnomeprint for instance fails to compile with
-	# fresh install, and existing) - <azarah@gentoo.org> (22 Dec 2002).
-
-	# The meaning of the 'debug' USE flag does not apply to the --with-debug
-	# switch (enabling the libxml2 debug module). See bug #100898.
-
-	# --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() {
-		mkdir -p "${BUILD_DIR}" || die # ensure python build dirs exist
-		run_in_build_dir libxml2_configure "--with-python=${ROOT%/}${PYTHON}" # odd build system, also see bug #582130
-	}
-
-	libxml2_configure --without-python # build python bindings separately
-
-	if multilib_is_native_abi && use python; then
-		python_foreach_impl libxml2_py_configure
-	fi
-}
-
-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() {
-	emake check
-	multilib_is_native_abi && use python && python_foreach_impl libxml2_py_emake test
-}
-
-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() {
-	# on windows, xmllint is installed by interix libxml2 in parent prefix.
-	# this is the version to use. the native winnt version does not support
-	# symlinks, which makes repoman fail if the portage tree is linked in
-	# from another location (which is my default). -- mduft
-	if [[ ${CHOST} == *-winnt* ]]; then
-		rm -rf "${ED}"/usr/bin/xmllint
-		rm -rf "${ED}"/usr/bin/xmlcatalog
-	fi
-
-	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
-
-	prune_libtool_files --modules
-}
-
-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 [[ "${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 dont 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
-}
-
-libxml2_py_emake() {
-	pushd "${BUILD_DIR}/python" > /dev/null || die
-	emake "$@"
-	popd > /dev/null
-}

diff --git a/dev-libs/libxml2/libxml2-2.9.8.ebuild b/dev-libs/libxml2/libxml2-2.9.8.ebuild
deleted file mode 100644
index fbb37285cb7..00000000000
--- a/dev-libs/libxml2/libxml2-2.9.8.ebuild
+++ /dev/null
@@ -1,213 +0,0 @@
-# Copyright 1999-2018 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-PYTHON_COMPAT=( python2_7 python3_{4,5,6,7} )
-PYTHON_REQ_USE="xml"
-
-inherit libtool flag-o-matic ltprune python-r1 autotools prefix multilib-minimal
-
-DESCRIPTION="XML C parser and toolkit"
-HOMEPAGE="http://www.xmlsoft.org/"
-
-LICENSE="MIT"
-SLOT="2"
-KEYWORDS="alpha amd64 arm arm64 hppa ia64 ~m68k ~mips ppc ppc64 s390 ~sh sparc x86 ~ppc-aix ~x64-cygwin ~amd64-fbsd ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~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} )"
-
-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"
-
-SRC_URI="ftp://xmlsoft.org/${PN}/${PN}-${PV/_rc/-rc}.tar.gz
-	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} )"
-
-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}
-	dev-util/gtk-doc-am
-	virtual/pkgconfig
-	hppa? ( >=sys-devel/binutils-2.15.92.0.2 )
-"
-
-S="${WORKDIR}/${PN}-${PV%_rc*}"
-
-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
-	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* )
-
-	# Patches needed for prefix support
-	eapply "${FILESDIR}"/${PN}-2.7.1-catalog_path.patch
-
-	eprefixify catalog.c xmlcatalog.c runtest.c xmllint.c
-
-	# Fix build for Windows platform
-	# https://bugzilla.gnome.org/show_bug.cgi?id=760456
-	# eapply "${FILESDIR}"/${PN}-2.8.0_rc1-winnt.patch
-
-	# 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
-
-	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
-#	epunt_cxx # if we don't eautoreconf
-
-	eautoreconf
-}
-
-multilib_src_configure() {
-	# filter seemingly problematic CFLAGS (#26320)
-	filter-flags -fprefetch-loop-arrays -funroll-loops
-
-	# USE zlib support breaks gnome2
-	# (libgnomeprint for instance fails to compile with
-	# fresh install, and existing) - <azarah@gentoo.org> (22 Dec 2002).
-
-	# The meaning of the 'debug' USE flag does not apply to the --with-debug
-	# switch (enabling the libxml2 debug module). See bug #100898.
-
-	# --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() {
-		mkdir -p "${BUILD_DIR}" || die # ensure python build dirs exist
-		run_in_build_dir libxml2_configure "--with-python=${ROOT%/}${PYTHON}" # odd build system, also see bug #582130
-	}
-
-	libxml2_configure --without-python # build python bindings separately
-
-	if multilib_is_native_abi && use python; then
-		python_foreach_impl libxml2_py_configure
-	fi
-}
-
-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() {
-	emake check
-	multilib_is_native_abi && use python && python_foreach_impl libxml2_py_emake test
-}
-
-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() {
-	# on windows, xmllint is installed by interix libxml2 in parent prefix.
-	# this is the version to use. the native winnt version does not support
-	# symlinks, which makes repoman fail if the portage tree is linked in
-	# from another location (which is my default). -- mduft
-	if [[ ${CHOST} == *-winnt* ]]; then
-		rm -rf "${ED}"/usr/bin/xmllint
-		rm -rf "${ED}"/usr/bin/xmlcatalog
-	fi
-
-	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
-
-	prune_libtool_files --modules
-}
-
-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 [[ "${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 dont 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
-}
-
-libxml2_py_emake() {
-	pushd "${BUILD_DIR}/python" > /dev/null || die
-	emake "$@"
-	popd > /dev/null
-}


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/libxml2/, dev-libs/libxml2/files/
@ 2020-01-01 16:28 Mart Raudsepp
  0 siblings, 0 replies; 15+ messages in thread
From: Mart Raudsepp @ 2020-01-01 16:28 UTC (permalink / raw
  To: gentoo-commits

commit:     3d060cd62d99a7b6f26b30a695701b4ccafcccea
Author:     Mart Raudsepp <leio <AT> gentoo <DOT> org>
AuthorDate: Wed Jan  1 16:27:19 2020 +0000
Commit:     Mart Raudsepp <leio <AT> gentoo <DOT> org>
CommitDate: Wed Jan  1 16:28:19 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3d060cd6

dev-libs/libxml2: workaround py3 issues for itstool

Bug: https://bugs.gentoo.org/701020
Package-Manager: Portage-2.3.79, Repoman-2.3.12
Signed-off-by: Mart Raudsepp <leio <AT> gentoo.org>

 .../files/2.9.9-python3-unicode-errors.patch       |  34 +++
 dev-libs/libxml2/libxml2-2.9.9-r3.ebuild           | 227 +++++++++++++++++++++
 2 files changed, 261 insertions(+)

diff --git a/dev-libs/libxml2/files/2.9.9-python3-unicode-errors.patch b/dev-libs/libxml2/files/2.9.9-python3-unicode-errors.patch
new file mode 100644
index 00000000000..e87dcdedf88
--- /dev/null
+++ b/dev-libs/libxml2/files/2.9.9-python3-unicode-errors.patch
@@ -0,0 +1,34 @@
+Index: libxml2-2.9.5/python/libxml.c
+===================================================================
+--- libxml2-2.9.5.orig/python/libxml.c
++++ libxml2-2.9.5/python/libxml.c
+@@ -1620,6 +1620,7 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNU
+     PyObject *message;
+     PyObject *result;
+     char str[1000];
++    unsigned char *ptr = (unsigned char *)str;
+ 
+ #ifdef DEBUG_ERROR
+     printf("libxml_xmlErrorFuncHandler(%p, %s, ...) called\n", ctx, msg);
+@@ -1636,12 +1637,20 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNU
+ 	    str[999] = 0;
+         va_end(ap);
+ 
++#if PY_MAJOR_VERSION >= 3
++        /* Ensure the error string doesn't start at UTF8 continuation. */
++        while (*ptr && (*ptr & 0xc0) == 0x80)
++            ptr++;
++#endif
++
+         list = PyTuple_New(2);
+         PyTuple_SetItem(list, 0, libxml_xmlPythonErrorFuncCtxt);
+         Py_XINCREF(libxml_xmlPythonErrorFuncCtxt);
+-        message = libxml_charPtrConstWrap(str);
++        message = libxml_charPtrConstWrap(ptr);
+         PyTuple_SetItem(list, 1, message);
+         result = PyEval_CallObject(libxml_xmlPythonErrorFuncHandler, list);
++        /* Forget any errors caused in the error handler. */
++        PyErr_Clear();
+         Py_XDECREF(list);
+         Py_XDECREF(result);
+     }

diff --git a/dev-libs/libxml2/libxml2-2.9.9-r3.ebuild b/dev-libs/libxml2/libxml2-2.9.9-r3.ebuild
new file mode 100644
index 00000000000..5f7f29a15de
--- /dev/null
+++ b/dev-libs/libxml2/libxml2-2.9.9-r3.ebuild
@@ -0,0 +1,227 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 python3_{5,6,7,8} )
+PYTHON_REQ_USE="xml"
+
+inherit libtool flag-o-matic python-r1 autotools prefix multilib-minimal
+
+DESCRIPTION="XML C parser and toolkit"
+HOMEPAGE="http://www.xmlsoft.org/"
+
+LICENSE="MIT"
+SLOT="2"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sh ~sparc ~x86 ~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~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 )"
+
+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"
+
+SRC_URI="ftp://xmlsoft.org/${PN}/${PN}-${PV/_rc/-rc}.tar.gz
+	https://dev.gentoo.org/~leio/distfiles/${P}-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} )"
+
+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}
+	dev-util/gtk-doc-am
+	virtual/pkgconfig
+	hppa? ( >=sys-devel/binutils-2.15.92.0.2 )
+"
+
+S="${WORKDIR}/${PN}-${PV%_rc*}"
+
+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}-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
+
+	eprefixify catalog.c xmlcatalog.c runtest.c xmllint.c
+
+	# Fix build for Windows platform
+	# https://bugzilla.gnome.org/show_bug.cgi?id=760456
+	# eapply "${FILESDIR}"/${PN}-2.8.0_rc1-winnt.patch
+
+	# 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
+
+	# Workaround python3 itstool potential problems, bug 701020
+	eapply "${FILESDIR}"/${PV}-python3-unicode-errors.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
+#	epunt_cxx # if we don't eautoreconf
+
+	eautoreconf
+}
+
+multilib_src_configure() {
+	# filter seemingly problematic CFLAGS (#26320)
+	filter-flags -fprefetch-loop-arrays -funroll-loops
+
+	# USE zlib support breaks gnome2
+	# (libgnomeprint for instance fails to compile with
+	# fresh install, and existing) - <azarah@gentoo.org> (22 Dec 2002).
+
+	# The meaning of the 'debug' USE flag does not apply to the --with-debug
+	# switch (enabling the libxml2 debug module). See bug #100898.
+
+	# --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() {
+		mkdir -p "${BUILD_DIR}" || die # ensure python build dirs exist
+		run_in_build_dir libxml2_configure \
+			"--with-python=${EPYTHON}" \
+			"--with-python-install-dir=$(python_get_sitedir)"
+			# odd build system, also see bug #582130
+	}
+
+	libxml2_configure --without-python # build python bindings separately
+
+	if multilib_is_native_abi && use python; then
+		python_foreach_impl libxml2_py_configure
+	fi
+}
+
+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
+	multilib_is_native_abi && use python && python_foreach_impl libxml2_py_emake test
+}
+
+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() {
+	# on windows, xmllint is installed by interix libxml2 in parent prefix.
+	# this is the version to use. the native winnt version does not support
+	# symlinks, which makes repoman fail if the portage tree is linked in
+	# from another location (which is my default). -- mduft
+	if [[ ${CHOST} == *-winnt* ]]; then
+		rm -rf "${ED}"/usr/bin/xmllint
+		rm -rf "${ED}"/usr/bin/xmlcatalog
+	fi
+
+	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 [[ "${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 dont 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
+}
+
+libxml2_py_emake() {
+	pushd "${BUILD_DIR}/python" > /dev/null || die
+	emake "$@"
+	popd > /dev/null
+}


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/libxml2/, dev-libs/libxml2/files/
@ 2020-10-30 22:34 Matt Turner
  0 siblings, 0 replies; 15+ messages in thread
From: Matt Turner @ 2020-10-30 22:34 UTC (permalink / raw
  To: gentoo-commits

commit:     ffcf01ad268f711faa94fcb5f7d5b3e22ad4a567
Author:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 30 22:27:50 2020 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Fri Oct 30 22:33:53 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ffcf01ad

dev-libs/libxml2: Add patch to fix build with icu-68.1

Closes: https://bugs.gentoo.org/751922
Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>

 .../libxml2/files/libxml2-2.9.10-remove-TRUE.patch | 31 ++++++++++++++++++++++
 dev-libs/libxml2/libxml2-2.9.10-r3.ebuild          |  2 ++
 2 files changed, 33 insertions(+)

diff --git a/dev-libs/libxml2/files/libxml2-2.9.10-remove-TRUE.patch b/dev-libs/libxml2/files/libxml2-2.9.10-remove-TRUE.patch
new file mode 100644
index 00000000000..e405feb37c3
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.9.10-remove-TRUE.patch
@@ -0,0 +1,31 @@
+https://bugs.gentoo.org/751922
+https://gitlab.gnome.org/GNOME/libxml2/-/issues/202
+
+From c1bae734f3850f6900cf54d186ca0a9102895d82 Mon Sep 17 00:00:00 2001
+From: Lars Wendler <polynomial-c@gentoo.org>
+Date: Fri, 30 Oct 2020 10:27:23 +0100
+Subject: [PATCH] Fix build with icu-68.1
+
+icu-68.1 removed macro definitions for TRUE and FALSE
+
+Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
+---
+ encoding.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/encoding.c b/encoding.c
+index ad4d8a63..ea1fa99e 100644
+--- a/encoding.c
++++ b/encoding.c
+@@ -1958,7 +1958,7 @@ xmlEncOutputChunk(xmlCharEncodingHandler *handler, unsigned char *out,
+ #ifdef LIBXML_ICU_ENABLED
+     else if (handler->uconv_out != NULL) {
+         ret = xmlUconvWrapper(handler->uconv_out, 0, out, outlen, in, inlen,
+-                              TRUE);
++                              1);
+     }
+ #endif /* LIBXML_ICU_ENABLED */
+     else {
+-- 
+2.29.2
+

diff --git a/dev-libs/libxml2/libxml2-2.9.10-r3.ebuild b/dev-libs/libxml2/libxml2-2.9.10-r3.ebuild
index 360bcffb202..916abdd469c 100644
--- a/dev-libs/libxml2/libxml2-2.9.10-r3.ebuild
+++ b/dev-libs/libxml2/libxml2-2.9.10-r3.ebuild
@@ -78,6 +78,8 @@ src_prepare() {
 	# 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 build for Windows platform


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/libxml2/, dev-libs/libxml2/files/
@ 2020-10-30 22:39 Matt Turner
  0 siblings, 0 replies; 15+ messages in thread
From: Matt Turner @ 2020-10-30 22:39 UTC (permalink / raw
  To: gentoo-commits

commit:     f016ee441ef5590db02e09198fcbf6b12a463c50
Author:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 30 22:37:29 2020 +0000
Commit:     Matt Turner <mattst88 <AT> gentoo <DOT> org>
CommitDate: Fri Oct 30 22:38:56 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f016ee44

dev-libs/libxml2: Drop old versions

Signed-off-by: Matt Turner <mattst88 <AT> gentoo.org>

 dev-libs/libxml2/Manifest                          |   3 -
 .../files/2.9.9-python3-unicode-errors.patch       |  34 ---
 dev-libs/libxml2/libxml2-2.9.10-r2.ebuild          | 224 --------------------
 dev-libs/libxml2/libxml2-2.9.9-r4.ebuild           | 227 ---------------------
 4 files changed, 488 deletions(-)

diff --git a/dev-libs/libxml2/Manifest b/dev-libs/libxml2/Manifest
index ee77f61e855..9ded83cf33f 100644
--- a/dev-libs/libxml2/Manifest
+++ b/dev-libs/libxml2/Manifest
@@ -1,8 +1,5 @@
-DIST libxml2-2.9.10-patchset.tar.xz 71584 BLAKE2B 4925a28570ed4f84da0407c3ce5b257d0959661855792160e4c534125fe0bbfa3749e7fc43b6c91a17206ac08a85922f4158bf40164c8a17ec940bf12b7dde1c SHA512 cd5a6aa86b6cf9ff852922ecfa23f34edeecab10a0e6d1bcd4dca56a6e17713b10af9387c7a6276bfec612f1d44fc06c16a7bdcab01ef9080f4dd10fab253b93
 DIST libxml2-2.9.10-r1-patchset.tar.xz 72088 BLAKE2B 4d5f8aed35d6c0232089e09f22a77cbd25cbd2007c1330538e1c7acc4398ec3ef9023289129677cf5499dbacde4c2f28850ae81acab351d02625d3452aedaede SHA512 a63032d1e85128f637c2b54356aab06a17e31eb1f5facd8fdf88463eb21df6a1d9fd8cc751fa94b8d322fa4f796be4e1d9aa071cbd0826ab31fae46525fde952
 DIST libxml2-2.9.10.tar.gz 5624761 BLAKE2B a9958bd7db17fbfb8259b64d66548eb19d28f1aecf40cf66752fcec5720855d31cea9941d52963badd8c18ea1770485f1c11da6213149458336ce0273418f421 SHA512 0adfd12bfde89cbd6296ba6e66b6bed4edb814a74b4265bda34d95c41d9d92c696ee7adb0c737aaf9cc6e10426a31a35079b2a23d26c074e299858da12c072ed
-DIST libxml2-2.9.9-patchset.tar.xz 16792 BLAKE2B f761b5cda41d57543dadf2cdd8915b69727a818f31badc1092903a9e4341b807852fed0887e9ec7a06a0c19c4a49f9afc2f3c048947f21a09006bb51ef8399ef SHA512 c8c0ee6d0a2833e5664aa7549999f8ba63b9f0bbfda4651050eeee7d3a958c33ef55daba8cfb1ca73ebffeb44d411b5f4259fe6e11ef0204ad2deebd1708ebfb
-DIST libxml2-2.9.9.tar.gz 5476717 BLAKE2B 00a67c38084f2effd5d68d7d3e68f0c96cf4f52eab6d8d9b96dc91f03a84baa132abeaf303a836ff9bbf04f832432a036077316c464398e433c9779d8519074b SHA512 cb7784ba4e72e942614e12e4f83f4ceb275f3d738b30e3b5c1f25edf8e9fa6789e854685974eed95b362049dbf6c8e7357e0327d64c681ed390534ac154e6810
 DIST xmlts20080827.tar.gz 638940 BLAKE2B c5aab959c6e0698acd5b9be82b48a8ac26f4d01cc03f9acfff20d344f97f4711fc6d4a524ae70457147e8e30c72e27b6726829e1dd21896286aa974ed60774e7 SHA512 7325d0977c4427fc4944b291ccf896a665f654cc24399e5565c12a849c2bc3aef4fa3ee42a09ac115abcb6570c51a8fbd052c38d64d164279ecdecad5a4e884d
 DIST xsts-2002-01-16.tar.gz 6894439 BLAKE2B 1e9ec63d2c104655e64249e07440a04d862fcbcd4d4e19745d81b34994319b510a531c9d6df1491fae1e90b5d0764f0f1a827251ca8df5d613178b0eab01ef25 SHA512 43300af6d39c1e2221b0ed7318fe14c7464eeb6eb030ed1e22eb29b4ab17f014e2a4c8887c3a46ae5d243e3072da27f00f4e285498ae6f1288177d38d1108288
 DIST xsts-2004-01-14.tar.gz 2761085 BLAKE2B 41545995fb3a65d053257c376c07d45ffd1041a433bfbdb46d4dd87a5afb60c18c8629a3d988323f9e7a1d709775b5a7e5930276a7121c0725a22705c0976e36 SHA512 32854388d7e720ad67156baf50bf2bae7bd878ca3e35fd7e44e57cad3f434f69d56bbbedd61509f8a1faf01c9eae74a078df8fe130780b182c05c05cb1c39ebe

diff --git a/dev-libs/libxml2/files/2.9.9-python3-unicode-errors.patch b/dev-libs/libxml2/files/2.9.9-python3-unicode-errors.patch
deleted file mode 100644
index e87dcdedf88..00000000000
--- a/dev-libs/libxml2/files/2.9.9-python3-unicode-errors.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-Index: libxml2-2.9.5/python/libxml.c
-===================================================================
---- libxml2-2.9.5.orig/python/libxml.c
-+++ libxml2-2.9.5/python/libxml.c
-@@ -1620,6 +1620,7 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNU
-     PyObject *message;
-     PyObject *result;
-     char str[1000];
-+    unsigned char *ptr = (unsigned char *)str;
- 
- #ifdef DEBUG_ERROR
-     printf("libxml_xmlErrorFuncHandler(%p, %s, ...) called\n", ctx, msg);
-@@ -1636,12 +1637,20 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNU
- 	    str[999] = 0;
-         va_end(ap);
- 
-+#if PY_MAJOR_VERSION >= 3
-+        /* Ensure the error string doesn't start at UTF8 continuation. */
-+        while (*ptr && (*ptr & 0xc0) == 0x80)
-+            ptr++;
-+#endif
-+
-         list = PyTuple_New(2);
-         PyTuple_SetItem(list, 0, libxml_xmlPythonErrorFuncCtxt);
-         Py_XINCREF(libxml_xmlPythonErrorFuncCtxt);
--        message = libxml_charPtrConstWrap(str);
-+        message = libxml_charPtrConstWrap(ptr);
-         PyTuple_SetItem(list, 1, message);
-         result = PyEval_CallObject(libxml_xmlPythonErrorFuncHandler, list);
-+        /* Forget any errors caused in the error handler. */
-+        PyErr_Clear();
-         Py_XDECREF(list);
-         Py_XDECREF(result);
-     }

diff --git a/dev-libs/libxml2/libxml2-2.9.10-r2.ebuild b/dev-libs/libxml2/libxml2-2.9.10-r2.ebuild
deleted file mode 100644
index 2993851ec4a..00000000000
--- a/dev-libs/libxml2/libxml2-2.9.10-r2.ebuild
+++ /dev/null
@@ -1,224 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_{6,7,8,9} )
-PYTHON_REQ_USE="xml"
-
-inherit libtool flag-o-matic python-r1 autotools prefix multilib-minimal
-
-DESCRIPTION="XML C parser and toolkit"
-HOMEPAGE="http://www.xmlsoft.org/"
-
-LICENSE="MIT"
-SLOT="2"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 sparc x86 ~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~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 )"
-
-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"
-
-SRC_URI="ftp://xmlsoft.org/${PN}/${PN}-${PV/_rc/-rc}.tar.gz
-	https://dev.gentoo.org/~sam/distfiles/${CATEGORY}/${PN}/${P}-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} )"
-
-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}"
-BDEPEND="
-	dev-util/gtk-doc-am
-	virtual/pkgconfig
-"
-
-S="${WORKDIR}/${PN}-${PV%_rc*}"
-
-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}-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
-
-	eprefixify catalog.c xmlcatalog.c runtest.c xmllint.c
-
-	# Fix build for Windows platform
-	# https://bugzilla.gnome.org/show_bug.cgi?id=760456
-	# eapply "${FILESDIR}"/${PN}-2.8.0_rc1-winnt.patch
-
-	# 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
-
-	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
-#	epunt_cxx # if we don't eautoreconf
-
-	eautoreconf
-}
-
-multilib_src_configure() {
-	# filter seemingly problematic CFLAGS (#26320)
-	filter-flags -fprefetch-loop-arrays -funroll-loops
-
-	# USE zlib support breaks gnome2
-	# (libgnomeprint for instance fails to compile with
-	# fresh install, and existing) - <azarah@gentoo.org> (22 Dec 2002).
-
-	# The meaning of the 'debug' USE flag does not apply to the --with-debug
-	# switch (enabling the libxml2 debug module). See bug #100898.
-
-	# --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() {
-		mkdir -p "${BUILD_DIR}" || die # ensure python build dirs exist
-		run_in_build_dir libxml2_configure \
-			"--with-python=${EPYTHON}" \
-			"--with-python-install-dir=$(python_get_sitedir)"
-			# odd build system, also see bug #582130
-	}
-
-	libxml2_configure --without-python # build python bindings separately
-
-	if multilib_is_native_abi && use python; then
-		python_foreach_impl libxml2_py_configure
-	fi
-}
-
-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
-	multilib_is_native_abi && use python && python_foreach_impl libxml2_py_emake test
-}
-
-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() {
-	# on windows, xmllint is installed by interix libxml2 in parent prefix.
-	# this is the version to use. the native winnt version does not support
-	# symlinks, which makes repoman fail if the portage tree is linked in
-	# from another location (which is my default). -- mduft
-	if [[ ${CHOST} == *-winnt* ]]; then
-		rm -rf "${ED}"/usr/bin/xmllint
-		rm -rf "${ED}"/usr/bin/xmlcatalog
-	fi
-
-	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 [[ "${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 dont 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
-}
-
-libxml2_py_emake() {
-	pushd "${BUILD_DIR}/python" > /dev/null || die
-	emake "$@"
-	popd > /dev/null
-}

diff --git a/dev-libs/libxml2/libxml2-2.9.9-r4.ebuild b/dev-libs/libxml2/libxml2-2.9.9-r4.ebuild
deleted file mode 100644
index 6e250aac8ff..00000000000
--- a/dev-libs/libxml2/libxml2-2.9.9-r4.ebuild
+++ /dev/null
@@ -1,227 +0,0 @@
-# Copyright 1999-2020 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=6
-
-PYTHON_COMPAT=( python3_{6,7,8} )
-PYTHON_REQ_USE="xml"
-
-inherit libtool flag-o-matic python-r1 autotools prefix multilib-minimal
-
-DESCRIPTION="XML C parser and toolkit"
-HOMEPAGE="http://www.xmlsoft.org/"
-
-LICENSE="MIT"
-SLOT="2"
-KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~m68k ~mips ppc ppc64 ~riscv s390 sparc x86 ~ppc-aix ~x64-cygwin ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~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 )"
-
-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"
-
-SRC_URI="ftp://xmlsoft.org/${PN}/${PN}-${PV/_rc/-rc}.tar.gz
-	https://dev.gentoo.org/~leio/distfiles/${P}-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} )"
-
-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}
-	dev-util/gtk-doc-am
-	virtual/pkgconfig
-	hppa? ( >=sys-devel/binutils-2.15.92.0.2 )
-"
-
-S="${WORKDIR}/${PN}-${PV%_rc*}"
-
-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}-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
-
-	eprefixify catalog.c xmlcatalog.c runtest.c xmllint.c
-
-	# Fix build for Windows platform
-	# https://bugzilla.gnome.org/show_bug.cgi?id=760456
-	# eapply "${FILESDIR}"/${PN}-2.8.0_rc1-winnt.patch
-
-	# 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
-
-	# Workaround python3 itstool potential problems, bug 701020
-	eapply "${FILESDIR}"/${PV}-python3-unicode-errors.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
-#	epunt_cxx # if we don't eautoreconf
-
-	eautoreconf
-}
-
-multilib_src_configure() {
-	# filter seemingly problematic CFLAGS (#26320)
-	filter-flags -fprefetch-loop-arrays -funroll-loops
-
-	# USE zlib support breaks gnome2
-	# (libgnomeprint for instance fails to compile with
-	# fresh install, and existing) - <azarah@gentoo.org> (22 Dec 2002).
-
-	# The meaning of the 'debug' USE flag does not apply to the --with-debug
-	# switch (enabling the libxml2 debug module). See bug #100898.
-
-	# --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() {
-		mkdir -p "${BUILD_DIR}" || die # ensure python build dirs exist
-		run_in_build_dir libxml2_configure \
-			"--with-python=${EPYTHON}" \
-			"--with-python-install-dir=$(python_get_sitedir)"
-			# odd build system, also see bug #582130
-	}
-
-	libxml2_configure --without-python # build python bindings separately
-
-	if multilib_is_native_abi && use python; then
-		python_foreach_impl libxml2_py_configure
-	fi
-}
-
-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
-	multilib_is_native_abi && use python && python_foreach_impl libxml2_py_emake test
-}
-
-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() {
-	# on windows, xmllint is installed by interix libxml2 in parent prefix.
-	# this is the version to use. the native winnt version does not support
-	# symlinks, which makes repoman fail if the portage tree is linked in
-	# from another location (which is my default). -- mduft
-	if [[ ${CHOST} == *-winnt* ]]; then
-		rm -rf "${ED}"/usr/bin/xmllint
-		rm -rf "${ED}"/usr/bin/xmlcatalog
-	fi
-
-	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 [[ "${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 dont 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
-}
-
-libxml2_py_emake() {
-	pushd "${BUILD_DIR}/python" > /dev/null || die
-	emake "$@"
-	popd > /dev/null
-}


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/libxml2/, dev-libs/libxml2/files/
@ 2020-12-03  0:14 Sam James
  0 siblings, 0 replies; 15+ messages in thread
From: Sam James @ 2020-12-03  0:14 UTC (permalink / raw
  To: gentoo-commits

commit:     da4038c33b2c7684f5766d6e8f1d1089e863e87c
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu Dec  3 00:13:24 2020 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu Dec  3 00:14:49 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=da4038c3

dev-libs/libxml2: restore itstool-segfault patch

We stopped applying this patch during a roll
of a new patchset (my fault), but it seems to still
be needed. Noticed when building some of MATE.

Bug: https://bugs.gentoo.org/745162
Package-Manager: Portage-3.0.9, Repoman-3.0.2
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../libxml2-2.9.8-python3-unicode-errors.patch     | 34 ++++++++++++++++++++++
 ...2-2.9.10-r3.ebuild => libxml2-2.9.10-r4.ebuild} |  3 ++
 2 files changed, 37 insertions(+)

diff --git a/dev-libs/libxml2/files/libxml2-2.9.8-python3-unicode-errors.patch b/dev-libs/libxml2/files/libxml2-2.9.8-python3-unicode-errors.patch
new file mode 100644
index 00000000000..e87dcdedf88
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.9.8-python3-unicode-errors.patch
@@ -0,0 +1,34 @@
+Index: libxml2-2.9.5/python/libxml.c
+===================================================================
+--- libxml2-2.9.5.orig/python/libxml.c
++++ libxml2-2.9.5/python/libxml.c
+@@ -1620,6 +1620,7 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNU
+     PyObject *message;
+     PyObject *result;
+     char str[1000];
++    unsigned char *ptr = (unsigned char *)str;
+ 
+ #ifdef DEBUG_ERROR
+     printf("libxml_xmlErrorFuncHandler(%p, %s, ...) called\n", ctx, msg);
+@@ -1636,12 +1637,20 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNU
+ 	    str[999] = 0;
+         va_end(ap);
+ 
++#if PY_MAJOR_VERSION >= 3
++        /* Ensure the error string doesn't start at UTF8 continuation. */
++        while (*ptr && (*ptr & 0xc0) == 0x80)
++            ptr++;
++#endif
++
+         list = PyTuple_New(2);
+         PyTuple_SetItem(list, 0, libxml_xmlPythonErrorFuncCtxt);
+         Py_XINCREF(libxml_xmlPythonErrorFuncCtxt);
+-        message = libxml_charPtrConstWrap(str);
++        message = libxml_charPtrConstWrap(ptr);
+         PyTuple_SetItem(list, 1, message);
+         result = PyEval_CallObject(libxml_xmlPythonErrorFuncHandler, list);
++        /* Forget any errors caused in the error handler. */
++        PyErr_Clear();
+         Py_XDECREF(list);
+         Py_XDECREF(result);
+     }

diff --git a/dev-libs/libxml2/libxml2-2.9.10-r3.ebuild b/dev-libs/libxml2/libxml2-2.9.10-r4.ebuild
similarity index 98%
rename from dev-libs/libxml2/libxml2-2.9.10-r3.ebuild
rename to dev-libs/libxml2/libxml2-2.9.10-r4.ebuild
index 916abdd469c..a6678320ffe 100644
--- a/dev-libs/libxml2/libxml2-2.9.10-r3.ebuild
+++ b/dev-libs/libxml2/libxml2-2.9.10-r4.ebuild
@@ -93,6 +93,9 @@ src_prepare() {
 	# 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
+
 	if [[ ${CHOST} == *-darwin* ]] ; then
 		# Avoid final linking arguments for python modules
 		sed -i -e '/PYTHON_LIBS/s/ldflags/libs/' configure.ac || die


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/libxml2/, dev-libs/libxml2/files/
@ 2021-05-13 17:50 Sam James
  0 siblings, 0 replies; 15+ messages in thread
From: Sam James @ 2021-05-13 17:50 UTC (permalink / raw
  To: gentoo-commits

commit:     6aa57ec7fe0a20bf67be358b0badfd149df2c3ec
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu May 13 17:49:51 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu May 13 17:50:36 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6aa57ec7

dev-libs/libxml2: add 2.9.11

Without tests for now because:
- fuzz test files aren't included in the distfile (bug is upstream)
- Python tests seem to fail now but rest pass

Bug: https://bugs.gentoo.org/790002
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-libs/libxml2/Manifest                          |   1 +
 .../files/libxml2-2.9.11-disable-fuzz-tests.patch  |  33 +++
 dev-libs/libxml2/libxml2-2.9.11.ebuild             | 234 +++++++++++++++++++++
 3 files changed, 268 insertions(+)

diff --git a/dev-libs/libxml2/Manifest b/dev-libs/libxml2/Manifest
index 9ded83cf33f..3bc54c16073 100644
--- a/dev-libs/libxml2/Manifest
+++ b/dev-libs/libxml2/Manifest
@@ -1,5 +1,6 @@
 DIST libxml2-2.9.10-r1-patchset.tar.xz 72088 BLAKE2B 4d5f8aed35d6c0232089e09f22a77cbd25cbd2007c1330538e1c7acc4398ec3ef9023289129677cf5499dbacde4c2f28850ae81acab351d02625d3452aedaede SHA512 a63032d1e85128f637c2b54356aab06a17e31eb1f5facd8fdf88463eb21df6a1d9fd8cc751fa94b8d322fa4f796be4e1d9aa071cbd0826ab31fae46525fde952
 DIST libxml2-2.9.10.tar.gz 5624761 BLAKE2B a9958bd7db17fbfb8259b64d66548eb19d28f1aecf40cf66752fcec5720855d31cea9941d52963badd8c18ea1770485f1c11da6213149458336ce0273418f421 SHA512 0adfd12bfde89cbd6296ba6e66b6bed4edb814a74b4265bda34d95c41d9d92c696ee7adb0c737aaf9cc6e10426a31a35079b2a23d26c074e299858da12c072ed
+DIST libxml2-2.9.11.tar.gz 5676226 BLAKE2B 16420e593e075d23a4cd363f9adb3505a6779b1500c35fbbafa19b64a2b72f1d43b186579e02a3bcfaab52e5b69df223ded00d76bb25eb09d07d57fe423b94b1 SHA512 d9c71d75d1cd0708f56fef47802ce53d6c64c4580469458edb2fc12b699319235bcff62bc1be1f0a01f4077726e37ad2cf5e4dee4bca36a9d5d3b21d12253ba5
 DIST xmlts20080827.tar.gz 638940 BLAKE2B c5aab959c6e0698acd5b9be82b48a8ac26f4d01cc03f9acfff20d344f97f4711fc6d4a524ae70457147e8e30c72e27b6726829e1dd21896286aa974ed60774e7 SHA512 7325d0977c4427fc4944b291ccf896a665f654cc24399e5565c12a849c2bc3aef4fa3ee42a09ac115abcb6570c51a8fbd052c38d64d164279ecdecad5a4e884d
 DIST xsts-2002-01-16.tar.gz 6894439 BLAKE2B 1e9ec63d2c104655e64249e07440a04d862fcbcd4d4e19745d81b34994319b510a531c9d6df1491fae1e90b5d0764f0f1a827251ca8df5d613178b0eab01ef25 SHA512 43300af6d39c1e2221b0ed7318fe14c7464eeb6eb030ed1e22eb29b4ab17f014e2a4c8887c3a46ae5d243e3072da27f00f4e285498ae6f1288177d38d1108288
 DIST xsts-2004-01-14.tar.gz 2761085 BLAKE2B 41545995fb3a65d053257c376c07d45ffd1041a433bfbdb46d4dd87a5afb60c18c8629a3d988323f9e7a1d709775b5a7e5930276a7121c0725a22705c0976e36 SHA512 32854388d7e720ad67156baf50bf2bae7bd878ca3e35fd7e44e57cad3f434f69d56bbbedd61509f8a1faf01c9eae74a078df8fe130780b182c05c05cb1c39ebe

diff --git a/dev-libs/libxml2/files/libxml2-2.9.11-disable-fuzz-tests.patch b/dev-libs/libxml2/files/libxml2-2.9.11-disable-fuzz-tests.patch
new file mode 100644
index 00000000000..7f6fd4ae826
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.9.11-disable-fuzz-tests.patch
@@ -0,0 +1,33 @@
+https://gitlab.gnome.org/GNOME/libxml2/-/issues/252
+
+From 5d6403682a3463f29a1f7c27aa54ecb5e3971547 Mon Sep 17 00:00:00 2001
+From: Sam James <sam@gentoo.org>
+Date: Thu, 13 May 2021 17:40:22 +0000
+Subject: [PATCH] Disable fuzz tests
+
+Not all of the fuzz files are included with the dist tarball,
+so disabling them for now to get the release in with most tests
+given the security bug.
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -2,9 +2,9 @@
+ 
+ ACLOCAL_AMFLAGS = -I m4
+ 
+-SUBDIRS = include . doc example fuzz xstc $(PYTHON_SUBDIR)
++SUBDIRS = include . doc example xstc $(PYTHON_SUBDIR)
+ 
+-DIST_SUBDIRS = include . doc example fuzz python xstc
++DIST_SUBDIRS = include . doc example python xstc
+ 
+ AM_CPPFLAGS = -I$(top_builddir)/include -I$(srcdir)/include
+ 
+@@ -210,7 +210,6 @@ runtests: runtest$(EXEEXT) testrecurse$(EXEEXT) testapi$(EXEEXT) \
+ 	    $(CHECKER) ./runxmlconf$(EXEEXT)
+ 	@(if [ "$(PYTHON_SUBDIR)" != "" ] ; then cd python ; \
+ 	    $(MAKE) tests ; fi)
+-	@cd fuzz; $(MAKE) tests
+ 
+ check: all runtests
+ 
+-- 

diff --git a/dev-libs/libxml2/libxml2-2.9.11.ebuild b/dev-libs/libxml2/libxml2-2.9.11.ebuild
new file mode 100644
index 00000000000..33bd19bfcd6
--- /dev/null
+++ b/dev-libs/libxml2/libxml2-2.9.11.ebuild
@@ -0,0 +1,234 @@
+# 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 flag-o-matic prefix python-r1 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
+	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} )"
+# Python tests are flaky in 2.9.11
+# TODO: skip?
+RESTRICT="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
+)
+
+DOCS=( AUTHORS ChangeLog NEWS README TODO TODO_SCHEMAS )
+
+PATCHES=(
+	# Patches needed for prefix support
+	"${FILESDIR}"/${PN}-2.7.1-catalog_path.patch
+
+	# Fix python detection, bug #567066
+	# https://bugzilla.gnome.org/show_bug.cgi?id=760458
+	"${FILESDIR}"/${PN}-2.9.2-python-ABIFLAG.patch
+
+	# Fix python tests when building out of tree #565576
+	"${FILESDIR}"/${PN}-2.9.8-out-of-tree-test.patch
+
+	# bug #745162
+	"${FILESDIR}"/${PN}-2.9.8-python3-unicode-errors.patch
+
+	# Avoid failure on missing fuzz.h when running tests
+	"${FILESDIR}"/${PN}-2.9.11-disable-fuzz-tests.patch
+)
+
+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
+	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
+
+	eprefixify catalog.c xmlcatalog.c runtest.c xmllint.c
+
+	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
+	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
+}


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/libxml2/, dev-libs/libxml2/files/
@ 2021-05-20  1:46 Sam James
  0 siblings, 0 replies; 15+ messages in thread
From: Sam James @ 2021-05-20  1:46 UTC (permalink / raw
  To: gentoo-commits

commit:     6d220e09b25048d28d6598f8a6ffb62f0fbe92b4
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Thu May 20 01:33:39 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Thu May 20 01:46:11 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6d220e09

dev-libs/libxml2: include lxml compatibility patch

Bug: https://bugs.gentoo.org/790737
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../libxml2-2.9.12-fix-lxml-compatibility.patch    | 214 ++++++++++++++++++
 dev-libs/libxml2/libxml2-2.9.12-r1.ebuild          | 245 +++++++++++++++++++++
 2 files changed, 459 insertions(+)

diff --git a/dev-libs/libxml2/files/libxml2-2.9.12-fix-lxml-compatibility.patch b/dev-libs/libxml2/files/libxml2-2.9.12-fix-lxml-compatibility.patch
new file mode 100644
index 00000000000..844266038d3
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.9.12-fix-lxml-compatibility.patch
@@ -0,0 +1,214 @@
+https://gitlab.gnome.org/nwellnhof/libxml2/-/commit/7955b0d6fbbe49392ccc2e511edd00fbbfcb5a10.patch
+https://gitlab.gnome.org/GNOME/libxml2/-/issues/255
+https://bugs.gentoo.org/790737
+
+From 7955b0d6fbbe49392ccc2e511edd00fbbfcb5a10 Mon Sep 17 00:00:00 2001
+From: Nick Wellnhofer <wellnhofer@aevum.de>
+Date: Tue, 18 May 2021 20:08:28 +0200
+Subject: [PATCH] Work around lxml API abuse
+
+Make xmlNodeDumpOutput and htmlNodeDumpFormatOutput work with corrupted
+parent pointers. This used to work with the old recursive code but the
+non-recursive rewrite required parent pointers to be set correctly.
+
+Unfortunately, lxml relies on the old behavior and passes subtrees with
+a corrupted structure. Fall back to a recursive function call if an
+invalid parent pointer is detected.
+
+Fixes #255.
+---
+ HTMLtree.c | 46 ++++++++++++++++++++++++++++------------------
+ xmlsave.c  | 31 +++++++++++++++++++++----------
+ 2 files changed, 49 insertions(+), 28 deletions(-)
+
+diff --git a/HTMLtree.c b/HTMLtree.c
+index 24434d453..bdd639c7f 100644
+--- a/HTMLtree.c
++++ b/HTMLtree.c
+@@ -744,7 +744,7 @@ void
+ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
+ 	                 xmlNodePtr cur, const char *encoding ATTRIBUTE_UNUSED,
+                          int format) {
+-    xmlNodePtr root;
++    xmlNodePtr root, parent;
+     xmlAttrPtr attr;
+     const htmlElemDesc * info;
+ 
+@@ -755,6 +755,7 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
+     }
+ 
+     root = cur;
++    parent = cur->parent;
+     while (1) {
+         switch (cur->type) {
+         case XML_HTML_DOCUMENT_NODE:
+@@ -762,13 +763,25 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
+             if (((xmlDocPtr) cur)->intSubset != NULL) {
+                 htmlDtdDumpOutput(buf, (xmlDocPtr) cur, NULL);
+             }
+-            if (cur->children != NULL) {
++            /* Always validate cur->parent when descending. */
++            if ((cur->parent == parent) && (cur->children != NULL)) {
++                parent = cur;
+                 cur = cur->children;
+                 continue;
+             }
+             break;
+ 
+         case XML_ELEMENT_NODE:
++            /*
++             * Some users like lxml are known to pass nodes with a corrupted
++             * tree structure. Fall back to a recursive call to handle this
++             * case.
++             */
++            if ((cur->parent != parent) && (cur->children != NULL)) {
++                htmlNodeDumpFormatOutput(buf, doc, cur, encoding, format);
++                break;
++            }
++
+             /*
+              * Get specific HTML info for that node.
+              */
+@@ -817,6 +830,7 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
+                     (cur->name != NULL) &&
+                     (cur->name[0] != 'p')) /* p, pre, param */
+                     xmlOutputBufferWriteString(buf, "\n");
++                parent = cur;
+                 cur = cur->children;
+                 continue;
+             }
+@@ -825,9 +839,9 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
+                 (info != NULL) && (!info->isinline)) {
+                 if ((cur->next->type != HTML_TEXT_NODE) &&
+                     (cur->next->type != HTML_ENTITY_REF_NODE) &&
+-                    (cur->parent != NULL) &&
+-                    (cur->parent->name != NULL) &&
+-                    (cur->parent->name[0] != 'p')) /* p, pre, param */
++                    (parent != NULL) &&
++                    (parent->name != NULL) &&
++                    (parent->name[0] != 'p')) /* p, pre, param */
+                     xmlOutputBufferWriteString(buf, "\n");
+             }
+ 
+@@ -842,9 +856,9 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
+                 break;
+             if (((cur->name == (const xmlChar *)xmlStringText) ||
+                  (cur->name != (const xmlChar *)xmlStringTextNoenc)) &&
+-                ((cur->parent == NULL) ||
+-                 ((xmlStrcasecmp(cur->parent->name, BAD_CAST "script")) &&
+-                  (xmlStrcasecmp(cur->parent->name, BAD_CAST "style"))))) {
++                ((parent == NULL) ||
++                 ((xmlStrcasecmp(parent->name, BAD_CAST "script")) &&
++                  (xmlStrcasecmp(parent->name, BAD_CAST "style"))))) {
+                 xmlChar *buffer;
+ 
+                 buffer = xmlEncodeEntitiesReentrant(doc, cur->content);
+@@ -902,13 +916,9 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
+                 break;
+             }
+ 
+-            /*
+-             * The parent should never be NULL here but we want to handle
+-             * corrupted documents gracefully.
+-             */
+-            if (cur->parent == NULL)
+-                return;
+-            cur = cur->parent;
++            cur = parent;
++            /* cur->parent was validated when descending. */
++            parent = cur->parent;
+ 
+             if ((cur->type == XML_HTML_DOCUMENT_NODE) ||
+                 (cur->type == XML_DOCUMENT_NODE)) {
+@@ -939,9 +949,9 @@ htmlNodeDumpFormatOutput(xmlOutputBufferPtr buf, xmlDocPtr doc,
+                     (cur->next != NULL)) {
+                     if ((cur->next->type != HTML_TEXT_NODE) &&
+                         (cur->next->type != HTML_ENTITY_REF_NODE) &&
+-                        (cur->parent != NULL) &&
+-                        (cur->parent->name != NULL) &&
+-                        (cur->parent->name[0] != 'p')) /* p, pre, param */
++                        (parent != NULL) &&
++                        (parent->name != NULL) &&
++                        (parent->name[0] != 'p')) /* p, pre, param */
+                         xmlOutputBufferWriteString(buf, "\n");
+                 }
+             }
+diff --git a/xmlsave.c b/xmlsave.c
+index 61a40459b..aedbd5e70 100644
+--- a/xmlsave.c
++++ b/xmlsave.c
+@@ -847,7 +847,7 @@ htmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
+ static void
+ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
+     int format = ctxt->format;
+-    xmlNodePtr tmp, root, unformattedNode = NULL;
++    xmlNodePtr tmp, root, unformattedNode = NULL, parent;
+     xmlAttrPtr attr;
+     xmlChar *start, *end;
+     xmlOutputBufferPtr buf;
+@@ -856,6 +856,7 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
+     buf = ctxt->buf;
+ 
+     root = cur;
++    parent = cur->parent;
+     while (1) {
+         switch (cur->type) {
+         case XML_DOCUMENT_NODE:
+@@ -868,7 +869,9 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
+             break;
+ 
+         case XML_DOCUMENT_FRAG_NODE:
+-            if (cur->children != NULL) {
++            /* Always validate cur->parent when descending. */
++            if ((cur->parent == parent) && (cur->children != NULL)) {
++                parent = cur;
+                 cur = cur->children;
+                 continue;
+             }
+@@ -887,7 +890,18 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
+             break;
+ 
+         case XML_ELEMENT_NODE:
+-	    if ((cur != root) && (ctxt->format == 1) && (xmlIndentTreeOutput))
++            /*
++             * Some users like lxml are known to pass nodes with a corrupted
++             * tree structure. Fall back to a recursive call to handle this
++             * case.
++             */
++            if ((cur->parent != parent) && (cur->children != NULL)) {
++                xmlNodeDumpOutputInternal(ctxt, cur);
++                break;
++            }
++
++	    if ((ctxt->level > 0) && (ctxt->format == 1) &&
++                (xmlIndentTreeOutput))
+ 		xmlOutputBufferWrite(buf, ctxt->indent_size *
+ 				     (ctxt->level > ctxt->indent_nr ?
+ 				      ctxt->indent_nr : ctxt->level),
+@@ -942,6 +956,7 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
+                 xmlOutputBufferWrite(buf, 1, ">");
+                 if (ctxt->format == 1) xmlOutputBufferWrite(buf, 1, "\n");
+                 if (ctxt->level >= 0) ctxt->level++;
++                parent = cur;
+                 cur = cur->children;
+                 continue;
+             }
+@@ -1058,13 +1073,9 @@ xmlNodeDumpOutputInternal(xmlSaveCtxtPtr ctxt, xmlNodePtr cur) {
+                 break;
+             }
+ 
+-            /*
+-             * The parent should never be NULL here but we want to handle
+-             * corrupted documents gracefully.
+-             */
+-            if (cur->parent == NULL)
+-                return;
+-            cur = cur->parent;
++            cur = parent;
++            /* cur->parent was validated when descending. */
++            parent = cur->parent;
+ 
+             if (cur->type == XML_ELEMENT_NODE) {
+                 if (ctxt->level > 0) ctxt->level--;
+-- 
+GitLab

diff --git a/dev-libs/libxml2/libxml2-2.9.12-r1.ebuild b/dev-libs/libxml2/libxml2-2.9.12-r1.ebuild
new file mode 100644
index 00000000000..2b005c416ec
--- /dev/null
+++ b/dev-libs/libxml2/libxml2-2.9.12-r1.ebuild
@@ -0,0 +1,245 @@
+# Copyright 1999-2021 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+# Note: Please bump in sync with dev-libs/libxslt
+
+PYTHON_COMPAT=( python3_{7,8,9} )
+PYTHON_REQ_USE="xml"
+VERIFY_SIG_OPENPGP_KEY_PATH=/usr/share/openpgp-keys/danielveillard.asc
+inherit autotools flag-o-matic prefix python-r1 multilib-minimal verify-sig
+
+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="xmlts20130923.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
+	test? (
+		${XSTS_HOME}/${XSTS_NAME_1}/${XSTS_TARBALL_1}
+		${XSTS_HOME}/${XSTS_NAME_2}/${XSTS_TARBALL_2}
+		https://www.w3.org/XML/Test/${XMLCONF_TARBALL}
+	)
+	verify-sig? ( ftp://xmlsoft.org/${PN}/${PN}-${PV/_rc/-rc}.tar.gz.asc )
+"
+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"
+RESTRICT="!test? ( test )"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+BDEPEND="
+	dev-util/gtk-doc-am
+	virtual/pkgconfig
+	verify-sig? ( app-crypt/openpgp-keys-danielveillard )
+"
+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
+)
+
+DOCS=( AUTHORS ChangeLog NEWS README TODO TODO_SCHEMAS )
+
+PATCHES=(
+	## Gentoo
+	# Patches needed for prefix support
+	"${FILESDIR}"/${PN}-2.7.1-catalog_path.patch
+
+	# Fix python detection, bug #567066
+	# https://bugzilla.gnome.org/show_bug.cgi?id=760458
+	"${FILESDIR}"/${PN}-2.9.2-python-ABIFLAG.patch
+
+	# Fix python tests when building out of tree #565576
+	"${FILESDIR}"/${PN}-2.9.8-out-of-tree-test.patch
+
+	# bug #745162
+	"${FILESDIR}"/${PN}-2.9.8-python3-unicode-errors.patch
+
+	# Avoid failure on missing fuzz.h when running tests
+	"${FILESDIR}"/${PN}-2.9.11-disable-fuzz-tests.patch
+
+	## Upstream
+	# Fix lxml compatibility
+	"${FILESDIR}"/${PN}-2.9.12-fix-lxml-compatibility.patch
+)
+
+src_unpack() {
+	local tarname=${P/_rc/-rc}.tar.gz
+
+	if use verify-sig ; then
+		verify-sig_verify_detached "${DISTDIR}"/${tarname}{,.asc}
+	fi
+
+	# ${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 ${tarname}
+	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
+
+	eprefixify catalog.c xmlcatalog.c runtest.c xmllint.c
+
+	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
+	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
+}


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/libxml2/, dev-libs/libxml2/files/
@ 2021-10-29 13:46 David Seifert
  0 siblings, 0 replies; 15+ messages in thread
From: David Seifert @ 2021-10-29 13:46 UTC (permalink / raw
  To: gentoo-commits

commit:     1f361d68bae474c55c7d08826107f9b2ef73ae81
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Fri Oct 29 13:46:13 2021 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Fri Oct 29 13:46:13 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1f361d68

dev-libs/libxml2: drop 2.9.10-r5, 2.9.12, 2.9.12-r2, 2.9.12-r3

Signed-off-by: David Seifert <soap <AT> gentoo.org>

 dev-libs/libxml2/Manifest                          |   5 -
 .../libxml2/files/libxml2-2.7.1-catalog_path.patch |  66 ------
 .../libxml2/files/libxml2-2.9.10-remove-TRUE.patch |  24 --
 .../files/libxml2-2.9.10-xmllint-utf8.patch        |  30 ---
 .../files/libxml2-2.9.11-disable-fuzz-tests.patch  |  33 ---
 .../files/libxml2-2.9.2-python-ABIFLAG.patch       |  11 -
 .../files/libxml2-2.9.8-out-of-tree-test.patch     |  32 ---
 .../libxml2-2.9.8-python3-unicode-errors.patch     |  33 ---
 dev-libs/libxml2/libxml2-2.9.10-r5.ebuild          | 240 --------------------
 dev-libs/libxml2/libxml2-2.9.12-r2.ebuild          | 249 --------------------
 dev-libs/libxml2/libxml2-2.9.12-r3.ebuild          | 251 ---------------------
 dev-libs/libxml2/libxml2-2.9.12.ebuild             | 240 --------------------
 12 files changed, 1214 deletions(-)

diff --git a/dev-libs/libxml2/Manifest b/dev-libs/libxml2/Manifest
index a3ddfee2530..f529aea0838 100644
--- a/dev-libs/libxml2/Manifest
+++ b/dev-libs/libxml2/Manifest
@@ -1,11 +1,6 @@
-DIST libxml2-2.9.10-r1-patchset.tar.xz 72088 BLAKE2B 4d5f8aed35d6c0232089e09f22a77cbd25cbd2007c1330538e1c7acc4398ec3ef9023289129677cf5499dbacde4c2f28850ae81acab351d02625d3452aedaede SHA512 a63032d1e85128f637c2b54356aab06a17e31eb1f5facd8fdf88463eb21df6a1d9fd8cc751fa94b8d322fa4f796be4e1d9aa071cbd0826ab31fae46525fde952
-DIST libxml2-2.9.10.tar.gz 5624761 BLAKE2B a9958bd7db17fbfb8259b64d66548eb19d28f1aecf40cf66752fcec5720855d31cea9941d52963badd8c18ea1770485f1c11da6213149458336ce0273418f421 SHA512 0adfd12bfde89cbd6296ba6e66b6bed4edb814a74b4265bda34d95c41d9d92c696ee7adb0c737aaf9cc6e10426a31a35079b2a23d26c074e299858da12c072ed
-DIST libxml2-2.9.12-r2-patchset.tar.bz2 5939 BLAKE2B e518a174385a121ca5545d0a51c2a2b4ddd21b1e7996e2806f368588b27d60e8318ab50ebfb90c3ee57ccece4f1c37e05c1daeed4203a4e9cb5a056ba530ad2b SHA512 06b96ab8426cd560c1147998965b5e718bee08536549a278269f6535ff1460ed97d83067ed0e8a4d834145a5e5a6caa912cf8aa5a33a360e4b1bc9d9135bfb04
-DIST libxml2-2.9.12-r3-patchset.tar.bz2 6281 BLAKE2B b7038f85009afdacc2fcf0b9cf30f915f20a2c8dfbe3749c6e74c637191f97169ee46b26deac5e347230d956f2d5aded218d09f0232f23b39ef4ad5e2fd09f61 SHA512 8170462eb3ecd2f834650309498a4e586fb3edb3114f42b3c95e96dc2ca81181e70ccd1790c440bd7ef4f489a2311b99765dcd12d9fb52207a11fb4394409ae8
 DIST libxml2-2.9.12-r5-patchset.tar.bz2 7231 BLAKE2B d9d0d56ebccbfe234a8af04cc5343c1a02d84fbd998c2373fd48be59cf92807a9417db650a6bb6ba309e101994c4ae2b28edda7bf635c7728eb8b8047d0d3391 SHA512 b2db0fe4595c1559d9f8dc836ee6eee469191f6c490fc95d25d9fa99a544e80858894cc35b6e4a6624a38d0309800540badc929e86ef29950c1107caa4656a14
 DIST libxml2-2.9.12.tar.gz 5681632 BLAKE2B ab93633140e9fd119d3a48ed829a91213c3d7956a00d181203f5188fb0ed0d3a7150d3128fe986b13efadf6fe484393262a3de575527f38f74aa6c0067a6d934 SHA512 df1c6486e80f0fcf3c506f3599bcfb94b620c00d0b5d26831bc983daa78d58ec58b5057b1ec7c1a26c694f40199c6234ee2a6dcabf65abfa10c447cb5705abbd
 DIST libxml2-2.9.12.tar.gz.asc 488 BLAKE2B 48ec86ec373d94de73bdb52141fc77fccd0ca296a35ed97aa3479ecdcf82b15422dd7d751359b5b1ca477e24b8eee9226784cfbfd861236e10eed2519e7959bf SHA512 69ca6ab7170cad467724e19eff99a3544966a26069e78a7b7cc27ae93a9077b11cc8dad2536bd0b27c3b45f4ea7520c813fe5a018cd65f103059f7f75147a656
-DIST xmlts20080827.tar.gz 638940 BLAKE2B c5aab959c6e0698acd5b9be82b48a8ac26f4d01cc03f9acfff20d344f97f4711fc6d4a524ae70457147e8e30c72e27b6726829e1dd21896286aa974ed60774e7 SHA512 7325d0977c4427fc4944b291ccf896a665f654cc24399e5565c12a849c2bc3aef4fa3ee42a09ac115abcb6570c51a8fbd052c38d64d164279ecdecad5a4e884d
 DIST xmlts20130923.tar.gz 641522 BLAKE2B 63a47bc69278ef510cd0b3779aed729e1b309e30efa0015d28ed051cc03f9dfddb447ab57b07b3393e8f47393d15473b0e199c34cb1f5f746b15ddfaa55670be SHA512 d5c4d26b324ed21f4e0641cd7f8b76dbf9de80df8b519982e44d41c960df29fd03618e02e9693b2d11ad06d19c4a965274c95a048ec3b9653eacb919a7f8b733
 DIST xsts-2002-01-16.tar.gz 6894439 BLAKE2B 1e9ec63d2c104655e64249e07440a04d862fcbcd4d4e19745d81b34994319b510a531c9d6df1491fae1e90b5d0764f0f1a827251ca8df5d613178b0eab01ef25 SHA512 43300af6d39c1e2221b0ed7318fe14c7464eeb6eb030ed1e22eb29b4ab17f014e2a4c8887c3a46ae5d243e3072da27f00f4e285498ae6f1288177d38d1108288
 DIST xsts-2004-01-14.tar.gz 2761085 BLAKE2B 41545995fb3a65d053257c376c07d45ffd1041a433bfbdb46d4dd87a5afb60c18c8629a3d988323f9e7a1d709775b5a7e5930276a7121c0725a22705c0976e36 SHA512 32854388d7e720ad67156baf50bf2bae7bd878ca3e35fd7e44e57cad3f434f69d56bbbedd61509f8a1faf01c9eae74a078df8fe130780b182c05c05cb1c39ebe

diff --git a/dev-libs/libxml2/files/libxml2-2.7.1-catalog_path.patch b/dev-libs/libxml2/files/libxml2-2.7.1-catalog_path.patch
deleted file mode 100644
index 3f69ec2a4d8..00000000000
--- a/dev-libs/libxml2/files/libxml2-2.7.1-catalog_path.patch
+++ /dev/null
@@ -1,66 +0,0 @@
---- a/catalog.c
-+++ b/catalog.c
-@@ -68,10 +68,10 @@
- #define XML_URN_PUBID "urn:publicid:"
- #define XML_CATAL_BREAK ((xmlChar *) -1)
- #ifndef XML_XML_DEFAULT_CATALOG
--#define XML_XML_DEFAULT_CATALOG "file:///etc/xml/catalog"
-+#define XML_XML_DEFAULT_CATALOG "file://@GENTOO_PORTAGE_EPREFIX@/etc/xml/catalog"
- #endif
- #ifndef XML_SGML_DEFAULT_CATALOG
--#define XML_SGML_DEFAULT_CATALOG "file:///etc/sgml/catalog"
-+#define XML_SGML_DEFAULT_CATALOG "file://@GENTOO_PORTAGE_EPREFIX@/etc/sgml/catalog"
- #endif
- 
- #if defined(_WIN32) && defined(_MSC_VER)
-@@ -76,7 +76,7 @@
- 
- #if defined(_WIN32) && defined(_MSC_VER)
- #undef XML_XML_DEFAULT_CATALOG
--static char XML_XML_DEFAULT_CATALOG[256] = "file:///etc/xml/catalog";
-+static char XML_XML_DEFAULT_CATALOG[256] = "file://@GENTOO_PORTAGE_EPREFIX@/etc/xml/catalog";
- #if defined(_WIN32_WCE)
- /* Windows CE don't have a A variant */
- #define GetModuleHandleA GetModuleHandle
---- a/xmlcatalog.c
-+++ b/xmlcatalog.c
-@@ -43,7 +43,7 @@
- 
- 
- #ifndef XML_SGML_DEFAULT_CATALOG
--#define XML_SGML_DEFAULT_CATALOG "/etc/sgml/catalog"
-+#define XML_SGML_DEFAULT_CATALOG "@GENTOO_PORTAGE_EPREFIX@/etc/sgml/catalog"
- #endif
- 
- /************************************************************************
---- a/runtest.c
-+++ b/runtest.c
-@@ -2747,7 +2747,7 @@
-  */
- static int
- uripMatch(const char * URI) {
--    if ((URI == NULL) || (!strcmp(URI, "file:///etc/xml/catalog")))
-+    if ((URI == NULL) || (!strcmp(URI, "file://@GENTOO_PORTAGE_EPREFIX@/etc/xml/catalog")))
-         return(0);
-     /* Verify we received the escaped URL */
-     if (strcmp(urip_rcvsURLs[urip_current], URI))
-@@ -2766,7 +2766,7 @@
-  */
- static void *
- uripOpen(const char * URI) {
--    if ((URI == NULL) || (!strcmp(URI, "file:///etc/xml/catalog")))
-+    if ((URI == NULL) || (!strcmp(URI, "file://@GENTOO_PORTAGE_EPREFIX@/etc/xml/catalog")))
-         return(NULL);
-     /* Verify we received the escaped URL */
-     if (strcmp(urip_rcvsURLs[urip_current], URI))
---- a/xmllint.c
-+++ b/xmllint.c
-@@ -103,7 +103,7 @@
- #endif
- 
- #ifndef XML_XML_DEFAULT_CATALOG
--#define XML_XML_DEFAULT_CATALOG "file:///etc/xml/catalog"
-+#define XML_XML_DEFAULT_CATALOG "file://@GENTOO_PORTAGE_EPREFIX@/etc/xml/catalog"
- #endif
- 
- typedef enum {

diff --git a/dev-libs/libxml2/files/libxml2-2.9.10-remove-TRUE.patch b/dev-libs/libxml2/files/libxml2-2.9.10-remove-TRUE.patch
deleted file mode 100644
index c979c841477..00000000000
--- a/dev-libs/libxml2/files/libxml2-2.9.10-remove-TRUE.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-https://bugs.gentoo.org/751922
-https://gitlab.gnome.org/GNOME/libxml2/-/issues/202
-
-From c1bae734f3850f6900cf54d186ca0a9102895d82 Mon Sep 17 00:00:00 2001
-From: Lars Wendler <polynomial-c@gentoo.org>
-Date: Fri, 30 Oct 2020 10:27:23 +0100
-Subject: [PATCH] Fix build with icu-68.1
-
-icu-68.1 removed macro definitions for TRUE and FALSE
-
-Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
----
---- a/encoding.c
-+++ b/encoding.c
-@@ -1958,7 +1958,7 @@ xmlEncOutputChunk(xmlCharEncodingHandler *handler, unsigned char *out,
- #ifdef LIBXML_ICU_ENABLED
-     else if (handler->uconv_out != NULL) {
-         ret = xmlUconvWrapper(handler->uconv_out, 0, out, outlen, in, inlen,
--                              TRUE);
-+                              1);
-     }
- #endif /* LIBXML_ICU_ENABLED */
-     else {
--- 

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
deleted file mode 100644
index 205b26b54f8..00000000000
--- a/dev-libs/libxml2/files/libxml2-2.9.10-xmllint-utf8.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-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.
---- 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);
--- 

diff --git a/dev-libs/libxml2/files/libxml2-2.9.11-disable-fuzz-tests.patch b/dev-libs/libxml2/files/libxml2-2.9.11-disable-fuzz-tests.patch
deleted file mode 100644
index 7f6fd4ae826..00000000000
--- a/dev-libs/libxml2/files/libxml2-2.9.11-disable-fuzz-tests.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-https://gitlab.gnome.org/GNOME/libxml2/-/issues/252
-
-From 5d6403682a3463f29a1f7c27aa54ecb5e3971547 Mon Sep 17 00:00:00 2001
-From: Sam James <sam@gentoo.org>
-Date: Thu, 13 May 2021 17:40:22 +0000
-Subject: [PATCH] Disable fuzz tests
-
-Not all of the fuzz files are included with the dist tarball,
-so disabling them for now to get the release in with most tests
-given the security bug.
---- a/Makefile.am
-+++ b/Makefile.am
-@@ -2,9 +2,9 @@
- 
- ACLOCAL_AMFLAGS = -I m4
- 
--SUBDIRS = include . doc example fuzz xstc $(PYTHON_SUBDIR)
-+SUBDIRS = include . doc example xstc $(PYTHON_SUBDIR)
- 
--DIST_SUBDIRS = include . doc example fuzz python xstc
-+DIST_SUBDIRS = include . doc example python xstc
- 
- AM_CPPFLAGS = -I$(top_builddir)/include -I$(srcdir)/include
- 
-@@ -210,7 +210,6 @@ runtests: runtest$(EXEEXT) testrecurse$(EXEEXT) testapi$(EXEEXT) \
- 	    $(CHECKER) ./runxmlconf$(EXEEXT)
- 	@(if [ "$(PYTHON_SUBDIR)" != "" ] ; then cd python ; \
- 	    $(MAKE) tests ; fi)
--	@cd fuzz; $(MAKE) tests
- 
- check: all runtests
- 
--- 

diff --git a/dev-libs/libxml2/files/libxml2-2.9.2-python-ABIFLAG.patch b/dev-libs/libxml2/files/libxml2-2.9.2-python-ABIFLAG.patch
deleted file mode 100644
index 7c5557f9915..00000000000
--- a/dev-libs/libxml2/files/libxml2-2.9.2-python-ABIFLAG.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- a/configure.ac
-+++ b/configure.ac
-@@ -844,7 +844,7 @@ if test "$with_python" != "no" ; then
-     fi
-     if test "$PYTHON" != ""
-     then
--        PYTHON_VERSION=`$PYTHON -c "from distutils import sysconfig; print(sysconfig.get_python_version())"`
-+        PYTHON_VERSION=`$PYTHON -c "import sysconfig; print(sysconfig.get_config_var('LDVERSION') or sysconfig.get_config_var('py_version_short'))"`
- 	PYTHON_INCLUDES=`$PYTHON -c "from distutils import sysconfig; print(sysconfig.get_python_inc())"`
- # does not work as it produce a /usr/lib/python path instead of/usr/lib64/python
- #

diff --git a/dev-libs/libxml2/files/libxml2-2.9.8-out-of-tree-test.patch b/dev-libs/libxml2/files/libxml2-2.9.8-out-of-tree-test.patch
deleted file mode 100644
index 1e269c3387b..00000000000
--- a/dev-libs/libxml2/files/libxml2-2.9.8-out-of-tree-test.patch
+++ /dev/null
@@ -1,32 +0,0 @@
-https://gitlab.gnome.org/GNOME/libxml2/merge_requests/14
-
-From 54878c018af979b20ca1bfbf12599973484cae5b Mon Sep 17 00:00:00 2001
-From: Mike Frysinger <vapier@gentoo.org>
-Date: Thu, 3 Jan 2019 05:44:03 -0500
-Subject: [PATCH] fix reader5.py test when building out of tree
-
-When building out of tree, the relative path this test uses doesn't
-work.  Resolve the path relative to the test script itself instead.
-
-Url: https://bugs.gentoo.org/565576
---- a/python/tests/reader5.py
-+++ b/python/tests/reader5.py
-@@ -4,6 +4,7 @@
- # this extract the Dragon bibliography entries from the XML specification
- #
- import libxml2
-+import os
- import sys
- 
- # Memory debug specific
-@@ -14,7 +15,8 @@ Ravi Sethi, and Jeffrey D. Ullman.
- <emph>Compilers:  Principles, Techniques, and Tools</emph>.
- Reading:  Addison-Wesley, 1986, rpt. corr. 1988.</bibl>"""
- 
--f = open('../../test/valid/REC-xml-19980210.xml', 'rb')
-+basedir = os.path.dirname(os.path.realpath(__file__))
-+f = open(os.path.join(basedir, '../../test/valid/REC-xml-19980210.xml'), 'rb')
- input = libxml2.inputBuffer(f)
- reader = input.newTextReader("REC")
- res=""
--- 

diff --git a/dev-libs/libxml2/files/libxml2-2.9.8-python3-unicode-errors.patch b/dev-libs/libxml2/files/libxml2-2.9.8-python3-unicode-errors.patch
deleted file mode 100644
index db20221afe4..00000000000
--- a/dev-libs/libxml2/files/libxml2-2.9.8-python3-unicode-errors.patch
+++ /dev/null
@@ -1,33 +0,0 @@
-https://bugs.gentoo.org/745162
---- a/python/libxml.c
-+++ b/python/libxml.c
-@@ -1620,6 +1620,7 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNU
-     PyObject *message;
-     PyObject *result;
-     char str[1000];
-+    unsigned char *ptr = (unsigned char *)str;
- 
- #ifdef DEBUG_ERROR
-     printf("libxml_xmlErrorFuncHandler(%p, %s, ...) called\n", ctx, msg);
-@@ -1636,12 +1637,20 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNU
- 	    str[999] = 0;
-         va_end(ap);
- 
-+#if PY_MAJOR_VERSION >= 3
-+        /* Ensure the error string doesn't start at UTF8 continuation. */
-+        while (*ptr && (*ptr & 0xc0) == 0x80)
-+            ptr++;
-+#endif
-+
-         list = PyTuple_New(2);
-         PyTuple_SetItem(list, 0, libxml_xmlPythonErrorFuncCtxt);
-         Py_XINCREF(libxml_xmlPythonErrorFuncCtxt);
--        message = libxml_charPtrConstWrap(str);
-+        message = libxml_charPtrConstWrap(ptr);
-         PyTuple_SetItem(list, 1, message);
-         result = PyEval_CallObject(libxml_xmlPythonErrorFuncHandler, list);
-+        /* Forget any errors caused in the error handler. */
-+        PyErr_Clear();
-         Py_XDECREF(list);
-         Py_XDECREF(result);
-     }

diff --git a/dev-libs/libxml2/libxml2-2.9.10-r5.ebuild b/dev-libs/libxml2/libxml2-2.9.10-r5.ebuild
deleted file mode 100644
index 97ea995cd04..00000000000
--- a/dev-libs/libxml2/libxml2-2.9.10-r5.ebuild
+++ /dev/null
@@ -1,240 +0,0 @@
-# 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 flag-o-matic prefix python-r1 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
-}

diff --git a/dev-libs/libxml2/libxml2-2.9.12-r2.ebuild b/dev-libs/libxml2/libxml2-2.9.12-r2.ebuild
deleted file mode 100644
index c00357fd49f..00000000000
--- a/dev-libs/libxml2/libxml2-2.9.12-r2.ebuild
+++ /dev/null
@@ -1,249 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-# Note: Please bump in sync with dev-libs/libxslt
-
-PATCHSET_VERSION="2.9.12-r2-patchset"
-
-PYTHON_COMPAT=( python3_{7,8,9} )
-PYTHON_REQ_USE="xml"
-VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/danielveillard.asc
-inherit autotools flag-o-matic prefix python-r1 multilib-minimal verify-sig
-
-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="xmlts20130923.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}/${PN}-${PATCHSET_VERSION}.tar.bz2
-	test? (
-		${XSTS_HOME}/${XSTS_NAME_1}/${XSTS_TARBALL_1}
-		${XSTS_HOME}/${XSTS_NAME_2}/${XSTS_TARBALL_2}
-		https://www.w3.org/XML/Test/${XMLCONF_TARBALL}
-	)
-	verify-sig? ( ftp://xmlsoft.org/${PN}/${PN}-${PV/_rc/-rc}.tar.gz.asc )
-"
-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"
-RESTRICT="!test? ( test )"
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
-
-BDEPEND="
-	dev-util/gtk-doc-am
-	virtual/pkgconfig
-	verify-sig? ( app-crypt/openpgp-keys-danielveillard )
-"
-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
-)
-
-DOCS=( AUTHORS ChangeLog NEWS README TODO TODO_SCHEMAS )
-
-PATCHES=(
-	## Gentoo
-	# Patches needed for prefix support
-	"${WORKDIR}"/${PN}-2.7.1-catalog_path.patch
-
-	# Fix python detection, bug #567066
-	# https://bugzilla.gnome.org/show_bug.cgi?id=760458
-	"${WORKDIR}"/${PN}-2.9.2-python-ABIFLAG.patch
-
-	# Fix python tests when building out of tree #565576
-	"${WORKDIR}"/${PN}-2.9.8-out-of-tree-test.patch
-
-	# bug #745162
-	"${WORKDIR}"/${PN}-2.9.8-python3-unicode-errors.patch
-
-	# Avoid failure on missing fuzz.h when running tests
-	"${WORKDIR}"/${PN}-2.9.11-disable-fuzz-tests.patch
-
-	## Upstream
-	# Fix lxml compatibility
-	"${WORKDIR}"/${PN}-2.9.12-fix-lxml-compatibility.patch
-)
-
-src_unpack() {
-	local tarname=${P/_rc/-rc}.tar.gz
-
-	if use verify-sig ; then
-		verify-sig_verify_detached "${DISTDIR}"/${tarname}{,.asc}
-	fi
-
-	# ${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 ${tarname} ${PN}-${PATCHSET_VERSION}.tar.bz2
-
-	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
-
-	eprefixify catalog.c xmlcatalog.c runtest.c xmllint.c
-
-	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
-	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
-}

diff --git a/dev-libs/libxml2/libxml2-2.9.12-r3.ebuild b/dev-libs/libxml2/libxml2-2.9.12-r3.ebuild
deleted file mode 100644
index 7d87a16e154..00000000000
--- a/dev-libs/libxml2/libxml2-2.9.12-r3.ebuild
+++ /dev/null
@@ -1,251 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-# Note: Please bump in sync with dev-libs/libxslt
-
-PATCHSET_VERSION="2.9.12-r3-patchset"
-
-PYTHON_COMPAT=( python3_{7,8,9} )
-PYTHON_REQ_USE="xml"
-VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/danielveillard.asc
-inherit autotools flag-o-matic prefix python-r1 multilib-minimal verify-sig
-
-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="xmlts20130923.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}/${PN}-${PATCHSET_VERSION}.tar.bz2
-	test? (
-		${XSTS_HOME}/${XSTS_NAME_1}/${XSTS_TARBALL_1}
-		${XSTS_HOME}/${XSTS_NAME_2}/${XSTS_TARBALL_2}
-		https://www.w3.org/XML/Test/${XMLCONF_TARBALL}
-	)
-	verify-sig? ( ftp://xmlsoft.org/${PN}/${PN}-${PV/_rc/-rc}.tar.gz.asc )
-"
-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"
-RESTRICT="!test? ( test )"
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
-
-BDEPEND="
-	dev-util/gtk-doc-am
-	virtual/pkgconfig
-	verify-sig? ( app-crypt/openpgp-keys-danielveillard )
-"
-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
-)
-
-DOCS=( AUTHORS ChangeLog NEWS README TODO TODO_SCHEMAS )
-
-PATCHES=(
-	## Gentoo
-	# Patches needed for prefix support
-	"${WORKDIR}"/${PN}-2.7.1-catalog_path.patch
-
-	# Fix python detection, bug #567066
-	# https://bugzilla.gnome.org/show_bug.cgi?id=760458
-	"${WORKDIR}"/${PN}-2.9.2-python-ABIFLAG.patch
-
-	# Fix python tests when building out of tree #565576
-	"${WORKDIR}"/${PN}-2.9.8-out-of-tree-test.patch
-
-	# bug #745162
-	"${WORKDIR}"/${PN}-2.9.8-python3-unicode-errors.patch
-
-	# Avoid failure on missing fuzz.h when running tests
-	"${WORKDIR}"/${PN}-2.9.11-disable-fuzz-tests.patch
-
-	## Upstream
-	# Fix lxml compatibility (bug #790737)
-	"${WORKDIR}"/${PN}-2.9.12-fix-lxml-compatibility.patch
-	# Fix serialising empty HTML documents (bug #794733)
-	"${WORKDIR}"/${PN}-2.9.12-Fix-whitespace-when-serializing-empty-HTML-documents.patch
-)
-
-src_unpack() {
-	local tarname=${P/_rc/-rc}.tar.gz
-
-	if use verify-sig ; then
-		verify-sig_verify_detached "${DISTDIR}"/${tarname}{,.asc}
-	fi
-
-	# ${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 ${tarname} ${PN}-${PATCHSET_VERSION}.tar.bz2
-
-	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
-
-	eprefixify catalog.c xmlcatalog.c runtest.c xmllint.c
-
-	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
-	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
-}

diff --git a/dev-libs/libxml2/libxml2-2.9.12.ebuild b/dev-libs/libxml2/libxml2-2.9.12.ebuild
deleted file mode 100644
index 75db7e79251..00000000000
--- a/dev-libs/libxml2/libxml2-2.9.12.ebuild
+++ /dev/null
@@ -1,240 +0,0 @@
-# Copyright 1999-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-# Note: Please bump in sync with dev-libs/libxslt
-
-PYTHON_COMPAT=( python3_{7,8,9} )
-PYTHON_REQ_USE="xml"
-VERIFY_SIG_OPENPGP_KEY_PATH=${BROOT}/usr/share/openpgp-keys/danielveillard.asc
-inherit autotools flag-o-matic prefix python-r1 multilib-minimal verify-sig
-
-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="xmlts20130923.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
-	test? (
-		${XSTS_HOME}/${XSTS_NAME_1}/${XSTS_TARBALL_1}
-		${XSTS_HOME}/${XSTS_NAME_2}/${XSTS_TARBALL_2}
-		https://www.w3.org/XML/Test/${XMLCONF_TARBALL}
-	)
-	verify-sig? ( ftp://xmlsoft.org/${PN}/${PN}-${PV/_rc/-rc}.tar.gz.asc )
-"
-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"
-RESTRICT="!test? ( test )"
-REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
-
-BDEPEND="
-	dev-util/gtk-doc-am
-	virtual/pkgconfig
-	verify-sig? ( app-crypt/openpgp-keys-danielveillard )
-"
-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
-)
-
-DOCS=( AUTHORS ChangeLog NEWS README TODO TODO_SCHEMAS )
-
-PATCHES=(
-	# Patches needed for prefix support
-	"${FILESDIR}"/${PN}-2.7.1-catalog_path.patch
-
-	# Fix python detection, bug #567066
-	# https://bugzilla.gnome.org/show_bug.cgi?id=760458
-	"${FILESDIR}"/${PN}-2.9.2-python-ABIFLAG.patch
-
-	# Fix python tests when building out of tree #565576
-	"${FILESDIR}"/${PN}-2.9.8-out-of-tree-test.patch
-
-	# bug #745162
-	"${FILESDIR}"/${PN}-2.9.8-python3-unicode-errors.patch
-
-	# Avoid failure on missing fuzz.h when running tests
-	"${FILESDIR}"/${PN}-2.9.11-disable-fuzz-tests.patch
-)
-
-src_unpack() {
-	local tarname=${P/_rc/-rc}.tar.gz
-
-	if use verify-sig ; then
-		verify-sig_verify_detached "${DISTDIR}"/${tarname}{,.asc}
-	fi
-
-	# ${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 ${tarname}
-	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
-
-	eprefixify catalog.c xmlcatalog.c runtest.c xmllint.c
-
-	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
-	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
-}


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/libxml2/, dev-libs/libxml2/files/
@ 2022-11-29 19:59 David Seifert
  0 siblings, 0 replies; 15+ messages in thread
From: David Seifert @ 2022-11-29 19:59 UTC (permalink / raw
  To: gentoo-commits

commit:     bee4fbd32b0225d09bf7fca8d38b83a9ac368bfd
Author:     David Seifert <soap <AT> gentoo <DOT> org>
AuthorDate: Tue Nov 29 19:58:44 2022 +0000
Commit:     David Seifert <soap <AT> gentoo <DOT> org>
CommitDate: Tue Nov 29 19:58:44 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bee4fbd3

dev-libs/libxml2: add workaround patch for itstool breakage

Bug: https://bugs.gentoo.org/745162
Signed-off-by: David Seifert <soap <AT> gentoo.org>

 .../libxml2-2.10.3-python3-unicode-errors.patch    | 35 ++++++++++++++++++++++
 ...xml2-2.10.3.ebuild => libxml2-2.10.3-r1.ebuild} |  2 ++
 2 files changed, 37 insertions(+)

diff --git a/dev-libs/libxml2/files/libxml2-2.10.3-python3-unicode-errors.patch b/dev-libs/libxml2/files/libxml2-2.10.3-python3-unicode-errors.patch
new file mode 100644
index 000000000000..525e1fe36c0b
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.10.3-python3-unicode-errors.patch
@@ -0,0 +1,35 @@
+https://bugs.gentoo.org/745162
+https://gitlab.gnome.org/GNOME/libxml2/-/issues/64
+
+--- a/python/libxml.c
++++ b/python/libxml.c
+@@ -1620,6 +1620,7 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNU
+     PyObject *message;
+     PyObject *result;
+     char str[1000];
++    unsigned char *ptr = (unsigned char *)str;
+ 
+ #ifdef DEBUG_ERROR
+     printf("libxml_xmlErrorFuncHandler(%p, %s, ...) called\n", ctx, msg);
+@@ -1636,12 +1637,20 @@ libxml_xmlErrorFuncHandler(ATTRIBUTE_UNU
+ 	    str[999] = 0;
+         va_end(ap);
+ 
++#if PY_MAJOR_VERSION >= 3
++        /* Ensure the error string doesn't start at UTF8 continuation. */
++        while (*ptr && (*ptr & 0xc0) == 0x80)
++            ptr++;
++#endif
++
+         list = PyTuple_New(2);
+         PyTuple_SetItem(list, 0, libxml_xmlPythonErrorFuncCtxt);
+         Py_XINCREF(libxml_xmlPythonErrorFuncCtxt);
+-        message = libxml_charPtrConstWrap(str);
++        message = libxml_charPtrConstWrap(ptr);
+         PyTuple_SetItem(list, 1, message);
+         result = PyEval_CallObject(libxml_xmlPythonErrorFuncHandler, list);
++        /* Forget any errors caused in the error handler. */
++        PyErr_Clear();
+         Py_XDECREF(list);
+         Py_XDECREF(result);
+     }

diff --git a/dev-libs/libxml2/libxml2-2.10.3.ebuild b/dev-libs/libxml2/libxml2-2.10.3-r1.ebuild
similarity index 98%
rename from dev-libs/libxml2/libxml2-2.10.3.ebuild
rename to dev-libs/libxml2/libxml2-2.10.3-r1.ebuild
index 7b940b3948b0..bc2c968b0da6 100644
--- a/dev-libs/libxml2/libxml2-2.10.3.ebuild
+++ b/dev-libs/libxml2/libxml2-2.10.3-r1.ebuild
@@ -56,6 +56,8 @@ MULTILIB_CHOST_TOOLS=(
 	/usr/bin/xml2-config
 )
 
+PATCHES=( "${FILESDIR}"/${PN}-2.10.3-python3-unicode-errors.patch )
+
 DOCS=( NEWS README.md TODO TODO_SCHEMAS python/TODO )
 
 src_unpack() {


^ permalink raw reply related	[flat|nested] 15+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: dev-libs/libxml2/, dev-libs/libxml2/files/
@ 2023-05-10 22:01 Sam James
  0 siblings, 0 replies; 15+ messages in thread
From: Sam James @ 2023-05-10 22:01 UTC (permalink / raw
  To: gentoo-commits

commit:     97f1778b35848eed1adca03fa45dcf5c337e01c1
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed May 10 22:00:25 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed May 10 22:00:25 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=97f1778b

dev-libs/libxml2: backport various patches to 2.11.2 from 2.11.x branch

2.11.3 should be coming soon hopefully.

Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../libxml2/files/libxml2-2.11.2-0001-iconv.patch  |  63 ++++++
 .../libxml2-2.11.2-0002-crash-old-libxslt.patch    |  27 +++
 .../files/libxml2-2.11.2-0003-no-xpath.patch       | 245 +++++++++++++++++++++
 .../files/libxml2-2.11.2-0004-huge-push.patch      |  27 +++
 .../files/libxml2-2.11.2-0005-icu-detection.patch  |  21 ++
 dev-libs/libxml2/libxml2-2.11.2-r1.ebuild          | 206 +++++++++++++++++
 6 files changed, 589 insertions(+)

diff --git a/dev-libs/libxml2/files/libxml2-2.11.2-0001-iconv.patch b/dev-libs/libxml2/files/libxml2-2.11.2-0001-iconv.patch
new file mode 100644
index 000000000000..615f413c4419
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.11.2-0001-iconv.patch
@@ -0,0 +1,63 @@
+https://gitlab.gnome.org/GNOME/libxml2/-/commit/9c1f5fe7fbad2b57149c628802c4ded3e4f3d284
+
+From 9c1f5fe7fbad2b57149c628802c4ded3e4f3d284 Mon Sep 17 00:00:00 2001
+From: Mike Dalessio <mike.dalessio@gmail.com>
+Date: Fri, 5 May 2023 17:34:57 -0400
+Subject: [PATCH] autoconf: fix iconv library paths
+
+and pass cflags when building executables
+
+See 0f77167f for prior related work
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -145,11 +145,12 @@ runsuite_DEPENDENCIES = $(DEPS)
+ runsuite_LDADD= $(LDADDS)
+ 
+ xmllint_SOURCES=xmllint.c
+-xmllint_CFLAGS = $(AM_CFLAGS) $(RDL_CFLAGS)
++xmllint_CFLAGS = $(AM_CFLAGS) $(RDL_CFLAGS) $(ICONV_CFLAGS)
+ xmllint_DEPENDENCIES = $(DEPS)
+ xmllint_LDADD=  $(RDL_LIBS) $(LDADDS)
+ 
+ xmlcatalog_SOURCES=xmlcatalog.c
++xmlcatalog_CFLAGS = $(AM_CFLAGS) $(RDL_CFLAGS) $(ICONV_CFLAGS)
+ xmlcatalog_DEPENDENCIES = $(DEPS)
+ xmlcatalog_LDADD = $(RDL_LIBS) $(LDADDS)
+ 
+--- a/configure.ac
++++ b/configure.ac
+@@ -1036,7 +1036,7 @@ else
+     if test "$with_iconv" != "yes" && test "$with_iconv" != "" ; then
+ 	ICONV_DIR=$with_iconv
+ 	CPPFLAGS="$CPPFLAGS -I$ICONV_DIR/include"
+-        LIBS="$LIBS -L$ICONV_DIR/libs"
++	LIBS="$LIBS -L$ICONV_DIR/lib"
+ 	# Export this since our headers include iconv.h
+ 	XML_INCLUDEDIR="$XML_INCLUDEDIR -I$ICONV_DIR/include"
+     fi
+@@ -1052,12 +1052,13 @@ else
+                 ICONV_LIBS="-liconv"])])])
+     if test "$WITH_ICONV" = "1" && test "$ICONV_DIR" != ""; then
+         ICONV_CFLAGS="-I$ICONV_DIR/include"
+-        ICONV_LIBS="-L$ICONV_DIR/libs $ICONV_LIBS"
++        ICONV_LIBS="-L$ICONV_DIR/lib $ICONV_LIBS"
+     fi
+     CPPFLAGS=$_cppflags
+     LIBS=$_libs
+ fi
+ AC_SUBST(WITH_ICONV)
++AC_SUBST(ICONV_CFLAGS)
+ 
+ dnl
+ dnl Checks for ICU library.
+@@ -1100,7 +1101,7 @@ else
+                     ICU_LIBS=-licucore
+                     if test "$ICU_DIR" != ""; then
+                         ICU_CFLAGS="-I$ICU_DIR/include"
+-                        ICU_LIBS="-L$ICU_DIR/libs $ICU_LIBS"
++                        ICU_LIBS="-L$ICU_DIR/lib $ICU_LIBS"
+                     fi])])
+             CPPFLAGS=$_cppflags
+             LIBS=$_libs
+-- 
+GitLab

diff --git a/dev-libs/libxml2/files/libxml2-2.11.2-0002-crash-old-libxslt.patch b/dev-libs/libxml2/files/libxml2-2.11.2-0002-crash-old-libxslt.patch
new file mode 100644
index 000000000000..2253ea6211d1
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.11.2-0002-crash-old-libxslt.patch
@@ -0,0 +1,27 @@
+https://gitlab.gnome.org/GNOME/libxml2/-/commit/e6a9cc8d66778c20435a46e50d4e5866deace5f6
+
+From e6a9cc8d66778c20435a46e50d4e5866deace5f6 Mon Sep 17 00:00:00 2001
+From: Nick Wellnhofer <wellnhofer@aevum.de>
+Date: Sat, 6 May 2023 15:28:13 +0200
+Subject: [PATCH] hash: Fix possible startup crash with old libxslt versions
+
+Call xmlInitParser in xmlHashCreate to make it work if the library
+wasn't initialized yet.
+
+Otherwise, exsltRegisterAll from libxslt 1.1.24 or older might cause
+a crash.
+
+See #534.
+--- a/hash.c
++++ b/hash.c
+@@ -180,6 +180,8 @@ xmlHashTablePtr
+ xmlHashCreate(int size) {
+     xmlHashTablePtr table;
+ 
++    xmlInitParser();
++
+     if (size <= 0)
+         size = 256;
+ 
+-- 
+GitLab

diff --git a/dev-libs/libxml2/files/libxml2-2.11.2-0003-no-xpath.patch b/dev-libs/libxml2/files/libxml2-2.11.2-0003-no-xpath.patch
new file mode 100644
index 000000000000..f036c5814f26
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.11.2-0003-no-xpath.patch
@@ -0,0 +1,245 @@
+https://gitlab.gnome.org/GNOME/libxml2/-/commit/41e78f8f8656b8e2206c06995da6bd8dcc82823d
+
+From 41e78f8f8656b8e2206c06995da6bd8dcc82823d Mon Sep 17 00:00:00 2001
+From: Nick Wellnhofer <wellnhofer@aevum.de>
+Date: Mon, 8 May 2023 23:12:33 +0200
+Subject: [PATCH] xpath: Fix build without LIBXML_XPATH_ENABLED
+
+Move static function declaration into XPATH block. Also move comparison
+functions.
+
+Fixes #537.
+--- a/xpath.c
++++ b/xpath.c
+@@ -145,6 +145,114 @@
+  * any use of the macros IS_ASCII_CHARACTER and IS_ASCII_DIGIT)
+  */
+ 
++#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
++
++/************************************************************************
++ *									*
++ *			Floating point stuff				*
++ *									*
++ ************************************************************************/
++
++double xmlXPathNAN = 0.0;
++double xmlXPathPINF = 0.0;
++double xmlXPathNINF = 0.0;
++
++/**
++ * xmlXPathInit:
++ *
++ * DEPRECATED: Alias for xmlInitParser.
++ */
++void
++xmlXPathInit(void) {
++    xmlInitParser();
++}
++
++/**
++ * xmlInitXPathInternal:
++ *
++ * Initialize the XPath environment
++ */
++ATTRIBUTE_NO_SANITIZE("float-divide-by-zero")
++void
++xmlInitXPathInternal(void) {
++#if defined(NAN) && defined(INFINITY)
++    xmlXPathNAN = NAN;
++    xmlXPathPINF = INFINITY;
++    xmlXPathNINF = -INFINITY;
++#else
++    /* MSVC doesn't allow division by zero in constant expressions. */
++    double zero = 0.0;
++    xmlXPathNAN = 0.0 / zero;
++    xmlXPathPINF = 1.0 / zero;
++    xmlXPathNINF = -xmlXPathPINF;
++#endif
++}
++
++/**
++ * xmlXPathIsNaN:
++ * @val:  a double value
++ *
++ * Returns 1 if the value is a NaN, 0 otherwise
++ */
++int
++xmlXPathIsNaN(double val) {
++#ifdef isnan
++    return isnan(val);
++#else
++    return !(val == val);
++#endif
++}
++
++/**
++ * xmlXPathIsInf:
++ * @val:  a double value
++ *
++ * Returns 1 if the value is +Infinite, -1 if -Infinite, 0 otherwise
++ */
++int
++xmlXPathIsInf(double val) {
++#ifdef isinf
++    return isinf(val) ? (val > 0 ? 1 : -1) : 0;
++#else
++    if (val >= xmlXPathPINF)
++        return 1;
++    if (val <= -xmlXPathPINF)
++        return -1;
++    return 0;
++#endif
++}
++
++#endif /* SCHEMAS or XPATH */
++
++#ifdef LIBXML_XPATH_ENABLED
++
++/*
++ * TODO: when compatibility allows remove all "fake node libxslt" strings
++ *       the test should just be name[0] = ' '
++ */
++#ifdef DEBUG_XPATH_EXPRESSION
++#define DEBUG_STEP
++#define DEBUG_EXPR
++#define DEBUG_EVAL_COUNTS
++#endif
++
++static xmlNs xmlXPathXMLNamespaceStruct = {
++    NULL,
++    XML_NAMESPACE_DECL,
++    XML_XML_NAMESPACE,
++    BAD_CAST "xml",
++    NULL,
++    NULL
++};
++static xmlNsPtr xmlXPathXMLNamespace = &xmlXPathXMLNamespaceStruct;
++#ifndef LIBXML_THREAD_ENABLED
++/*
++ * Optimizer is disabled only when threaded apps are detected while
++ * the library ain't compiled for thread safety.
++ */
++static int xmlXPathDisableOptimizer = 0;
++#endif
++
+ static void
+ xmlXPathNodeSetClear(xmlNodeSetPtr set, int hasNsNodes);
+ 
+@@ -475,114 +583,6 @@ int wrap_cmp( xmlNodePtr x, xmlNodePtr y );
+ #include "timsort.h"
+ #endif /* WITH_TIM_SORT */
+ 
+-#if defined(LIBXML_XPATH_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED)
+-
+-/************************************************************************
+- *									*
+- *			Floating point stuff				*
+- *									*
+- ************************************************************************/
+-
+-double xmlXPathNAN = 0.0;
+-double xmlXPathPINF = 0.0;
+-double xmlXPathNINF = 0.0;
+-
+-/**
+- * xmlXPathInit:
+- *
+- * DEPRECATED: Alias for xmlInitParser.
+- */
+-void
+-xmlXPathInit(void) {
+-    xmlInitParser();
+-}
+-
+-/**
+- * xmlInitXPathInternal:
+- *
+- * Initialize the XPath environment
+- */
+-ATTRIBUTE_NO_SANITIZE("float-divide-by-zero")
+-void
+-xmlInitXPathInternal(void) {
+-#if defined(NAN) && defined(INFINITY)
+-    xmlXPathNAN = NAN;
+-    xmlXPathPINF = INFINITY;
+-    xmlXPathNINF = -INFINITY;
+-#else
+-    /* MSVC doesn't allow division by zero in constant expressions. */
+-    double zero = 0.0;
+-    xmlXPathNAN = 0.0 / zero;
+-    xmlXPathPINF = 1.0 / zero;
+-    xmlXPathNINF = -xmlXPathPINF;
+-#endif
+-}
+-
+-/**
+- * xmlXPathIsNaN:
+- * @val:  a double value
+- *
+- * Returns 1 if the value is a NaN, 0 otherwise
+- */
+-int
+-xmlXPathIsNaN(double val) {
+-#ifdef isnan
+-    return isnan(val);
+-#else
+-    return !(val == val);
+-#endif
+-}
+-
+-/**
+- * xmlXPathIsInf:
+- * @val:  a double value
+- *
+- * Returns 1 if the value is +Infinite, -1 if -Infinite, 0 otherwise
+- */
+-int
+-xmlXPathIsInf(double val) {
+-#ifdef isinf
+-    return isinf(val) ? (val > 0 ? 1 : -1) : 0;
+-#else
+-    if (val >= xmlXPathPINF)
+-        return 1;
+-    if (val <= -xmlXPathPINF)
+-        return -1;
+-    return 0;
+-#endif
+-}
+-
+-#endif /* SCHEMAS or XPATH */
+-
+-#ifdef LIBXML_XPATH_ENABLED
+-
+-/*
+- * TODO: when compatibility allows remove all "fake node libxslt" strings
+- *       the test should just be name[0] = ' '
+- */
+-#ifdef DEBUG_XPATH_EXPRESSION
+-#define DEBUG_STEP
+-#define DEBUG_EXPR
+-#define DEBUG_EVAL_COUNTS
+-#endif
+-
+-static xmlNs xmlXPathXMLNamespaceStruct = {
+-    NULL,
+-    XML_NAMESPACE_DECL,
+-    XML_XML_NAMESPACE,
+-    BAD_CAST "xml",
+-    NULL,
+-    NULL
+-};
+-static xmlNsPtr xmlXPathXMLNamespace = &xmlXPathXMLNamespaceStruct;
+-#ifndef LIBXML_THREAD_ENABLED
+-/*
+- * Optimizer is disabled only when threaded apps are detected while
+- * the library ain't compiled for thread safety.
+- */
+-static int xmlXPathDisableOptimizer = 0;
+-#endif
+-
+ /************************************************************************
+  *									*
+  *			Error handling routines				*
+-- 
+GitLab

diff --git a/dev-libs/libxml2/files/libxml2-2.11.2-0004-huge-push.patch b/dev-libs/libxml2/files/libxml2-2.11.2-0004-huge-push.patch
new file mode 100644
index 000000000000..5f3d06038271
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.11.2-0004-huge-push.patch
@@ -0,0 +1,27 @@
+https://gitlab.gnome.org/GNOME/libxml2/-/commit/7c14859d0779797a93ea75744266425028599944
+
+From 7c14859d0779797a93ea75744266425028599944 Mon Sep 17 00:00:00 2001
+From: Nick Wellnhofer <wellnhofer@aevum.de>
+Date: Tue, 9 May 2023 13:28:06 +0200
+Subject: [PATCH] parser: Fix "huge input lookup" error with push parser
+
+Fix parsing of larger documents without XML_PARSE_HUGE.
+
+Should fix #538.
+--- a/parserInternals.c
++++ b/parserInternals.c
+@@ -418,9 +418,10 @@ xmlParserShrink(xmlParserCtxtPtr ctxt) {
+     xmlParserInputBufferPtr buf = in->buf;
+     size_t used;
+ 
+-    /* Don't shrink memory buffers. */
++    /* Don't shrink pull parser memory buffers. */
+     if ((buf == NULL) ||
+-        ((buf->encoder == NULL) && (buf->readcallback == NULL)))
++        ((ctxt->progressive == 0) &&
++         (buf->encoder == NULL) && (buf->readcallback == NULL)))
+         return;
+ 
+     used = in->cur - in->base;
+-- 
+GitLab

diff --git a/dev-libs/libxml2/files/libxml2-2.11.2-0005-icu-detection.patch b/dev-libs/libxml2/files/libxml2-2.11.2-0005-icu-detection.patch
new file mode 100644
index 000000000000..6fffb156ea9c
--- /dev/null
+++ b/dev-libs/libxml2/files/libxml2-2.11.2-0005-icu-detection.patch
@@ -0,0 +1,21 @@
+https://gitlab.gnome.org/GNOME/libxml2/-/commit/55f221a4c57903ced5721008607d4133d6eb51cf
+
+From 55f221a4c57903ced5721008607d4133d6eb51cf Mon Sep 17 00:00:00 2001
+From: Nick Wellnhofer <wellnhofer@aevum.de>
+Date: Wed, 10 May 2023 18:13:47 +0200
+Subject: [PATCH] autotools: Fix ICU detection
+
+Fixes #540.
+--- a/configure.ac
++++ b/configure.ac
+@@ -1096,7 +1096,7 @@ else
+             fi
+ 
+             AC_CHECK_HEADER(unicode/ucnv.h, [
+-                AC_CHECK_LIB([icucore], [uconv_open], [
++                AC_CHECK_LIB([icucore], [ucnv_open], [
+                     WITH_ICU=1
+                     ICU_LIBS=-licucore
+                     if test "$ICU_DIR" != ""; then
+-- 
+GitLab

diff --git a/dev-libs/libxml2/libxml2-2.11.2-r1.ebuild b/dev-libs/libxml2/libxml2-2.11.2-r1.ebuild
new file mode 100644
index 000000000000..005ddba984c7
--- /dev/null
+++ b/dev-libs/libxml2/libxml2-2.11.2-r1.ebuild
@@ -0,0 +1,206 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+# Note: Please bump in sync with dev-libs/libxslt
+
+PYTHON_COMPAT=( python3_{9..11} )
+PYTHON_REQ_USE="xml(+)"
+inherit flag-o-matic python-r1 multilib-minimal
+
+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="xmlts20130923.tar.gz"
+
+DESCRIPTION="XML C parser and toolkit"
+HOMEPAGE="http://www.xmlsoft.org/ https://gitlab.gnome.org/GNOME/libxml2"
+if [[ ${PV} == 9999 ]] ; then
+	EGIT_REPO_URI="https://gitlab.gnome.org/GNOME/libxml2"
+	inherit autotools git-r3
+else
+	inherit autotools gnome.org libtool
+	KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x64-cygwin ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
+fi
+
+SRC_URI+="
+	test? (
+		${XSTS_HOME}/${XSTS_NAME_1}/${XSTS_TARBALL_1}
+		${XSTS_HOME}/${XSTS_NAME_2}/${XSTS_TARBALL_2}
+		https://www.w3.org/XML/Test/${XMLCONF_TARBALL}
+	)
+"
+S="${WORKDIR}/${PN}-${PV%_rc*}"
+
+LICENSE="MIT"
+SLOT="2"
+IUSE="debug examples +ftp icu lzma +python readline static-libs test"
+RESTRICT="!test? ( test )"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+
+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}"
+BDEPEND="virtual/pkgconfig"
+
+if [[ ${PV} == 9999 ]] ; then
+	BDEPEND+=" dev-util/gtk-doc-am"
+fi
+
+MULTILIB_CHOST_TOOLS=(
+	/usr/bin/xml2-config
+)
+
+PATCHES=(
+	"${FILESDIR}"/${P}-0001-iconv.patch
+	"${FILESDIR}"/${P}-0002-crash-old-libxslt.patch
+	"${FILESDIR}"/${P}-0003-no-xpath.patch
+	"${FILESDIR}"/${P}-0004-huge-push.patch
+	"${FILESDIR}"/${P}-0005-icu-detection.patch
+)
+
+src_unpack() {
+	if [[ ${PV} == 9999 ]] ; then
+		git-r3_src_unpack
+	else
+		local tarname=${P/_rc/-rc}.tar.xz
+
+		# ${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 ${tarname}
+
+		if [[ -n ${PATCHSET_VERSION} ]] ; then
+			unpack ${PN}-${PATCHSET_VERSION}.tar.bz2
+		fi
+	fi
+
+	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
+
+	if [[ ${PV} == 9999 ]] ; then
+		eautoreconf
+	else
+		# Please do not remove, as else we get references to PORTAGE_TMPDIR
+		# in /usr/lib/python?.?/site-packages/libxml2mod.la among things.
+		#elibtoolize
+
+		# TODO: remove me >2.11.2, just here for backports
+		eautoreconf
+	fi
+}
+
+multilib_src_configure() {
+	# Filter seemingly problematic CFLAGS (bug #26320)
+	filter-flags -fprefetch-loop-arrays -funroll-loops
+
+	# Notes:
+	# The meaning of the 'debug' USE flag does not apply to the --with-debug
+	# switch (enabling the libxml2 debug module). See bug #100898.
+	libxml2_configure() {
+		ECONF_SOURCE="${S}" econf \
+			--enable-ipv6 \
+			$(use_with ftp) \
+			$(use_with debug run-debug) \
+			$(use_with icu) \
+			$(use_with lzma) \
+			$(use_enable static-libs static) \
+			$(multilib_native_use_with readline) \
+			$(multilib_native_use_with readline history) \
+			"$@"
+	}
+
+	# Build python bindings separately
+	libxml2_configure --without-python
+
+	multilib_is_native_abi && use python &&
+		python_foreach_impl run_in_build_dir libxml2_configure --with-python
+}
+
+libxml2_py_emake() {
+	pushd "${BUILD_DIR}"/python >/dev/null || die
+
+	emake top_builddir="${NATIVE_BUILD_DIR}" "$@"
+
+	popd >/dev/null || die
+}
+
+multilib_src_compile() {
+	default
+
+	if multilib_is_native_abi && use python ; then
+		NATIVE_BUILD_DIR="${BUILD_DIR}"
+		python_foreach_impl run_in_build_dir libxml2_py_emake all
+	fi
+}
+
+multilib_src_test() {
+	ln -s "${S}"/xmlconf || die
+
+	emake check
+
+	multilib_is_native_abi && use python &&
+		python_foreach_impl run_in_build_dir libxml2_py_emake check
+}
+
+multilib_src_install() {
+	emake DESTDIR="${D}" install
+
+	multilib_is_native_abi && use python &&
+		python_foreach_impl run_in_build_dir libxml2_py_emake DESTDIR="${D}" install
+
+	# Hack until automake release is made for the optimise fix
+	# https://git.savannah.gnu.org/cgit/automake.git/commit/?id=bde43d0481ff540418271ac37012a574a4fcf097
+	multilib_is_native_abi && use python && python_foreach_impl python_optimize
+}
+
+multilib_src_install_all() {
+	einstalldocs
+
+	if ! use examples ; then
+		rm -rf "${ED}"/usr/share/doc/${PF}/examples || die
+		rm -rf "${ED}"/usr/share/doc/${PF}/python/examples || die
+	fi
+
+	rm -rf "${ED}"/usr/share/doc/${PN}-python-${PVR} || die
+
+	find "${ED}" -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
+}


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2023-05-10 22:01 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-30 22:34 [gentoo-commits] repo/gentoo:master commit in: dev-libs/libxml2/, dev-libs/libxml2/files/ Matt Turner
  -- strict thread matches above, loose matches on Subject: below --
2023-05-10 22:01 Sam James
2022-11-29 19:59 David Seifert
2021-10-29 13:46 David Seifert
2021-05-20  1:46 Sam James
2021-05-13 17:50 Sam James
2020-12-03  0:14 Sam James
2020-10-30 22:39 Matt Turner
2020-01-01 16:28 Mart Raudsepp
2019-03-30 20:57 Mart Raudsepp
2019-01-03 11:22 Mike Frysinger
2019-01-03 11:22 Mike Frysinger
2019-01-03 11:22 Mike Frysinger
2018-07-25 16:47 Mart Raudsepp
2015-11-29 11:58 Justin Lecher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox