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 3/3] Create '${CHOST}-executable' symlinks in multilib-portage.
Date: Wed, 23 Apr 2014 12:58:28
Message-Id: 1398257821-17286-3-git-send-email-mgorny@gentoo.org
In Reply to: [gentoo-dev] multilib RFC: improving wrapping compatibility with non-multilib and multilib-portage systems by "Michał Górny"
1 To support multilib-portage abi-wrapper properly, we need to install
2 executables non-prefixed on all ABIs. However, we can safely create
3 prefixed symlinks to the executable to improve compatibility with
4 non-multilib-portage systems.
5
6 All of the symlinks point to the same executable but since it is wrapped
7 by abi-wrapper, it will work correctly in portage context.
8 ---
9 eclass/multilib-build.eclass | 19 +++++++++++++++++--
10 1 file changed, 17 insertions(+), 2 deletions(-)
11
12 diff --git a/eclass/multilib-build.eclass b/eclass/multilib-build.eclass
13 index 4b6a953..755d774 100644
14 --- a/eclass/multilib-build.eclass
15 +++ b/eclass/multilib-build.eclass
16 @@ -295,11 +295,26 @@ multilib_prepare_wrappers() {
17
18 [[ ${#} -le 1 ]] || die "${FUNCNAME}: too many arguments"
19
20 - [[ ${COMPLETE_MULTILIB} == yes ]] && return
21 -
22 local root=${1:-${ED}}
23 local f
24
25 + if [[ ${COMPLETE_MULTILIB} == yes ]]; then
26 + # symlink '${CHOST}-foo -> foo' to support abi-wrapper while
27 + # keeping ${CHOST}-foo calls correct.
28 +
29 + for f in "${MULTILIB_CHOST_TOOLS[@]}"; do
30 + # drop leading slash if it's there
31 + f=${f#/}
32 +
33 + local dir=${f%/*}
34 + local fn=${f##*/}
35 +
36 + ln -s "${fn}" "${root}/${dir}/${CHOST}-${fn}" || die
37 + done
38 +
39 + return
40 + fi
41 +
42 for f in "${MULTILIB_WRAPPED_HEADERS[@]}"; do
43 # drop leading slash if it's there
44 f=${f#/}
45 --
46 1.9.2