Skip to content

Commit 773d3a9

Browse files
committed
use variable SAGE_GIAC_ENABLED to control giac feature
1 parent 9cc97cc commit 773d3a9

File tree

4 files changed

+10
-1
lines changed

4 files changed

+10
-1
lines changed

build/pkgs/giac/spkg-configure.m4

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ SAGE_SPKG_CONFIGURE([giac], [
2222
AC_SEARCH_LIBS([ConvertUTF16toUTF8], [giac], [
2323
], [sage_spkg_install_giac=yes])
2424
], [sage_spkg_install_giac=yes])
25+
AC_SUBST(SAGE_ENABLE_giac)
2526
m4_popdef([GIAC_MIN_VERSION])
2627
m4_popdef([GIAC_MAX_VERSION])
2728
])

pkgs/sage-conf/_sage_conf/_conf.py.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ SAGE_NAUTY_BINS_PREFIX = "@SAGE_NAUTY_BINS_PREFIX@"
3434

3535
SAGE_ECMBIN = "@SAGE_ECMBIN@"
3636

37+
SAGE_GIAC_ENABLED = "@SAGE_ENABLE_giac@"
38+
3739
# Names or paths of the 4ti2 executables
3840
FOURTITWO_HILBERT = "@FOURTITWO_HILBERT@"
3941
FOURTITWO_MARKOV = "@FOURTITWO_MARKOV@"

src/sage/env.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st
224224
KENZO_FAS = var("KENZO_FAS")
225225
SAGE_NAUTY_BINS_PREFIX = var("SAGE_NAUTY_BINS_PREFIX", "")
226226
SAGE_ECMBIN = var("SAGE_ECMBIN", "ecm")
227+
SAGE_GIAC_ENABLED = var("SAGE_GIAC_ENABLED", "yes")
227228
RUBIKS_BINS_PREFIX = var("RUBIKS_BINS_PREFIX", "")
228229
FOURTITWO_HILBERT = var("FOURTITWO_HILBERT")
229230
FOURTITWO_MARKOV = var("FOURTITWO_MARKOV")

src/sage/features/giac.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"""
55

66
from . import Executable, FeatureTestResult
7+
from sage.env import SAGE_GIAC_ENABLED
78

89
class Giac(Executable):
910
r"""
@@ -23,7 +24,11 @@ def __init__(self):
2324
sage: isinstance(Giac(), Giac)
2425
True
2526
"""
26-
Executable.__init__(self, 'giac', executable='giac',
27+
if SAGE_GIAC_ENABLED == "no":
28+
giac_exe = 'fofobar42barfoo'
29+
else:
30+
giac_exe = 'giac'
31+
Executable.__init__(self, 'giac', executable=giac_exe,
2732
spkg='giac', type='optional')
2833

2934
def all_features():

0 commit comments

Comments
 (0)