commit:     62e3ddc88fe4221b322dde8c0e11347889970ce4
Author:     Jakov Smolić <jsmolic <AT> gentoo <DOT> org>
AuthorDate: Thu Oct  7 09:02:09 2021 +0000
Commit:     Jakov Smolić <jsmolic <AT> gentoo <DOT> org>
CommitDate: Thu Oct  7 09:02:09 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=62e3ddc8

sci-mathematics/dsfmt: Fix tc-directly

Closes: https://bugs.gentoo.org/780936
Signed-off-by: Jakov Smolić <jsmolic <AT> gentoo.org>

 sci-mathematics/dsfmt/dsfmt-2.2.4.ebuild         |  9 ++++++++-
 sci-mathematics/dsfmt/files/dsfmt-2.2.4-cc.patch | 12 ++++++++++++
 2 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/sci-mathematics/dsfmt/dsfmt-2.2.4.ebuild 
b/sci-mathematics/dsfmt/dsfmt-2.2.4.ebuild
index 5de399e78f8..fb35881b936 100644
--- a/sci-mathematics/dsfmt/dsfmt-2.2.4.ebuild
+++ b/sci-mathematics/dsfmt/dsfmt-2.2.4.ebuild
@@ -11,15 +11,22 @@ MYP=${MYPN}-${PV}
 DESCRIPTION="Double precision SIMD-oriented Fast Mersenne Twister library"
 HOMEPAGE="http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/SFMT";
 SRC_URI="https://github.com/MersenneTwister-Lab/dSFMT/archive/v${PV}.tar.gz -> 
${P}.tar.gz"
+S="${WORKDIR}/${MYP}"
 
 LICENSE="BSD"
 SLOT="0"
 KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
 
-S="${WORKDIR}/${MYP}"
+PATCHES=(
+       "${FILESDIR}"/${P}-cc.patch
+)
 
 soname="lib${MYPN}.so"
 
+src_configure() {
+               tc-export CC
+}
+
 src_compile() {
        emake CCFLAGS="${CFLAGS}"
        $(tc-getCC) -fPIC -shared -DDSFMT_SHLIB -DDSFMT_DO_NOT_USE_OLD_NAMES 
${LDFLAGS} ${CFLAGS} -Wl,-soname=${soname} -o ${soname} ${MYPN}.c || die

diff --git a/sci-mathematics/dsfmt/files/dsfmt-2.2.4-cc.patch 
b/sci-mathematics/dsfmt/files/dsfmt-2.2.4-cc.patch
new file mode 100644
index 00000000000..fda30002ad7
--- /dev/null
+++ b/sci-mathematics/dsfmt/files/dsfmt-2.2.4-cc.patch
@@ -0,0 +1,12 @@
+# https://bugs.gentoo.org/780936
+--- a/Makefile
++++ b/Makefile
+@@ -28,7 +28,7 @@ OPTI = -O3 -finline-functions -fomit-frame-pointer -DNDEBUG \
+ #STD = -std=c89 -pedantic
+ #STD = -std=c99 -pedantic
+ STD = -std=c99
+-CC = gcc
++CC ?= gcc
+ CCFLAGS = $(OPTI) $(WARN) $(STD)
+ ALTIFLAGS = -mabi=altivec -maltivec -DHAVE_ALTIVEC
+ OSXALTIFLAGS = -faltivec -maltivec -DHAVE_ALTIVEC

Reply via email to