Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: lu_zero@g.o
Subject: Re: [gentoo-dev] [PATCH] autotools-multilib: wrapper eclass for multilib builds.
Date: Sat, 22 Sep 2012 22:03:28
Message-Id: 20120923000234.58566528@pomiocik.lan
In Reply to: Re: [gentoo-dev] [PATCH] autotools-multilib: wrapper eclass for multilib builds. by Luca Barbato
1 On Sat, 22 Sep 2012 23:44:43 +0200
2 Luca Barbato <lu_zero@g.o> wrote:
3
4 > "Michał Górny" <mgorny@g.o> wrote:
5 >
6 > >It is a simple eclass using autotools out-of-source builds to build
7 > >packages for multiple ABIs when multilib is supported.
8 > >
9 > >Use case: xorg packages, ask Matt.
10 > >---
11 > >gx86/eclass/autotools-multilib.eclass | 72
12 > >+++++++++++++++++++++++++++++++++++
13 > > 1 file changed, 72 insertions(+)
14 > > create mode 100644 gx86/eclass/autotools-multilib.eclass
15 > >
16 > >diff --git a/gx86/eclass/autotools-multilib.eclass
17 > >b/gx86/eclass/autotools-multilib.eclass
18 > >new file mode 100644
19 > >index 0000000..1a345a1
20 > >--- /dev/null
21 > >+++ b/gx86/eclass/autotools-multilib.eclass
22 > >@@ -0,0 +1,72 @@
23 > >+# Copyright 1999-2012 Gentoo Foundation
24 > >+# Distributed under the terms of the GNU General Public License v2
25 > >+# $Header: $
26 > >+
27 > >+# @ECLASS: autotools-multilib.eclass
28 > >+# @MAINTAINER:
29 > >+# Michał Górny <mgorny@g.o>
30 > >+# @BLURB: autotools-utils wrapper for multilib builds
31 > >+# @DESCRIPTION:
32 > >+# The autotools-multilib.eclass is an autotools-utils.eclass(5)
33 > >wrapper
34 > >+# introducing support for building for more than one ABI (multilib).
35 > >+#
36 > >+# Inheriting this eclass sets IUSE=multilib and exports
37 > >autotools-utils
38 > >+# phase function wrappers which build the package for each supported
39 > >ABI
40 > >+# if the flag is enabled. Otherwise, it works like regular
41 > >+# autotools-utils.
42 > >+#
43 > >+# Note that the multilib support requires out-of-source builds to be
44 > >+# enabled. Thus, it is impossible to use AUTOTOOLS_IN_SOURCE_BUILD
45 > >with
46 > >+# it.
47 > >+
48 > >+case ${EAPI:-0} in
49 > >+ 2|3|4) ;;
50 > >+ *) die "EAPI=${EAPI} is not supported" ;;
51 > >+esac
52 > >+
53 > >+if [[ ${AUTOTOOLS_IN_SOURCE_BUILD} ]]; then
54 > >+ die "${ECLASS}: multilib support requires out-of-source
55 > >builds." +fi
56 > >+
57 > >+inherit autotools-utils multilib
58 > >+
59 > >+EXPORT_FUNCTIONS src_configure src_compile src_test src_install
60 > >+
61 > >+IUSE=multilib
62 > >+
63 > >+# @FUNCTION: autotools-multilib_foreach_abi
64 > >+# @USAGE: argv...
65 > >+# @DESCRIPTION:
66 > >+# If multilib support is enabled, sets the toolchain up for each
67 > >+# supported ABI along with the ABI variable and correct
68 > >+# AUTOTOOLS_BUILD_DIR, and runs the given commands with them.
69 > >+#
70 > >+# If multilib support is disabled, it just runs the commands. No
71 > >setup +# is done.
72 > >+autotools-multilib_foreach_abi() {
73 > >+ if use multilib; then
74 > >+ local ABI
75 > >+ for ABI in $(get_all_abis); do
76 > >+ multilib_toolchain_setup "${ABI}"
77 > >+ AUTOTOOLS_BUILD_DIR=${S%%/}-${ABI} "${@}"
78 > >+ done
79 > >+ else
80 > >+ "${@}"
81 > >+ fi
82 > >+}
83 > >+
84 > >+autotools-multilib_src_configure() {
85 > >+ autotools-multilib_foreach_abi autotools-utils_src_configure
86 > >+}
87 > >+
88 > >+autotools-multilib_src_compile() {
89 > >+ autotools-multilib_foreach_abi autotools-utils_src_compile
90 > >+}
91 > >+
92 > >+autotools-multilib_src_test() {
93 > >+ autotools-multilib_foreach_abi autotools-utils_src_test
94 > >+}
95 > >+
96 > >+autotools-multilib_src_install() {
97 > >+ autotools-multilib_foreach_abi autotools-utils_src_install
98 > >+}
99 >
100 > How docs and nonbinaries get managed?
101
102 As usual. Installed twice, second time replacing the first ones.
103
104 --
105 Best regards,
106 Michał Górny

Attachments

File name MIME type
signature.asc application/pgp-signature