Gentoo Archives: gentoo-commits

From: Mart Raudsepp <leio@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/libxml2/
Date: Sun, 03 Mar 2019 20:20:24
Message-Id: 1551644351.9f33b7a6cb6cb08274e34472cca930620fced3c7.leio@gentoo
1 commit: 9f33b7a6cb6cb08274e34472cca930620fced3c7
2 Author: Mart Raudsepp <leio <AT> gentoo <DOT> org>
3 AuthorDate: Sun Mar 3 20:18:16 2019 +0000
4 Commit: Mart Raudsepp <leio <AT> gentoo <DOT> org>
5 CommitDate: Sun Mar 3 20:19:11 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9f33b7a6
7
8 dev-libs/libxml2: revbump for patchset, fix xmlconf for tests
9
10 Closes: https://bugs.gentoo.org/679046
11 Closes: https://bugs.gentoo.org/679096
12 Package-Manager: Portage-2.3.52, Repoman-2.3.12
13 Signed-off-by: Mart Raudsepp <leio <AT> gentoo.org>
14
15 dev-libs/libxml2/Manifest | 1 +
16 dev-libs/libxml2/libxml2-2.9.9-r1.ebuild | 219 +++++++++++++++++++++++++++++++
17 2 files changed, 220 insertions(+)
18
19 diff --git a/dev-libs/libxml2/Manifest b/dev-libs/libxml2/Manifest
20 index 49ef3db88a9..34ec74aa101 100644
21 --- a/dev-libs/libxml2/Manifest
22 +++ b/dev-libs/libxml2/Manifest
23 @@ -1,4 +1,5 @@
24 DIST libxml2-2.9.8.tar.gz 5469097 BLAKE2B 0b7836db46edebf6e7108c28da4bb7e3fb5ddc695aaa3e456ba51a66c0294a741d7b60eb4c31c7040443bbd54712c019424078bd533856a9650b39a703a926d5 SHA512 28903282c7672206effa1362fd564cbe4cf5be44264b083a7d14e383f73bccd1b81bcafb5f4f2f56f5e7e05914c660e27668c9ce91b1b9f256ef5358d55ba917
25 +DIST libxml2-2.9.9-patchset.tar.xz 16792 BLAKE2B f761b5cda41d57543dadf2cdd8915b69727a818f31badc1092903a9e4341b807852fed0887e9ec7a06a0c19c4a49f9afc2f3c048947f21a09006bb51ef8399ef SHA512 c8c0ee6d0a2833e5664aa7549999f8ba63b9f0bbfda4651050eeee7d3a958c33ef55daba8cfb1ca73ebffeb44d411b5f4259fe6e11ef0204ad2deebd1708ebfb
26 DIST libxml2-2.9.9.tar.gz 5476717 BLAKE2B 00a67c38084f2effd5d68d7d3e68f0c96cf4f52eab6d8d9b96dc91f03a84baa132abeaf303a836ff9bbf04f832432a036077316c464398e433c9779d8519074b SHA512 cb7784ba4e72e942614e12e4f83f4ceb275f3d738b30e3b5c1f25edf8e9fa6789e854685974eed95b362049dbf6c8e7357e0327d64c681ed390534ac154e6810
27 DIST xmlts20080827.tar.gz 638940 BLAKE2B c5aab959c6e0698acd5b9be82b48a8ac26f4d01cc03f9acfff20d344f97f4711fc6d4a524ae70457147e8e30c72e27b6726829e1dd21896286aa974ed60774e7 SHA512 7325d0977c4427fc4944b291ccf896a665f654cc24399e5565c12a849c2bc3aef4fa3ee42a09ac115abcb6570c51a8fbd052c38d64d164279ecdecad5a4e884d
28 DIST xsts-2002-01-16.tar.gz 6894439 BLAKE2B 1e9ec63d2c104655e64249e07440a04d862fcbcd4d4e19745d81b34994319b510a531c9d6df1491fae1e90b5d0764f0f1a827251ca8df5d613178b0eab01ef25 SHA512 43300af6d39c1e2221b0ed7318fe14c7464eeb6eb030ed1e22eb29b4ab17f014e2a4c8887c3a46ae5d243e3072da27f00f4e285498ae6f1288177d38d1108288
29
30 diff --git a/dev-libs/libxml2/libxml2-2.9.9-r1.ebuild b/dev-libs/libxml2/libxml2-2.9.9-r1.ebuild
31 new file mode 100644
32 index 00000000000..c196e26a284
33 --- /dev/null
34 +++ b/dev-libs/libxml2/libxml2-2.9.9-r1.ebuild
35 @@ -0,0 +1,219 @@
36 +# Copyright 1999-2019 Gentoo Authors
37 +# Distributed under the terms of the GNU General Public License v2
38 +
39 +EAPI=6
40 +PYTHON_COMPAT=( python2_7 python3_{4,5,6,7} )
41 +PYTHON_REQ_USE="xml"
42 +
43 +inherit libtool flag-o-matic ltprune python-r1 autotools prefix multilib-minimal
44 +
45 +DESCRIPTION="XML C parser and toolkit"
46 +HOMEPAGE="http://www.xmlsoft.org/"
47 +
48 +LICENSE="MIT"
49 +SLOT="2"
50 +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"
51 +IUSE="debug examples icu ipv6 lzma python readline static-libs test"
52 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
53 +
54 +XSTS_HOME="http://www.w3.org/XML/2004/xml-schema-test-suite"
55 +XSTS_NAME_1="xmlschema2002-01-16"
56 +XSTS_NAME_2="xmlschema2004-01-14"
57 +XSTS_TARBALL_1="xsts-2002-01-16.tar.gz"
58 +XSTS_TARBALL_2="xsts-2004-01-14.tar.gz"
59 +XMLCONF_TARBALL="xmlts20080827.tar.gz"
60 +
61 +SRC_URI="ftp://xmlsoft.org/${PN}/${PN}-${PV/_rc/-rc}.tar.gz
62 + https://dev.gentoo.org/~leio/distfiles/${P}-patchset.tar.xz
63 + test? (
64 + ${XSTS_HOME}/${XSTS_NAME_1}/${XSTS_TARBALL_1}
65 + ${XSTS_HOME}/${XSTS_NAME_2}/${XSTS_TARBALL_2}
66 + http://www.w3.org/XML/Test/${XMLCONF_TARBALL} )"
67 +
68 +RDEPEND="
69 + >=sys-libs/zlib-1.2.8-r1:=[${MULTILIB_USEDEP}]
70 + icu? ( >=dev-libs/icu-51.2-r1:=[${MULTILIB_USEDEP}] )
71 + lzma? ( >=app-arch/xz-utils-5.0.5-r1:=[${MULTILIB_USEDEP}] )
72 + python? ( ${PYTHON_DEPS} )
73 + readline? ( sys-libs/readline:= )
74 +"
75 +DEPEND="${RDEPEND}
76 + dev-util/gtk-doc-am
77 + virtual/pkgconfig
78 + hppa? ( >=sys-devel/binutils-2.15.92.0.2 )
79 +"
80 +
81 +S="${WORKDIR}/${PN}-${PV%_rc*}"
82 +
83 +MULTILIB_CHOST_TOOLS=(
84 + /usr/bin/xml2-config
85 +)
86 +
87 +src_unpack() {
88 + # ${A} isn't used to avoid unpacking of test tarballs into $WORKDIR,
89 + # as they are needed as tarballs in ${S}/xstc instead and not unpacked
90 + unpack ${P/_rc/-rc}.tar.gz
91 + unpack ${P}-patchset.tar.xz
92 + cd "${S}" || die
93 +
94 + if use test; then
95 + cp "${DISTDIR}/${XSTS_TARBALL_1}" \
96 + "${DISTDIR}/${XSTS_TARBALL_2}" \
97 + "${S}"/xstc/ \
98 + || die "Failed to install test tarballs"
99 + unpack ${XMLCONF_TARBALL}
100 + fi
101 +}
102 +
103 +src_prepare() {
104 + default
105 +
106 + DOCS=( AUTHORS ChangeLog NEWS README* TODO* )
107 +
108 + # Selective cherry-picks from master up to 2019-02-28 (commit 8161b463f5)
109 + eapply "${WORKDIR}"/patches
110 +
111 + # Patches needed for prefix support
112 + eapply "${FILESDIR}"/${PN}-2.7.1-catalog_path.patch
113 +
114 + eprefixify catalog.c xmlcatalog.c runtest.c xmllint.c
115 +
116 + # Fix build for Windows platform
117 + # https://bugzilla.gnome.org/show_bug.cgi?id=760456
118 + # eapply "${FILESDIR}"/${PN}-2.8.0_rc1-winnt.patch
119 +
120 + # Fix python detection, bug #567066
121 + # https://bugzilla.gnome.org/show_bug.cgi?id=760458
122 + eapply "${FILESDIR}"/${PN}-2.9.2-python-ABIFLAG.patch
123 +
124 + # Fix python tests when building out of tree #565576
125 + eapply "${FILESDIR}"/${PN}-2.9.8-out-of-tree-test.patch
126 +
127 + if [[ ${CHOST} == *-darwin* ]] ; then
128 + # Avoid final linking arguments for python modules
129 + sed -i -e '/PYTHON_LIBS/s/ldflags/libs/' configure.ac || die
130 + # gcc-apple doesn't grok -Wno-array-bounds
131 + sed -i -e 's/-Wno-array-bounds//' configure.ac || die
132 + fi
133 +
134 + # Please do not remove, as else we get references to PORTAGE_TMPDIR
135 + # in /usr/lib/python?.?/site-packages/libxml2mod.la among things.
136 + # We now need to run eautoreconf at the end to prevent maintainer mode.
137 +# elibtoolize
138 +# epunt_cxx # if we don't eautoreconf
139 +
140 + eautoreconf
141 +}
142 +
143 +multilib_src_configure() {
144 + # filter seemingly problematic CFLAGS (#26320)
145 + filter-flags -fprefetch-loop-arrays -funroll-loops
146 +
147 + # USE zlib support breaks gnome2
148 + # (libgnomeprint for instance fails to compile with
149 + # fresh install, and existing) - <azarah@g.o> (22 Dec 2002).
150 +
151 + # The meaning of the 'debug' USE flag does not apply to the --with-debug
152 + # switch (enabling the libxml2 debug module). See bug #100898.
153 +
154 + # --with-mem-debug causes unusual segmentation faults (bug #105120).
155 +
156 + libxml2_configure() {
157 + ECONF_SOURCE="${S}" econf \
158 + --with-html-subdir=${PF}/html \
159 + $(use_with debug run-debug) \
160 + $(use_with icu) \
161 + $(use_with lzma) \
162 + $(use_enable ipv6) \
163 + $(use_enable static-libs static) \
164 + $(multilib_native_use_with readline) \
165 + $(multilib_native_use_with readline history) \
166 + "$@"
167 + }
168 +
169 + libxml2_py_configure() {
170 + mkdir -p "${BUILD_DIR}" || die # ensure python build dirs exist
171 + run_in_build_dir libxml2_configure "--with-python=${ROOT%/}${PYTHON}" # odd build system, also see bug #582130
172 + }
173 +
174 + libxml2_configure --without-python # build python bindings separately
175 +
176 + if multilib_is_native_abi && use python; then
177 + python_foreach_impl libxml2_py_configure
178 + fi
179 +}
180 +
181 +multilib_src_compile() {
182 + default
183 + if multilib_is_native_abi && use python; then
184 + local native_builddir=${BUILD_DIR}
185 + python_foreach_impl libxml2_py_emake top_builddir="${native_builddir}" all
186 + fi
187 +}
188 +
189 +multilib_src_test() {
190 + ln -s "${S}"/xmlconf || die
191 + emake check || die "tests failed"
192 + multilib_is_native_abi && use python && python_foreach_impl libxml2_py_emake test
193 +}
194 +
195 +multilib_src_install() {
196 + emake DESTDIR="${D}" \
197 + EXAMPLES_DIR="${EPREFIX}"/usr/share/doc/${PF}/examples install
198 +
199 + if multilib_is_native_abi && use python; then
200 + python_foreach_impl libxml2_py_emake \
201 + DESTDIR="${D}" \
202 + docsdir="${EPREFIX}"/usr/share/doc/${PF}/python \
203 + exampledir="${EPREFIX}"/usr/share/doc/${PF}/python/examples \
204 + install
205 + python_foreach_impl python_optimize
206 + fi
207 +}
208 +
209 +multilib_src_install_all() {
210 + # on windows, xmllint is installed by interix libxml2 in parent prefix.
211 + # this is the version to use. the native winnt version does not support
212 + # symlinks, which makes repoman fail if the portage tree is linked in
213 + # from another location (which is my default). -- mduft
214 + if [[ ${CHOST} == *-winnt* ]]; then
215 + rm -rf "${ED}"/usr/bin/xmllint
216 + rm -rf "${ED}"/usr/bin/xmlcatalog
217 + fi
218 +
219 + rm -rf "${ED}"/usr/share/doc/${P}
220 + einstalldocs
221 +
222 + if ! use examples; then
223 + rm -rf "${ED}"/usr/share/doc/${PF}/examples
224 + rm -rf "${ED}"/usr/share/doc/${PF}/python/examples
225 + fi
226 +
227 + prune_libtool_files --modules
228 +}
229 +
230 +pkg_postinst() {
231 + # We don't want to do the xmlcatalog during stage1, as xmlcatalog will not
232 + # be in / and stage1 builds to ROOT=/tmp/stage1root. This fixes bug #208887.
233 + if [[ "${ROOT}" != "/" ]]; then
234 + elog "Skipping XML catalog creation for stage building (bug #208887)."
235 + else
236 + # need an XML catalog, so no-one writes to a non-existent one
237 + CATALOG="${EROOT}etc/xml/catalog"
238 +
239 + # we dont want to clobber an existing catalog though,
240 + # only ensure that one is there
241 + # <obz@g.o>
242 + if [[ ! -e ${CATALOG} ]]; then
243 + [[ -d "${EROOT}etc/xml" ]] || mkdir -p "${EROOT}etc/xml"
244 + "${EPREFIX}"/usr/bin/xmlcatalog --create > "${CATALOG}"
245 + einfo "Created XML catalog in ${CATALOG}"
246 + fi
247 + fi
248 +}
249 +
250 +libxml2_py_emake() {
251 + pushd "${BUILD_DIR}/python" > /dev/null || die
252 + emake "$@"
253 + popd > /dev/null
254 +}