From 299769f033f474606f3dca07ea2043721130a9ff Mon Sep 17 00:00:00 2001 From: Flatcar Buildbot Date: Mon, 30 Jun 2025 07:08:11 +0000 Subject: [PATCH] dev-libs/libxml2: Sync with Gentoo It's from Gentoo commit 3aa722d388017616ac06d54065a3d11acf42c32c. --- .../portage-stable/dev-libs/libxml2/Manifest | 2 +- .../files/libxml2-2.13.8-CVE-2025-6021.patch | 57 ++++++ .../libxml2/files/libxml2-2.14.4-cmake.patch | 66 ++++++ .../dev-libs/libxml2/libxml2-2.13.8-r1.ebuild | 191 ++++++++++++++++++ .../dev-libs/libxml2/libxml2-2.13.8.ebuild | 2 +- .../dev-libs/libxml2/libxml2-2.14.4-r1.ebuild | 184 +++++++++++++++++ ...l2-2.14.3.ebuild => libxml2-2.14.4.ebuild} | 0 7 files changed, 500 insertions(+), 2 deletions(-) create mode 100644 sdk_container/src/third_party/portage-stable/dev-libs/libxml2/files/libxml2-2.13.8-CVE-2025-6021.patch create mode 100644 sdk_container/src/third_party/portage-stable/dev-libs/libxml2/files/libxml2-2.14.4-cmake.patch create mode 100644 sdk_container/src/third_party/portage-stable/dev-libs/libxml2/libxml2-2.13.8-r1.ebuild create mode 100644 sdk_container/src/third_party/portage-stable/dev-libs/libxml2/libxml2-2.14.4-r1.ebuild rename sdk_container/src/third_party/portage-stable/dev-libs/libxml2/{libxml2-2.14.3.ebuild => libxml2-2.14.4.ebuild} (100%) diff --git a/sdk_container/src/third_party/portage-stable/dev-libs/libxml2/Manifest b/sdk_container/src/third_party/portage-stable/dev-libs/libxml2/Manifest index 5db23366b7..5df8ded35f 100644 --- a/sdk_container/src/third_party/portage-stable/dev-libs/libxml2/Manifest +++ b/sdk_container/src/third_party/portage-stable/dev-libs/libxml2/Manifest @@ -1,6 +1,6 @@ DIST libxml2-2.13.7.tar.xz 2424236 BLAKE2B 464097c4b579f964a42909e26b3c2702d7b40c3029628c8980a1ea7a43867dda3c4bdf38b63557f971b20b125a5fc0ac7031bad5df10b1bc25380e995f7707b4 SHA512 6e69ed38cdf2aaa5df7e26b654a7aadd2d80131619184380bafc6a22811acb6b7286c819175c3b37edb194019a93ba6085852a0281934d6bb36d0b52ce138541 DIST libxml2-2.13.8.tar.xz 2423128 BLAKE2B 9abe12acb2b619f8649dc4472c39d4c59074a83538bf1a534163737bf9e99e6387fec53404392c325102da1e77f53606f2679c47b7136d7f7541a8fcc6bcd995 SHA512 668e556404693f17e074bc31e2caa5e50bf003ee3cd81b61a51ea25e76efd7eff7ec70ff603eed87b9d9e9b2299673e6e8871798264113e660e703b74b58458f -DIST libxml2-2.14.3.tar.xz 2325052 BLAKE2B 25ad281925dee3aa032f9ce5c71bebfdfeb3469351eebdcede01c81978ddc411376f2a13b82d207614857b385ca7d589708c3437ad3effd5bc425d7e6b515cf2 SHA512 0efdd42c5fe0160a91945fdbe3193937ee799965e0ac19bd091e1a56e63a36dfc585bd9afee83af330b7d93914e5bd28cf4914246802565dd758a6edd80b1bf7 +DIST libxml2-2.14.4.tar.xz 2325848 BLAKE2B 6ee7e4f35e6f15124fe1ceb55758236229f87e05344c55e82c419f8e8dba763adbd25746c038d13189dfadc3bb023fd8891251e78e9c9046d42961829d93b885 SHA512 5991223bdd6c84886bba8fb81c4e48bf92c8bc3571262ffa8c7673a10efeebceafc1dee362624417dca146982d030ee8d0ccda41f4c82d3074845f74ef6da5d4 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/sdk_container/src/third_party/portage-stable/dev-libs/libxml2/files/libxml2-2.13.8-CVE-2025-6021.patch b/sdk_container/src/third_party/portage-stable/dev-libs/libxml2/files/libxml2-2.13.8-CVE-2025-6021.patch new file mode 100644 index 0000000000..8c5e83e680 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-libs/libxml2/files/libxml2-2.13.8-CVE-2025-6021.patch @@ -0,0 +1,57 @@ +From ebe46ba82340cea8f030e0c0b3bb89aabad83674 Mon Sep 17 00:00:00 2001 +Message-ID: +From: Nick Wellnhofer +Date: Tue, 27 May 2025 12:53:17 +0200 +Subject: [PATCH] tree: Fix integer overflow in xmlBuildQName + +This issue affects memory safety and might receive a CVE ID later. + +Fixes #926. + +(cherry picked from commit acbbeef9f5dcdcc901c5f3fa14d583ef8cfd22f0) +--- + tree.c | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) + +diff --git a/tree.c b/tree.c +index f097cf87..76112e22 100644 +--- a/tree.c ++++ b/tree.c +@@ -22,6 +22,7 @@ + #include + #include + #include ++#include + #include + + #ifdef LIBXML_ZLIB_ENABLED +@@ -167,10 +168,10 @@ xmlGetParameterEntityFromDtd(const xmlDtd *dtd, const xmlChar *name) { + xmlChar * + xmlBuildQName(const xmlChar *ncname, const xmlChar *prefix, + xmlChar *memory, int len) { +- int lenn, lenp; ++ size_t lenn, lenp; + xmlChar *ret; + +- if (ncname == NULL) return(NULL); ++ if ((ncname == NULL) || (len < 0)) return(NULL); + if (prefix == NULL) return((xmlChar *) ncname); + + #ifdef FUZZING_BUILD_MODE_UNSAFE_FOR_PRODUCTION +@@ -181,8 +182,10 @@ xmlBuildQName(const xmlChar *ncname, const xmlChar *prefix, + + lenn = strlen((char *) ncname); + lenp = strlen((char *) prefix); ++ if (lenn >= SIZE_MAX - lenp - 1) ++ return(NULL); + +- if ((memory == NULL) || (len < lenn + lenp + 2)) { ++ if ((memory == NULL) || ((size_t) len < lenn + lenp + 2)) { + ret = (xmlChar *) xmlMallocAtomic(lenn + lenp + 2); + if (ret == NULL) + return(NULL); + +base-commit: 3a1c25f5e7bbf8180690cf5c4c5a9fc1caf55c62 +-- +2.50.0 + diff --git a/sdk_container/src/third_party/portage-stable/dev-libs/libxml2/files/libxml2-2.14.4-cmake.patch b/sdk_container/src/third_party/portage-stable/dev-libs/libxml2/files/libxml2-2.14.4-cmake.patch new file mode 100644 index 0000000000..b047fba3d5 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-libs/libxml2/files/libxml2-2.14.4-cmake.patch @@ -0,0 +1,66 @@ +https://gitlab.gnome.org/GNOME/libxml2/-/commit/5700d989cc18889e1601c651ad69a41af8b32073 +https://gitlab.gnome.org/GNOME/libxml2/-/commit/d3e33dc214276498e73b61188be02b2863c9670a + +From 5700d989cc18889e1601c651ad69a41af8b32073 Mon Sep 17 00:00:00 2001 +From: Markus Rickert +Date: Wed, 18 Jun 2025 13:48:55 +0200 +Subject: [PATCH] Fix CMake iconv handling after change to private dependency + +--- + CMakeLists.txt | 2 +- + libxml2-config.cmake.in | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/CMakeLists.txt b/CMakeLists.txt +index e136f2167..b952d7bfa 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -354,7 +354,7 @@ if(WIN32) + endif() + + if(LIBXML2_WITH_ICONV) +- target_link_libraries(LibXml2 PUBLIC Iconv::Iconv) ++ target_link_libraries(LibXml2 PRIVATE Iconv::Iconv) + if(NOT Iconv_IS_BUILT_IN) + set(ICONV_LIBS "-liconv") + endif() +diff --git a/libxml2-config.cmake.in b/libxml2-config.cmake.in +index e040a759b..3ce7ef43f 100644 +--- a/libxml2-config.cmake.in ++++ b/libxml2-config.cmake.in +@@ -56,7 +56,7 @@ if(NOT LIBXML2_SHARED) + if(LIBXML2_WITH_ICONV) + find_dependency(Iconv) + list(APPEND LIBXML2_LIBRARIES ${Iconv_LIBRARIES}) +- list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "Iconv::Iconv") ++ list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "\$") + if(NOT Iconv_FOUND) + set(${CMAKE_FIND_PACKAGE_NAME}_FOUND FALSE) + set(${CMAKE_FIND_PACKAGE_NAME}_NOT_FOUND_MESSAGE "Iconv dependency was not found") +-- +GitLab + +From d3e33dc214276498e73b61188be02b2863c9670a Mon Sep 17 00:00:00 2001 +From: Nick Wellnhofer +Date: Fri, 20 Jun 2025 11:20:34 +0200 +Subject: [PATCH] cmake: Add missing endif() in libxml2-config.cmake.in + +Regressed with 28ccdaf9. +--- + libxml2-config.cmake.in | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/libxml2-config.cmake.in b/libxml2-config.cmake.in +index 3ce7ef43f..bd971e081 100644 +--- a/libxml2-config.cmake.in ++++ b/libxml2-config.cmake.in +@@ -119,6 +119,7 @@ if(NOT LIBXML2_SHARED) + if(LIBXML2_WITH_HTTP) + list(APPEND LIBXML2_LIBRARIES ws2_32) + list(APPEND LIBXML2_INTERFACE_LINK_LIBRARIES "\$") ++ endif() + endif() + endif() + +-- +GitLab diff --git a/sdk_container/src/third_party/portage-stable/dev-libs/libxml2/libxml2-2.13.8-r1.ebuild b/sdk_container/src/third_party/portage-stable/dev-libs/libxml2/libxml2-2.13.8-r1.ebuild new file mode 100644 index 0000000000..bf99e8749a --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-libs/libxml2/libxml2-2.13.8-r1.ebuild @@ -0,0 +1,191 @@ +# Copyright 1999-2025 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_{11..14} ) +PYTHON_REQ_USE="xml(+)" +inherit autotools 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="https://gitlab.gnome.org/GNOME/libxml2/-/wikis/home" +if [[ ${PV} == 9999 ]] ; then + EGIT_REPO_URI="https://gitlab.gnome.org/GNOME/libxml2" + inherit git-r3 +else + inherit gnome.org + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-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="examples icu lzma +python readline static-libs test" +RESTRICT="!test? ( test )" +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" + +RDEPEND=" + virtual/libiconv + >=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-build/gtk-doc-am" +fi + +MULTILIB_CHOST_TOOLS=( + /usr/bin/xml2-config +) + +PATCHES=( + "${FILESDIR}"/${PN}-2.12.9-icu-pkgconfig.patch + "${FILESDIR}"/${PN}-2.13.8-CVE-2025-6021.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.xz + 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 + + # Please do not remove, as else we get references to PORTAGE_TMPDIR + # in /usr/lib/python?.?/site-packages/libxml2mod.la among things. + #elibtoolize + + eautoreconf +} + +multilib_src_configure() { + libxml2_configure() { + ECONF_SOURCE="${S}" econf \ + $(use_with icu) \ + $(use_with lzma) \ + $(use_enable static-libs static) \ + $(multilib_native_use_with readline) \ + $(multilib_native_use_with readline history) \ + --with-legacy \ + "$@" + } + + # 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 + # + 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/sdk_container/src/third_party/portage-stable/dev-libs/libxml2/libxml2-2.13.8.ebuild b/sdk_container/src/third_party/portage-stable/dev-libs/libxml2/libxml2-2.13.8.ebuild index 677cbccf38..0b52015688 100644 --- a/sdk_container/src/third_party/portage-stable/dev-libs/libxml2/libxml2-2.13.8.ebuild +++ b/sdk_container/src/third_party/portage-stable/dev-libs/libxml2/libxml2-2.13.8.ebuild @@ -23,7 +23,7 @@ if [[ ${PV} == 9999 ]] ; then inherit git-r3 else inherit gnome.org - KEYWORDS="~alpha amd64 ~arm arm64 ~hppa ~loong ~m68k ~mips ~ppc ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris" + KEYWORDS="~alpha amd64 arm arm64 ~hppa ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 ~sparc x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris" fi SRC_URI+=" diff --git a/sdk_container/src/third_party/portage-stable/dev-libs/libxml2/libxml2-2.14.4-r1.ebuild b/sdk_container/src/third_party/portage-stable/dev-libs/libxml2/libxml2-2.14.4-r1.ebuild new file mode 100644 index 0000000000..f8c49ee9c2 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-libs/libxml2/libxml2-2.14.4-r1.ebuild @@ -0,0 +1,184 @@ +# Copyright 1999-2025 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_{11..14} ) +PYTHON_REQ_USE="xml(+)" +inherit python-r1 meson-multilib + +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="https://gitlab.gnome.org/GNOME/libxml2/-/wikis/home" +if [[ ${PV} == 9999 ]] ; then + EGIT_REPO_URI="https://gitlab.gnome.org/GNOME/libxml2" + inherit git-r3 +else + inherit gnome.org + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-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" +# see so_version = v_maj + v_min_compat for subslot +SLOT="2/16" +IUSE="icu +python readline static-libs test" +RESTRICT="!test? ( test )" +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )" + +RDEPEND=" + virtual/libiconv + >=sys-libs/zlib-1.2.8-r1:=[${MULTILIB_USEDEP}] + icu? ( >=dev-libs/icu-51.2-r1:=[${MULTILIB_USEDEP}] ) + python? ( ${PYTHON_DEPS} ) + readline? ( sys-libs/readline:= ) +" +DEPEND="${RDEPEND}" +BDEPEND="virtual/pkgconfig" + +MULTILIB_CHOST_TOOLS=( + /usr/bin/xml2-config +) + +PATCHES=( + "${FILESDIR}"/libxml2-2.14.2-no-git.patch + "${FILESDIR}"/libxml2-2.14.4-cmake.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.xz + 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 + + sed -e "/^dir_doc/ s/meson.project_name()$/\'${PF}\'/" -i meson.build || die +} + +python_configure() { + local emesonargs=( + $(meson_feature icu) + $(meson_native_use_feature readline) + $(meson_native_use_feature readline history) + -Dpython=enabled + ) + mkdir "${BUILD_DIR}" || die + pushd "${BUILD_DIR}" >/dev/null || die + meson_src_configure + popd >/dev/null || die +} + +multilib_src_configure() { + local emesonargs=( + -Ddefault_library=$(multilib_native_usex static-libs both shared) + $(meson_feature icu) + $(meson_native_use_feature readline) + $(meson_native_use_feature readline history) + -Dpython=disabled + + # There has been a clean break with a soname bump. + # It's time to deal with the breakage. + # bug #935452 + -Dlegacy=disabled + ) + meson_src_configure + + if multilib_is_native_abi && use python ; then + python_foreach_impl python_configure + fi +} + +python_compile() { + pushd "${BUILD_DIR}" >/dev/null || die + meson_src_compile + popd >/dev/null || die +} + +multilib_src_compile() { + meson_src_compile + + if multilib_is_native_abi && use python ; then + python_foreach_impl python_compile + fi +} + +multilib_src_test() { + meson_src_test + + if multilib_is_native_abi && use python ; then + python_foreach_impl meson_src_test + fi +} + +python_install() { + pushd "${BUILD_DIR}" >/dev/null || die + meson_src_install + python_optimize + popd >/dev/null || die +} + +multilib_src_install() { + if multilib_is_native_abi && use python ; then + python_foreach_impl python_install + fi + + meson_src_install +} + +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 + # + 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/sdk_container/src/third_party/portage-stable/dev-libs/libxml2/libxml2-2.14.3.ebuild b/sdk_container/src/third_party/portage-stable/dev-libs/libxml2/libxml2-2.14.4.ebuild similarity index 100% rename from sdk_container/src/third_party/portage-stable/dev-libs/libxml2/libxml2-2.14.3.ebuild rename to sdk_container/src/third_party/portage-stable/dev-libs/libxml2/libxml2-2.14.4.ebuild