Skip to content
Closed
1 change: 1 addition & 0 deletions build/pkgs/giac/spkg-configure.m4
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ SAGE_SPKG_CONFIGURE([giac], [
AC_SEARCH_LIBS([ConvertUTF16toUTF8], [giac], [
], [sage_spkg_install_giac=yes])
], [sage_spkg_install_giac=yes])
AC_SUBST(SAGE_ENABLE_giac)
m4_popdef([GIAC_MIN_VERSION])
m4_popdef([GIAC_MAX_VERSION])
])
Expand Down
2 changes: 1 addition & 1 deletion build/pkgs/giac/type
Original file line number Diff line number Diff line change
@@ -1 +1 @@
standard
optional
2 changes: 2 additions & 0 deletions pkgs/sage-conf/_sage_conf/_conf.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ SAGE_NAUTY_BINS_PREFIX = "@SAGE_NAUTY_BINS_PREFIX@"

SAGE_ECMBIN = "@SAGE_ECMBIN@"

SAGE_GIAC_ENABLED = "@SAGE_ENABLE_giac@"

# Names or paths of the 4ti2 executables
FOURTITWO_HILBERT = "@FOURTITWO_HILBERT@"
FOURTITWO_MARKOV = "@FOURTITWO_MARKOV@"
Expand Down
1 change: 1 addition & 0 deletions src/sage/env.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ def var(key: str, *fallbacks: Optional[str], force: bool = False) -> Optional[st
KENZO_FAS = var("KENZO_FAS")
SAGE_NAUTY_BINS_PREFIX = var("SAGE_NAUTY_BINS_PREFIX", "")
SAGE_ECMBIN = var("SAGE_ECMBIN", "ecm")
SAGE_GIAC_ENABLED = var("SAGE_GIAC_ENABLED", "yes")
RUBIKS_BINS_PREFIX = var("RUBIKS_BINS_PREFIX", "")
FOURTITWO_HILBERT = var("FOURTITWO_HILBERT")
FOURTITWO_MARKOV = var("FOURTITWO_MARKOV")
Expand Down
10 changes: 8 additions & 2 deletions src/sage/features/giac.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# sage_setup: distribution = sagemath-environment
# sage.doctest: optional - giac
r"""
Feature for testing the presence of ``giac``
"""

from . import Executable, FeatureTestResult
from sage.env import SAGE_GIAC_ENABLED

class Giac(Executable):
r"""
Expand All @@ -12,7 +14,7 @@
EXAMPLES::

sage: from sage.features.giac import Giac
sage: Giac().is_present() # needs giac

Check failure on line 17 in src/sage/features/giac.py

View workflow job for this annotation

GitHub Actions / test-new

Failed example:

Failed example:: Got: FeatureTestResult('giac', False)
FeatureTestResult('giac', True)
"""
def __init__(self):
Expand All @@ -23,8 +25,12 @@
sage: isinstance(Giac(), Giac)
True
"""
Executable.__init__(self, 'giac', executable='giac',
spkg='giac', type='standard')
if SAGE_GIAC_ENABLED == "no":
giac_exe = 'fofobar42barfoo'
else:
giac_exe = 'giac'
Executable.__init__(self, 'giac', executable=giac_exe,
spkg='giac', type='optional')

def all_features():
return [Giac()]
1 change: 1 addition & 0 deletions src/sage/interfaces/giac.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# sage.doctest: optional - giac
r"""
Pexpect Interface to Giac

Expand Down
Loading