2020-04-24 23:36:52 +00:00
|
|
|
{ sage-src
|
|
|
|
, env-locations
|
2023-05-24 13:37:59 +00:00
|
|
|
, python
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
2022-02-10 20:34:41 +00:00
|
|
|
, m4
|
2023-05-24 13:37:59 +00:00
|
|
|
, perl
|
|
|
|
, pkg-config
|
|
|
|
, sage-setup
|
|
|
|
, gd
|
|
|
|
, iml
|
|
|
|
, libpng
|
|
|
|
, readline
|
2020-04-24 23:36:52 +00:00
|
|
|
, arb
|
|
|
|
, blas
|
2023-05-24 13:37:59 +00:00
|
|
|
, boost
|
2020-04-24 23:36:52 +00:00
|
|
|
, brial
|
|
|
|
, cliquer
|
|
|
|
, eclib
|
|
|
|
, ecm
|
2023-05-24 13:37:59 +00:00
|
|
|
, fflas-ffpack
|
2020-04-24 23:36:52 +00:00
|
|
|
, flint
|
2023-05-24 13:37:59 +00:00
|
|
|
, gap
|
2020-12-25 13:55:36 +00:00
|
|
|
, giac
|
2020-04-24 23:36:52 +00:00
|
|
|
, givaro
|
|
|
|
, glpk
|
|
|
|
, gsl
|
2023-05-24 13:37:59 +00:00
|
|
|
, lapack
|
2020-04-24 23:36:52 +00:00
|
|
|
, lcalc
|
2023-05-24 13:37:59 +00:00
|
|
|
, libbraiding
|
|
|
|
, libhomfly
|
|
|
|
, libmpc
|
2020-04-24 23:36:52 +00:00
|
|
|
, linbox
|
2023-05-24 13:37:59 +00:00
|
|
|
, lisp-compiler
|
|
|
|
, lrcalc
|
2020-04-24 23:36:52 +00:00
|
|
|
, m4ri
|
|
|
|
, m4rie
|
|
|
|
, mpfi
|
2023-05-24 13:37:59 +00:00
|
|
|
, mpfr
|
2020-04-24 23:36:52 +00:00
|
|
|
, ntl
|
|
|
|
, pari
|
|
|
|
, planarity
|
|
|
|
, ppl
|
|
|
|
, rankwidth
|
2023-05-24 13:37:59 +00:00
|
|
|
, ratpoints
|
2020-04-24 23:36:52 +00:00
|
|
|
, singular
|
2020-12-25 13:55:36 +00:00
|
|
|
, sqlite
|
2023-05-24 13:37:59 +00:00
|
|
|
, symmetrica
|
|
|
|
, cvxopt
|
|
|
|
, cypari2
|
|
|
|
, cysignals
|
2024-01-25 14:12:00 +00:00
|
|
|
, cython_3
|
2023-05-24 13:37:59 +00:00
|
|
|
, fpylll
|
|
|
|
, gmpy2
|
|
|
|
, importlib-metadata
|
|
|
|
, importlib-resources
|
|
|
|
, ipykernel
|
|
|
|
, ipython
|
2022-02-10 20:34:41 +00:00
|
|
|
, ipywidgets
|
2023-05-24 13:37:59 +00:00
|
|
|
, jinja2
|
|
|
|
, jupyter-client
|
|
|
|
, jupyter-core
|
|
|
|
, lrcalc-python
|
|
|
|
, matplotlib
|
|
|
|
, memory-allocator
|
2022-02-10 20:34:41 +00:00
|
|
|
, mpmath
|
2023-05-24 13:37:59 +00:00
|
|
|
, networkx
|
|
|
|
, numpy
|
|
|
|
, pexpect
|
|
|
|
, pillow
|
|
|
|
, pip
|
|
|
|
, pkgconfig
|
|
|
|
, pplpy
|
|
|
|
, primecountpy
|
|
|
|
, ptyprocess
|
|
|
|
, requests
|
2022-02-10 20:34:41 +00:00
|
|
|
, rpy2
|
|
|
|
, scipy
|
2023-05-24 13:37:59 +00:00
|
|
|
, sphinx
|
2022-02-10 20:34:41 +00:00
|
|
|
, sympy
|
2023-05-24 13:37:59 +00:00
|
|
|
, typing-extensions
|
2023-11-16 04:20:00 +00:00
|
|
|
, nbclassic
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
assert (!blas.isILP64) && (!lapack.isILP64);
|
|
|
|
|
|
|
|
# This is the core sage python package. Everything else is just wrappers gluing
|
|
|
|
# stuff together. It is not very useful on its own though, since it will not
|
|
|
|
# find many of its dependencies without `sage-env`, will not be tested without
|
|
|
|
# `sage-tests` and will not have html docs without `sagedoc`.
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
version = src.version;
|
|
|
|
pname = "sagelib";
|
|
|
|
src = sage-src;
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
iml
|
2023-05-24 13:37:59 +00:00
|
|
|
lisp-compiler
|
|
|
|
m4
|
2020-04-24 23:36:52 +00:00
|
|
|
perl
|
2023-05-24 13:37:59 +00:00
|
|
|
pip # needed to query installed packages
|
2020-04-24 23:36:52 +00:00
|
|
|
pkg-config
|
2022-02-10 20:34:41 +00:00
|
|
|
sage-setup
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
gd
|
|
|
|
iml
|
2023-03-24 00:07:29 +00:00
|
|
|
libpng
|
2023-05-24 13:37:59 +00:00
|
|
|
readline
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
2023-05-24 13:37:59 +00:00
|
|
|
# native dependencies (TODO: determine which ones need to be propagated)
|
2020-04-24 23:36:52 +00:00
|
|
|
arb
|
2023-05-24 13:37:59 +00:00
|
|
|
blas
|
|
|
|
boost
|
2020-04-24 23:36:52 +00:00
|
|
|
brial
|
|
|
|
cliquer
|
|
|
|
eclib
|
|
|
|
ecm
|
|
|
|
fflas-ffpack
|
|
|
|
flint
|
2023-05-24 13:37:59 +00:00
|
|
|
gap
|
2020-12-25 13:55:36 +00:00
|
|
|
giac
|
2020-04-24 23:36:52 +00:00
|
|
|
givaro
|
|
|
|
glpk
|
|
|
|
gsl
|
2023-05-24 13:37:59 +00:00
|
|
|
lapack
|
2020-04-24 23:36:52 +00:00
|
|
|
lcalc
|
2023-05-24 13:37:59 +00:00
|
|
|
libbraiding
|
|
|
|
libhomfly
|
2020-04-24 23:36:52 +00:00
|
|
|
libmpc
|
|
|
|
linbox
|
2023-05-24 13:37:59 +00:00
|
|
|
lisp-compiler
|
2020-04-24 23:36:52 +00:00
|
|
|
lrcalc
|
|
|
|
m4ri
|
|
|
|
m4rie
|
|
|
|
mpfi
|
2023-05-24 13:37:59 +00:00
|
|
|
mpfr
|
2020-04-24 23:36:52 +00:00
|
|
|
ntl
|
|
|
|
pari
|
|
|
|
planarity
|
|
|
|
ppl
|
|
|
|
rankwidth
|
|
|
|
ratpoints
|
|
|
|
singular
|
2023-05-24 13:37:59 +00:00
|
|
|
sqlite
|
2020-04-24 23:36:52 +00:00
|
|
|
symmetrica
|
2023-05-24 13:37:59 +00:00
|
|
|
|
|
|
|
# from src/sage/setup.cfg and requirements.txt
|
|
|
|
cvxopt
|
|
|
|
cypari2
|
2020-04-24 23:36:52 +00:00
|
|
|
cysignals
|
2024-01-25 14:12:00 +00:00
|
|
|
cython_3
|
2023-05-24 13:37:59 +00:00
|
|
|
fpylll
|
2020-04-24 23:36:52 +00:00
|
|
|
gmpy2
|
2023-05-24 13:37:59 +00:00
|
|
|
importlib-metadata
|
|
|
|
importlib-resources
|
2022-02-10 20:34:41 +00:00
|
|
|
ipykernel
|
2023-05-24 13:37:59 +00:00
|
|
|
ipython
|
2022-02-10 20:34:41 +00:00
|
|
|
ipywidgets
|
2023-05-24 13:37:59 +00:00
|
|
|
jinja2
|
|
|
|
jupyter-client
|
|
|
|
jupyter-core
|
2022-05-18 14:49:53 +00:00
|
|
|
lrcalc-python
|
2023-05-24 13:37:59 +00:00
|
|
|
matplotlib
|
|
|
|
memory-allocator
|
|
|
|
mpmath
|
|
|
|
networkx
|
|
|
|
numpy
|
|
|
|
pexpect
|
|
|
|
pillow
|
|
|
|
pip
|
|
|
|
pkgconfig
|
|
|
|
pplpy
|
|
|
|
primecountpy
|
|
|
|
ptyprocess
|
|
|
|
requests
|
|
|
|
rpy2
|
|
|
|
scipy
|
2022-02-10 20:34:41 +00:00
|
|
|
sphinx
|
2023-05-24 13:37:59 +00:00
|
|
|
sympy
|
|
|
|
typing-extensions
|
2023-11-16 04:20:00 +00:00
|
|
|
|
|
|
|
nbclassic
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2021-04-26 19:14:03 +00:00
|
|
|
preBuild = ''
|
2020-04-24 23:36:52 +00:00
|
|
|
export SAGE_ROOT="$PWD"
|
|
|
|
export SAGE_LOCAL="$SAGE_ROOT"
|
|
|
|
export SAGE_SHARE="$SAGE_LOCAL/share"
|
|
|
|
|
|
|
|
# set locations of dependencies (needed for nbextensions like threejs)
|
|
|
|
. ${env-locations}/sage-env-locations
|
|
|
|
|
|
|
|
export JUPYTER_PATH="$SAGE_LOCAL/jupyter"
|
|
|
|
export PATH="$SAGE_ROOT/build/bin:$SAGE_ROOT/src/bin:$PATH"
|
|
|
|
|
|
|
|
export SAGE_NUM_THREADS="$NIX_BUILD_CORES"
|
|
|
|
|
|
|
|
mkdir -p "$SAGE_SHARE/sage/ext/notebook-ipython"
|
|
|
|
mkdir -p "var/lib/sage/installed"
|
|
|
|
|
2022-04-15 01:41:22 +00:00
|
|
|
# version lower bounds are useful, but upper bounds are a hassle because
|
|
|
|
# Sage tests already catch any relevant API breakage.
|
|
|
|
# according to the discussion at https://trac.sagemath.org/ticket/33520,
|
|
|
|
# upper bounds will be less noisy starting from Sage 9.6.
|
2024-01-25 14:12:00 +00:00
|
|
|
sed -i 's/, <[^, ]*//' build/pkgs/*/install-requires.txt
|
2022-02-10 20:34:41 +00:00
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
cd build/pkgs/sagelib/src
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2021-04-26 19:14:03 +00:00
|
|
|
postInstall = ''
|
2020-04-24 23:36:52 +00:00
|
|
|
rm -r "$out/${python.sitePackages}/sage/cython_debug"
|
|
|
|
'';
|
2021-04-26 19:14:03 +00:00
|
|
|
|
|
|
|
doCheck = false; # we will run tests in sage-tests.nix
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|