public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: sys-devel/binutils-config/, sys-devel/binutils-config/files/
@ 2015-08-13  8:04 Mike Frysinger
  0 siblings, 0 replies; 3+ messages in thread
From: Mike Frysinger @ 2015-08-13  8:04 UTC (permalink / raw
  To: gentoo-commits

commit:     9c7ffc0c89bf341f50303a72e9de99e1abb7f9aa
Author:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 13 08:03:03 2015 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Thu Aug 13 08:04:44 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9c7ffc0c

sys-devel/binutils-config: add an eselect wrapper

 .../binutils-config/binutils-config-4-r4.ebuild    | 29 ++++++++++++++
 sys-devel/binutils-config/files/binutils.eselect   | 45 ++++++++++++++++++++++
 2 files changed, 74 insertions(+)

diff --git a/sys-devel/binutils-config/binutils-config-4-r4.ebuild b/sys-devel/binutils-config/binutils-config-4-r4.ebuild
new file mode 100644
index 0000000..6ca1125
--- /dev/null
+++ b/sys-devel/binutils-config/binutils-config-4-r4.ebuild
@@ -0,0 +1,29 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI="4"
+
+DESCRIPTION="Utility to change the binutils version being used"
+HOMEPAGE="http://www.gentoo.org/"
+SRC_URI=""
+
+LICENSE="GPL-2"
+SLOT="0"
+# Need a new eselect release w/out the binutils wrapper first.
+#KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd"
+IUSE=""
+
+# We also RDEPEND on sys-apps/findutils which is in base @system
+RDEPEND="sys-apps/gentoo-functions
+	!<app-admin/eselect-1.4.4"
+
+S=${WORKDIR}
+
+src_install() {
+	newbin "${FILESDIR}"/${PN}-${PV} ${PN}
+	doman "${FILESDIR}"/${PN}.8
+
+	insinto /usr/share/eselect/modules
+	doins "${FILESDIR}"/binutils.eselect
+}

diff --git a/sys-devel/binutils-config/files/binutils.eselect b/sys-devel/binutils-config/files/binutils.eselect
new file mode 100644
index 0000000..a89655a
--- /dev/null
+++ b/sys-devel/binutils-config/files/binutils.eselect
@@ -0,0 +1,45 @@
+# -*-eselect-*-  vim: ft=eselect
+# Copyright 2005-2015 Gentoo Foundation
+# Distributed under the terms of the GNU GPL version 2 or later
+
+DESCRIPTION="Manage installed versions of sys-devel/binutils"
+MAINTAINER="toolchain@gentoo.org"
+
+### list action
+
+describe_list() {
+	echo "List all installed version of binutils"
+}
+
+do_list() {
+	binutils-config -l
+}
+
+### set action
+
+describe_set() {
+	echo "Activate one of the installed binutils"
+}
+
+describe_set_parameters() {
+	echo "<target>"
+}
+
+describe_set_options() {
+	echo "target : Target name or number (from 'list' action)"
+}
+
+do_set() {
+	[[ $# -eq 1 ]] || die -q "Please specify exactly one version to activate!"
+	binutils-config "$1"
+}
+
+### show action
+
+describe_show() {
+	echo "Print the currently active binutils version"
+}
+
+do_show() {
+	binutils-config -c
+}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-devel/binutils-config/, sys-devel/binutils-config/files/
@ 2015-10-16  3:14 Mike Frysinger
  0 siblings, 0 replies; 3+ messages in thread
From: Mike Frysinger @ 2015-10-16  3:14 UTC (permalink / raw
  To: gentoo-commits

commit:     5cee7a8c1fbbbe6b314d9990b8519b7258236ae4
Author:     Alexander Tsoy <alexander <AT> tsoy <DOT> me>
AuthorDate: Fri Oct 16 03:13:58 2015 +0000
Commit:     Mike Frysinger <vapier <AT> gentoo <DOT> org>
CommitDate: Fri Oct 16 03:14:10 2015 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5cee7a8c

sys-devel/binutils-config: clean out dwp binary too #562524

 .../{binutils-config-5.ebuild => binutils-config-5-r1.ebuild}           | 0
 sys-devel/binutils-config/files/binutils-config-5                       | 2 +-
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys-devel/binutils-config/binutils-config-5.ebuild b/sys-devel/binutils-config/binutils-config-5-r1.ebuild
similarity index 100%
rename from sys-devel/binutils-config/binutils-config-5.ebuild
rename to sys-devel/binutils-config/binutils-config-5-r1.ebuild

diff --git a/sys-devel/binutils-config/files/binutils-config-5 b/sys-devel/binutils-config/files/binutils-config-5
index 3afc963..86f6abc 100755
--- a/sys-devel/binutils-config/files/binutils-config-5
+++ b/sys-devel/binutils-config/files/binutils-config-5
@@ -242,7 +242,7 @@ uninstall_target() {
 
 	local x
 	for x in \
-		addr2line ar as c++filt elf2flt elfedit flthdr gprof \
+		addr2line ar as c++filt dwp elf2flt elfedit flthdr gprof \
 		ld ld.{bfd,gold,real} \
 		nm objcopy objdump ranlib readelf size strings strip
 	do


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-devel/binutils-config/, sys-devel/binutils-config/files/
@ 2016-05-25  2:28 Benda XU
  0 siblings, 0 replies; 3+ messages in thread
From: Benda XU @ 2016-05-25  2:28 UTC (permalink / raw
  To: gentoo-commits

commit:     62c75f76eb7047f3f9f53b080a46a4ba4c6d9c48
Author:     Benda Xu <heroxbd <AT> gentoo <DOT> org>
AuthorDate: Wed May 25 02:28:10 2016 +0000
Commit:     Benda XU <heroxbd <AT> gentoo <DOT> org>
CommitDate: Wed May 25 02:28:43 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=62c75f76

sys-devel/binutils-config: add prefix support.

Bug: 531616

Package-Manager: portage-2.2.28
RepoMan-Options: --force

 .../binutils-config/binutils-config-5-r2.ebuild    |  5 +-
 sys-devel/binutils-config/files/binutils-config-5  | 84 +++++++++++-----------
 2 files changed, 45 insertions(+), 44 deletions(-)

diff --git a/sys-devel/binutils-config/binutils-config-5-r2.ebuild b/sys-devel/binutils-config/binutils-config-5-r2.ebuild
index adb97e0..98eb31b 100644
--- a/sys-devel/binutils-config/binutils-config-5-r2.ebuild
+++ b/sys-devel/binutils-config/binutils-config-5-r2.ebuild
@@ -1,9 +1,11 @@
-# Copyright 1999-2015 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 # $Id$
 
 EAPI="4"
 
+inherit prefix
+
 DESCRIPTION="Utility to change the binutils version being used"
 HOMEPAGE="https://www.gentoo.org/"
 SRC_URI=""
@@ -21,6 +23,7 @@ S=${WORKDIR}
 
 src_install() {
 	newbin "${FILESDIR}"/${PN}-${PV} ${PN}
+	use prefix && eprefixify "${ED}"/usr/bin/${PN}
 	doman "${FILESDIR}"/${PN}.8
 
 	insinto /usr/share/eselect/modules

diff --git a/sys-devel/binutils-config/files/binutils-config-5 b/sys-devel/binutils-config/files/binutils-config-5
index 2bdd07e..b0d8760 100755
--- a/sys-devel/binutils-config/files/binutils-config-5
+++ b/sys-devel/binutils-config/files/binutils-config-5
@@ -7,16 +7,23 @@
 #  config-TARGET:	CURRENT=version for TARGET
 #  TARGET-VER:		has a TARGET and VER variable
 
+EPREFIX="@GENTOO_PORTAGE_EPREFIX@"
+if [[ ${EPREFIX} == "@"GENTOO_PORTAGE_EPREFIX"@" ]] ; then
+	EPREFIX=""
+fi
+
 : ${ROOT:=/}
 [[ ${ROOT} != */ ]] && ROOT="${ROOT}/"
 [[ ${ROOT} != /* ]] && ROOT="${PWD%/}/${ROOT}"
 
-cd /
+EROOT="${ROOT%/}${EPREFIX}/"
+
+cd "${EPREFIX}/"
 
 trap ":" INT QUIT TSTP
 
 argv0=${0##*/}
-FUNCTIONS_SH="/lib/gentoo/functions.sh"
+FUNCTIONS_SH="${EPREFIX}/lib/gentoo/functions.sh"
 source ${FUNCTIONS_SH} || {
 	echo "${argv0}: Could not source ${FUNCTIONS_SH}!" 1>&2
 	exit 1
@@ -97,14 +104,14 @@ setup_env() {
 		# Newer paths: /usr/${HOST}/${TARGET}/...
 		# Older paths: /usr/${TARGET}/...
 		#
-		if [[ -d ${ROOT}/usr/${HOST}/${TARGET}/binutils-bin/${VER} ]] ; then
-			BINPATH=/usr/${HOST}/${TARGET}/binutils-bin/${VER}
-			BINPATH_LINKS=/usr/libexec/gcc/${TARGET}
+		if [[ -d "${EROOT}"/usr/${HOST}/${TARGET}/binutils-bin/${VER} ]] ; then
+			BINPATH="${EPREFIX}"/usr/${HOST}/${TARGET}/binutils-bin/${VER}
+			BINPATH_LINKS="${EPREFIX}"/usr/libexec/gcc/${TARGET}
 		fi
 	fi
 	if [[ -z ${BINPATH} ]] ; then
-		BINPATH=/usr/${TARGET}/binutils-bin/${VER}
-		BINPATH_LINKS=/usr/${TARGET}/bin
+		BINPATH="${EPREFIX}"/usr/${TARGET}/binutils-bin/${VER}
+		BINPATH_LINKS="${EPREFIX}"/usr/${TARGET}/bin
 	fi
 }
 
@@ -123,24 +130,24 @@ switch_profile() {
 	setup_env || return 1
 
 	cd "${ROOT}/${BINPATH}" || exit 1
-	mkdir -p "${ROOT}/${BINPATH_LINKS}" "${ROOT}/usr/bin"
+	mkdir -p "${ROOT}/${BINPATH_LINKS}" "${EROOT}/usr/bin"
 	for x in * ; do
 		atomic_ln "${BINPATH}/${x}" "${ROOT}/${BINPATH_LINKS}" "${x}"
-		atomic_ln "${BINPATH_LINKS}/${x}" "${ROOT}/usr/bin" "${TARGET}-${x}"
+		atomic_ln "${BINPATH_LINKS}/${x}" "${EROOT}/usr/bin" "${TARGET}-${x}"
 		if [[ ${TARGET} == ${HOST} ]] ; then
-			atomic_ln "${TARGET}-${x}" "${ROOT}/usr/bin" "${x}"
+			atomic_ln "${TARGET}-${x}" "${EROOT}/usr/bin" "${x}"
 		fi
 	done
 
 	#
 	# Generate library / ldscripts symlinks
 	#
-	: ${LIBPATH:=/usr/lib/binutils/${TARGET}/${VER}}
+	: ${LIBPATH:=${EPREFIX}/usr/lib/binutils/${TARGET}/${VER}}
 	cd "${ROOT}/${LIBPATH}" || exit 1
 	if [[ ${TARGET} == ${HOST} ]] ; then
-		dstlib=${ROOT}/usr/${HOST}/lib
+		dstlib=${EROOT}/usr/${HOST}/lib
 	else
-		dstlib=${ROOT}/usr/${HOST}/${TARGET}/lib
+		dstlib=${EROOT}/usr/${HOST}/${TARGET}/lib
 	fi
 	# When upgrading, we need to clean up ldscripts and libs.
 	# Don't symlink back in the libs -- the binutils-lib package handles
@@ -149,16 +156,7 @@ switch_profile() {
 	mkdir -p "${dstlib}"
 	rm -rf "${ROOT}/${BINPATH_LINKS}"/ldscripts
 	atomic_ln "${LIBPATH}/ldscripts" "${dstlib}" "ldscripts"
-	find -L "${dstlib}" -xtype l -name 'lib*' -delete
-	# Detect older binutils w/broken rpaths. #562460
-	# We can hardcode the "/lib" part since that's what the binutils
-	# configure scripts have.  They did not include any other path.
-	if [[ $(scanelf -qF '%r#F' "${ROOT}/${BINPATH}/as") == */lib ]] ; then
-		ewarn "Old cross-binutils detected; please re-emerge to fix (see bug #562460)."
-		for x in lib* ; do
-			atomic_ln "${LIBPATH}/${x}" "${dstlib}" "${x}"
-		done
-	fi
+	find -L "${dstlib}" -xtype l -name 'lib*' -exec rm -f {} +
 
 	#
 	# Clean out old generated include symlinks
@@ -169,17 +167,17 @@ switch_profile() {
 		if [[ ${HOST} == ${TARGET} ]] ; then
 			# The binutils-lib package handles these files now.
 			for x in libiberty "${HEADERS[@]}" ; do
-				x="${ROOT}/usr/include/${x}"
+				x="${EROOT}/usr/include/${x}"
 				if [[ -L ${x} ]] ; then
 					rm "${x}"
 				fi
 			done
 		else
 			# Clean out old path -- cannot use '-exec {} +' syntax here
-			find . -type f -exec rm -f "${ROOT}/usr/${TARGET}/usr/include/{}" \;
-			rmdir "${ROOT}/usr/${TARGET}/usr/include" >& /dev/null
-			rmdir "${ROOT}/usr/${TARGET}/usr" >& /dev/null
-			rmdir "${ROOT}/usr/${TARGET}" >& /dev/null
+			find . -type f -exec rm -f "${EROOT}/usr/${TARGET}/usr/include/{}" \;
+			rmdir "${EROOT}/usr/${TARGET}/usr/include" >& /dev/null
+			rmdir "${EROOT}/usr/${TARGET}/usr" >& /dev/null
+			rmdir "${EROOT}/usr/${TARGET}" >& /dev/null
 		fi
 	fi
 
@@ -192,14 +190,14 @@ switch_profile() {
 		# Note: This skips ldconfig update if env.d had LDPATH, but meh.
 		# Most people have upgraded to ld.so.conf.d, and someone else will
 		# eventually re-run ldconfig for us.
-		x="${ROOT}"/etc/ld.so.conf.d/05binutils.conf
+		x="${EROOT}"/etc/ld.so.conf.d/05binutils.conf
 		if [[ -e ${x} ]]; then
 			rm -f "${x}"
 			env_update_flag=""
 		fi
 
-		DATAPATH=/usr/share/binutils-data/${TARGET}/${VER}
-		local e="${ROOT}"/etc/env.d/05binutils
+		DATAPATH="${EPREFIX}"/usr/share/binutils-data/${TARGET}/${VER}
+		local e="${EROOT}"/etc/env.d/05binutils
 		local ee="${e}.tmp"
 		rm -f "${ee}"
 		[[ -d ${ROOT}/${DATAPATH}/man  ]] && echo "MANPATH=${DATAPATH}/man"   >> "${ee}"
@@ -222,7 +220,7 @@ switch_profile() {
 		echo
 		ewarn "Please remember to run:"
 		echo
-		ewarn "  # . /etc/profile"
+		ewarn "  # . ${EPREFIX}/etc/profile"
 		echo
 	fi
 
@@ -251,33 +249,33 @@ uninstall_target() {
 
 	local x
 	for x in \
-		addr2line ar as c++filt dwp elf2flt elfedit flthdr gprof \
+		addr2line ar as c++filt elf2flt elfedit flthdr gprof \
 		ld ld.{bfd,gold,real} \
 		nm objcopy objdump ranlib readelf size strings strip
 	do
 		x=(
-			"${ROOT}"/usr/bin/${TARGET}-${x}
-			"${ROOT}"/usr/{${HOST}/,}${TARGET}/bin/${x}
-			"${ROOT}"/usr/libexec/gcc/${TARGET}/${x}
+			"${EROOT}"/usr/bin/${TARGET}-${x}
+			"${EROOT}"/usr/{${HOST}/,}${TARGET}/bin/${x}
+			"${EROOT}"/usr/libexec/gcc/${TARGET}/${x}
 		)
 		rm -f "${x[@]}"
 	done
 	for x in "${HEADERS[@]}" ; do
-		rm -f "${ROOT}"/usr/{${HOST}/,}${TARGET}/{usr/,}include/${x}
+		rm -f "${EROOT}"/usr/{${HOST}/,}${TARGET}/{usr/,}include/${x}
 	done
 	for x in bfd iberty opcodes ; do
-		rm -f "${ROOT}"/usr/${HOST}/${TARGET}/lib/lib${x}{{-*,}.so,.a,.la}
+		rm -f "${EROOT}"/usr/${HOST}/${TARGET}/lib/lib${x}{{-*,}.so,.a,.la}
 	done
 	# Delete broken symlinks
-	local destdir="${ROOT}/usr/${HOST}/${TARGET}"
+	local destdir="${EROOT}/usr/${HOST}/${TARGET}"
 	rm -f "${destdir}"/lib/ldscripts
 	find -L "${destdir}"/lib -type l -exec rm {} +
 	rmdir \
 		"${destdir}"/{bin,include,lib,usr} \
 		"${destdir}" \
-		"${ROOT}"/var/db/pkg/cross-${TARGET} \
-		"${ROOT}"/usr/{${HOST}/,}${TARGET}/bin \
-		"${ROOT}"/usr/libexec/gcc/${TARGET} \
+		"${EROOT}"/var/db/pkg/cross-${TARGET} \
+		"${EROOT}"/usr/{${HOST}/,}${TARGET}/bin \
+		"${EROOT}"/usr/libexec/gcc/${TARGET} \
 		2>/dev/null
 
 	rm -f "${ENV_D}"/${TARGET}-*
@@ -376,7 +374,7 @@ set_HOST() {
 	: ${HOST:=${CHOST:-$(portageq envvar CHOST)}}
 }
 
-ENV_D="${ROOT}etc/env.d/binutils"
+ENV_D="${EROOT}etc/env.d/binutils"
 
 DEBUG="no"
 NEED_ACTION="yes"


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-05-25  2:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-08-13  8:04 [gentoo-commits] repo/gentoo:master commit in: sys-devel/binutils-config/, sys-devel/binutils-config/files/ Mike Frysinger
  -- strict thread matches above, loose matches on Subject: below --
2015-10-16  3:14 Mike Frysinger
2016-05-25  2:28 Benda XU

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox