summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Orlitzky <mjo@gentoo.org>2024-02-05 10:00:39 -0500
committerMichael Orlitzky <mjo@gentoo.org>2024-02-05 10:13:45 -0500
commit0b6fa23e6ed561e1248bf2928202ba5966944388 (patch)
treead84117c908be0004c6ad19e9591d1c6589bfb83 /sci-mathematics
parentnet-print/cups-filters: Stabilize 2.0.0 arm, #923811 (diff)
downloadgentoo-0b6fa23e6ed561e1248bf2928202ba5966944388.tar.gz
gentoo-0b6fa23e6ed561e1248bf2928202ba5966944388.tar.bz2
gentoo-0b6fa23e6ed561e1248bf2928202ba5966944388.zip
sci-mathematics/gap: respect CC and CXX in the "gac" compiler
Closes: https://bugs.gentoo.org/922835 Signed-off-by: Michael Orlitzky <mjo@gentoo.org>
Diffstat (limited to 'sci-mathematics')
-rw-r--r--sci-mathematics/gap/files/gap-4.12.2-cc-and-cxx-for-gac.patch42
-rw-r--r--sci-mathematics/gap/gap-4.12.2-r4.ebuild (renamed from sci-mathematics/gap/gap-4.12.2-r3.ebuild)2
2 files changed, 44 insertions, 0 deletions
diff --git a/sci-mathematics/gap/files/gap-4.12.2-cc-and-cxx-for-gac.patch b/sci-mathematics/gap/files/gap-4.12.2-cc-and-cxx-for-gac.patch
new file mode 100644
index 000000000000..cfdfb4ac8a11
--- /dev/null
+++ b/sci-mathematics/gap/files/gap-4.12.2-cc-and-cxx-for-gac.patch
@@ -0,0 +1,42 @@
+From 2933af2d8a986430a4fcf2ab4d577e5bb049662a Mon Sep 17 00:00:00 2001
+From: Michael Orlitzky <michael@orlitzky.com>
+Date: Fri, 2 Feb 2024 18:14:59 -0500
+Subject: [PATCH] cnf/gac.in: respect $CC and $CXX if they're non-null
+
+This allows the user to override the stored C and C++ compilers
+(typically obtained from sysinfo.gap) if desired. This is especially
+useful on rolling release and/or source-based distributions where the
+"current" compiler can change frequently and without user interaction.
+
+Closes: https://github.com/gap-system/gap/issues/5606
+---
+ cnf/gac.in | 16 ++++++++++++++++
+ 1 file changed, 16 insertions(+)
+
+diff --git a/cnf/gac.in b/cnf/gac.in
+index 1faafba820..3a9fc6eb16 100644
+--- a/cnf/gac.in
++++ b/cnf/gac.in
+@@ -63,6 +63,22 @@ GAP_CFLAGS="${GAP_CFLAGS} ${GAC_CFLAGS}"
+ GAP_CXXFLAGS="${GAP_CXXFLAGS} ${GAC_CFLAGS}"
+ GAP_LDFLAGS="${GAP_LDFLAGS} ${GAC_LDFLAGS}"
+
++# Using the stored C/C++ compilers from sysinfo.gap is sometimes
++# undesirable. For example, if the compiler suite is upgraded or
++# downgraded, the particular executable used to build GAP itself may
++# no longer exist. The CC and CXX environment variables provide a
++# somewhat standard way for the user to indicate which compilers he
++# would like to use. So if those are set, we prefer them to the stored
++# values. This allows people who know what they are doing to override
++# the default behavior, while keeping the defaults safe for normal
++# people.
++if test -n "${CC}"; then
++ c_compiler="${CC}"
++ c_dyn_linker="${CC}"
++fi
++if test -n "${CXX}"; then
++ cxx_compiler="${CXX}"
++fi
+
+ # is output going to a terminal?
+ if test -t 1 && command -v tput >/dev/null 2>&1 ; then
diff --git a/sci-mathematics/gap/gap-4.12.2-r3.ebuild b/sci-mathematics/gap/gap-4.12.2-r4.ebuild
index d44da14dfd8a..f9f41bafaaab 100644
--- a/sci-mathematics/gap/gap-4.12.2-r3.ebuild
+++ b/sci-mathematics/gap/gap-4.12.2-r4.ebuild
@@ -62,6 +62,8 @@ RDEPEND="${DEPEND}"
# packages, use package.provided.
PDEPEND="${REQUIRED_PKGS} !minimal? ( ${AUTOLOADED_PKGS} )"
+PATCHES=( "${FILESDIR}/${P}-cc-and-cxx-for-gac.patch" )
+
pkg_setup() {
if use valgrind; then
elog "If you enable the use of valgrind during building"