Skip to content

Commit

Permalink
use variable SAGE_GIAC_ENABLED to control giac feature
Browse files Browse the repository at this point in the history
  • Loading branch information
dimpase committed Sep 25, 2024
1 parent 9cc97cc commit d47e633
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 1 deletion.
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: 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
7 changes: 6 additions & 1 deletion src/sage/features/giac.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"""

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

class Giac(Executable):
r"""
Expand All @@ -23,7 +24,11 @@ def __init__(self):
sage: isinstance(Giac(), Giac)
True
"""
Executable.__init__(self, 'giac', executable='giac',
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():
Expand Down

0 comments on commit d47e633

Please sign in to comment.