Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 480404 - dev-libs/libxml2-2.9.1-r2 - add multilib support
Summary: dev-libs/libxml2-2.9.1-r2 - add multilib support
Status: VERIFIED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] GNOME (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Gentoo Linux Gnome Desktop Team
URL:
Whiteboard:
Keywords: EBUILD, NeedPatch
Depends on: 480422
Blocks: gx86-multilib 482038 496218 496370
  Show dependency tree
 
Reported: 2013-08-09 18:06 UTC by David Heidelberg (okias)
Modified: 2014-03-18 22:41 UTC (History)
4 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
libxml2-2.9.1-r2.ebuild (libxml2-2.9.1-r2.ebuild,6.02 KB, text/plain)
2013-08-09 18:06 UTC, David Heidelberg (okias)
Details
libxml2-2.9.1-r2.ebuild (libxml2-2.9.1-r2.ebuild,6.32 KB, text/plain)
2013-08-09 19:04 UTC, Mike Lothian
Details
Update configure.in to accept external ICU_CONFIG variable (libxml2-icu-config.patch,544 bytes, patch)
2013-08-09 19:05 UTC, Mike Lothian
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Heidelberg (okias) 2013-08-09 18:06:26 UTC
ebuild

Reproducible: Always
Comment 1 David Heidelberg (okias) 2013-08-09 18:06:57 UTC
Created attachment 355518 [details]
libxml2-2.9.1-r2.ebuild
Comment 2 Mike Lothian 2013-08-09 19:04:15 UTC
Created attachment 355536 [details]
libxml2-2.9.1-r2.ebuild

Requires dev-libs/icu-51.2-r1 from https://bugs.gentoo.org/show_bug.cgi?id=480422
Comment 3 Mike Lothian 2013-08-09 19:05:08 UTC
Created attachment 355538 [details, diff]
Update configure.in to accept external ICU_CONFIG variable
Comment 4 Mike Lothian 2013-08-09 19:06:10 UTC
Comment on attachment 355536 [details]
libxml2-2.9.1-r2.ebuild

Works with icu-config.abi
Comment 5 Gilles Dartiguelongue (RETIRED) gentoo-dev 2013-08-10 09:46:05 UTC
Please submit unified diffs against gentoo-x86 ebuilds.
Comment 6 Jeroen Roovers (RETIRED) gentoo-dev 2013-08-11 12:56:59 UTC
Comment on attachment 355518 [details]
libxml2-2.9.1-r2.ebuild

--- libxml2-2.9.1-r1.ebuild     2013-08-07 14:41:18.848849020 +0200
+++ -   2013-08-11 14:56:51.642933444 +0200
@@ -6,7 +6,7 @@
 PYTHON_COMPAT=( python{2_5,2_6,2_7,3_1,3_2,3_3} )
 PYTHON_REQ_USE="xml"

-inherit libtool flag-o-matic eutils python-r1 autotools prefix
+inherit libtool flag-o-matic eutils python-r1 autotools prefix multilib-minimal
 
 DESCRIPTION="Version 2 of the library to manipulate XML files"
 HOMEPAGE="http://www.xmlsoft.org/"
@@ -82,9 +82,11 @@
        epatch "${FILESDIR}/${PN}-2.9.0-manual-python.patch"

        eautoreconf
+
+       multilib_copy_sources
 }

-src_configure() {
+multilib_src_configure() {
        # filter seemingly problematic CFLAGS (#26320)
        filter-flags -fprefetch-loop-arrays -funroll-loops

@@ -109,20 +111,20 @@
                $(use_enable static-libs static)
 }

-src_compile() {
+multilib_src_compile() {
        default
-       if use python; then
+       if use python && multilib_is_native_abi; then
                python_copy_sources
                python_foreach_impl libxml2_py_emake
        fi
 }

-src_test() {
+multilib_src_test() {
        default
        use python && python_foreach_impl libxml2_py_emake test
 }

-src_install() {
+multilib_src_install() {
        emake DESTDIR="${D}" \
                EXAMPLES_DIR="${EPREFIX}"/usr/share/doc/${PF}/examples install

@@ -135,7 +137,7 @@
                rm -rf "${ED}"/usr/bin/xmlcatalog
        fi

-       if use python; then
+       if use python && multilib_is_native_abi; then
                python_foreach_impl libxml2_py_emake DESTDIR="${D}" \
                        docsdir="${EPREFIX}"/usr/share/doc/${PF}/python \
                        exampledir="${EPREFIX}"/usr/share/doc/${PF}/python/examples \
Comment 7 Jeroen Roovers (RETIRED) gentoo-dev 2013-08-11 12:57:28 UTC
Comment on attachment 355536 [details]
libxml2-2.9.1-r2.ebuild

--- libxml2-2.9.1-r1.ebuild     2013-08-07 14:41:18.848849020 +0200
+++ -   2013-08-11 14:57:13.266632903 +0200
@@ -6,14 +6,16 @@
 PYTHON_COMPAT=( python{2_5,2_6,2_7,3_1,3_2,3_3} )
 PYTHON_REQ_USE="xml"
 
-inherit libtool flag-o-matic eutils python-r1 autotools prefix
+inherit libtool flag-o-matic eutils 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 hppa ia64 ~m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~m68k-mint ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris ~x86-winnt"
+KEYWORDS="alpha amd64 arm hppa ia64 ~m68k ~mips ppc ppc64 s390 sh sparc x86 ~ppc-aix ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd 
+~x86-freebsd ~hppa-hpux ~ia64-hpux ~x86-interix ~amd64-linux ~arm-linux ~ia64-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"
 
 XSTS_HOME="http://www.w3.org/XML/2004/xml-schema-test-suite"
@@ -29,9 +31,9 @@
                ${XSTS_HOME}/${XSTS_NAME_2}/${XSTS_TARBALL_2}
                http://www.w3.org/XML/Test/${XMLCONF_TARBALL} )"
 
-RDEPEND="sys-libs/zlib:=
-       icu? ( dev-libs/icu:= )
-       lzma? ( app-arch/xz-utils:= )
+RDEPEND="sys-libs/zlib:=[${MULTILIB_USEDEP}]
+       icu? ( dev-libs/icu:=[${MULTILIB_USEDEP}] )
+       lzma? ( app-arch/xz-utils:=[${MULTILIB_USEDEP}] )
        python? ( ${PYTHON_DEPS} )
        readline? ( sys-libs/readline:= )"
 
@@ -81,10 +83,15 @@
        # Python bindings are built/tested/installed manually.
        epatch "${FILESDIR}/${PN}-2.9.0-manual-python.patch"
 
+       # Patch configure.in so accept local icu-config
+       epatch "${FILESDIR}/${PN}-icu-config.patch"
+
        eautoreconf
+
+       multilib_copy_sources
 }
 
-src_configure() {
+multilib_src_configure() {
        # filter seemingly problematic CFLAGS (#26320)
        filter-flags -fprefetch-loop-arrays -funroll-loops
 
@@ -96,6 +103,14 @@
        # switch (enabling the libxml2 debug module). See bug #100898.
 
        # --with-mem-debug causes unusual segmentation faults (bug #105120).
+
+       if multilib_is_native_abi; then
+               icuconfig="/usr/bin/icu-config"
+       else
+               icuconfig="/usr/bin/icu-config.${ABI}"
+       fi
+
+       ICU_CONFIG=${icuconfig} \
        econf \
                -with-html-subdir=${PF}/html \
                --docdir="${EPREFIX}/usr/share/doc/${PF}" \
@@ -109,20 +124,20 @@
                $(use_enable static-libs static)
 }
 
-src_compile() {
+multilib_src_compile() {
        default
-       if use python; then
+       if use python && multilib_is_native_abi; then
                python_copy_sources
                python_foreach_impl libxml2_py_emake
        fi
 }
 
-src_test() {
+multilib_src_test() {
        default
        use python && python_foreach_impl libxml2_py_emake test
 }
 
-src_install() {
+multilib_src_install() {
        emake DESTDIR="${D}" \
                EXAMPLES_DIR="${EPREFIX}"/usr/share/doc/${PF}/examples install
 
@@ -135,7 +150,7 @@
                rm -rf "${ED}"/usr/bin/xmlcatalog
        fi
 
-       if use python; then
+       if use python && multilib_is_native_abi; then
                python_foreach_impl libxml2_py_emake DESTDIR="${D}" \
                        docsdir="${EPREFIX}"/usr/share/doc/${PF}/python \
                        exampledir="${EPREFIX}"/usr/share/doc/${PF}/python/examples \
Comment 8 Alexis Ballier gentoo-dev 2013-09-11 17:07:47 UTC
Comment on attachment 355536 [details]
libxml2-2.9.1-r2.ebuild

>
>	multilib_copy_sources
>}

out of tree builds seem to work

>
>multilib_src_configure() {
>	# filter seemingly problematic CFLAGS (#26320)
>	filter-flags -fprefetch-loop-arrays -funroll-loops
>

this is for src_configure, not multilib_src_configure AFAIK

>	# 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).
>
>	if multilib_is_native_abi; then
>		icuconfig="/usr/bin/icu-config"
>	else
>		icuconfig="/usr/bin/icu-config.${ABI}"
>	fi
>
>	ICU_CONFIG=${icuconfig} \

better patch it to use icu's pkgconfig files rather than these hacks. does it fail if you use only the native abi icu-config ?

>	econf \
>		-with-html-subdir=${PF}/html \
>		--docdir="${EPREFIX}/usr/share/doc/${PF}" \
>		$(use_with debug run-debug) \
>		$(use_with icu) \
>		$(use_with lzma) \
>		$(use_with python) \

disable python for non native abis

>		$(use_with readline) \
>		$(use_with readline history) \

disable readline for non native abis. these seem only for xmllint and you dont MULTILIB_USEDEP on readline anyway

>		$(use_enable ipv6) \
>		$(use_enable static-libs static)
>}
>
>multilib_src_compile() {
>	default
>	if use python && multilib_is_native_abi; then
>		python_copy_sources
>		python_foreach_impl libxml2_py_emake
>	fi
>}
>
>multilib_src_test() {
>	default
>	use python && python_foreach_impl libxml2_py_emake test
>}
>
>multilib_src_install() {
>	emake DESTDIR="${D}" \
>		EXAMPLES_DIR="${EPREFIX}"/usr/share/doc/${PF}/examples install

what is that EXAMPLES_DIR good for ? better send it to $T for non native ABIs anyway

>	# 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

this is for multilib_src_install_all


>	if use python && multilib_is_native_abi; 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

looks ok in multilib_src_install; should be checked / fixed for out of tree builds though

>	rm -rf "${ED}"/usr/share/doc/${P}

this is for multilib_src_install_all

>	dodoc AUTHORS ChangeLog Copyright NEWS README* TODO*

set DOCS=( files ) in global scope; multilib-minimal will install those for you

>	if ! use python; then
>		rm -rf "${ED}"/usr/share/doc/${PF}/python
>		rm -rf "${ED}"/usr/share/doc/${PN}-python-${PV}
>	fi

multilib_src_install_all

>
>	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

ditto
Comment 9 David Heidelberg (okias) 2013-12-27 20:37:31 UTC
I couldn't get rid of "multilib_copy_sources", cause: line 3454: pushd: /var/tmp/portage/dev-libs/libxml2-2.9.1-r2/work/libxml2-2.9.1-x86: No such file or directory.

Also "what is that EXAMPLES_DIR good for ? better send it to $T for non native ABIs anyway" is not much clear to me.

At least, when we have ICU in tree, I sending improved and tested ebuild.

Anyway, could be used autotools-utils (or better autotools-multilib) ?

Bonus: getting rid of 12 years old comment.

Idea: In multilib_src_test python could also depend on multilib_native_abi, but not sure about it.


--- /usr/portage/dev-libs/libxml2/libxml2-2.9.1-r1.ebuild       2013-09-05 20:31:09.000000000 +0200
+++ /var/lib/layman/ixit/dev-libs/libxml2/libxml2-2.9.1-r2.ebuild       2013-12-27 21:31:18.466651597 +0100
@@ -6,7 +6,7 @@
 PYTHON_COMPAT=( python{2_6,2_7,3_2,3_3} )
 PYTHON_REQ_USE="xml"
 
-inherit libtool flag-o-matic eutils python-r1 autotools prefix
+inherit libtool flag-o-matic eutils python-r1 autotools prefix multilib-minimal
 
 DESCRIPTION="Version 2 of the library to manipulate XML files"
 HOMEPAGE="http://www.xmlsoft.org/"
@@ -29,9 +29,9 @@
                ${XSTS_HOME}/${XSTS_NAME_2}/${XSTS_TARBALL_2}
                http://www.w3.org/XML/Test/${XMLCONF_TARBALL} )"
 
-RDEPEND="sys-libs/zlib:=
-       icu? ( dev-libs/icu:= )
-       lzma? ( app-arch/xz-utils:= )
+RDEPEND="sys-libs/zlib:=[${MULTILIB_USEDEP}]
+       icu? ( dev-libs/icu:=[${MULTILIB_USEDEP}] )
+       lzma? ( app-arch/xz-utils:=[${MULTILIB_USEDEP}] )
        python? ( ${PYTHON_DEPS} )
        readline? ( sys-libs/readline:= )"
 
@@ -41,6 +41,8 @@
 
 S="${WORKDIR}/${PN}-${PV%_rc*}"
 
+DOCS=( AUTHORS ChangeLog Copyright NEWS README* TODO* )
+
 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
@@ -82,50 +84,64 @@
        epatch "${FILESDIR}/${PN}-2.9.0-manual-python.patch"
 
        eautoreconf
+
+       multilib_copy_sources
 }
 
-src_configure() {
+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).
-       econf \
-               -with-html-subdir=${PF}/html \
+
+       $econf_args = -with-html-subdir=${PF}/html \
                --docdir="${EPREFIX}/usr/share/doc/${PF}" \
                $(use_with debug run-debug) \
                $(use_with icu) \
                $(use_with lzma) \
-               $(use_with python) \
-               $(use_with readline) \
-               $(use_with readline history) \
                $(use_enable ipv6) \
                $(use_enable static-libs static)
+
+       if multilib_is_native_abi; then
+               $native_econf += \
+                       $(use_with python) \
+                       $(use_with readline) \
+                       $(use_with readline history)
+       fi
+
+       econf $econf_args
 }
 
-src_compile() {
+multilib_src_compile() {
        default
-       if use python; then
+       if use python && multilib_is_native_abi; then
                python_copy_sources
                python_foreach_impl libxml2_py_emake
        fi
 }
 
-src_test() {
+multilib_src_test() {
        default
        use python && python_foreach_impl libxml2_py_emake test
 }
 
-src_install() {
+multilib_src_install() {
        emake DESTDIR="${D}" \
                EXAMPLES_DIR="${EPREFIX}"/usr/share/doc/${PF}/examples install
 
+       if use python && multilib_is_native_abi; 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
@@ -135,16 +151,7 @@
                rm -rf "${ED}"/usr/bin/xmlcatalog
        fi
 
-       if 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
-
        rm -rf "${ED}"/usr/share/doc/${P}
-       dodoc AUTHORS ChangeLog Copyright NEWS README* TODO*
 
        if ! use python; then
                rm -rf "${ED}"/usr/share/doc/${PF}/python
Comment 10 Alexandre Rostovtsev (RETIRED) gentoo-dev 2013-12-30 05:31:54 UTC
David, thanks for your work on the ebuild; added it with some changes (and avoiding multilib_copy_sources).

+*libxml2-2.9.1-r2 (30 Dec 2013)
+
+  30 Dec 2013; Alexandre Rostovtsev <tetromino@gentoo.org>
+  +libxml2-2.9.1-r2.ebuild, +files/libxml2-2.9.1-icu-pkgconfig.patch:
+  Add multilib support (bug #480404, thanks to David Heidelberger (okias) and
+  Alexis Ballier).

+*emul-linux-x86-baselibs-20131008-r7 (30 Dec 2013)
+
+  30 Dec 2013; Alexandre Rostovtsev <tetromino@gentoo.org>
+  emul-linux-x86-baselibs-20131008-r6.ebuild,
+  +emul-linux-x86-baselibs-20131008-r7.ebuild,
+  +files/remove-native-20131008-r6, files/remove-native:
+  Bump for multilib libxml2.
Comment 11 Arfrever Frehtes Taifersar Arahesis 2014-01-02 19:10:57 UTC
(In reply to Alexandre Rostovtsev from comment #10)
> +*libxml2-2.9.1-r2 (30 Dec 2013)
> +
> +  30 Dec 2013; Alexandre Rostovtsev <tetromino@gentoo.org>
> +  +libxml2-2.9.1-r2.ebuild, +files/libxml2-2.9.1-icu-pkgconfig.patch:
> +  Add multilib support

You forgot [${MULTILIB_USEDEP}] for sys-libs/readline.

Also it is better to explicitly depend on 0 slot of sys-libs/zlib, dev-libs/icu, app-arch/xz-utils and sys-libs/readline. Example:
    sys-libs/zlib:0=[${MULTILIB_USEDEP}]
Comment 12 Alexandre Rostovtsev (RETIRED) gentoo-dev 2014-01-02 20:30:08 UTC
(In reply to Arfrever Frehtes Taifersar Arahesis from comment #11)
> You forgot [${MULTILIB_USEDEP}] for sys-libs/readline.

No. Take a look at multilib_src_configure() : readline is explicitly disabled for non-native ABIs because it is only needed for linking /usr/bin/xmllint.
Comment 13 Arfrever Frehtes Taifersar Arahesis 2014-01-03 07:11:09 UTC
(In reply to Alexandre Rostovtsev from comment #10)
> +*libxml2-2.9.1-r2 (30 Dec 2013)
> +
> +  30 Dec 2013; Alexandre Rostovtsev <tetromino@gentoo.org>
> +  +libxml2-2.9.1-r2.ebuild, +files/libxml2-2.9.1-icu-pkgconfig.patch:
> +  Add multilib support

myconf variable (in multilib_src_configure()) should be declared as local.
Comment 14 Alexandre Rostovtsev (RETIRED) gentoo-dev 2014-01-03 20:48:59 UTC
(In reply to Arfrever Frehtes Taifersar Arahesis from comment #13)
> myconf variable (in multilib_src_configure()) should be declared as local.

Fixed, thanks for noticing.

+  03 Jan 2014; Alexandre Rostovtsev <tetromino@gentoo.org>
+  libxml2-2.9.1-r2.ebuild:
+  Stylistic fix: make locals local, thanks to Arfrever for noticing.
Comment 15 Thomas Sachau gentoo-dev 2014-01-06 19:18:38 UTC
for the future, please remember to use the multilib_build_binaries function instead of multilib_is_native_abi since only the first one will allow overriding the restriction for users, which currently likely means multilib-portage (which failed to build a 32bit mesa because of missing libxml2 python bindings)
Comment 16 Alexandre Rostovtsev (RETIRED) gentoo-dev 2014-01-06 21:41:39 UTC
(In reply to Thomas Sachau from comment #15)
> for the future, please remember to use the multilib_build_binaries function
> instead of multilib_is_native_abi since only the first one will allow
> overriding the restriction for users, which currently likely means
> multilib-portage (which failed to build a 32bit mesa because of missing
> libxml2 python bindings)

Wait. Explain please why you need 32-bit python bindings when there is no multilib python in portage, and AFAIK there were no plans to add it, and no use case for it.

Because if there *is* a plan to use 32-bit python bindings, the gnome team will need to completely revise our treatment of gobject-introspection. At the moment, per upstream decisions, gobject-introspection is architected in a way that is unfriendly to multilib (arch-specific data files installed in /usr/share)...
Comment 17 Alexandre Rostovtsev (RETIRED) gentoo-dev 2014-01-06 21:53:43 UTC
(In reply to Thomas Sachau from comment #15)
> for the future, please remember to use the multilib_build_binaries function
> instead of multilib_is_native_abi since only the first one will allow
> overriding the restriction for users, which currently likely means
> multilib-portage (which failed to build a 32bit mesa because of missing
> libxml2 python bindings)

Also, multilib_build_binaries currently results in broken dependencies.

How can we specify a dependency on e.g. readline[abi_x86_32] *only* when multilib_build_binaries != multilib_is_native_abi? ${MULTILIB_USEDEP} won't work for that, and I don't want to add unnecessary dependencies for the vast majority of users (i.e. those who are not using multilib-portage).