eutils.eclass: copy over logic from libtool.eclass to find ELT-patches dir #517752
authorMike Frysinger <vapier@gentoo.org>
Mon, 23 Nov 2015 00:24:25 +0000 (19:24 -0500)
committerMike Frysinger <vapier@gentoo.org>
Mon, 23 Nov 2015 00:24:33 +0000 (19:24 -0500)
eclass/eutils.eclass
eclass/libtool.eclass

index a08aee40f7ee706945c2512fb7ae75e4bcb68ad0..6457501c6b08412cfc024fdb33859b79e904ce7d 100644 (file)
@@ -1403,6 +1403,20 @@ built_with_use() {
        [[ ${opt} = "-a" ]]
 }
 
+# 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.
+# Note: Duplicated in libtool.eclass.
+_EUTILS_ECLASSDIR_LOCAL=${BASH_SOURCE[0]%/*}
+eutils_elt_patch_dir() {
+       local d="${ECLASSDIR}/ELT-patches"
+       if [[ ! -d ${d} ]] ; then
+               d="${_EUTILS_ECLASSDIR_LOCAL}/ELT-patches"
+       fi
+       echo "${d}"
+}
+
 # @FUNCTION: epunt_cxx
 # @USAGE: [dir to scan]
 # @DESCRIPTION:
@@ -1416,7 +1430,7 @@ epunt_cxx() {
        ebegin "Removing useless C++ checks"
        local f p any_found
        while IFS= read -r -d '' f; do
-               for p in "${PORTDIR}"/eclass/ELT-patches/nocxx/*.patch ; do
+               for p in "$(eutils_elt_patch_dir)"/nocxx/*.patch ; do
                        if patch --no-backup-if-mismatch -p1 "${f}" "${p}" >/dev/null ; then
                                any_found=1
                                break
index 090c6576983067f0cf2bb7ebd419f5a12e62c7ce..9434480b25eb03acdd959101a0d0c09adb8cec9d 100644 (file)
@@ -21,8 +21,9 @@ _LIBTOOL_ECLASS=1
 # 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.
+# Note: Duplicated in eutils.eclass.
 _LIBTOOL_ECLASSDIR_LOCAL=${BASH_SOURCE[0]%/*}
-elt_patch_dir() {
+libtool_elt_patch_dir() {
        local d="${ECLASSDIR}/ELT-patches"
        if [[ ! -d ${d} ]] ; then
                d="${_LIBTOOL_ECLASSDIR_LOCAL}/ELT-patches"
@@ -92,7 +93,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="$(libtool_elt_patch_dir)/${patch_set}"
        local rem_int_dep=$3
 
        [[ -z ${patch_set} ]] && return 1
@@ -106,7 +107,7 @@ ELT_walk_patches() {
                sed_args+=( -e "s|@REM_INT_DEP@|${rem_int_dep}|g" )
        fi
 
-       pushd "$(elt_patch_dir)" >/dev/null || die
+       pushd "$(libtool_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