summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2024-08-15 23:15:10 +0100
committerSam James <sam@gentoo.org>2024-08-15 23:17:33 +0100
commit9c908753edf4523644b47779bc3d9894d247e69c (patch)
treef5c6d63096bed4b19e6169337a6773ba19f527b6 /sys-devel/bpf-toolchain
parentapp-shells/bash: drop old 5.3_alpha_p* snapshots (diff)
downloadgentoo-9c908753edf4523644b47779bc3d9894d247e69c.tar.gz
gentoo-9c908753edf4523644b47779bc3d9894d247e69c.tar.bz2
gentoo-9c908753edf4523644b47779bc3d9894d247e69c.zip
sys-devel/bpf-toolchain: add USE=bin-symlinks
Note that unlike dev-util/mingw64-toolchain, we're enabling it by default because it'll be pretty uncommon for anyone to have a crossdev-built toolchain for it. This is needed to avoid conflicts if someone wants to build a bpf-unknown-none toolchain via crossdev where an ebuild depends on bpf-toolchain (wouldn't be possible before because of file conflicts). Also, with it off by default, we would have to add some hacks in e.g. the systemd ebuild to make it work by mangling PATH and things get tricky there especially given only a small part of the build would even use it. May change mind on this later if needed though. Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'sys-devel/bpf-toolchain')
-rw-r--r--sys-devel/bpf-toolchain/bpf-toolchain-14.2.0-r1.ebuild (renamed from sys-devel/bpf-toolchain/bpf-toolchain-14.2.0.ebuild)19
-rw-r--r--sys-devel/bpf-toolchain/metadata.xml7
2 files changed, 23 insertions, 3 deletions
diff --git a/sys-devel/bpf-toolchain/bpf-toolchain-14.2.0.ebuild b/sys-devel/bpf-toolchain/bpf-toolchain-14.2.0-r1.ebuild
index aba05ad111a3..0c5a58f41988 100644
--- a/sys-devel/bpf-toolchain/bpf-toolchain-14.2.0.ebuild
+++ b/sys-devel/bpf-toolchain/bpf-toolchain-14.2.0-r1.ebuild
@@ -41,8 +41,8 @@ LICENSE="
"
SLOT="0"
KEYWORDS="-* ~amd64"
-# TODO: USE=strip, USE=bin-symlinks from dev-util/mingw64-toolchain
-IUSE="custom-cflags"
+# TODO: USE=strip from dev-util/mingw64-toolchain?
+IUSE="+bin-symlinks custom-cflags"
RDEPEND="
dev-libs/gmp:=
@@ -50,6 +50,10 @@ RDEPEND="
dev-libs/mpfr:=
sys-libs/zlib:=
virtual/libiconv
+ bin-symlinks? (
+ !cross-bpf-unknown-none/binutils
+ !cross-bpf-unknown-none/gcc
+ )
"
DEPEND="${RDEPEND}"
@@ -81,7 +85,8 @@ src_compile() {
CTARGET=bpf-unknown-none
BPFT_D=${T}/root # moved to ${D} in src_install
- local prefix=${EPREFIX}/usr
+ local bpftdir=/usr/lib/${PN}
+ local prefix=${EPREFIX}${bpftdir}
local sysroot=${BPFT_D}${prefix}
local -x PATH=${sysroot}/bin:${PATH}
@@ -177,6 +182,14 @@ src_compile() {
bpft-build binutils
bpft-build gcc
+ if use bin-symlinks; then
+ mkdir -p -- "${BPFT_D}${EPREFIX}"/usr/bin/ || die
+ local bin
+ for bin in "${sysroot}"/bin/*; do
+ ln -rs -- "${bin}" "${BPFT_D}${EPREFIX}"/usr/bin/ || die
+ done
+ fi
+
# Delete libdep.a, which has a colliding name and is useless for bpf,
# which does not make use of cross-library dependencies: the libdep.a
# for the native binutils will do.
diff --git a/sys-devel/bpf-toolchain/metadata.xml b/sys-devel/bpf-toolchain/metadata.xml
index 12065082990f..34b44dd721cd 100644
--- a/sys-devel/bpf-toolchain/metadata.xml
+++ b/sys-devel/bpf-toolchain/metadata.xml
@@ -5,6 +5,13 @@
<email>toolchain@gentoo.org</email>
<name>Gentoo Toolchain Project</name>
</maintainer>
+ <use>
+ <flag name="bin-symlinks">
+ Symlink executables to usr/bin to be in default
+ PATH (conflicts with crossdev bpf, and crossdev
+ is preferable for a fully featured toolchain)
+ </flag>
+ </use>
<upstream>
<remote-id type="cpe">cpe:/a:gnu:gcc</remote-id>
<remote-id type="cpe">cpe:/a:gnu:binutils</remote-id>