commit:     8f92925b8d3eceb7e1d66571505ad040089b3921
Author:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
AuthorDate: Thu May 21 22:05:32 2020 +0000
Commit:     Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
CommitDate: Thu May 21 22:05:47 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8f92925b

sys-devel/binutils-config: add live ebuild

To ease live testing of changes like bug #724454
let's have a live ebuild. Should also be a good hint
where default repository hides.

Add USE=+native-symlinks flag to install 'as', 'ar' and friends.

Bug: https://bugs.gentoo.org/724454
Package-Manager: Portage-2.3.99, Repoman-2.3.22
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>

 .../binutils-config/binutils-config-9999.ebuild    | 46 ++++++++++++++++++++++
 sys-devel/binutils-config/metadata.xml             | 11 ++++--
 2 files changed, 53 insertions(+), 4 deletions(-)

diff --git a/sys-devel/binutils-config/binutils-config-9999.ebuild 
b/sys-devel/binutils-config/binutils-config-9999.ebuild
new file mode 100644
index 00000000000..fdc08708627
--- /dev/null
+++ b/sys-devel/binutils-config/binutils-config-9999.ebuild
@@ -0,0 +1,46 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit prefix
+
+if [[ ${PV} == 9999 ]]; then
+       EGIT_REPO_URI="https://anongit.gentoo.org/git/proj/binutils-config.git";
+       inherit git-r3
+else
+       SRC_URI="https://dev.gentoo.org/~slyfox/distfiles/${P}.tar.xz";
+       KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 
~s390 ~sparc ~x86"
+fi
+
+DESCRIPTION="Utility to change the binutils version being used"
+HOMEPAGE="https://wiki.gentoo.org/wiki/Project:Toolchain";
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="+native-symlinks"
+
+# We also RDEPEND on sys-apps/findutils which is in base @system
+RDEPEND="sys-apps/gentoo-functions"
+
+src_compile() {
+       emake DESTDIR="${D}" PV="${PV}" USE_NATIVE_LINKS="$(usex 
native-symlinks)"
+}
+
+src_install() {
+       emake DESTDIR="${D}" PV="${PV}" install
+
+       use prefix && eprefixify "${ED}"/usr/bin/${PN}
+}
+
+pkg_preinst() {
+       # Force a refresh when upgrading from an older version that symlinked
+       # in all the libs & includes that binutils-libs handles. #528088
+       if has_version "<${CATEGORY}/${PN}-5" ; then
+               local bc current
+               bc="${ED}/usr/bin/binutils-config"
+               if current=$("${bc}" -c) ; then
+                       "${bc}" "${current}"
+               fi
+       fi
+}

diff --git a/sys-devel/binutils-config/metadata.xml 
b/sys-devel/binutils-config/metadata.xml
index e396f375597..3c7c5c4c8e9 100644
--- a/sys-devel/binutils-config/metadata.xml
+++ b/sys-devel/binutils-config/metadata.xml
@@ -1,8 +1,11 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd";>
 <pkgmetadata>
-<maintainer type="project">
-       <email>toolch...@gentoo.org</email>
-       <name>Gentoo Toolchain Project</name>
-</maintainer>
+       <maintainer type="project">
+               <email>toolch...@gentoo.org</email>
+               <name>Gentoo Toolchain Project</name>
+       </maintainer>
+       <use>
+               <flag name="native-symlinks">Install native symlinks like 'as' 
or 'ar' to /usr/bin. Otherwise keep only ${CHOST}-as and friends.</flag>
+       </use>
 </pkgmetadata>

Reply via email to