sage, sageWithDoc: 10.2 -> 10.3

This commit is contained in:
Mauricio Collares
2024-03-20 11:46:58 +01:00
parent 2e1ebdb6e0
commit d403e1be7a
6 changed files with 24 additions and 29 deletions
@@ -15,7 +15,7 @@ let
pkgs = pkgs.python3.pkgs.overrideScope (self: super: {
# `sagelib`, i.e. all of sage except some wrappers and runtime dependencies
sagelib = self.callPackage ./sagelib.nix {
inherit flint arb;
inherit flint3;
inherit sage-src env-locations singular;
inherit (maxima) lisp-compiler;
linbox = pkgs.linbox.override { withSage = true; };
@@ -73,7 +73,7 @@ let
sagelib = python3.pkgs.sagelib;
sage-docbuild = python3.pkgs.sage-docbuild;
inherit env-locations;
inherit python3 singular palp flint pythonEnv maxima;
inherit python3 singular palp flint3 pythonEnv maxima;
pkg-config = pkgs.pkg-config; # not to confuse with pythonPackages.pkg-config
};
@@ -125,9 +125,7 @@ let
ignoreCollisions = true;
} // { extraLibs = pythonRuntimeDeps; }; # make the libs accessible
arb = pkgs.arb.override { inherit flint; };
singular = pkgs.singular.override { inherit flint; };
singular = pkgs.singular.override { inherit flint3; };
maxima = pkgs.maxima-ecl.override {
lisp-compiler = pkgs.ecl.override {
@@ -149,7 +147,7 @@ let
# openblas instead of openblasCompat. Apparently other packages somehow use flints
# blas when it is available. Alternative would be to override flint to use
# openblasCompat.
flint = pkgs.flint.override { withBlas = false; };
flint3 = pkgs.flint3.override { withBlas = false; };
# Multiple palp dimensions need to be available and sage expects them all to be
# in the same folder.
@@ -26,15 +26,13 @@ writeTextFile rec {
export GPDOCDIR="${pari}/share/pari/doc"
export SINGULARPATH='${singular}/share/singular'
export SINGULAR_SO='${singular}/lib/libSingular.so'
export GAP_SO='${gap}/lib/libgap.so'
export SINGULAR_EXECUTABLE='${singular}/bin/Singular'
export MAXIMA_FAS='${maxima}/lib/maxima/${maxima.version}/binary-ecl/maxima.fas'
export MAXIMA_PREFIX="${maxima}"
export GRAPHS_DATA_DIR='${graphs}/share/graphs'
export ELLCURVE_DATA_DIR='${elliptic_curves}/share/ellcurves'
export POLYTOPE_DATA_DIR='${polytopes_db}/share/reflexive_polytopes'
export GAP_LIB_DIR='${gap}/lib/gap'
export GAP_SHARE_DIR='${gap}/share/gap'
export GAP_ROOT_PATHS='${gap}/lib/gap;${gap}/share/gap'
export ECLDIR='${maxima.lisp-compiler}/lib/${maxima.lisp-compiler.pname}-${maxima.lisp-compiler.version}/'
export COMBINATORIAL_DESIGN_DATA_DIR="${combinatorial_designs}/share/combinatorial_designs"
export CREMONA_MINI_DATA_DIR="${elliptic_curves}/share/cremona"
@@ -4,6 +4,7 @@
, jupyter-sphinx
, sphinx
, sphinx-copybutton
, sphinx-inline-tabs
}:
buildPythonPackage rec {
@@ -15,6 +16,7 @@ buildPythonPackage rec {
jupyter-sphinx
sphinx
sphinx-copybutton
sphinx-inline-tabs
];
preBuild = ''
@@ -42,7 +42,7 @@
, flintqs
, blas
, lapack
, flint
, flint3
, gmp
, mpfr
, zlib
@@ -155,7 +155,7 @@ writeTextFile rec {
# cython needs to find these libraries, otherwise will fail with `ld: cannot find -lflint` or similar
export LDFLAGS='${
lib.concatStringsSep " " (map (pkg: "-L${pkg}/lib") [
flint
flint3
gap
glpk
gmp
@@ -174,7 +174,7 @@ writeTextFile rec {
singular
gmp.dev
glpk
flint
flint3
gap
mpfr.dev
])
@@ -10,14 +10,14 @@
# all get the same sources with the same patches applied.
stdenv.mkDerivation rec {
version = "10.2";
version = "10.3";
pname = "sage-src";
src = fetchFromGitHub {
owner = "sagemath";
repo = "sage";
rev = version;
sha256 = "sha256-VXnPdJhtw5Y/anecrVpevJDCyBVfnjksyuuZslNipm4=";
hash = "sha256-OHtMv8t0RrP6R8XIREU+C1vpazeQLWa75wx9Mv6BN1U=";
};
# contains essential files (e.g., setup.cfg) generated by the bootstrap script.
@@ -25,8 +25,8 @@ stdenv.mkDerivation rec {
configure-src = fetchurl {
# the hash below is the tagged commit's _parent_. it can also be found by looking for
# the "configure" asset at https://github.com/sagemath/sage/releases/tag/${version}
url = "mirror://sageupstream/configure/configure-b2813506039143e6f0abe859ab67a343abf72c2e.tar.gz";
sha256 = "sha256-a1v0XyoKI+zO6Sjm8DzEwItRHbIgRDbpj4UfwVH+/hw=";
url = "mirror://sageupstream/configure/configure-ab1a517b64b02bf15bbcb8d7c2d4d643bd5eff9b.tar.gz";
hash = "sha256-pe9AxTM+gFSR4/eVfUzay+4bwjoubbYeDPc+avKjlaw=";
};
# Patches needed because of particularities of nix or the way this is packaged.
@@ -62,11 +62,11 @@ stdenv.mkDerivation rec {
# should come from or be proposed to upstream. This list will probably never
# be empty since dependencies update all the time.
packageUpgradePatches = [
# https://github.com/sagemath/sage/pull/37123, to land in 10.3.beta7
# https://github.com/sagemath/sage/pull/37492
(fetchpatch {
name = "scipy-1.12-upgrade.patch";
url = "https://github.com/sagemath/sage/commit/54eec464e9fdf18b411d9148aecb918178e95909.diff";
sha256 = "sha256-9wyNrcSfF6mYFTIV4ev2OdD7igb0AeyZZYWSc/+JrIU=";
name = "singular-4.3.2p14-upgrade.patch";
url = "https://github.com/sagemath/sage/commit/a0c56816b051e97da44ac0a4e4d4f6915cf7fa0f.diff";
sha256 = "sha256-WGMmPeBoj2LUC+2qxWuaJL89QUuGt6axGvxWkpM9LYg=";
})
];
@@ -10,7 +10,6 @@
, iml
, libpng
, readline
, arb
, blas
, boost
, brial
@@ -18,7 +17,7 @@
, eclib
, ecm
, fflas-ffpack
, flint
, flint3
, gap
, giac
, givaro
@@ -45,6 +44,7 @@
, singular
, sqlite
, symmetrica
, conway-polynomials
, cvxopt
, cypari2
, cysignals
@@ -92,6 +92,7 @@ buildPythonPackage rec {
version = src.version;
pname = "sagelib";
src = sage-src;
pyproject = true;
nativeBuildInputs = [
iml
@@ -112,7 +113,6 @@ buildPythonPackage rec {
propagatedBuildInputs = [
# native dependencies (TODO: determine which ones need to be propagated)
arb
blas
boost
brial
@@ -120,7 +120,7 @@ buildPythonPackage rec {
eclib
ecm
fflas-ffpack
flint
flint3
gap
giac
givaro
@@ -149,6 +149,7 @@ buildPythonPackage rec {
symmetrica
# from src/sage/setup.cfg and requirements.txt
conway-polynomials
cvxopt
cypari2
cysignals
@@ -202,11 +203,7 @@ buildPythonPackage rec {
mkdir -p "$SAGE_SHARE/sage/ext/notebook-ipython"
mkdir -p "var/lib/sage/installed"
# 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.
sed -i 's/, <[^, ]*//' build/pkgs/*/install-requires.txt
sed -i "/sage-conf/d" src/{setup.cfg,pyproject.toml,requirements.txt}
cd build/pkgs/sagelib/src
'';