Skip to content

Commit

Permalink
Properly set SAGE_SHARE to datadir, and warn if cremona is not installed
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasdiez authored Nov 20, 2023
1 parent b78557d commit 353b989
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkgs/sage-conf/_sage_conf/_conf.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ VERSION = "@PACKAGE_VERSION@"
# to it.
SAGE_LOCAL = "@prefix@"
SAGE_ROOT = "@SAGE_ROOT@"
SAGE_SHARE = "@SAGE_SHARE@"

# The path to the standalone maxima executable.
MAXIMA = "@SAGE_MAXIMA@".replace('${prefix}', SAGE_LOCAL)
Expand Down
12 changes: 12 additions & 0 deletions src/sage/meson.build
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
fs = import('fs')
sage_install_dir = py.get_install_dir() / 'sage'

# Generate the configuration file
conf_data = configuration_data()
conf_data.set('PACKAGE_VERSION', '1.2.3')
conf_data.set('SAGE_ROOT', meson.current_source_dir() / '..' / '..')
# We use Python's prefix here to make it work with conda
prefix = py.get_variable('prefix', '')
conf_data.set('prefix', prefix)
datadir = fs.expanduser(get_option('datadir'))
if not fs.is_absolute(datadir)
datadir = prefix / datadir
endif
conf_data.set('SAGE_SHARE', datadir)
if not fs.exists(datadir / 'cremona')
message('Warning: The specified datadir does not contain the necessary Cremona database. Either specify a different datadir or specify a correct the correct path via the environment variable SAGE_SHARE during runtime.')
endif
conf_data.set('SAGE_MAXIMA', maxima.full_path())
# Conda's ecl does not have any problems with Maxima, so nothing needs to be set here:
conf_data.set('SAGE_MAXIMA_FAS', '')
Expand Down

0 comments on commit 353b989

Please sign in to comment.