diff --git a/build/pkgs/giac/spkg-configure.m4 b/build/pkgs/giac/spkg-configure.m4 index 53e3a8301cd..0c22692a1a1 100644 --- a/build/pkgs/giac/spkg-configure.m4 +++ b/build/pkgs/giac/spkg-configure.m4 @@ -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]) ]) diff --git a/build/pkgs/giac/type b/build/pkgs/giac/type index a6a7b9cd726..134d9bc32d5 100644 --- a/build/pkgs/giac/type +++ b/build/pkgs/giac/type @@ -1 +1 @@ -standard +optional diff --git a/pkgs/sage-conf/_sage_conf/_conf.py.in b/pkgs/sage-conf/_sage_conf/_conf.py.in index 54a59fdbacf..c14dc14c197 100644 --- a/pkgs/sage-conf/_sage_conf/_conf.py.in +++ b/pkgs/sage-conf/_sage_conf/_conf.py.in @@ -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@" diff --git a/src/sage/env.py b/src/sage/env.py index 0f287145814..660e1aac0cf 100644 --- a/src/sage/env.py +++ b/src/sage/env.py @@ -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") diff --git a/src/sage/features/giac.py b/src/sage/features/giac.py index 6f9fe2ccfba..cf86bad4360 100644 --- a/src/sage/features/giac.py +++ b/src/sage/features/giac.py @@ -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""" @@ -23,8 +25,12 @@ def __init__(self): 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()] diff --git a/src/sage/interfaces/giac.py b/src/sage/interfaces/giac.py index 00c9ff429c3..10d0dadf177 100644 --- a/src/sage/interfaces/giac.py +++ b/src/sage/interfaces/giac.py @@ -1,3 +1,4 @@ +# sage.doctest: optional - giac r""" Pexpect Interface to Giac