Gentoo Archives: gentoo-dev

From: "Michał Górny" <mgorny@g.o>
To: gentoo-dev@l.g.o
Cc: multilib@g.o, "Michał Górny" <mgorny@g.o>
Subject: [gentoo-dev] [PATCH multilib-build.eclass] Introduce MULTILIB_COMPAT to limit the supported ABIs.
Date: Sat, 26 Apr 2014 16:32:30
Message-Id: 1398529860-13541-1-git-send-email-mgorny@gentoo.org
1 Use case: prebuilt software and programs working with such. More
2 specifically, {ati,nvidia}-drivers (that provide the binaries for x86 &
3 amd64), wine (not sure but I don't think there's a point in having x32
4 wine).
5 ---
6 eclass/multilib-build.eclass | 30 ++++++++++++++++++++++++++++++
7 1 file changed, 30 insertions(+)
8
9 diff --git a/eclass/multilib-build.eclass b/eclass/multilib-build.eclass
10 index ee8be72..9fa9743 100644
11 --- a/eclass/multilib-build.eclass
12 +++ b/eclass/multilib-build.eclass
13 @@ -46,6 +46,23 @@ _MULTILIB_FLAGS=(
14 abi_mips_o32:o32
15 )
16
17 +# @ECLASS-VARIABLE: MULTILIB_COMPAT
18 +# @DEFAULT_UNSET
19 +# @DESCRIPTION:
20 +# List of multilib ABIs supported by the ebuild. If unset, defaults to
21 +# all ABIs supported by the eclass.
22 +#
23 +# This variable is intended for use in prebuilt multilib packages that
24 +# can provide binaries only for a limited set of ABIs. If ABIs need to
25 +# be limited due to a bug in source code, package.use.mask is
26 +# recommended instead.
27 +#
28 +# Example use:
29 +# @CODE
30 +# # Upstream provides binaries for x86 & amd64 only
31 +# MULTILIB_COMPAT=( abi_x86_{32,64} )
32 +# @CODE
33 +
34 # @ECLASS-VARIABLE: MULTILIB_USEDEP
35 # @DESCRIPTION:
36 # The USE-dependency to be used on dependencies (libraries) needing
37 @@ -59,6 +76,19 @@ _MULTILIB_FLAGS=(
38
39 _multilib_build_set_globals() {
40 local flags=( "${_MULTILIB_FLAGS[@]%:*}" )
41 +
42 + if [[ ${MULTILIB_COMPAT[@]} ]]; then
43 + # Validate MULTILIB_COMPAT and filter out the flags.
44 + local f
45 + for f in "${MULTILIB_COMPAT[@]}"; do
46 + if ! has "${f}" "${flags[@]}"; then
47 + die "Invalid value in MULTILIB_COMPAT: ${f}"
48 + fi
49 + done
50 +
51 + flags=( "${MULTILIB_COMPAT[@]}" )
52 + fi
53 +
54 local usedeps=${flags[@]/%/(-)?}
55
56 IUSE=${flags[*]}
57 --
58 1.9.2

Replies