summaryrefslogtreecommitdiff
path: root/eclass
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-11-18 17:32:14 +0000
committerMike Frysinger <vapier@gentoo.org>2011-11-18 17:32:14 +0000
commit24470479592f8896b21da79d3e3b1eebdba4de31 (patch)
treef2847f6644112fdff1ae8f1adf5a54498edb19fa /eclass
parentIntroduce "freedesktop" as backup herd. (diff)
downloadhistorical-24470479592f8896b21da79d3e3b1eebdba4de31.tar.gz
historical-24470479592f8896b21da79d3e3b1eebdba4de31.tar.bz2
historical-24470479592f8896b21da79d3e3b1eebdba4de31.zip
allow overlays to specify eclass overrides without breaking libtools lookup of local patches #389009
Diffstat (limited to 'eclass')
-rw-r--r--eclass/libtool.eclass21
1 files changed, 16 insertions, 5 deletions
diff --git a/eclass/libtool.eclass b/eclass/libtool.eclass
index b36e7e388387..097612eacc9e 100644
--- a/eclass/libtool.eclass
+++ b/eclass/libtool.eclass
@@ -1,6 +1,6 @@
# Copyright 1999-2011 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/eclass/libtool.eclass,v 1.95 2011/11/14 17:08:49 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/eclass/libtool.eclass,v 1.96 2011/11/18 17:32:14 vapier Exp $
# @ECLASS: libtool.eclass
# @MAINTAINER:
@@ -14,12 +14,23 @@
# generated libtool files. We do not run the libtoolize program because that
# requires a regeneration of the main autotool files in order to work properly.
+# If an overlay has eclass overrides, but doesn't actually override the
+# libtool.eclass, we'll have ECLASSDIR pointing to the active overlay's
+# eclass/ dir, but libtool.eclass is still in the main Gentoo tree. So
+# add a check to locate the ELT-patches/ regardless of what's going on.
+ECLASSDIR_LOCAL=${BASH_SOURCE[0]%/*}
+elt_patch_dir() {
+ local d="${ECLASSDIR}/ELT-patches"
+ if [[ ! -d ${d} ]] ; then
+ d="${ECLASSDIR_LOCAL}/ELT-patches"
+ fi
+ echo "${d}"
+}
+
DESCRIPTION="Based on the ${ECLASS} eclass"
inherit multilib toolchain-funcs
-ELT_PATCH_DIR="${ECLASSDIR}/ELT-patches"
-
#
# See if we can apply $2 on $1, and if so, do it
#
@@ -70,7 +81,7 @@ ELT_walk_patches() {
local ret=1
local file=$1
local patch_set=$2
- local patch_dir="${ELT_PATCH_DIR}/${patch_set}"
+ local patch_dir="$(elt_patch_dir)/${patch_set}"
local rem_int_dep=$3
[[ -z ${patch_set} ]] && return 1
@@ -84,7 +95,7 @@ ELT_walk_patches() {
sed_args+=( -e "s|@REM_INT_DEP@|${rem_int_dep}|g" )
fi
- pushd "${ELT_PATCH_DIR}" >/dev/null || die
+ pushd "$(elt_patch_dir)" >/dev/null || die
# Go through the patches in reverse order (newer version to older)
for patch in $(find "${patch_set}" -maxdepth 1 -type f | LC_ALL=C sort -r) ; do