Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/libxml2/
Date: Fri, 26 Aug 2022 05:08:25
Message-Id: 1661486642.c6ca0fde39ddc8e781ada623e319d82cf7321069.sam@gentoo
1 commit: c6ca0fde39ddc8e781ada623e319d82cf7321069
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Fri Aug 26 04:01:40 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Fri Aug 26 04:04:02 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c6ca0fde
7
8 dev-libs/libxml2: add 2.10.1
9
10 Still needs workaround for Python 3.10+.
11
12 Signed-off-by: Sam James <sam <AT> gentoo.org>
13
14 dev-libs/libxml2/Manifest | 1 +
15 dev-libs/libxml2/libxml2-2.10.1.ebuild | 195 +++++++++++++++++++++++++++++++++
16 2 files changed, 196 insertions(+)
17
18 diff --git a/dev-libs/libxml2/Manifest b/dev-libs/libxml2/Manifest
19 index 8a1b41309525..21abbdb9281f 100644
20 --- a/dev-libs/libxml2/Manifest
21 +++ b/dev-libs/libxml2/Manifest
22 @@ -1,4 +1,5 @@
23 DIST libxml2-2.10.0.tar.xz 2698684 BLAKE2B 655b9241db06b98f5d33f6d02f2dbf5f998ae9a125f2c16e4d8ce3ee902d53ec14e728e7f3de2aea47b45e825b9ed78f17caffd9e4e9afbde40e1d7b1e047e7f SHA512 0a7a58414c3a4f21e9b052cc18f18032bc646f2690483bb95e37e132a3fc5789f0ec7bbc91b58497df59dbccf0e52f6e6280947762f47a035e85a316e96b1623
24 +DIST libxml2-2.10.1.tar.xz 2697480 BLAKE2B a6297058b9a4f351dbf078a4cbcee2be0a30d3cae10fad53e8972b8ddff833b1612a25af8784be547aa6a3e7bafa126a3a23e5a7b3b75d17d4484af668eba4d0 SHA512 7ae653eef725706c825a8755da14a92124c3f85b38f81fd1148c6e373b149d095eae935a47d874d210dafc7e76f09c019866657b8f9d6a44c666ce741e12f3ce
25 DIST libxml2-2.9.14-patches-r0.tar.bz2 8304 BLAKE2B 067faba5bfcbf81e2ef356925c0d3b4ef0aff7604db049366180b8217b781c60c2746be348c5e1a09de925e54fc69e3e431f7e2199ce326b6ff88ea9352ca45c SHA512 e97bada92a14ef0501a5f7be312d35d26eb52b648102d028dc11b3eef62ee0597540d0b474f54bd015a914a9cb7600d4dc34912b0ead5230136e945d80ae8428
26 DIST libxml2-2.9.14.tar.xz 3129968 BLAKE2B ab584503d5209e4aaf41ae6f44aed5e94c0ae29e28cfba39a9012568aa97515af861b47891b84d2a352a07357626ba50ddb1e344e911fa14ff2ce93c5beff1f1 SHA512 d08e6cafb289c499fdc5b3a12181e032a34f7a249bc66758859f964d3e71e19fd69be79921e1a9d8ab1e692d15b13f5fae95eeb10c3236974d89e218f5107606
27 DIST xmlts20130923.tar.gz 641522 BLAKE2B 63a47bc69278ef510cd0b3779aed729e1b309e30efa0015d28ed051cc03f9dfddb447ab57b07b3393e8f47393d15473b0e199c34cb1f5f746b15ddfaa55670be SHA512 d5c4d26b324ed21f4e0641cd7f8b76dbf9de80df8b519982e44d41c960df29fd03618e02e9693b2d11ad06d19c4a965274c95a048ec3b9653eacb919a7f8b733
28
29 diff --git a/dev-libs/libxml2/libxml2-2.10.1.ebuild b/dev-libs/libxml2/libxml2-2.10.1.ebuild
30 new file mode 100644
31 index 000000000000..713da438e12c
32 --- /dev/null
33 +++ b/dev-libs/libxml2/libxml2-2.10.1.ebuild
34 @@ -0,0 +1,195 @@
35 +# Copyright 1999-2022 Gentoo Authors
36 +# Distributed under the terms of the GNU General Public License v2
37 +
38 +EAPI=8
39 +
40 +# Note: Please bump in sync with dev-libs/libxslt
41 +
42 +PYTHON_COMPAT=( python3_{8..11} )
43 +PYTHON_REQ_USE="xml(+)"
44 +inherit autotools flag-o-matic python-r1 multilib-minimal
45 +
46 +XSTS_HOME="http://www.w3.org/XML/2004/xml-schema-test-suite"
47 +XSTS_NAME_1="xmlschema2002-01-16"
48 +XSTS_NAME_2="xmlschema2004-01-14"
49 +XSTS_TARBALL_1="xsts-2002-01-16.tar.gz"
50 +XSTS_TARBALL_2="xsts-2004-01-14.tar.gz"
51 +XMLCONF_TARBALL="xmlts20130923.tar.gz"
52 +
53 +DESCRIPTION="XML C parser and toolkit"
54 +HOMEPAGE="http://www.xmlsoft.org/ https://gitlab.gnome.org/GNOME/libxml2"
55 +if [[ ${PV} == 9999 ]] ; then
56 + EGIT_REPO_URI="https://gitlab.gnome.org/GNOME/libxml2"
57 + inherit git-r3 #autotools
58 +else
59 + inherit gnome.org #libtool
60 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~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"
61 +fi
62 +
63 +SRC_URI+="
64 + test? (
65 + ${XSTS_HOME}/${XSTS_NAME_1}/${XSTS_TARBALL_1}
66 + ${XSTS_HOME}/${XSTS_NAME_2}/${XSTS_TARBALL_2}
67 + https://www.w3.org/XML/Test/${XMLCONF_TARBALL}
68 + )"
69 +S="${WORKDIR}/${PN}-${PV%_rc*}"
70 +
71 +LICENSE="MIT"
72 +SLOT="2"
73 +IUSE="debug examples +ftp icu lzma +python readline static-libs test"
74 +RESTRICT="!test? ( test )"
75 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
76 +
77 +RDEPEND=">=sys-libs/zlib-1.2.8-r1:=[${MULTILIB_USEDEP}]
78 + icu? ( >=dev-libs/icu-51.2-r1:=[${MULTILIB_USEDEP}] )
79 + lzma? ( >=app-arch/xz-utils-5.0.5-r1:=[${MULTILIB_USEDEP}] )
80 + python? ( ${PYTHON_DEPS} )
81 + readline? ( sys-libs/readline:= )"
82 +DEPEND="${RDEPEND}"
83 +BDEPEND="virtual/pkgconfig"
84 +
85 +if [[ ${PV} == 9999 ]] ; then
86 + BDEPEND+=" dev-util/gtk-doc-am"
87 +fi
88 +
89 +MULTILIB_CHOST_TOOLS=(
90 + /usr/bin/xml2-config
91 +)
92 +
93 +DOCS=( NEWS README.md TODO TODO_SCHEMAS python/TODO )
94 +
95 +src_unpack() {
96 + if [[ ${PV} == 9999 ]] ; then
97 + git-r3_src_unpack
98 + else
99 + local tarname=${P/_rc/-rc}.tar.xz
100 +
101 + # ${A} isn't used to avoid unpacking of test tarballs into ${WORKDIR},
102 + # as they are needed as tarballs in ${S}/xstc instead and not unpacked
103 + unpack ${tarname}
104 +
105 + if [[ -n ${PATCHSET_VERSION} ]] ; then
106 + unpack ${PN}-${PATCHSET_VERSION}.tar.bz2
107 + fi
108 + fi
109 +
110 + cd "${S}" || die
111 +
112 + if use test ; then
113 + cp "${DISTDIR}/${XSTS_TARBALL_1}" \
114 + "${DISTDIR}/${XSTS_TARBALL_2}" \
115 + "${S}"/xstc/ \
116 + || die "Failed to install test tarballs"
117 + unpack ${XMLCONF_TARBALL}
118 + fi
119 +}
120 +
121 +src_prepare() {
122 + default
123 +
124 + if [[ ${PV} == 9999 ]] ; then
125 + eautoreconf
126 + else
127 + # Please do not remove, as else we get references to PORTAGE_TMPDIR
128 + # in /usr/lib/python?.?/site-packages/libxml2mod.la among things.
129 + #elibtoolize
130 +
131 + # Temporarily for Python 3.10 fix (version used for
132 + # dist tarballs fails w/ "3.1" error)
133 + # See https://gitlab.gnome.org/GNOME/libxml2/-/issues/392.
134 + eautoreconf
135 + fi
136 +}
137 +
138 +multilib_src_configure() {
139 + # Filter seemingly problematic CFLAGS (bug #26320)
140 + filter-flags -fprefetch-loop-arrays -funroll-loops
141 +
142 + # Notes:
143 + # The meaning of the 'debug' USE flag does not apply to the --with-debug
144 + # switch (enabling the libxml2 debug module). See bug #100898.
145 + libxml2_configure() {
146 + ECONF_SOURCE="${S}" econf \
147 + --enable-ipv6 \
148 + $(use_with ftp) \
149 + $(use_with debug run-debug) \
150 + $(use_with icu) \
151 + $(use_with lzma) \
152 + $(use_enable static-libs static) \
153 + $(multilib_native_use_with readline) \
154 + $(multilib_native_use_with readline history) \
155 + "$@"
156 + }
157 +
158 + # Build python bindings separately
159 + libxml2_configure --without-python
160 +
161 + multilib_is_native_abi && use python &&
162 + python_foreach_impl run_in_build_dir libxml2_configure --with-python
163 +}
164 +
165 +libxml2_py_emake() {
166 + pushd "${BUILD_DIR}"/python >/dev/null || die
167 +
168 + emake top_builddir="${NATIVE_BUILD_DIR}" "$@"
169 +
170 + popd >/dev/null || die
171 +}
172 +
173 +multilib_src_compile() {
174 + default
175 +
176 + if multilib_is_native_abi && use python ; then
177 + NATIVE_BUILD_DIR="${BUILD_DIR}"
178 + python_foreach_impl run_in_build_dir libxml2_py_emake all
179 + fi
180 +}
181 +
182 +multilib_src_test() {
183 + ln -s "${S}"/xmlconf || die
184 +
185 + emake check
186 +
187 + multilib_is_native_abi && use python &&
188 + python_foreach_impl run_in_build_dir libxml2_py_emake check
189 +}
190 +
191 +multilib_src_install() {
192 + emake DESTDIR="${D}" install
193 +
194 + multilib_is_native_abi && use python &&
195 + python_foreach_impl run_in_build_dir libxml2_py_emake DESTDIR="${D}" install
196 +}
197 +
198 +multilib_src_install_all() {
199 + einstalldocs
200 +
201 + if ! use examples ; then
202 + rm -rf "${ED}"/usr/share/doc/${PF}/examples || die
203 + rm -rf "${ED}"/usr/share/doc/${PF}/python/examples || die
204 + fi
205 +
206 + rm -rf "${ED}"/usr/share/doc/${PN}-python-${PVR} || die
207 +
208 + find "${ED}" -name '*.la' -delete || die
209 +}
210 +
211 +pkg_postinst() {
212 + # We don't want to do the xmlcatalog during stage1, as xmlcatalog will not
213 + # be in / and stage1 builds to ROOT=/tmp/stage1root. This fixes bug #208887.
214 + if [[ -n "${ROOT}" ]]; then
215 + elog "Skipping XML catalog creation for stage building (bug #208887)."
216 + else
217 + # Need an XML catalog, so no-one writes to a non-existent one
218 + CATALOG="${EROOT}/etc/xml/catalog"
219 +
220 + # We don't want to clobber an existing catalog though,
221 + # only ensure that one is there
222 + # <obz@g.o>
223 + if [[ ! -e "${CATALOG}" ]]; then
224 + [[ -d "${EROOT}/etc/xml" ]] || mkdir -p "${EROOT}/etc/xml"
225 + "${EPREFIX}"/usr/bin/xmlcatalog --create > "${CATALOG}"
226 + einfo "Created XML catalog in ${CATALOG}"
227 + fi
228 + fi
229 +}