summary refs log tree commit diff
path: root/pkgs/applications/science/math/sage
diff options
context:
space:
mode:
authorFranz Pletz <fpletz@fnordicwalking.de>2019-12-26 14:16:15 +0100
committerFranz Pletz <fpletz@fnordicwalking.de>2019-12-26 14:17:36 +0100
commit77b6c3cd06a679140fb5a44f81f904497007f333 (patch)
treee8ed1606b326cdafba719cc2a14c527c1b601f2e /pkgs/applications/science/math/sage
parent602bccd1a8262d4e6bd787838d21fc3c2c1c50ba (diff)
parent4d2dd1554618831f0a5b159b8a4dff86612c02a9 (diff)
downloadnixpkgs-77b6c3cd06a679140fb5a44f81f904497007f333.tar
nixpkgs-77b6c3cd06a679140fb5a44f81f904497007f333.tar.gz
nixpkgs-77b6c3cd06a679140fb5a44f81f904497007f333.tar.bz2
nixpkgs-77b6c3cd06a679140fb5a44f81f904497007f333.tar.lz
nixpkgs-77b6c3cd06a679140fb5a44f81f904497007f333.tar.xz
nixpkgs-77b6c3cd06a679140fb5a44f81f904497007f333.tar.zst
nixpkgs-77b6c3cd06a679140fb5a44f81f904497007f333.zip
Merge remote-tracking branch 'origin/master' into gcc-9
Diffstat (limited to 'pkgs/applications/science/math/sage')
-rw-r--r--pkgs/applications/science/math/sage/patches/ignore-cmp-deprecation.patch19
-rw-r--r--pkgs/applications/science/math/sage/patches/ignore-werkzeug-immutable-dict-deprecation.patch12
-rw-r--r--pkgs/applications/science/math/sage/patches/sagenb-cmp-deprecation.patch13
-rw-r--r--pkgs/applications/science/math/sage/pybrial.nix10
-rw-r--r--pkgs/applications/science/math/sage/sage-env.nix25
-rw-r--r--pkgs/applications/science/math/sage/sage-src.nix18
-rw-r--r--pkgs/applications/science/math/sage/sage-tests.nix2
-rw-r--r--pkgs/applications/science/math/sage/sagenb.nix5
8 files changed, 86 insertions, 18 deletions
diff --git a/pkgs/applications/science/math/sage/patches/ignore-cmp-deprecation.patch b/pkgs/applications/science/math/sage/patches/ignore-cmp-deprecation.patch
index 5c1073e13e9..11ca7481961 100644
--- a/pkgs/applications/science/math/sage/patches/ignore-cmp-deprecation.patch
+++ b/pkgs/applications/science/math/sage/patches/ignore-cmp-deprecation.patch
@@ -1,13 +1,24 @@
 diff --git a/src/sage/tests/cmdline.py b/src/sage/tests/cmdline.py
-index bd6b76ab82..f8340a8c66 100644
+index bd6b76ab82..ccf1203dec 100644
 --- a/src/sage/tests/cmdline.py
 +++ b/src/sage/tests/cmdline.py
-@@ -872,7 +872,7 @@ def test_executable(args, input="", timeout=100.0, **kwds):
+@@ -837,8 +837,6 @@ def test_executable(args, input="", timeout=100.0, **kwds):
+         ///
+         4
+         }}}
+-        sage: err # py2
+-        ''
+         sage: ret
+         0
+ 
+@@ -871,8 +869,8 @@ def test_executable(args, input="", timeout=100.0, **kwds):
+         sage: output = tmp_filename(ext='.sws')
          sage: with open(input, 'w') as F:
          ....:     _ = F.write(s)
-         sage: test_executable(["sage", "--rst2sws", input, output]) # py2
+-        sage: test_executable(["sage", "--rst2sws", input, output]) # py2
 -        ('', '', 0)
-+        ('', '...', 0)
++        sage: test_executable(["sage", "--rst2sws", input, output])[2] # py2
++        0
          sage: import tarfile # py2
          sage: f = tarfile.open(output, 'r') # py2
          sage: print(f.extractfile('sage_worksheet/worksheet.html').read()) # py2
diff --git a/pkgs/applications/science/math/sage/patches/ignore-werkzeug-immutable-dict-deprecation.patch b/pkgs/applications/science/math/sage/patches/ignore-werkzeug-immutable-dict-deprecation.patch
new file mode 100644
index 00000000000..c5f95b498d5
--- /dev/null
+++ b/pkgs/applications/science/math/sage/patches/ignore-werkzeug-immutable-dict-deprecation.patch
@@ -0,0 +1,12 @@
+diff --git a/src/sage/all.py b/src/sage/all.py
+index c87c9372e9..862fca4fcc 100644
+--- a/src/sage/all.py
++++ b/src/sage/all.py
+@@ -306,6 +306,7 @@ warnings.filters.remove(('ignore', None, DeprecationWarning, None, 0))
+ # Ignore all deprecations from IPython etc.
+ warnings.filterwarnings('ignore', category=DeprecationWarning,
+     module='.*(IPython|ipykernel|jupyter_client|jupyter_core|nbformat|notebook|ipywidgets|storemagic)')
++warnings.filterwarnings('ignore', category=DeprecationWarning, message=r".*The import 'werkzeug.ImmutableDict' is deprecated")
+ # Ignore collections.abc warnings, there are a lot of them but they are
+ # harmless.
+ warnings.filterwarnings('ignore', category=DeprecationWarning,
diff --git a/pkgs/applications/science/math/sage/patches/sagenb-cmp-deprecation.patch b/pkgs/applications/science/math/sage/patches/sagenb-cmp-deprecation.patch
new file mode 100644
index 00000000000..9f502a66951
--- /dev/null
+++ b/pkgs/applications/science/math/sage/patches/sagenb-cmp-deprecation.patch
@@ -0,0 +1,13 @@
+diff --git a/sagenb/__init__.py b/sagenb/__init__.py
+index 4db0d2cb..2fc5f01e 100644
+--- a/sagenb/__init__.py
++++ b/sagenb/__init__.py
+@@ -1,3 +1,8 @@
+ # -*- coding: utf-8 -*
+   # init
++import warnings
+ from . import storage
++
++# deprecation in attrs, needs to be fixed in twisted
++warnings.filterwarnings('ignore', category=DeprecationWarning,
++    message=r'The usage of `cmp` is deprecated and will be removed.*')
diff --git a/pkgs/applications/science/math/sage/pybrial.nix b/pkgs/applications/science/math/sage/pybrial.nix
index 092a340bb5b..718414126ae 100644
--- a/pkgs/applications/science/math/sage/pybrial.nix
+++ b/pkgs/applications/science/math/sage/pybrial.nix
@@ -1,6 +1,7 @@
 { stdenv
 , fetchFromGitHub
 , buildPythonPackage
+, brial
 }:
 # This has a cyclic dependency with sage. I don't include sage in the
 # buildInputs and let python figure it out at runtime. Because of this,
@@ -9,15 +10,10 @@
 # it).
 buildPythonPackage rec {
     pname = "pyBRiAl";
-    version = "1.2.3";
+    version = brial.version;
 
     # included with BRiAl source
-    src = fetchFromGitHub {
-      owner = "BRiAl";
-      repo = "BRiAl";
-      rev = version;
-      sha256 = "0qy4cwy7qrk4zg151cmws5cglaa866z461cnj9wdnalabs7v7qbg";
-    };
+    src = brial.src;
 
     sourceRoot = "source/sage-brial";
 
diff --git a/pkgs/applications/science/math/sage/sage-env.nix b/pkgs/applications/science/math/sage/sage-env.nix
index 0b67b3cff12..00397239876 100644
--- a/pkgs/applications/science/math/sage/sage-env.nix
+++ b/pkgs/applications/science/math/sage/sage-env.nix
@@ -18,6 +18,12 @@
 , ecl
 , maxima-ecl
 , singular
+, fflas-ffpack
+, givaro
+, gd
+, libpng
+, linbox
+, m4ri
 , giac
 , palp
 , rWrapper
@@ -101,14 +107,21 @@ writeTextFile rec {
   name = "sage-env";
   destination = "/${name}";
   text = ''
-    export PKG_CONFIG_PATH='${lib.concatStringsSep ":" (map (pkg: "${pkg}/lib/pkgconfig") [
-        # This is only needed in the src/sage/misc/cython.py test and I'm not
-        # sure if there's really a usecase for it outside of the tests. However
-        # since singular and openblas are runtime dependencies anyways, it doesn't
-        # really hurt to include.
+    export PKG_CONFIG_PATH='${lib.makeSearchPathOutput "dev" "lib/pkgconfig" [
+        # This should only be needed during build. However, since the  doctests
+        # also test the cython build (for example in src/sage/misc/cython.py),
+        # it is also needed for the testsuite to pass. We could fix the
+        # testsuite instead, but since all the packages are also runtime
+        # dependencies it doesn't really hurt to include them here.
         singular
         openblasCompat
-      ])
+        fflas-ffpack givaro
+        gd
+        libpng zlib
+        gsl
+        linbox
+        m4ri
+      ]
     }'
     export SAGE_ROOT='${sagelib.src}'
     export SAGE_LOCAL='@sage-local@'
diff --git a/pkgs/applications/science/math/sage/sage-src.nix b/pkgs/applications/science/math/sage/sage-src.nix
index c7a3da68b15..4530cbf69f4 100644
--- a/pkgs/applications/science/math/sage/sage-src.nix
+++ b/pkgs/applications/science/math/sage/sage-src.nix
@@ -107,6 +107,24 @@ stdenv.mkDerivation rec {
 
     # ignore a deprecation warning for usage of `cmp` in the attrs library in the doctests
     ./patches/ignore-cmp-deprecation.patch
+
+    # Werkzeug has deprecated ImmutableDict, but it is still used in legacy
+    # sagenb. That's no big issue since sagenb will be removed soon anyways.
+    ./patches/ignore-werkzeug-immutable-dict-deprecation.patch
+
+    # threejs r109 (#28560)
+    (fetchpatch {
+      name = "threejs-r109.patch";
+      url = "https://git.sagemath.org/sage.git/patch?id=fcc11d6effa39f375bc5f4ea5831fb7a2f2767da";
+      sha256 = "0hnmc8ld3bblks0hcjvjjaydkgwdr1cs3dbl2ys4gfq964pjgqwc";
+    })
+
+    # https://trac.sagemath.org/ticket/28911
+    (fetchpatch {
+      name = "sympy-1.5.patch";
+      url = "https://git.sagemath.org/sage.git/patch/?h=c6d0308db15efd611211d26cfcbefbd180fc0831";
+      sha256 = "0nwai2jr22h49km4hx3kwafs3mzsc5kwsv7mqwjf6ibwfx2bbgyq";
+    })
   ];
 
   patches = nixPatches ++ bugfixPatches ++ packageUpgradePatches;
diff --git a/pkgs/applications/science/math/sage/sage-tests.nix b/pkgs/applications/science/math/sage/sage-tests.nix
index 93ec1e33cf6..451edb8f085 100644
--- a/pkgs/applications/science/math/sage/sage-tests.nix
+++ b/pkgs/applications/science/math/sage/sage-tests.nix
@@ -56,6 +56,6 @@ stdenv.mkDerivation {
     export GLIBC_TUNABLES=glibc.malloc.arena_max=4
 
     echo "Running sage tests with arguments ${timeSpecifier} ${patienceSpecifier} ${testArgs}"
-    "sage" -t --nthreads "$NIX_BUILD_CORES" --optional=sage ${timeSpecifier} ${patienceSpecifier} ${testArgs}
+    "sage" -t --timeout=0 --nthreads "$NIX_BUILD_CORES" --optional=sage ${timeSpecifier} ${patienceSpecifier} ${testArgs}
   '';
 }
diff --git a/pkgs/applications/science/math/sage/sagenb.nix b/pkgs/applications/science/math/sage/sagenb.nix
index 03b5b7a3bbf..77b2168ad97 100644
--- a/pkgs/applications/science/math/sage/sagenb.nix
+++ b/pkgs/applications/science/math/sage/sagenb.nix
@@ -26,6 +26,11 @@ buildPythonPackage rec {
     sha256 = "0bxvhr03qh2nsjdfc4pyfiqrn9jhp3vf7irsc9gqx0185jlblbxs";
   };
 
+  patches = [
+    # cmp deprecation in attrs needs to be handled in twisted
+    ./patches/sagenb-cmp-deprecation.patch
+  ];
+
   propagatedBuildInputs = [
     twisted
     flask