diff options
author | Mike Frysinger <vapier@gentoo.org> | 2011-11-18 17:32:14 +0000 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2011-11-18 17:32:14 +0000 |
commit | e67741457e0c7b9ec1f6a64501b600749851d98d (patch) | |
tree | be554cd4dde2f42d02eaf3858a3864b96ef2a04c /eclass/libtool.eclass | |
parent | Introduce "freedesktop" as backup herd. (diff) | |
download | gentoo-2-e67741457e0c7b9ec1f6a64501b600749851d98d.tar.gz gentoo-2-e67741457e0c7b9ec1f6a64501b600749851d98d.tar.bz2 gentoo-2-e67741457e0c7b9ec1f6a64501b600749851d98d.zip |
allow overlays to specify eclass overrides without breaking libtools lookup of local patches #389009
Diffstat (limited to 'eclass/libtool.eclass')
-rw-r--r-- | eclass/libtool.eclass | 21 |
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 |