public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: David Seifert <soap@gentoo.org>
To: gentoo-dev@lists.gentoo.org
Cc: David Seifert <soap@gentoo.org>
Subject: [gentoo-dev] [PATCH 35/41] usr-ldscript.eclass: drop EAPI 6 support
Date: Sun, 25 Dec 2022 23:15:46 +0100	[thread overview]
Message-ID: <20221225221552.8023-35-soap@gentoo.org> (raw)
In-Reply-To: <20221225221552.8023-1-soap@gentoo.org>

Signed-off-by: David Seifert <soap@gentoo.org>
---
 eclass/usr-ldscript.eclass | 38 ++++++++++++++++++++------------------
 1 file changed, 20 insertions(+), 18 deletions(-)

diff --git a/eclass/usr-ldscript.eclass b/eclass/usr-ldscript.eclass
index c821abd6084..b73d538ae5b 100644
--- a/eclass/usr-ldscript.eclass
+++ b/eclass/usr-ldscript.eclass
@@ -4,11 +4,11 @@
 # @ECLASS: usr-ldscript.eclass
 # @MAINTAINER:
 # Toolchain Ninjas <toolchain@gentoo.org>
-# @SUPPORTED_EAPIS: 6 7 8
+# @SUPPORTED_EAPIS: 7 8
 # @BLURB: Defines the gen_usr_ldscript function.
 
 case ${EAPI} in
-	6|7|8) ;;
+	7|8) ;;
 	*) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
 esac
 
@@ -84,27 +84,27 @@ gen_usr_ldscript() {
 			# Ensure /lib/${lib} exists to avoid dangling scripts/symlinks.
 			# This especially is for AIX where $(get_libname) can return ".a",
 			# so /lib/${lib} might be moved to /usr/lib/${lib} (by accident).
-			[[ -r ${ED%/}/${libdir}/${lib} ]] || continue
+			[[ -r ${ED}/${libdir}/${lib} ]] || continue
 			#TODO: better die here?
 		fi
 
 		case ${CTARGET:-${CHOST}} in
 		*-darwin*)
 			if ${auto} ; then
-				tlib=$(scanmacho -qF'%S#F' "${ED%/}"/usr/${libdir}/${lib})
+				tlib=$(scanmacho -qF'%S#F' "${ED}"/usr/${libdir}/${lib})
 			else
-				tlib=$(scanmacho -qF'%S#F' "${ED%/}"/${libdir}/${lib})
+				tlib=$(scanmacho -qF'%S#F' "${ED}"/${libdir}/${lib})
 			fi
 			[[ -z ${tlib} ]] && die "unable to read install_name from ${lib}"
 			tlib=${tlib##*/}
 
 			if ${auto} ; then
-				mv "${ED%/}"/usr/${libdir}/${lib%${suffix}}.*${suffix#.} "${ED%/}"/${libdir}/ || die
+				mv "${ED}"/usr/${libdir}/${lib%${suffix}}.*${suffix#.} "${ED}"/${libdir}/ || die
 				# some install_names are funky: they encode a version
 				if [[ ${tlib} != ${lib%${suffix}}.*${suffix#.} ]] ; then
-					mv "${ED%/}"/usr/${libdir}/${tlib%${suffix}}.*${suffix#.} "${ED%/}"/${libdir}/ || die
+					mv "${ED}"/usr/${libdir}/${tlib%${suffix}}.*${suffix#.} "${ED}"/${libdir}/ || die
 				fi
-				rm -f "${ED%/}"/${libdir}/${lib}
+				rm -f "${ED}"/${libdir}/${lib}
 			fi
 
 			# Mach-O files have an id, which is like a soname, it tells how
@@ -114,34 +114,36 @@ gen_usr_ldscript() {
 			# libdir=/lib because that messes up libtool files.
 			# Make sure we don't lose the specific version, so just modify the
 			# existing install_name
-			if [[ ! -w "${ED%/}/${libdir}/${tlib}" ]] ; then
-				chmod u+w "${ED%/}/${libdir}/${tlib}" # needed to write to it
+			if [[ ! -w "${ED}/${libdir}/${tlib}" ]] ; then
+				chmod u+w "${ED}/${libdir}/${tlib}" || die # needed to write to it
 				local nowrite=yes
 			fi
 			install_name_tool \
 				-id "${EPREFIX}"/${libdir}/${tlib} \
-				"${ED%/}"/${libdir}/${tlib} || die "install_name_tool failed"
-			[[ -n ${nowrite} ]] && chmod u-w "${ED%/}/${libdir}/${tlib}"
+				"${ED}"/${libdir}/${tlib} || die "install_name_tool failed"
+			if [[ -n ${nowrite} ]] ; then
+				chmod u-w "${ED}/${libdir}/${tlib}" || die
+			fi
 			# Now as we don't use GNU binutils and our linker doesn't
 			# understand linker scripts, just create a symlink.
-			pushd "${ED%/}/usr/${libdir}" > /dev/null
+			pushd "${ED}/usr/${libdir}" > /dev/null
 			ln -snf "../../${libdir}/${tlib}" "${lib}"
 			popd > /dev/null
 			;;
 		*)
 			if ${auto} ; then
-				tlib=$(scanelf -qF'%S#F' "${ED%/}"/usr/${libdir}/${lib})
+				tlib=$(scanelf -qF'%S#F' "${ED}"/usr/${libdir}/${lib})
 				[[ -z ${tlib} ]] && die "unable to read SONAME from ${lib}"
-				mv "${ED%/}"/usr/${libdir}/${lib}* "${ED%/}"/${libdir}/ || die
+				mv "${ED}"/usr/${libdir}/${lib}* "${ED}"/${libdir}/ || die
 				# some SONAMEs are funky: they encode a version before the .so
 				if [[ ${tlib} != ${lib}* ]] ; then
-					mv "${ED%/}"/usr/${libdir}/${tlib}* "${ED%/}"/${libdir}/ || die
+					mv "${ED}"/usr/${libdir}/${tlib}* "${ED}"/${libdir}/ || die
 				fi
-				rm -f "${ED%/}"/${libdir}/${lib}
+				rm -f "${ED}"/${libdir}/${lib}
 			else
 				tlib=${lib}
 			fi
-			cat > "${ED%/}/usr/${libdir}/${lib}" <<-END_LDSCRIPT
+			cat > "${ED}/usr/${libdir}/${lib}" <<-END_LDSCRIPT
 			/* GNU ld script
 			   Since Gentoo has critical dynamic libraries in /lib, and the static versions
 			   in /usr/lib, we need to have a "fake" dynamic lib in /usr/lib, otherwise we
-- 
2.39.0



  parent reply	other threads:[~2022-12-25 22:25 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-25 22:15 [gentoo-dev] [PATCH 01/41] ada.eclass: drop EAPI 6 support David Seifert
2022-12-25 22:15 ` [gentoo-dev] [PATCH 02/41] alternatives.eclass: drop EAPI 5, " David Seifert
2022-12-25 22:15 ` [gentoo-dev] [PATCH 03/41] ant-tasks.eclass: drop EAPI " David Seifert
2022-12-25 22:15 ` [gentoo-dev] [PATCH 04/41] apache-2.eclass: " David Seifert
2022-12-26  9:38   ` Hans de Graaff
2022-12-25 22:15 ` [gentoo-dev] [PATCH 05/41] aspell-dict-r1.eclass: drop EAPI 7 support David Seifert
2022-12-25 22:15 ` [gentoo-dev] [PATCH 06/41] bazel.eclass: " David Seifert
2022-12-25 22:15 ` [gentoo-dev] [PATCH 07/41] docs.eclass: drop EAPI 6 support David Seifert
2022-12-25 22:15 ` [gentoo-dev] [PATCH 08/41] dotnet.eclass: " David Seifert
2022-12-25 22:15 ` [gentoo-dev] [PATCH 09/41] dune.eclass: " David Seifert
2022-12-25 22:15 ` [gentoo-dev] [PATCH 10/41] fcaps.eclass: " David Seifert
2022-12-25 22:15 ` [gentoo-dev] [PATCH 11/41] java-osgi.eclass: drop EAPI 5, " David Seifert
2022-12-25 22:15 ` [gentoo-dev] [PATCH 12/41] java-virtuals-2.eclass: drop EAPI 5-7 support David Seifert
2022-12-25 22:15 ` [gentoo-dev] [PATCH 13/41] libretro-core.eclass: drop EAPI 6 support David Seifert
2022-12-25 22:15 ` [gentoo-dev] [PATCH 14/41] linux-mod.eclass: " David Seifert
2022-12-25 22:15 ` [gentoo-dev] [PATCH 15/41] llvm.eclass: canonicalize eclass structure David Seifert
2022-12-25 22:15 ` [gentoo-dev] [PATCH 16/41] mozcoreconf-v6.eclass: drop EAPI 6, 7 support David Seifert
2022-12-25 22:15 ` [gentoo-dev] [PATCH 17/41] mozextension.eclass: drop EAPI 0-7 support David Seifert
2022-12-25 22:15 ` [gentoo-dev] [PATCH 18/41] mozlinguas-v2.eclass: drop EAPI 6, 7 support David Seifert
2022-12-25 22:15 ` [gentoo-dev] [PATCH 19/41] ninja-utils.eclass: drop EAPI 5, 6 support David Seifert
2022-12-25 22:15 ` [gentoo-dev] [PATCH 20/41] php-ext-pecl-r3.eclass: drop EAPI " David Seifert
2022-12-25 22:15 ` [gentoo-dev] [PATCH 21/41] php-ext-source-r3.eclass: " David Seifert
2022-12-25 22:15 ` [gentoo-dev] [PATCH 22/41] postgres.eclass: drop EAPI 5, " David Seifert
2022-12-25 22:15 ` [gentoo-dev] [PATCH 23/41] postgres-multi.eclass: " David Seifert
2022-12-25 22:15 ` [gentoo-dev] [PATCH 24/41] python-any-r1.eclass: drop EAPI " David Seifert
2022-12-25 22:15 ` [gentoo-dev] [PATCH 25/41] python-r1.eclass: " David Seifert
2022-12-25 22:15 ` [gentoo-dev] [PATCH 26/41] python-single-r1.eclass: " David Seifert
2022-12-25 22:15 ` [gentoo-dev] [PATCH 27/41] python-utils-r1.eclass: " David Seifert
2022-12-25 22:15 ` [gentoo-dev] [PATCH 28/41] rocm.eclass: drop EAPI 7 support David Seifert
2022-12-25 22:15 ` [gentoo-dev] [PATCH 29/41] ruby-ng-gnome2.eclass: drop EAPI 6 support David Seifert
2022-12-25 22:15 ` [gentoo-dev] [PATCH 30/41] ruby-single.eclass: drop EAPI 4-6 support David Seifert
2022-12-25 22:15 ` [gentoo-dev] [PATCH 31/41] rust-toolchain.eclass: drop EAPI 6, 7 support David Seifert
2022-12-25 22:15 ` [gentoo-dev] [PATCH 32/41] selinux-policy-2.eclass: drop EAPI 6 support David Seifert
2022-12-25 22:15 ` [gentoo-dev] [PATCH 33/41] toolchain-autoconf.eclass: drop EAPI 6, add EAPI 8 support David Seifert
2022-12-25 22:15 ` [gentoo-dev] [PATCH 34/41] user-info.eclass: drop EAPI 6 support David Seifert
2022-12-25 22:15 ` David Seifert [this message]
2022-12-25 22:15 ` [gentoo-dev] [PATCH 36/41] waf-utils.eclass: " David Seifert
2022-12-25 22:15 ` [gentoo-dev] [PATCH 37/41] xemacs-packages.eclass: drop EAPI 6, 7 support David Seifert
2022-12-25 22:35   ` Ulrich Mueller
2022-12-27 13:23     ` Ulrich Mueller
2022-12-25 22:15 ` [gentoo-dev] [PATCH 38/41] gnome2.eclass: remove useless || die on emake David Seifert
2022-12-25 22:15 ` [gentoo-dev] [PATCH 39/41] gnustep-base.eclass: " David Seifert
2022-12-25 22:15 ` [gentoo-dev] [PATCH 40/41] qmail.eclass: " David Seifert
2022-12-25 22:15 ` [gentoo-dev] [PATCH 41/41] xorg-3.eclass: " David Seifert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221225221552.8023-35-soap@gentoo.org \
    --to=soap@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox