summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIonen Wolkens <ionen@gentoo.org>2024-05-07 07:12:48 -0400
committerIonen Wolkens <ionen@gentoo.org>2024-05-07 10:23:04 -0400
commitab40dd1735ded9340253a9e693dd75eac860fe3c (patch)
tree40c8e0580f8149e27eab96ec77664b53a30ce19a /dev-util/mingw64-toolchain
parentdev-util/mingw64-toolchain: add 11.0.1, unkeyworded for now (diff)
downloadgentoo-ab40dd1735ded9340253a9e693dd75eac860fe3c.tar.gz
gentoo-ab40dd1735ded9340253a9e693dd75eac860fe3c.tar.bz2
gentoo-ab40dd1735ded9340253a9e693dd75eac860fe3c.zip
dev-util/mingw64-toolchain: add IUSE=bin-symlinks
Kept off-by-default given crossdev is still preferred for full featured mingw toolchain usage, just for anyone that wants it (also works out better with ccache). Signed-off-by: Ionen Wolkens <ionen@gentoo.org>
Diffstat (limited to 'dev-util/mingw64-toolchain')
-rw-r--r--dev-util/mingw64-toolchain/metadata.xml7
-rw-r--r--dev-util/mingw64-toolchain/mingw64-toolchain-11.0.1.ebuild28
2 files changed, 34 insertions, 1 deletions
diff --git a/dev-util/mingw64-toolchain/metadata.xml b/dev-util/mingw64-toolchain/metadata.xml
index 7a95ab69a652..ec66707e7ad0 100644
--- a/dev-util/mingw64-toolchain/metadata.xml
+++ b/dev-util/mingw64-toolchain/metadata.xml
@@ -5,6 +5,13 @@
<email>ionen@gentoo.org</email>
<name>Ionen Wolkens</name>
</maintainer>
+ <use>
+ <flag name="bin-symlinks">
+ Symlink executables to usr/bin to be in default
+ PATH (conflicts with crossdev mingw, 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>
diff --git a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.1.ebuild b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.1.ebuild
index d8d4a4846a8a..94e4af656ed4 100644
--- a/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.1.ebuild
+++ b/dev-util/mingw64-toolchain/mingw64-toolchain-11.0.1.ebuild
@@ -42,7 +42,7 @@ LICENSE="
SLOT="0"
# unkeyworded for testing
#KEYWORDS="-* ~amd64 ~x86"
-IUSE="+abi_x86_32 custom-cflags debug"
+IUSE="+abi_x86_32 bin-symlinks custom-cflags debug"
RDEPEND="
dev-libs/gmp:=
@@ -50,6 +50,16 @@ RDEPEND="
dev-libs/mpfr:=
sys-libs/zlib:=
virtual/libiconv
+ bin-symlinks? (
+ abi_x86_64? (
+ !cross-x86_64-w64-mingw32/binutils
+ !cross-x86_64-w64-mingw32/gcc
+ )
+ abi_x86_32? (
+ !cross-i686-w64-mingw32/binutils
+ !cross-i686-w64-mingw32/gcc
+ )
+ )
"
DEPEND="${RDEPEND}"
@@ -300,6 +310,14 @@ src_compile() {
popd >/dev/null || die
fi
+ if use bin-symlinks; then
+ mkdir -p -- "${MWT_D}${EPREFIX}"/usr/bin/ || die
+ local bin
+ for bin in "${sysroot}"/bin/*; do
+ ln -rs -- "${bin}" "${MWT_D}${EPREFIX}"/usr/bin/ || die
+ done
+ fi
+
# portage doesn't know the right strip executable to use for CTARGET
# and it can lead to .a mangling, notably with 32bit (breaks toolchain)
dostrip -x ${mwtdir}/{${CTARGET}/lib{,32},lib/gcc/${CTARGET}}
@@ -319,6 +337,9 @@ src_install() {
}
pkg_postinst() {
+ use bin-symlinks && has_version dev-util/shadowman && [[ ! ${ROOT} ]] &&
+ eselect compiler-shadow update all
+
if [[ ! ${REPLACING_VERSIONS} ]]; then
elog "Note that this package is primarily intended for Wine and related"
elog "packages to depend on without needing a manual crossdev setup."
@@ -337,3 +358,8 @@ pkg_postinst() {
ewarn "packages and optionally only one needs to be kept."
fi
}
+
+pkg_postrm() {
+ use bin-symlinks && has_version dev-util/shadowman && [[ ! ${ROOT} ]] &&
+ eselect compiler-shadow clean all
+}