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: Sat, 02 Apr 2022 03:45:00
Message-Id: 1648870340.fa7938cfb264d28a291c078ee4faab55fd8bf969.sam@gentoo
1 commit: fa7938cfb264d28a291c078ee4faab55fd8bf969
2 Author: David Seifert <soap <AT> gentoo <DOT> org>
3 AuthorDate: Wed Mar 30 21:27:44 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Sat Apr 2 03:32:20 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fa7938cf
7
8 dev-libs/libxml2: add 9999
9
10 Signed-off-by: David Seifert <soap <AT> gentoo.org>
11 Closes: https://github.com/gentoo/gentoo/pull/24824
12 Signed-off-by: Sam James <sam <AT> gentoo.org>
13
14 dev-libs/libxml2/libxml2-9999.ebuild | 169 +++++++++++++++++++++++++++++++++++
15 1 file changed, 169 insertions(+)
16
17 diff --git a/dev-libs/libxml2/libxml2-9999.ebuild b/dev-libs/libxml2/libxml2-9999.ebuild
18 new file mode 100644
19 index 000000000000..18743bea1507
20 --- /dev/null
21 +++ b/dev-libs/libxml2/libxml2-9999.ebuild
22 @@ -0,0 +1,169 @@
23 +# Copyright 1999-2022 Gentoo Authors
24 +# Distributed under the terms of the GNU General Public License v2
25 +
26 +EAPI=8
27 +
28 +# Note: Please bump in sync with dev-libs/libxslt
29 +
30 +PYTHON_COMPAT=( python3_{8..10} )
31 +PYTHON_REQ_USE="xml"
32 +EGIT_REPO_URI="https://gitlab.gnome.org/GNOME/libxml2"
33 +inherit autotools flag-o-matic python-r1 multilib-minimal git-r3
34 +
35 +XSTS_HOME="http://www.w3.org/XML/2004/xml-schema-test-suite"
36 +XSTS_NAME_1="xmlschema2002-01-16"
37 +XSTS_NAME_2="xmlschema2004-01-14"
38 +XSTS_TARBALL_1="xsts-2002-01-16.tar.gz"
39 +XSTS_TARBALL_2="xsts-2004-01-14.tar.gz"
40 +XMLCONF_TARBALL="xmlts20130923.tar.gz"
41 +
42 +DESCRIPTION="XML C parser and toolkit"
43 +HOMEPAGE="http://www.xmlsoft.org/ https://gitlab.gnome.org/GNOME/libxml2"
44 +SRC_URI+="
45 + test? (
46 + ${XSTS_HOME}/${XSTS_NAME_1}/${XSTS_TARBALL_1}
47 + ${XSTS_HOME}/${XSTS_NAME_2}/${XSTS_TARBALL_2}
48 + https://www.w3.org/XML/Test/${XMLCONF_TARBALL}
49 + )"
50 +S="${WORKDIR}/${PN}-${PV%_rc*}"
51 +
52 +LICENSE="MIT"
53 +SLOT="2"
54 +IUSE="debug examples icu lzma +python readline static-libs test"
55 +RESTRICT="!test? ( test )"
56 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
57 +
58 +BDEPEND="
59 + dev-util/gtk-doc-am
60 + virtual/pkgconfig
61 +"
62 +RDEPEND="
63 + >=sys-libs/zlib-1.2.8-r1:=[${MULTILIB_USEDEP}]
64 + icu? ( >=dev-libs/icu-51.2-r1:=[${MULTILIB_USEDEP}] )
65 + lzma? ( >=app-arch/xz-utils-5.0.5-r1:=[${MULTILIB_USEDEP}] )
66 + python? ( ${PYTHON_DEPS} )
67 + readline? ( sys-libs/readline:= )
68 +"
69 +DEPEND="${RDEPEND}"
70 +
71 +MULTILIB_CHOST_TOOLS=(
72 + /usr/bin/xml2-config
73 +)
74 +
75 +DOCS=( NEWS README.md TODO TODO_SCHEMAS python/TODO )
76 +
77 +src_unpack() {
78 + git-r3_src_unpack
79 +
80 + cd "${S}" || die
81 +
82 + if use test ; then
83 + cp "${DISTDIR}/${XSTS_TARBALL_1}" \
84 + "${DISTDIR}/${XSTS_TARBALL_2}" \
85 + "${S}"/xstc/ \
86 + || die "Failed to install test tarballs"
87 + unpack ${XMLCONF_TARBALL}
88 + fi
89 +}
90 +
91 +src_prepare() {
92 + default
93 +
94 + # Please do not remove, as else we get references to PORTAGE_TMPDIR
95 + # in /usr/lib/python?.?/site-packages/libxml2mod.la among things.
96 + # We now need to run eautoreconf at the end to prevent maintainer mode.
97 + #elibtoolize
98 + # Needed for https://gitlab.gnome.org/GNOME/libxml2/-/issues/338 too in 2.9.13
99 + eautoreconf
100 +}
101 +
102 +multilib_src_configure() {
103 + # Filter seemingly problematic CFLAGS (#26320)
104 + filter-flags -fprefetch-loop-arrays -funroll-loops
105 +
106 + # Notes:
107 + # The meaning of the 'debug' USE flag does not apply to the --with-debug
108 + # switch (enabling the libxml2 debug module). See bug #100898.
109 +
110 + libxml2_configure() {
111 + ECONF_SOURCE="${S}" econf \
112 + --enable-ipv6 \
113 + $(use_with debug run-debug) \
114 + $(use_with icu) \
115 + $(use_with lzma) \
116 + $(use_enable static-libs static) \
117 + $(multilib_native_use_with readline) \
118 + $(multilib_native_use_with readline history) \
119 + "$@"
120 + }
121 +
122 + # Build python bindings separately
123 + libxml2_configure --without-python
124 +
125 + multilib_is_native_abi && use python &&
126 + python_foreach_impl run_in_build_dir libxml2_configure --with-python
127 +}
128 +
129 +libxml2_py_emake() {
130 + pushd "${BUILD_DIR}"/python >/dev/null || die
131 +
132 + emake top_builddir="${NATIVE_BUILD_DIR}" "$@"
133 +
134 + popd >/dev/null || die
135 +}
136 +
137 +multilib_src_compile() {
138 + default
139 +
140 + if multilib_is_native_abi && use python ; then
141 + NATIVE_BUILD_DIR="${BUILD_DIR}"
142 + python_foreach_impl run_in_build_dir libxml2_py_emake all
143 + fi
144 +}
145 +
146 +multilib_src_test() {
147 + ln -s "${S}"/xmlconf || die
148 +
149 + emake check
150 +
151 + multilib_is_native_abi && use python &&
152 + python_foreach_impl run_in_build_dir libxml2_py_emake test
153 +}
154 +
155 +multilib_src_install() {
156 + emake DESTDIR="${D}" install
157 +
158 + multilib_is_native_abi && use python &&
159 + python_foreach_impl run_in_build_dir libxml2_py_emake DESTDIR="${D}" install
160 +}
161 +
162 +multilib_src_install_all() {
163 + einstalldocs
164 +
165 + if ! use examples ; then
166 + rm -rf "${ED}"/usr/share/doc/${PF}/examples || die
167 + rm -rf "${ED}"/usr/share/doc/${PF}/python/examples || die
168 + fi
169 +
170 + find "${ED}" -name '*.la' -delete || die
171 +}
172 +
173 +pkg_postinst() {
174 + # We don't want to do the xmlcatalog during stage1, as xmlcatalog will not
175 + # be in / and stage1 builds to ROOT=/tmp/stage1root. This fixes bug #208887.
176 + if [[ -n "${ROOT}" ]]; then
177 + elog "Skipping XML catalog creation for stage building (bug #208887)."
178 + else
179 + # Need an XML catalog, so no-one writes to a non-existent one
180 + CATALOG="${EROOT}/etc/xml/catalog"
181 +
182 + # We don't want to clobber an existing catalog though,
183 + # only ensure that one is there
184 + # <obz@g.o>
185 + if [[ ! -e "${CATALOG}" ]]; then
186 + [[ -d "${EROOT}/etc/xml" ]] || mkdir -p "${EROOT}/etc/xml"
187 + "${EPREFIX}"/usr/bin/xmlcatalog --create > "${CATALOG}"
188 + einfo "Created XML catalog in ${CATALOG}"
189 + fi
190 + fi
191 +}