commit:     0b6fa23e6ed561e1248bf2928202ba5966944388
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Mon Feb  5 15:00:39 2024 +0000
Commit:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
CommitDate: Mon Feb  5 15:13:45 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=0b6fa23e

sci-mathematics/gap: respect CC and CXX in the "gac" compiler

Closes: https://bugs.gentoo.org/922835
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>

 .../gap/files/gap-4.12.2-cc-and-cxx-for-gac.patch  | 42 ++++++++++++++++++++++
 .../{gap-4.12.2-r3.ebuild => gap-4.12.2-r4.ebuild} |  2 ++
 2 files changed, 44 insertions(+)

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 <[email protected]>
+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
similarity index 98%
rename from sci-mathematics/gap/gap-4.12.2-r3.ebuild
rename to 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"

Reply via email to