commit:     f6868eaade72ca7162fc979c3123fccf70f18132
Author:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
AuthorDate: Sun Dec 17 21:17:21 2023 +0000
Commit:     James Le Cuirot <chewi <AT> gentoo <DOT> org>
CommitDate: Wed Dec 27 15:42:41 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f6868eaa

dev-libs/libtomcrypt: Fix cross-compiling by using libtool from SYSROOT

libtool is normally generated by configure with the right toolchain
settings, but this package does not use autoconf, so it executes the
build host libtool with the wrong settings. CC seems to be respected for
compiling but not linking for some reason.

As much as I hate executing something from SYSROOT, hell will freeze
over before libtool stops being a shell script. This seems far easier
than any alternative. ${BASH} at least ensures that it is not executed
using some prefixed shebang.

We'll still allow ${LIBTOOL} to be manually overridden because slibtool
does not suffer from this issue.

Closes: https://github.com/gentoo/gentoo/pull/34334
Signed-off-by: James Le Cuirot <chewi <AT> gentoo.org>

 dev-libs/libtomcrypt/libtomcrypt-1.18.2-r4.ebuild | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/dev-libs/libtomcrypt/libtomcrypt-1.18.2-r4.ebuild 
b/dev-libs/libtomcrypt/libtomcrypt-1.18.2-r4.ebuild
index da71154a8a6b..a42911b32ece 100644
--- a/dev-libs/libtomcrypt/libtomcrypt-1.18.2-r4.ebuild
+++ b/dev-libs/libtomcrypt/libtomcrypt-1.18.2-r4.ebuild
@@ -28,12 +28,15 @@ BDEPEND="
        sys-devel/libtool
        virtual/pkgconfig
 "
-DEPEND="
+RDEPEND="
        gmp? ( dev-libs/gmp:= )
        libtommath? ( dev-libs/libtommath:= )
        tomsfastmath? ( dev-libs/tomsfastmath:= )
 "
-RDEPEND="${DEPEND}"
+DEPEND="
+       ${RDEPEND}
+       sys-devel/libtool
+"
 
 PATCHES=(
        "${FILESDIR}"/${P}-slibtool.patch
@@ -73,6 +76,9 @@ mymake() {
                enabled_features+=( -DUSE_TFM=1 )
        fi
 
+       # Fix cross-compiling, but allow manual overrides for slibtool, which 
works.
+       [[ -z ${LIBTOOL} ]] && declare -x LIBTOOL="${BASH} 
${ESYSROOT}/usr/bin/libtool"
+
        # IGNORE_SPEED=1 is needed to respect CFLAGS
        EXTRALIBS="${extra_libs[*]}" emake \
                CFLAGS="${CFLAGS} ${enabled_features[*]}" \

Reply via email to