summary refs log tree commit diff
path: root/pkgs/applications/science/math
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/science/math')
-rw-r--r--pkgs/applications/science/math/R/default.nix11
-rw-r--r--pkgs/applications/science/math/geogebra/default.nix4
-rw-r--r--pkgs/applications/science/math/giac/default.nix13
-rw-r--r--pkgs/applications/science/math/glsurf/default.nix8
-rw-r--r--pkgs/applications/science/math/gmsh/default.nix4
-rw-r--r--pkgs/applications/science/math/mathematica/default.nix5
-rw-r--r--pkgs/applications/science/math/pspp/default.nix5
-rw-r--r--pkgs/applications/science/math/qalculate-gtk/default.nix4
-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
-rw-r--r--pkgs/applications/science/math/yacas/default.nix4
17 files changed, 114 insertions, 48 deletions
diff --git a/pkgs/applications/science/math/R/default.nix b/pkgs/applications/science/math/R/default.nix
index bc0f7ed8831..517fc9d7b32 100644
--- a/pkgs/applications/science/math/R/default.nix
+++ b/pkgs/applications/science/math/R/default.nix
@@ -11,11 +11,11 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "R-3.6.1";
+  name = "R-3.6.2";
 
   src = fetchurl {
     url = "https://cran.r-project.org/src/base/R-3/${name}.tar.gz";
-    sha256 = "128kifbq0w25y8aq77w289ddax5i5w2djcfsqgffrb3i7syrxajv";
+    sha256 = "0m69pfi0nxyriyb2yz74xfzaxwfkinnf9kpvf1rz727vvmfa8rdx";
   };
 
   dontUseImakeConfigure = true;
@@ -23,9 +23,8 @@ stdenv.mkDerivation rec {
   buildInputs = [
     bzip2 gfortran libX11 libXmu libXt libXt libjpeg libpng libtiff ncurses
     pango pcre perl readline texLive xz zlib less texinfo graphviz icu
-    pkgconfig bison imake which openblas curl
-  ] ++ stdenv.lib.optionals (!stdenv.isDarwin) [ tcl tk ]
-    ++ stdenv.lib.optionals stdenv.isDarwin [ Cocoa Foundation libobjc libcxx ]
+    pkgconfig bison imake which openblas curl tcl tk
+  ] ++ stdenv.lib.optionals stdenv.isDarwin [ Cocoa Foundation libobjc libcxx ]
     ++ stdenv.lib.optional javaSupport jdk;
 
   patches = [
@@ -62,8 +61,6 @@ stdenv.mkDerivation rec {
       RANLIB=$(type -p ranlib)
       R_SHELL="${stdenv.shell}"
   '' + stdenv.lib.optionalString stdenv.isDarwin ''
-      --without-tcltk
-      --without-aqua
       --disable-R-framework
       OBJC="clang"
       CPPFLAGS="-isystem ${libcxx}/include/c++/v1"
diff --git a/pkgs/applications/science/math/geogebra/default.nix b/pkgs/applications/science/math/geogebra/default.nix
index 0ab4c169944..75c49591675 100644
--- a/pkgs/applications/science/math/geogebra/default.nix
+++ b/pkgs/applications/science/math/geogebra/default.nix
@@ -2,7 +2,7 @@
 
 stdenv.mkDerivation rec {
   pname = "geogebra";
-  version = "5-0-560-0";
+  version = "5-0-569-0";
 
   preferLocalBuild = true;
 
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
       "https://download.geogebra.org/installers/5.0/GeoGebra-Linux-Portable-${version}.tar.bz2"
       "http://web.archive.org/https://download.geogebra.org/installers/5.0/GeoGebra-Linux-Portable-${version}.tar.bz2"
     ];
-    sha256 = "16w6z3axzb9g51w4cbyf5zj6gpm9qab65xbw1184v5wym5llf4iw";
+    sha256 = "16bav6hf80l21gnhdjll82hpjqi7kr3w74jcq7mnf24acmcn70qm";
   };
 
   srcIcon = fetchurl {
diff --git a/pkgs/applications/science/math/giac/default.nix b/pkgs/applications/science/math/giac/default.nix
index 90b1b367a7c..b3777528ecd 100644
--- a/pkgs/applications/science/math/giac/default.nix
+++ b/pkgs/applications/science/math/giac/default.nix
@@ -1,14 +1,13 @@
-{ stdenv, fetchurl, fetchpatch, texlive, bison, flex, liblapack
+{ stdenv, lib, fetchurl, fetchpatch, texlive, bison, flex, liblapack
 , gmp, mpfr, pari, ntl, gsl, blas, mpfi, ecm, glpk, nauty
 , readline, gettext, libpng, libao, gfortran, perl
-, enableGUI ? false, libGLU_combined ? null, xorg ? null, fltk ? null
+, enableGUI ? false, libGL ? null, libGLU ? null, xorg ? null, fltk ? null
 }:
 
-assert enableGUI -> libGLU_combined != null && xorg != null && fltk != null;
+assert enableGUI -> libGLU != null && libGL != null && xorg != null && fltk != null;
 
 stdenv.mkDerivation rec {
-  name = "${attr}-${version}";
-  attr = if enableGUI then "giac-with-xcas" else "giac";
+  pname = "giac${lib.optionalString enableGUI "-with-xcas"}";
   version = "1.5.0-21"; # TODO try to remove preCheck phase on upgrade
 
   src = fetchurl {
@@ -44,7 +43,7 @@ stdenv.mkDerivation rec {
     (stdenv.lib.getLib gfortran.cc)
     liblapack
   ] ++ stdenv.lib.optionals enableGUI [
-    libGLU_combined fltk xorg.libX11
+    libGL libGLU fltk xorg.libX11
   ];
 
   /* fixes:
@@ -104,7 +103,7 @@ stdenv.mkDerivation rec {
     description = "A free computer algebra system (CAS)";
     homepage = "https://www-fourier.ujf-grenoble.fr/~parisse/giac.html";
     license = licenses.gpl3Plus;
-    platforms = platforms.unix;
+    platforms = platforms.linux ++ (optionals (!enableGUI) platforms.darwin);
     maintainers = [ maintainers.symphorien ];
   };
 }
diff --git a/pkgs/applications/science/math/glsurf/default.nix b/pkgs/applications/science/math/glsurf/default.nix
index 1cd5e364208..c11110e4bc4 100644
--- a/pkgs/applications/science/math/glsurf/default.nix
+++ b/pkgs/applications/science/math/glsurf/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, ocamlPackages, libGLU_combined, freeglut
+{ stdenv, fetchurl, ocamlPackages, libGLU, libGL, freeglut
 , libmysqlclient, mpfr, gmp, libtiff, libjpeg, libpng, giflib
 }:
 
@@ -6,11 +6,11 @@ stdenv.mkDerivation {
   name = "glsurf-3.3.1";
 
   src = fetchurl {
-    url = "https://lama.univ-savoie.fr/~raffalli/glsurf/glsurf-3.3.1.tar.gz";
+    url = "https://raffalli.eu/~christophe/glsurf/glsurf-3.3.1.tar.gz";
     sha256 = "0w8xxfnw2snflz8wdr2ca9f5g91w5vbyp1hwlx1v7vg83d4bwqs7";
   };
 
-  buildInputs = [ freeglut libGLU_combined libmysqlclient mpfr gmp
+  buildInputs = [ freeglut libGLU libGL libmysqlclient mpfr gmp
     libtiff libjpeg libpng giflib ]
   ++ (with ocamlPackages; [
     ocaml findlib ocaml_mysql lablgl camlimages_4_0 mlgmpidl
@@ -24,7 +24,7 @@ stdenv.mkDerivation {
   '';
 
   meta = {
-    homepage = http://www.lama.univ-savoie.fr/~raffalli/glsurf;
+    homepage = https://raffalli.eu/~christophe/glsurf/;
     description = "A program to draw implicit surfaces and curves";
     license = stdenv.lib.licenses.lgpl21;
   };
diff --git a/pkgs/applications/science/math/gmsh/default.nix b/pkgs/applications/science/math/gmsh/default.nix
index 1d96c0039ad..66c41bb073a 100644
--- a/pkgs/applications/science/math/gmsh/default.nix
+++ b/pkgs/applications/science/math/gmsh/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, cmake, openblasCompat, gfortran, gmm, fltk, libjpeg
-, zlib, libGLU_combined, libGLU, xorg, opencascade-occt }:
+, zlib, libGL, libGLU, xorg, opencascade-occt }:
 
 stdenv.mkDerivation rec {
   pname = "gmsh";
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     sha256 = "1p7hibmsgv961lfkzdxlgcvmcb0q155m2sp60r97cjsfzhw68g45";
   };
 
-  buildInputs = [ openblasCompat gmm fltk libjpeg zlib libGLU_combined
+  buildInputs = [ openblasCompat gmm fltk libjpeg zlib libGLU libGL
     libGLU xorg.libXrender xorg.libXcursor xorg.libXfixes xorg.libXext
     xorg.libXft xorg.libXinerama xorg.libX11 xorg.libSM xorg.libICE
     opencascade-occt
diff --git a/pkgs/applications/science/math/mathematica/default.nix b/pkgs/applications/science/math/mathematica/default.nix
index ca9a87abe13..7cd1b2eb99f 100644
--- a/pkgs/applications/science/math/mathematica/default.nix
+++ b/pkgs/applications/science/math/mathematica/default.nix
@@ -93,13 +93,16 @@ stdenv.mkDerivation rec {
     # Fix library paths
     cd $out/libexec/Mathematica/Executables
     for path in mathematica MathKernel Mathematica WolframKernel wolfram math; do
-      sed -i -e 's#export LD_LIBRARY_PATH$#export LD_LIBRARY_PATH=${zlib}/lib:\''${LD_LIBRARY_PATH}#' $path
+      sed -i -e "2iexport LD_LIBRARY_PATH=${zlib}/lib:\''${LD_LIBRARY_PATH}\n" $path
     done
 
     # Fix xkeyboard config path for Qt
     for path in mathematica Mathematica; do
       sed -i -e "2iexport QT_XKB_CONFIG_ROOT=\"${xkeyboard_config}/share/X11/xkb\"\n" $path
     done
+
+    # Remove some broken libraries
+    rm $out/libexec/Mathematica/SystemFiles/Libraries/Linux-x86-64/libz.so*
   '';
 
   preFixup = ''
diff --git a/pkgs/applications/science/math/pspp/default.nix b/pkgs/applications/science/math/pspp/default.nix
index c53e87caa9a..3c263916a0e 100644
--- a/pkgs/applications/science/math/pspp/default.nix
+++ b/pkgs/applications/science/math/pspp/default.nix
@@ -1,7 +1,6 @@
 { stdenv, fetchurl, libxml2, readline, zlib, perl, cairo, gtk3, gsl
-, pkgconfig, gtksourceview, pango, gettext
+, pkgconfig, gtksourceview, pango, gettext, dconf
 , makeWrapper, gsettings-desktop-schemas, hicolor-icon-theme
-, gnome3
 }:
 
 stdenv.mkDerivation rec {
@@ -26,7 +25,7 @@ stdenv.mkDerivation rec {
      --prefix XDG_DATA_DIRS : "$out/share" \
      --prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS" \
      --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH" \
-     --prefix GIO_EXTRA_MODULES : "${stdenv.lib.getLib gnome3.dconf}/lib/gio/modules"
+     --prefix GIO_EXTRA_MODULES : "${stdenv.lib.getLib dconf}/lib/gio/modules"
   '';
 
   meta = {
diff --git a/pkgs/applications/science/math/qalculate-gtk/default.nix b/pkgs/applications/science/math/qalculate-gtk/default.nix
index fccd83aa86f..0a300a15d01 100644
--- a/pkgs/applications/science/math/qalculate-gtk/default.nix
+++ b/pkgs/applications/science/math/qalculate-gtk/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "qalculate-gtk";
-  version = "3.5.0";
+  version = "3.6.0";
 
   src = fetchFromGitHub {
     owner = "qalculate";
     repo = "qalculate-gtk";
     rev = "v${version}";
-    sha256 = "0vknp52zyp2c4pxr12pryflyin1hl2dwhkrn5y0r4qh4ndf3ms1m";
+    sha256 = "1b20sjkv853lqii0dpqg10rgcka3cs57zriihyd463n7dq3hsim5";
   };
 
   patchPhase = ''
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
diff --git a/pkgs/applications/science/math/yacas/default.nix b/pkgs/applications/science/math/yacas/default.nix
index bae0d9a18c6..ed680b1b4cd 100644
--- a/pkgs/applications/science/math/yacas/default.nix
+++ b/pkgs/applications/science/math/yacas/default.nix
@@ -5,13 +5,13 @@
 
 stdenv.mkDerivation rec {
   pname = "yacas";
-  version = "1.6.1";
+  version = "1.8.0";
 
   src = fetchFromGitHub {
     owner = "grzegorzmazur";
     repo = "yacas";
     rev = "v${version}";
-    sha256 = "0awvlvf607r4hwl1vkhs6jq2s6ig46c66pmr4vspj2cdnypx99cc";
+    sha256 = "0fwd98dwq6g0md3yhgyl30i377593b8rw6gsvffzvs11g3aqf1ga";
   };
 
   hardeningDisable = [ "format" ];