summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2014-01-16 18:53:41 +0000
committerMichał Górny <mgorny@gentoo.org>2014-01-16 18:53:41 +0000
commit6e77088c2ea50c60b49b77b6b893ba9599f1a2dc (patch)
treee8813aa6f701c5ab613ce8bd0a4a05603e833ac9 /eclass
parentAccount for bug #498274 (diff)
downloadgentoo-2-6e77088c2ea50c60b49b77b6b893ba9599f1a2dc.tar.gz
gentoo-2-6e77088c2ea50c60b49b77b6b893ba9599f1a2dc.tar.bz2
gentoo-2-6e77088c2ea50c60b49b77b6b893ba9599f1a2dc.zip
Support MULTILIB_CHOST_TOOLS for tool renaming/preserving.
Diffstat (limited to 'eclass')
-rw-r--r--eclass/ChangeLog5
-rw-r--r--eclass/multilib-build.eclass44
2 files changed, 46 insertions, 3 deletions
diff --git a/eclass/ChangeLog b/eclass/ChangeLog
index 9ea832cf366b..bb21ce4dd4b7 100644
--- a/eclass/ChangeLog
+++ b/eclass/ChangeLog
@@ -1,6 +1,9 @@
# ChangeLog for eclass directory
# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1116 2014/01/16 07:57:40 graaff Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/ChangeLog,v 1.1117 2014/01/16 18:53:41 mgorny Exp $
+
+ 16 Jan 2014; Michał Górny <mgorny@gentoo.org> multilib-build.eclass:
+ Support MULTILIB_CHOST_TOOLS for tool renaming/preserving.
16 Jan 2014; Hans de Graaff <graaff@gentoo.org> ruby-ng.eclass:
Explicitly cp symlinks as-is. The default for this changed in coreutils 8.22.
diff --git a/eclass/multilib-build.eclass b/eclass/multilib-build.eclass
index 9323df1f39de..48325673c7f7 100644
--- a/eclass/multilib-build.eclass
+++ b/eclass/multilib-build.eclass
@@ -1,6 +1,6 @@
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2014 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/multilib-build.eclass,v 1.25 2013/12/31 18:31:47 mgorny Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/multilib-build.eclass,v 1.26 2014/01/16 18:53:41 mgorny Exp $
# @ECLASS: multilib-build.eclass
# @MAINTAINER:
@@ -237,6 +237,31 @@ multilib_copy_sources() {
# )
# @CODE
+# @ECLASS-VARIABLE: MULTILIB_CHOST_TOOLS
+# @DESCRIPTION:
+# A list of tool executables to preserve for each multilib ABI.
+# The listed executables will be renamed to ${CHOST}-${basename},
+# and the native variant will be symlinked to the generic name.
+#
+# This variable has to be a bash array. Paths shall be relative to
+# installation root (${ED}), and name regular files. Recursive wrapping
+# is not supported.
+#
+# Please note that tool wrapping is *discouraged*. It is preferred to
+# install pkg-config files for each ABI, and require reverse
+# dependencies to use that.
+#
+# Packages that search for tools properly (e.g. using AC_PATH_TOOL
+# macro) will find the wrapper executables automatically. Other packages
+# will need explicit override of tool paths.
+#
+# Example:
+# @CODE
+# MULTILIB_CHOST_TOOLS=(
+# /usr/bin/foo-config
+# )
+
+# @CODE
# @FUNCTION: multilib_prepare_wrappers
# @USAGE: [<install-root>]
# @DESCRIPTION:
@@ -335,6 +360,21 @@ _EOF_
-i "${ED}/tmp/multilib-include${f}" || die
fi
done
+
+ for f in "${MULTILIB_CHOST_TOOLS[@]}"; do
+ # drop leading slash if it's there
+ f=${f#/}
+
+ local dir=${f%/*}
+ local fn=${f##*/}
+
+ mv "${root}/${f}" "${root}/${dir}/${CHOST}-${fn}" || die
+
+ # symlink the native one back
+ if multilib_build_binaries; then
+ ln -s "${CHOST}-${fn}" "${root}/${f}" || die
+ fi
+ done
}
# @FUNCTION: multilib_install_wrappers