From 49cddf1a7836c981cf72ce6b71db9ff9a8f42ae5 Mon Sep 17 00:00:00 2001 From: Mauricio Collares Date: Thu, 7 Apr 2022 12:16:52 +0200 Subject: [PATCH 1/4] sage: import networkx 2.7 update patch --- pkgs/applications/science/math/sage/sage-src.nix | 8 ++++++++ pkgs/applications/science/math/sage/sagelib.nix | 11 ++++++++--- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/science/math/sage/sage-src.nix b/pkgs/applications/science/math/sage/sage-src.nix index 22e3a288b7d7..d6909e6a4c51 100644 --- a/pkgs/applications/science/math/sage/sage-src.nix +++ b/pkgs/applications/science/math/sage/sage-src.nix @@ -156,6 +156,14 @@ stdenv.mkDerivation rec { # adapted from https://trac.sagemath.org/ticket/23712#comment:22 ./patches/tachyon-renamed-focallength.patch + + # https://trac.sagemath.org/ticket/33495 + (fetchSageDiff { + base = "9.6.beta5"; + name = "networkx-2.7-update.patch"; + rev = "8452003846a7303100847d8d0ed642fc642c11d6"; + sha256 = "sha256-A/XMouPlc2sjFp30L+56fBGJXydS2EtzfPOV98FCDqI="; + }) ]; patches = nixPatches ++ bugfixPatches ++ packageUpgradePatches; diff --git a/pkgs/applications/science/math/sage/sagelib.nix b/pkgs/applications/science/math/sage/sagelib.nix index 8d685c8da60f..92eae35688f7 100644 --- a/pkgs/applications/science/math/sage/sagelib.nix +++ b/pkgs/applications/science/math/sage/sagelib.nix @@ -181,11 +181,16 @@ buildPythonPackage rec { # some files, like Pipfile, pyproject.toml, requirements.txt and setup.cfg # are generated by the bootstrap script using m4. these can fetch data from # build/pkgs, either directly or via sage-get-system-packages. - sed -i 's/==2.1.0rc1/>=2.1.1/' ../gmpy2/install-requires.txt - sed -i 's/, <3.4//' ../rpy2/install-requires.txt - sed -i 's/, <4.3//' ../sphinx/install-requires.txt sed -i '/sage_conf/d' src/setup.cfg.m4 sed -i '/sage_conf/d' src/requirements.txt.m4 + + # 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/==2.1.0rc1/>=2.1.1/' ../gmpy2/install-requires.txt + sed -i 's/, <[^, ]*//' ../*/install-requires.txt + for infile in src/*.m4; do if [ -f "$infile" ]; then outfile="src/$(basename $infile .m4)" From 9e80144a8bb2ad38dba36998d0bc417c6d2b7f7d Mon Sep 17 00:00:00 2001 From: Mauricio Collares Date: Thu, 7 Apr 2022 13:22:43 +0200 Subject: [PATCH 2/4] sage: refresh ipython update patch for ipython 8.1 compat --- pkgs/applications/science/math/sage/sage-src.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/science/math/sage/sage-src.nix b/pkgs/applications/science/math/sage/sage-src.nix index d6909e6a4c51..ad6d363e8552 100644 --- a/pkgs/applications/science/math/sage/sage-src.nix +++ b/pkgs/applications/science/math/sage/sage-src.nix @@ -121,10 +121,10 @@ stdenv.mkDerivation rec { # https://trac.sagemath.org/ticket/33170 (fetchSageDiff { - base = "9.5.rc1"; - name = "ipython-8-update.patch"; - rev = "a90a314616d86d6be9c0d5233f0d36c4bfe06231"; - sha256 = "sha256-pXdtokTo84xNCnV+HyAKEzG562z8FjzJ7hczOja0dRw="; + base = "9.6.beta5"; + name = "ipython-8.1-update.patch"; + rev = "4d2b53f1541375861310af3a7f7109c1c2ed475d"; + sha256 = "sha256-ELda/VBzsQH7NdFas69fQ35QPUoJCeLx/gxT1j7qGR8="; }) # https://trac.sagemath.org/ticket/32968 From 384117bb95a34da017dbffda05603fb08a52fa23 Mon Sep 17 00:00:00 2001 From: Mauricio Collares Date: Thu, 7 Apr 2022 13:54:58 +0200 Subject: [PATCH 3/4] sage: import scipy 1.8 update patch --- pkgs/applications/science/math/sage/sage-src.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/applications/science/math/sage/sage-src.nix b/pkgs/applications/science/math/sage/sage-src.nix index ad6d363e8552..04c2355d26aa 100644 --- a/pkgs/applications/science/math/sage/sage-src.nix +++ b/pkgs/applications/science/math/sage/sage-src.nix @@ -157,6 +157,14 @@ stdenv.mkDerivation rec { # adapted from https://trac.sagemath.org/ticket/23712#comment:22 ./patches/tachyon-renamed-focallength.patch + # https://trac.sagemath.org/ticket/33336 + (fetchSageDiff { + base = "9.6.beta2"; + name = "scipy-1.8-update.patch"; + rev = "9c8235e44ffb509efa8a3ca6cdb55154e2b5066d"; + sha256 = "sha256-bfc4ljNOxVnhlmxIuNbjbKl4vJXYq2tlF3Z8bbC8PWw="; + }) + # https://trac.sagemath.org/ticket/33495 (fetchSageDiff { base = "9.6.beta5"; From 79cc492cebc8fc1d1cc5f2fc9658e8ea27b751b2 Mon Sep 17 00:00:00 2001 From: Mauricio Collares Date: Thu, 7 Apr 2022 14:06:18 +0200 Subject: [PATCH 4/4] sage: set CXXFLAGS to match CFLAGS in sage-env --- pkgs/applications/science/math/sage/sage-env.nix | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkgs/applications/science/math/sage/sage-env.nix b/pkgs/applications/science/math/sage/sage-env.nix index e680c0c3b22d..cdff1e8477ab 100644 --- a/pkgs/applications/science/math/sage/sage-env.nix +++ b/pkgs/applications/science/math/sage/sage-env.nix @@ -151,6 +151,7 @@ writeTextFile rec { # needed for cython export CC='${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc' + export CXX='${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++' # 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") [ @@ -178,6 +179,7 @@ writeTextFile rec { mpfr.dev ]) }' + export CXXFLAGS=$CFLAGS export SAGE_LIB='${sagelib}/${python3.sitePackages}'