about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/science/math
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2022-01-03 23:55:00 +0000
committerAlyssa Ross <hi@alyssa.is>2022-02-19 11:03:39 +0000
commitf4cf97a04cd5d0b86aa46baec9fb228a8f671c03 (patch)
tree28192415ff39a661d0001563bf81cc93fa25d16d /nixpkgs/pkgs/applications/science/math
parentf8422837c9bde058e8f2de37702e7e94b2226040 (diff)
parent18c84ea816348e2a098390101b92d1e39a9dbd45 (diff)
downloadnixlib-f4cf97a04cd5d0b86aa46baec9fb228a8f671c03.tar
nixlib-f4cf97a04cd5d0b86aa46baec9fb228a8f671c03.tar.gz
nixlib-f4cf97a04cd5d0b86aa46baec9fb228a8f671c03.tar.bz2
nixlib-f4cf97a04cd5d0b86aa46baec9fb228a8f671c03.tar.lz
nixlib-f4cf97a04cd5d0b86aa46baec9fb228a8f671c03.tar.xz
nixlib-f4cf97a04cd5d0b86aa46baec9fb228a8f671c03.tar.zst
nixlib-f4cf97a04cd5d0b86aa46baec9fb228a8f671c03.zip
Merge commit '18c84ea816348e2a098390101b92d1e39a9dbd45'
Conflicts:
	nixpkgs/nixos/modules/misc/documentation.nix
	nixpkgs/pkgs/applications/networking/browsers/firefox/packages.nix
	nixpkgs/pkgs/applications/window-managers/sway/default.nix
	nixpkgs/pkgs/build-support/rust/build-rust-package/default.nix
	nixpkgs/pkgs/development/go-modules/generic/default.nix
	nixpkgs/pkgs/development/interpreters/ruby/default.nix
	nixpkgs/pkgs/development/interpreters/ruby/patchsets.nix
	nixpkgs/pkgs/development/libraries/boehm-gc/7.6.6.nix
	nixpkgs/pkgs/development/python-modules/django-mailman3/default.nix
	nixpkgs/pkgs/servers/mail/mailman/web.nix
	nixpkgs/pkgs/top-level/aliases.nix
	nixpkgs/pkgs/top-level/all-packages.nix
	nixpkgs/pkgs/top-level/impure.nix
Diffstat (limited to 'nixpkgs/pkgs/applications/science/math')
-rw-r--r--nixpkgs/pkgs/applications/science/math/R/default.nix13
-rw-r--r--nixpkgs/pkgs/applications/science/math/R/skip-check-for-aarch64.patch11
-rw-r--r--nixpkgs/pkgs/applications/science/math/bcal/default.nix4
-rw-r--r--nixpkgs/pkgs/applications/science/math/calc/default.nix4
-rw-r--r--nixpkgs/pkgs/applications/science/math/cemu/default.nix8
-rw-r--r--nixpkgs/pkgs/applications/science/math/csdp/default.nix7
-rw-r--r--nixpkgs/pkgs/applications/science/math/fricas/default.nix6
-rw-r--r--nixpkgs/pkgs/applications/science/math/geogebra/default.nix4
-rw-r--r--nixpkgs/pkgs/applications/science/math/geogebra/geogebra6.nix14
-rw-r--r--nixpkgs/pkgs/applications/science/math/glsurf/default.nix32
-rw-r--r--nixpkgs/pkgs/applications/science/math/gmsh/default.nix4
-rw-r--r--nixpkgs/pkgs/applications/science/math/gretl/default.nix4
-rw-r--r--nixpkgs/pkgs/applications/science/math/jags/default.nix12
-rw-r--r--nixpkgs/pkgs/applications/science/math/mathematica/9.nix11
-rw-r--r--nixpkgs/pkgs/applications/science/math/mathematica/default.nix11
-rw-r--r--nixpkgs/pkgs/applications/science/math/mathematica/l10ns.nix53
-rw-r--r--nixpkgs/pkgs/applications/science/math/maxima/default.nix55
-rw-r--r--nixpkgs/pkgs/applications/science/math/msieve/default.nix9
-rw-r--r--nixpkgs/pkgs/applications/science/math/mxnet/default.nix33
-rw-r--r--nixpkgs/pkgs/applications/science/math/nasc/default.nix1
-rw-r--r--nixpkgs/pkgs/applications/science/math/pari/default.nix30
-rw-r--r--nixpkgs/pkgs/applications/science/math/pari/gp2c.nix16
-rw-r--r--nixpkgs/pkgs/applications/science/math/pari/rnfdisc.patch51
-rw-r--r--nixpkgs/pkgs/applications/science/math/pcalc/default.nix6
-rw-r--r--nixpkgs/pkgs/applications/science/math/perseus/default.nix4
-rw-r--r--nixpkgs/pkgs/applications/science/math/polymake/default.nix4
-rw-r--r--nixpkgs/pkgs/applications/science/math/programmer-calculator/default.nix4
-rw-r--r--nixpkgs/pkgs/applications/science/math/qalculate-gtk/default.nix6
-rw-r--r--nixpkgs/pkgs/applications/science/math/ries/default.nix7
-rw-r--r--nixpkgs/pkgs/applications/science/math/sage/default.nix16
-rw-r--r--nixpkgs/pkgs/applications/science/math/sage/env-locations.nix9
-rw-r--r--nixpkgs/pkgs/applications/science/math/sage/patches/fonttools-deprecation-warnings.patch39
-rw-r--r--nixpkgs/pkgs/applications/science/math/sage/sage-env.nix7
-rw-r--r--nixpkgs/pkgs/applications/science/math/sage/sage-src.nix54
-rw-r--r--nixpkgs/pkgs/applications/science/math/sage/sage-with-env.nix4
-rw-r--r--nixpkgs/pkgs/applications/science/math/sage/sagedoc.nix6
-rw-r--r--nixpkgs/pkgs/applications/science/math/sage/sagelib.nix6
-rw-r--r--nixpkgs/pkgs/applications/science/math/scotch/default.nix4
-rw-r--r--nixpkgs/pkgs/applications/science/math/singular/default.nix7
-rw-r--r--nixpkgs/pkgs/applications/science/math/singular/disable-vspace-on-aarch64.patch15
-rw-r--r--nixpkgs/pkgs/applications/science/math/singular/vspace-MAX_PROCESS.patch35
-rw-r--r--nixpkgs/pkgs/applications/science/math/speedcrunch/default.nix16
-rw-r--r--nixpkgs/pkgs/applications/science/math/wxmaxima/default.nix31
-rw-r--r--nixpkgs/pkgs/applications/science/math/yacas/default.nix69
-rw-r--r--nixpkgs/pkgs/applications/science/math/yacas/fix-test-script.patch26
-rw-r--r--nixpkgs/pkgs/applications/science/math/yacas/jsoncpp-fix-include.patch63
46 files changed, 571 insertions, 260 deletions
diff --git a/nixpkgs/pkgs/applications/science/math/R/default.nix b/nixpkgs/pkgs/applications/science/math/R/default.nix
index c26964bb3144..d08078c356e1 100644
--- a/nixpkgs/pkgs/applications/science/math/R/default.nix
+++ b/nixpkgs/pkgs/applications/science/math/R/default.nix
@@ -14,11 +14,11 @@ assert (!blas.isILP64) && (!lapack.isILP64);
 
 stdenv.mkDerivation rec {
   pname = "R";
-  version = "4.1.1";
+  version = "4.1.2";
 
   src = fetchurl {
     url = "https://cran.r-project.org/src/base/R-${lib.versions.major version}/${pname}-${version}.tar.gz";
-    sha256 = "0r6kpnxjbvb7gdfg4m1z8zc6xd225vw81wrnf05ps9ajawk06pji";
+    sha256 = "sha256-IDYiXp9yB9TOCX5Ulyrs2qi0DX2ZEc0mSR+sWg+rOK8=";
   };
 
   dontUseImakeConfigure = true;
@@ -31,14 +31,17 @@ stdenv.mkDerivation rec {
 
   patches = [
     ./no-usr-local-search-paths.patch
-    ./skip-check-for-aarch64.patch
   ];
 
-  prePatch = lib.optionalString stdenv.isDarwin ''
+  # Test of the examples for package 'tcltk' fails in Darwin sandbox. See:
+  # https://github.com/NixOS/nixpkgs/issues/146131
+  postPatch = lib.optionalString stdenv.isDarwin ''
     substituteInPlace configure \
       --replace "-install_name libRblas.dylib" "-install_name $out/lib/R/lib/libRblas.dylib" \
       --replace "-install_name libRlapack.dylib" "-install_name $out/lib/R/lib/libRlapack.dylib" \
       --replace "-install_name libR.dylib" "-install_name $out/lib/R/lib/libR.dylib"
+    substituteInPlace tests/Examples/Makefile.in \
+      --replace "test-Examples: test-Examples-Base" "test-Examples:" # do not test the examples
   '';
 
   dontDisableStatic = static;
@@ -119,6 +122,6 @@ stdenv.mkDerivation rec {
 
     platforms = platforms.all;
 
-    maintainers = with maintainers; teams.sage.members;
+    maintainers = with maintainers; [ jbedo ] ++ teams.sage.members;
   };
 }
diff --git a/nixpkgs/pkgs/applications/science/math/R/skip-check-for-aarch64.patch b/nixpkgs/pkgs/applications/science/math/R/skip-check-for-aarch64.patch
deleted file mode 100644
index 8721bf6b422d..000000000000
--- a/nixpkgs/pkgs/applications/science/math/R/skip-check-for-aarch64.patch
+++ /dev/null
@@ -1,11 +0,0 @@
-diff -ur a/src/library/stats/man/nls.Rd b/src/library/stats/man/nls.Rd
---- a/src/library/stats/man/nls.Rd   2021-05-21 19:15:02.000000000 -0300
-+++ b/src/library/stats/man/nls.Rd   2021-08-12 12:39:00.094758280 -0300
-@@ -287,7 +287,7 @@
- options(digits = 10) # more accuracy for 'trace'
- ## IGNORE_RDIFF_BEGIN
- try(nlm1 <- update(nlmod, control = list(tol = 1e-7))) # where central diff. work here:
--   (nlm2 <- update(nlmod, control = list(tol = 8e-8, nDcentral=TRUE), trace=TRUE))
-+   (nlm2 <- update(nlmod, control = list(tol = 8e-8, nDcentral=TRUE, warnOnly=TRUE), trace=TRUE))
- ## --> convergence tolerance  4.997e-8 (in 11 iter.)
- ## IGNORE_RDIFF_END
diff --git a/nixpkgs/pkgs/applications/science/math/bcal/default.nix b/nixpkgs/pkgs/applications/science/math/bcal/default.nix
index 1494b5324872..85bcd1b2d2fc 100644
--- a/nixpkgs/pkgs/applications/science/math/bcal/default.nix
+++ b/nixpkgs/pkgs/applications/science/math/bcal/default.nix
@@ -8,13 +8,13 @@
 
 stdenv.mkDerivation rec {
   pname = "bcal";
-  version = "2.2";
+  version = "2.3";
 
   src = fetchFromGitHub {
     owner = "jarun";
     repo = "bcal";
     rev = "v${version}";
-    sha256 = "4vR5rcbNkoEdSRNoMH9qMHP3iWFxejkVfXNiYfwbo/A=";
+    sha256 = "sha256-1k8Q+I1Mc196QL+x4yXzRi7WLBf30U4sJyl0rXisW7k=";
   };
 
   buildInputs = [ readline ];
diff --git a/nixpkgs/pkgs/applications/science/math/calc/default.nix b/nixpkgs/pkgs/applications/science/math/calc/default.nix
index f209e2de8c3e..5a9f1ef93fb8 100644
--- a/nixpkgs/pkgs/applications/science/math/calc/default.nix
+++ b/nixpkgs/pkgs/applications/science/math/calc/default.nix
@@ -3,14 +3,14 @@
 
 stdenv.mkDerivation rec {
   pname = "calc";
-  version = "2.13.0.1";
+  version = "2.14.0.13";
 
   src = fetchurl {
     urls = [
       "https://github.com/lcn2/calc/releases/download/${version}/${pname}-${version}.tar.bz2"
       "http://www.isthe.com/chongo/src/calc/${pname}-${version}.tar.bz2"
     ];
-    sha256 = "sha256-auU49XeFxXAacBEszwB6tVU6vTMq4t6q2vVk9AHHNK0=";
+    sha256 = "sha256-naNBismaWnzLjlUy49Rz9OfkhUcFdbnWxs917ogxTjk=";
   };
 
   postPatch = ''
diff --git a/nixpkgs/pkgs/applications/science/math/cemu/default.nix b/nixpkgs/pkgs/applications/science/math/cemu/default.nix
index 9d56ac70d921..35b9200a4774 100644
--- a/nixpkgs/pkgs/applications/science/math/cemu/default.nix
+++ b/nixpkgs/pkgs/applications/science/math/cemu/default.nix
@@ -1,6 +1,5 @@
 { fetchFromGitHub
 , lib
-, mkDerivation
 , SDL2
 , libGL
 , libarchive
@@ -10,9 +9,11 @@
 , git
 , libpng_apng
 , pkg-config
+, wrapQtAppsHook
+, stdenv
 }:
 
-mkDerivation rec {
+stdenv.mkDerivation rec {
   pname = "CEmu";
   version = "1.3";
   src = fetchFromGitHub {
@@ -26,6 +27,7 @@ mkDerivation rec {
   nativeBuildInputs = [
     qmake
     git
+    wrapQtAppsHook
     pkg-config
   ];
 
@@ -40,6 +42,7 @@ mkDerivation rec {
 
   qmakeFlags = [
     "gui/qt"
+    "CONFIG+=ltcg"
   ];
 
   meta = with lib; {
@@ -49,5 +52,6 @@ mkDerivation rec {
     license = licenses.gpl3;
     maintainers = with maintainers; [ luc65r ];
     platforms = [ "x86_64-linux" "x86_64-darwin" ];
+    broken = stdenv.isDarwin;
   };
 }
diff --git a/nixpkgs/pkgs/applications/science/math/csdp/default.nix b/nixpkgs/pkgs/applications/science/math/csdp/default.nix
index 02c4c134f92e..6ce03008d3a9 100644
--- a/nixpkgs/pkgs/applications/science/math/csdp/default.nix
+++ b/nixpkgs/pkgs/applications/science/math/csdp/default.nix
@@ -1,10 +1,11 @@
 { lib, stdenv, fetchurl, blas, gfortran, lapack }:
 
-stdenv.mkDerivation {
-  name = "csdp-6.1.1";
+stdenv.mkDerivation rec {
+  pname = "csdp";
+  version = "6.1.1";
 
   src = fetchurl {
-    url = "https://www.coin-or.org/download/source/Csdp/Csdp-6.1.1.tgz";
+    url = "https://www.coin-or.org/download/source/Csdp/Csdp-${version}.tgz";
     sha256 = "1f9ql6cjy2gwiyc51ylfan24v1ca9sjajxkbhszlds1lqmma8n05";
   };
 
diff --git a/nixpkgs/pkgs/applications/science/math/fricas/default.nix b/nixpkgs/pkgs/applications/science/math/fricas/default.nix
index a29d40367287..79d5664426be 100644
--- a/nixpkgs/pkgs/applications/science/math/fricas/default.nix
+++ b/nixpkgs/pkgs/applications/science/math/fricas/default.nix
@@ -1,15 +1,15 @@
 { lib, stdenv, fetchurl, sbcl, libX11, libXpm, libICE, libSM, libXt, libXau, libXdmcp }:
 
 let
-  version = "1.3.4";
+  version = "1.3.7";
   name = "fricas-" + version;
 in
 stdenv.mkDerivation {
   inherit name;
 
   src = fetchurl {
-    url    = "mirror://sourceforge/fricas/files/fricas/${version}/${name}-full.tar.bz2";
-    sha256 = "156k9az1623y5808j845c56z2nvvdrm48dzg1v0ivpplyl7vp57x";
+    url = "mirror://sourceforge/fricas/fricas/${version}/${name}-full.tar.bz2";
+    sha256 = "sha256-cOqMvSe3ef/ZeVy5cj/VU/aTRtxgfxZfRbE4lWE5TU4=";
   };
 
   buildInputs = [ sbcl libX11 libXpm libICE libSM libXt libXau libXdmcp ];
diff --git a/nixpkgs/pkgs/applications/science/math/geogebra/default.nix b/nixpkgs/pkgs/applications/science/math/geogebra/default.nix
index 124caf4180c8..7ebfe2030d4a 100644
--- a/nixpkgs/pkgs/applications/science/math/geogebra/default.nix
+++ b/nixpkgs/pkgs/applications/science/math/geogebra/default.nix
@@ -1,7 +1,7 @@
 { lib, stdenv, fetchurl, jre, makeDesktopItem, makeWrapper, unzip, language ? "en_US" }:
 let
   pname = "geogebra";
-  version = "5-0-662-0";
+  version = "5-0-680-0";
 
   srcIcon = fetchurl {
     url = "http://static.geogebra.org/images/geogebra-logo.svg";
@@ -43,7 +43,7 @@ let
         "https://download.geogebra.org/installers/5.0/GeoGebra-Linux-Portable-${version}.tar.bz2"
         "https://web.archive.org/web/20210910014320/https://download.geogebra.org/installers/5.0/GeoGebra-Linux-Portable-${version}.tar.bz2"
       ];
-      sha256 = "08gaiid5qgdznd9f8hb32m4qa90z7qlcx1cs7y0jr9ilnbmrgs8n";
+      sha256 = "0gdvajf220pm1w3nxi2fymxjx2vl978pz7ffn5gr72cx8f2956lm";
     };
 
     nativeBuildInputs = [ makeWrapper ];
diff --git a/nixpkgs/pkgs/applications/science/math/geogebra/geogebra6.nix b/nixpkgs/pkgs/applications/science/math/geogebra/geogebra6.nix
index 8163fe5478fa..76d178b7e490 100644
--- a/nixpkgs/pkgs/applications/science/math/geogebra/geogebra6.nix
+++ b/nixpkgs/pkgs/applications/science/math/geogebra/geogebra6.nix
@@ -1,7 +1,7 @@
-{ lib, stdenv, unzip, fetchurl, electron_6, makeWrapper, geogebra }:
+{ lib, stdenv, unzip, fetchurl, electron, makeWrapper, geogebra }:
 let
   pname = "geogebra";
-  version = "6-0-644-0";
+  version = "6-0-676-0";
 
   srcIcon = geogebra.srcIcon;
   desktopItem = geogebra.desktopItem;
@@ -18,9 +18,9 @@ let
     src = fetchurl {
       urls = [
         "https://download.geogebra.org/installers/6.0/GeoGebra-Linux64-Portable-${version}.zip"
-        "https://web.archive.org/web/20210604132845/https://download.geogebra.org/installers/6.0/GeoGebra-Linux64-Portable-${version}.zip"
+        "https://web.archive.org/web/20211123222708/https://download.geogebra.org/installers/6.0/GeoGebra-Linux64-Portable-${version}.zip"
       ];
-      sha256 = "bbe9e1a35abacfd560c0b7aa1ab975853e6adac08608bb70cd80261179e3f922";
+      sha256 = "0wn90n2nd476rkf83gk9vvcpbjflkrvyri50pnmv52j76n023hmm";
     };
 
     dontConfigure = true;
@@ -38,7 +38,7 @@ let
     installPhase = ''
       mkdir -p $out/libexec/geogebra/ $out/bin
       cp -r GeoGebra-linux-x64/{resources,locales} "$out/"
-      makeWrapper ${lib.getBin electron_6}/bin/electron $out/bin/geogebra --add-flags "$out/resources/app"
+      makeWrapper ${lib.getBin electron}/bin/electron $out/bin/geogebra --add-flags "$out/resources/app"
       install -Dm644 "${desktopItem}/share/applications/"* \
         -t $out/share/applications/
 
@@ -53,9 +53,9 @@ let
     src = fetchurl {
       urls = [
         "https://download.geogebra.org/installers/6.0/GeoGebra-Classic-6-MacOS-Portable-${version}.zip"
-        "https://web.archive.org/web/20210406084052/https://download.geogebra.org/installers/6.0/GeoGebra-Classic-6-MacOS-Portable-${version}.zip"
+        "https://web.archive.org/web/20211124143625/https://download.geogebra.org/installers/6.0/GeoGebra-Classic-6-MacOS-Portable-${version}.zip"
       ];
-      sha256 = "0fa680yyz4nry1xvb9v6qqh1mib6grff5d3p7d90nyjlv101p262";
+      sha256 = "1dwv2f94a1c2y10lmy0i66cafynalp7dkqgnpk4f0mk6pir2fdgj";
     };
 
     dontUnpack = true;
diff --git a/nixpkgs/pkgs/applications/science/math/glsurf/default.nix b/nixpkgs/pkgs/applications/science/math/glsurf/default.nix
index 58b2a617bd63..808d89ef9636 100644
--- a/nixpkgs/pkgs/applications/science/math/glsurf/default.nix
+++ b/nixpkgs/pkgs/applications/science/math/glsurf/default.nix
@@ -1,5 +1,13 @@
-{ lib, stdenv, fetchurl, ocamlPackages, makeWrapper
-, libGLU, libGL, freeglut, mpfr, gmp
+{ lib
+, stdenv
+, fetchurl
+, ocamlPackages
+, makeWrapper
+, libGLU
+, libGL
+, freeglut
+, mpfr
+, gmp
 , pkgsHostTarget
 }:
 
@@ -7,24 +15,32 @@ let
   inherit (pkgsHostTarget.targetPackages.stdenv) cc;
 in
 
-stdenv.mkDerivation {
-  name = "glsurf-3.3.1";
+stdenv.mkDerivation rec {
+  pname = "glsurf";
+  version = "3.3.1";
 
   src = fetchurl {
-    url = "https://raffalli.eu/~christophe/glsurf/glsurf-3.3.1.tar.gz";
+    url = "https://raffalli.eu/~christophe/glsurf/glsurf-${version}.tar.gz";
     sha256 = "0w8xxfnw2snflz8wdr2ca9f5g91w5vbyp1hwlx1v7vg83d4bwqs7";
   };
 
   nativeBuildInputs = [
     makeWrapper
   ] ++ (with ocamlPackages; [
-    ocaml findlib
+    ocaml
+    findlib
   ]);
 
   buildInputs = [
-    freeglut libGL libGLU mpfr gmp
+    freeglut
+    libGL
+    libGLU
+    mpfr
+    gmp
   ] ++ (with ocamlPackages; [
-    camlp4 lablgl camlimages_4_2_4
+    camlp4
+    lablgl
+    camlimages_4_2_4
   ]);
 
   postPatch = ''
diff --git a/nixpkgs/pkgs/applications/science/math/gmsh/default.nix b/nixpkgs/pkgs/applications/science/math/gmsh/default.nix
index 84f7ca72a3c8..0a48d813e915 100644
--- a/nixpkgs/pkgs/applications/science/math/gmsh/default.nix
+++ b/nixpkgs/pkgs/applications/science/math/gmsh/default.nix
@@ -5,11 +5,11 @@ assert (!blas.isILP64) && (!lapack.isILP64);
 
 stdenv.mkDerivation rec {
   pname = "gmsh";
-  version = "4.8.4";
+  version = "4.9.0";
 
   src = fetchurl {
     url = "http://gmsh.info/src/gmsh-${version}-source.tgz";
-    sha256 = "sha256-dg29wHLqo8gtBmxbo7BurN0zBOsqlzc/5K2pUJ8Las4=";
+    sha256 = "sha256-uO8TPJtm/+Et8XR+ctSs8Z8esenNlesPV3y8QIHZvqM=";
   };
 
   buildInputs = [ blas lapack gmm fltk libjpeg zlib libGLU libGL
diff --git a/nixpkgs/pkgs/applications/science/math/gretl/default.nix b/nixpkgs/pkgs/applications/science/math/gretl/default.nix
index 450021925bde..175add544b5c 100644
--- a/nixpkgs/pkgs/applications/science/math/gretl/default.nix
+++ b/nixpkgs/pkgs/applications/science/math/gretl/default.nix
@@ -3,11 +3,11 @@
 
 stdenv.mkDerivation rec {
   pname = "gretl";
-  version = "2021b";
+  version = "2021d";
 
   src = fetchurl {
     url = "mirror://sourceforge/gretl/${pname}-${version}.tar.xz";
-    sha256 = "sha256-3KSAA0UPx3cqMXf/G5nrlCfLjWcDiGtzvJe/syRyE6c=";
+    sha256 = "sha256-zij337P/MemCwvMah2bUE3odv0Kf/KW6fUl2OgMzjuI=";
   };
 
   buildInputs = [
diff --git a/nixpkgs/pkgs/applications/science/math/jags/default.nix b/nixpkgs/pkgs/applications/science/math/jags/default.nix
index 5c0de33a71ae..3ddcd6206d68 100644
--- a/nixpkgs/pkgs/applications/science/math/jags/default.nix
+++ b/nixpkgs/pkgs/applications/science/math/jags/default.nix
@@ -1,9 +1,11 @@
-{lib, stdenv, fetchurl, gfortran, blas, lapack}:
+{ lib, stdenv, fetchurl, gfortran, blas, lapack }:
 
 stdenv.mkDerivation rec {
-  name = "JAGS-4.3.0";
+  pname = "JAGS";
+  version = "4.3.0";
+
   src = fetchurl {
-    url = "mirror://sourceforge/mcmc-jags/${name}.tar.gz";
+    url = "mirror://sourceforge/mcmc-jags/JAGS-${version}.tar.gz";
     sha256 = "1z3icccg2ic56vmhyrpinlsvpq7kcaflk1731rgpvz9bk1bxvica";
   };
 
@@ -15,8 +17,8 @@ stdenv.mkDerivation rec {
 
   meta = with lib; {
     description = "Just Another Gibbs Sampler";
-    license     = licenses.gpl2;
-    homepage    = "http://mcmc-jags.sourceforge.net";
+    license = licenses.gpl2;
+    homepage = "http://mcmc-jags.sourceforge.net";
     maintainers = [ maintainers.andres ];
     platforms = platforms.unix;
   };
diff --git a/nixpkgs/pkgs/applications/science/math/mathematica/9.nix b/nixpkgs/pkgs/applications/science/math/mathematica/9.nix
index 88db3c4b2e92..90a7ada99504 100644
--- a/nixpkgs/pkgs/applications/science/math/mathematica/9.nix
+++ b/nixpkgs/pkgs/applications/science/math/mathematica/9.nix
@@ -1,4 +1,5 @@
-{ lib, stdenv
+{ lib
+, stdenv
 , coreutils
 , patchelf
 , requireFile
@@ -22,11 +23,11 @@ let
       throw "Mathematica requires i686-linux or x86_64 linux";
 in
 stdenv.mkDerivation rec {
-
-  name = "mathematica-9.0.0";
+  pname = "mathematica";
+  version = "9.0.0";
 
   src = requireFile {
-    name = "Mathematica_9.0.0_LINUX.sh";
+    name = "Mathematica_${version}_LINUX.sh";
     message = ''
       This nix expression requires that Mathematica_9.0.0_LINUX.sh is
       already part of the store. Find the file on your Mathematica CD
@@ -61,7 +62,7 @@ stdenv.mkDerivation rec {
 
   ldpath = lib.makeLibraryPath buildInputs
     + lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux")
-      (":" + lib.makeSearchPathOutput "lib" "lib64" buildInputs);
+    (":" + lib.makeSearchPathOutput "lib" "lib64" buildInputs);
 
   phases = "unpackPhase installPhase fixupPhase";
 
diff --git a/nixpkgs/pkgs/applications/science/math/mathematica/default.nix b/nixpkgs/pkgs/applications/science/math/mathematica/default.nix
index 10301f062e57..af8826388977 100644
--- a/nixpkgs/pkgs/applications/science/math/mathematica/default.nix
+++ b/nixpkgs/pkgs/applications/science/math/mathematica/default.nix
@@ -90,7 +90,16 @@ stdenv.mkDerivation rec {
     cd Installer
     # don't restrict PATH, that has already been done
     sed -i -e 's/^PATH=/# PATH=/' MathInstaller
-    sed -i -e 's/\/bin\/bash/\/bin\/sh/' MathInstaller
+
+    # Fix the installation script as follows:
+    # 1. Adjust the shebang
+    # 2. Use the wrapper in the desktop items
+    substituteInPlace MathInstaller \
+      --replace "/bin/bash" "/bin/sh" \
+      --replace "Executables/Mathematica" "../../bin/mathematica"
+
+    # Install the desktop items
+    export XDG_DATA_HOME="$out/share"
 
     echo "=== Running MathInstaller ==="
     ./MathInstaller -auto -createdir=y -execdir=$out/bin -targetdir=$out/libexec/Mathematica -silent
diff --git a/nixpkgs/pkgs/applications/science/math/mathematica/l10ns.nix b/nixpkgs/pkgs/applications/science/math/mathematica/l10ns.nix
index 7de63c287eaa..474c8d1ea060 100644
--- a/nixpkgs/pkgs/applications/science/math/mathematica/l10ns.nix
+++ b/nixpkgs/pkgs/applications/science/math/mathematica/l10ns.nix
@@ -8,31 +8,76 @@ let allVersions = with lib; flip map
   # N.B. Versions in this list should be ordered from newest to oldest.
   [
     {
+      version = "13.0.0";
+      lang = "en";
+      language = "English";
+      sha256 = "15bbad39a5995031325d1d178f63b00e71706d3ec9001eba6d1681fbc991d3e1";
+      installer = "Mathematica_13.0.0_BNDL_LINUX.sh";
+    }
+    {
       version = "12.3.1";
       lang = "en";
       language = "English";
       sha256 = "51b9cab12fd91b009ea7ad4968a2c8a59e94dc55d2e6cc1d712acd5ba2c4d509";
+      installer = "Mathematica_12.3.1_LINUX.sh";
+    }
+    {
+      version = "12.3.0";
+      lang = "en";
+      language = "English";
+      sha256 = "045df045f6e796ded59f64eb2e0f1949ac88dcba1d5b6e05fb53ea0a4aed7215";
+      installer = "Mathematica_12.3.0_LINUX.sh";
+    }
+    {
+      version = "12.2.0";
+      lang = "en";
+      language = "English";
+      sha256 = "3b6676a203c6adb7e9c418a5484b037974287b5be09c64e7dfea74ddc0e400d7";
+      installer = "Mathematica_12.2.0_LINUX.sh";
+    }
+    {
+      version = "12.1.1";
+      lang = "en";
+      language = "English";
+      sha256 = "02mk8gmv8idnakva1nc7r7mx8ld02lk7jgsj1zbn962aps3bhixd";
+      installer = "Mathematica_12.1.1_LINUX.sh";
+    }
+    {
+      version = "12.1.0";
+      lang = "en";
+      language = "English";
+      sha256 = "15m9l20jvkxh5w6mbp81ys7mx2lx5j8acw5gz0il89lklclgb8z7";
+      installer = "Mathematica_12.1.0_LINUX.sh";
+    }
+    {
+      version = "12.0.0";
+      lang = "en";
+      language = "English";
+      sha256 = "b9fb71e1afcc1d72c200196ffa434512d208fa2920e207878433f504e58ae9d7";
+      installer = "Mathematica_12.0.0_LINUX.sh";
     }
     {
       version = "11.3.0";
       lang = "en";
       language = "English";
       sha256 = "0fcfe208c1eac8448e7be3af0bdb84370b17bd9c5d066c013928c8ee95aed10e";
+      installer = "Mathematica_11.3.0_LINUX.sh";
     }
     {
       version = "11.2.0";
       lang = "ja";
       language = "Japanese";
       sha256 = "916392edd32bed8622238df435dd8e86426bb043038a3336f30df10d819b49b1";
+      installer = "Mathematica_11.2.0_ja_LINUX.sh";
     }
   ]
-  ({ version, lang, language, sha256 }: {
+  ({ version, lang, language, sha256, installer }: {
     inherit version lang;
     name = "mathematica-${version}" + optionalString (lang != "en") "-${lang}";
-    src = requireFile rec {
-      name = "Mathematica_${version}" + optionalString (lang != "en") "_${language}" + "_LINUX.sh";
+    src = requireFile {
+      name = installer;
       message = ''
-        This nix expression requires that ${name} is
+        This nix expression requires that ${installer} is
         already part of the store. Find the file on your Mathematica CD
         and add it to the nix store with nix-store --add-fixed sha256 <FILE>.
       '';
diff --git a/nixpkgs/pkgs/applications/science/math/maxima/default.nix b/nixpkgs/pkgs/applications/science/math/maxima/default.nix
index 3f295b416fb0..8bad09f17880 100644
--- a/nixpkgs/pkgs/applications/science/math/maxima/default.nix
+++ b/nixpkgs/pkgs/applications/science/math/maxima/default.nix
@@ -1,24 +1,30 @@
-{ lib, stdenv, fetchurl, fetchpatch, sbcl, texinfo, perl, python3, makeWrapper, autoreconfHook
-, rlwrap ? null, tk ? null, gnuplot ? null, ecl ? null, ecl-fasl ? false
+{ lib
+, stdenv
+, fetchurl
+, fetchpatch
+, texinfo
+, perl
+, python3
+, makeWrapper
+, autoreconfHook
+, rlwrap ? null
+, tk ? null
+, gnuplot ? null
+, lisp-compiler
 }:
 
 let
-  name    = "maxima";
-  version = "5.45.0";
-
-  lisp-compiler = if ecl-fasl then ecl else sbcl;
-
-  searchPath =
-    lib.makeBinPath
-      (lib.filter (x: x != null) [ lisp-compiler rlwrap tk gnuplot ]);
+  # Allow to remove some executables from the $PATH of the wrapped binary
+  searchPath = lib.makeBinPath
+    (lib.filter (x: x != null) [ lisp-compiler rlwrap tk gnuplot ]);
 in
-stdenv.mkDerivation ({
-  inherit version;
-  name = "${name}-${version}";
+stdenv.mkDerivation rec {
+  pname = "maxima";
+  version = "5.45.1";
 
   src = fetchurl {
-    url = "mirror://sourceforge/${name}/${name}-${version}.tar.gz";
-    sha256 = "sha256-x2MfMmRIBc67e6/vOrUzHEus0sJ+OE/YgyO1A5pg0Ng=";
+    url = "mirror://sourceforge/${pname}/${pname}-${version}.tar.gz";
+    sha256 = "sha256-/pAWJ2lwvvIUoaJENIVYZEUU1/36pPyLnQ6Hr8u059w=";
   };
 
   nativeBuildInputs = [
@@ -49,7 +55,7 @@ stdenv.mkDerivation ({
     ln -s ../maxima/${version}/emacs $out/share/emacs/site-lisp
     ln -s ../maxima/${version}/doc $out/share/doc/maxima
   ''
-   + (lib.optionalString ecl-fasl ''
+   + (lib.optionalString (lisp-compiler.pname == "ecl") ''
      cp src/binary-ecl/maxima.fas* "$out/lib/maxima/${version}/binary-ecl/"
    '')
   ;
@@ -67,12 +73,13 @@ stdenv.mkDerivation ({
       sha256 = "06961hn66rhjijfvyym21h39wk98sfxhp051da6gz0n9byhwc6zg";
     })
 
-    # undo https://sourceforge.net/p/maxima/code/ci/f5e9b0f7eb122c4e48ea9df144dd57221e5ea0ca, see see https://trac.sagemath.org/ticket/13364#comment:93
+    # undo https://sourceforge.net/p/maxima/code/ci/f5e9b0f7eb122c4e48ea9df144dd57221e5ea0ca
+    # see https://trac.sagemath.org/ticket/13364#comment:93
     (fetchpatch {
       url = "https://git.sagemath.org/sage.git/plain/build/pkgs/maxima/patches/undoing_true_false_printing_patch.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
       sha256 = "0fvi3rcjv6743sqsbgdzazy9jb6r1p1yq63zyj9fx42wd1hgf7yx";
     })
-  ] ++ lib.optionals ecl-fasl [
+  ] ++ lib.optionals (lisp-compiler.pname == "ecl") [
     # build fasl, needed for ECL support
     (fetchpatch {
       url = "https://git.sagemath.org/sage.git/plain/build/pkgs/maxima/patches/maxima.system.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
@@ -97,13 +104,13 @@ stdenv.mkDerivation ({
   enableParallelBuilding = true;
 
   passthru = {
-    ecl = ecl;
+    inherit lisp-compiler;
   };
 
-  meta = {
+  meta = with lib; {
     description = "Computer algebra system";
     homepage = "http://maxima.sourceforge.net";
-    license = lib.licenses.gpl2;
+    license = licenses.gpl2Plus;
 
     longDescription = ''
       Maxima is a fairly complete computer algebra system written in
@@ -111,7 +118,7 @@ stdenv.mkDerivation ({
       DOE-MACSYMA and licensed under the GPL. Its abilities include
       symbolic integration, 3D plotting, and an ODE solver.
     '';
-
-    platforms = lib.platforms.unix;
+    maintainers = with maintainers; [ doronbehar ];
+    platforms = platforms.unix;
   };
-})
+}
diff --git a/nixpkgs/pkgs/applications/science/math/msieve/default.nix b/nixpkgs/pkgs/applications/science/math/msieve/default.nix
index 588df51554ab..6456608e7dbc 100644
--- a/nixpkgs/pkgs/applications/science/math/msieve/default.nix
+++ b/nixpkgs/pkgs/applications/science/math/msieve/default.nix
@@ -1,10 +1,11 @@
-{lib, stdenv, fetchurl, zlib, gmp, ecm }:
+{ lib, stdenv, fetchurl, zlib, gmp, ecm }:
 
-stdenv.mkDerivation {
-  name = "msieve-1.53";
+stdenv.mkDerivation rec {
+  pname = "msieve";
+  version = "1.53";
 
   src = fetchurl {
-    url = "mirror://sourceforge/msieve/msieve/Msieve%20v1.53/msieve153_src.tar.gz";
+    url = "mirror://sourceforge/msieve/msieve/Msieve%20v${version}/msieve${lib.replaceStrings ["."] [""] version}_src.tar.gz";
     sha256 = "1d1vv7j4rh3nnxsmvafi73qy7lw7n3akjlm5pjl3m936yapvmz65";
   };
 
diff --git a/nixpkgs/pkgs/applications/science/math/mxnet/default.nix b/nixpkgs/pkgs/applications/science/math/mxnet/default.nix
index ab360a963852..c9ffb8ed5cb3 100644
--- a/nixpkgs/pkgs/applications/science/math/mxnet/default.nix
+++ b/nixpkgs/pkgs/applications/science/math/mxnet/default.nix
@@ -1,5 +1,5 @@
-{ config, stdenv, lib, fetchurl, bash, cmake
-, opencv3, gtest, blas, perl
+{ config, stdenv, lib, fetchurl, fetchpatch, bash, cmake
+, opencv3, gtest, blas, gomp, llvmPackages, perl
 , cudaSupport ? config.cudaSupport or false, cudatoolkit, nvidia_x11
 , cudnnSupport ? cudaSupport, cudnn
 }:
@@ -8,18 +8,35 @@ assert cudnnSupport -> cudaSupport;
 
 stdenv.mkDerivation rec {
   pname = "mxnet";
-  version = "1.6.0";
+  version = "1.8.0";
 
   src = fetchurl {
-    url = "https://github.com/apache/incubator-mxnet/releases/download/${version}/apache-mxnet-src-${version}-incubating.tar.gz";
-    sha256 = "1vvdb7pfh63kb9fzs6gqp95q550a3ck4cj9mqxlk9wwhkh30dsq1";
+    name = "apache-mxnet-src-${version}-incubating.tar.gz";
+    url = "https://dlcdn.apache.org/incubator/mxnet/${version}/apache-mxnet-src-${version}-incubating.tar.gz";
+    hash = "sha256-la/5hYlaukCcCNVRRRCuOLiEkM+2KBqzpf8PWCbI21Q=";
   };
 
+  patches = [
+    # Fix build error https://github.com/apache/incubator-mxnet/issues/19405
+    (fetchpatch {
+      name = "mxnet-fix-gcc-linker-error-1.patch";
+      url = "https://github.com/apache/incubator-mxnet/commit/78e31d66d19e385ca4ef73245ce79a47e375d8d1.diff";
+      sha256 = "sha256-UfmGhh4RbvrEOXe6IJxHm1Aqpy1gS6gHxrX5KQBXjv4=";
+    })
+    (fetchpatch {
+      name = "mxnet-fix-gcc-linker-error-2.patch";
+      url = "https://github.com/apache/incubator-mxnet/commit/9bfe3116aabd01049fdbd90855cb245a30b795df.diff";
+      sha256 = "sha256-BL7Zf7Bgn0qpai9HbQ6LBxZNa3iLjVJSe5nxZgqI/fw=";
+    })
+  ];
+
   nativeBuildInputs = [ cmake perl ];
 
   buildInputs = [ opencv3 gtest blas.provider ]
-              ++ lib.optionals cudaSupport [ cudatoolkit nvidia_x11 ]
-              ++ lib.optional cudnnSupport cudnn;
+    ++ lib.optional stdenv.cc.isGNU gomp
+    ++ lib.optional stdenv.cc.isClang llvmPackages.openmp
+    ++ lib.optionals cudaSupport [ cudatoolkit nvidia_x11 ]
+    ++ lib.optional cudnnSupport cudnn;
 
   cmakeFlags =
     [ "-DUSE_MKL_IF_AVAILABLE=OFF" ]
@@ -48,6 +65,6 @@ stdenv.mkDerivation rec {
     homepage = "https://mxnet.incubator.apache.org/";
     maintainers = with maintainers; [ abbradar ];
     license = licenses.asl20;
-    platforms = platforms.linux;
+    platforms = platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/applications/science/math/nasc/default.nix b/nixpkgs/pkgs/applications/science/math/nasc/default.nix
index dffbdaa23aa8..2fe027365cdc 100644
--- a/nixpkgs/pkgs/applications/science/math/nasc/default.nix
+++ b/nixpkgs/pkgs/applications/science/math/nasc/default.nix
@@ -83,5 +83,6 @@ stdenv.mkDerivation rec {
     maintainers = teams.pantheon.members;
     platforms = platforms.linux;
     license = licenses.gpl3Plus;
+    mainProgram = "com.github.parnold_x.nasc";
   };
 }
diff --git a/nixpkgs/pkgs/applications/science/math/pari/default.nix b/nixpkgs/pkgs/applications/science/math/pari/default.nix
index fc1a2e0abf8c..4ba1d5c6b474 100644
--- a/nixpkgs/pkgs/applications/science/math/pari/default.nix
+++ b/nixpkgs/pkgs/applications/science/math/pari/default.nix
@@ -1,10 +1,11 @@
-{ lib, stdenv
+{ lib
+, stdenv
 , fetchurl
 , gmp
-, readline
 , libX11
-, tex
 , perl
+, readline
+, tex
 , withThread ? true, libpthreadstubs
 }:
 
@@ -12,7 +13,7 @@ assert withThread -> libpthreadstubs != null;
 
 stdenv.mkDerivation rec {
   pname = "pari";
-  version = "2.13.1";
+  version = "2.13.3";
 
   src = fetchurl {
     urls = [
@@ -20,30 +21,25 @@ stdenv.mkDerivation rec {
       # old versions are at the url below
       "https://pari.math.u-bordeaux.fr/pub/pari/OLD/${lib.versions.majorMinor version}/${pname}-${version}.tar.gz"
     ];
-    sha256 = "sha256-gez31wzNquIwFlz/Ynyc4uwpe48i+fQHQiedhfht/LE=";
+    hash = "sha256-zLp/FgbGhU8UQ2N7tXrQlY1Bx/R1P4roRZ8dZMJnoco=";
   };
 
-  patches = [
-    # rebased version of 3edb98db78, see
-    # https://pari.math.u-bordeaux.fr/cgi-bin/bugreport.cgi?bug=2284
-    ./rnfdisc.patch
-  ];
-
   buildInputs = [
     gmp
-    readline
     libX11
-    tex
     perl
+    readline
+    tex
   ] ++ lib.optionals withThread [
     libpthreadstubs
   ];
 
   configureScript = "./Configure";
   configureFlags = [
-    "--with-gmp=${gmp.dev}"
-    "--with-readline=${readline.dev}"
-  ] ++ lib.optional stdenv.isDarwin "--host=x86_64-darwin"
+    "--with-gmp=${lib.getDev gmp}"
+    "--with-readline=${lib.getDev readline}"
+  ]
+  ++ lib.optional stdenv.isDarwin "--host=x86_64-darwin"
   ++ lib.optional withThread "--mt=pthread";
 
   preConfigure = ''
@@ -57,6 +53,7 @@ stdenv.mkDerivation rec {
   makeFlags = [ "all" ];
 
   meta = with lib; {
+    homepage = "http://pari.math.u-bordeaux.fr";
     description = "Computer algebra system for high-performance number theory computations";
     longDescription = ''
        PARI/GP is a widely used computer algebra system designed for fast
@@ -81,7 +78,6 @@ stdenv.mkDerivation rec {
          3 or 4 times faster.) gp2c currently only understands a subset of the
          GP language.
     '';
-    homepage = "http://pari.math.u-bordeaux.fr";
     downloadPage = "http://pari.math.u-bordeaux.fr/download.html";
     license = licenses.gpl2Plus;
     maintainers = with maintainers; [ ertes AndersonTorres ] ++ teams.sage.members;
diff --git a/nixpkgs/pkgs/applications/science/math/pari/gp2c.nix b/nixpkgs/pkgs/applications/science/math/pari/gp2c.nix
index 23183f83b36b..7f31543a925f 100644
--- a/nixpkgs/pkgs/applications/science/math/pari/gp2c.nix
+++ b/nixpkgs/pkgs/applications/science/math/pari/gp2c.nix
@@ -1,7 +1,9 @@
-{ lib, stdenv
-, pari
+{ lib
+, stdenv
 , fetchurl
-, perl }:
+, pari
+, perl
+}:
 
 stdenv.mkDerivation rec {
   pname = "gp2c";
@@ -12,11 +14,15 @@ stdenv.mkDerivation rec {
     sha256 = "039ip7qkwwv46wrcdrz7y12m30kazzkjr44kqbc0h137g4wzd7zf";
   };
 
-  buildInputs = [ pari perl ];
+  buildInputs = [
+    pari
+    perl
+  ];
 
   configureFlags = [
     "--with-paricfg=${pari}/lib/pari/pari.cfg"
-    "--with-perl=${perl}/bin/perl" ];
+    "--with-perl=${perl}/bin/perl"
+  ];
 
   meta = with lib; {
     description =  "A compiler to translate GP scripts to PARI programs";
diff --git a/nixpkgs/pkgs/applications/science/math/pari/rnfdisc.patch b/nixpkgs/pkgs/applications/science/math/pari/rnfdisc.patch
deleted file mode 100644
index 6acac96481d5..000000000000
--- a/nixpkgs/pkgs/applications/science/math/pari/rnfdisc.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-commit 0d8a3ac970291c62b56104172418b3f2ca30927c
-Author: Bill Allombert <Bill.Allombert@math.u-bordeaux.fr>
-Date:   Sun Mar 28 13:27:24 2021 +0200
-
-    rnfdisc_factored: remove spurious Q_primpart [#2284]
-
-diff --git a/src/basemath/base2.c b/src/basemath/base2.c
-index 7e7d0db9d..c461826f4 100644
---- a/src/basemath/base2.c
-+++ b/src/basemath/base2.c
-@@ -3582,7 +3582,7 @@ rnfdisc_factored(GEN nf, GEN pol, GEN *pd)
- 
-   nf = checknf(nf);
-   pol = rnfdisc_get_T(nf, pol, &lim);
--  disc = nf_to_scalar_or_basis(nf, nfX_disc(nf, Q_primpart(pol)));
-+  disc = nf_to_scalar_or_basis(nf, nfX_disc(nf, pol));
-   pol = nfX_to_monic(nf, pol, NULL);
-   fa = idealfactor_partial(nf, disc, lim);
-   P = gel(fa,1); l = lg(P);
-diff --git a/src/test/32/rnf b/src/test/32/rnf
-index 1e743f415..c016dce00 100644
---- a/src/test/32/rnf
-+++ b/src/test/32/rnf
-@@ -853,9 +853,10 @@ error("inconsistent dimensions in idealtwoelt.")
- 0
- 0
- 1
--[[7361, 3786, 318, 5823; 0, 1, 0, 0; 0, 0, 1, 0; 0, 0, 0, 1], [-3, 6, -2, 0]
--~]
--[2, -1]
-+[[433, 322, 318, 1318/17; 0, 1, 0, 12/17; 0, 0, 1, 5/17; 0, 0, 0, 1/17], [25
-+/17, -12/17, 12/17, 16/17]~]
-+[1, -1]
-+[[12, 0, 0, 0; 0, 12, 4, 0; 0, 0, 4, 0; 0, 0, 0, 4], [6, 5, -1, 2]~]
-   ***   at top-level: rnfdedekind(nf,P,pr2,1)
-   ***                 ^-----------------------
-   *** rnfdedekind: sorry, Dedekind in the difficult case is not yet implemented.
-diff --git a/src/test/in/rnf b/src/test/in/rnf
-index 7851ae291..318d5349e 100644
---- a/src/test/in/rnf
-+++ b/src/test/in/rnf
-@@ -212,6 +212,9 @@ k = nfinit(y^4 + 10*y^2 + 17);
- rnfdisc(k, x^2 - x + 1/Mod(y,k.pol))
- rnfdisc(k, x^2 - x + 1/2)
- 
-+k = nfinit(y^4 - 10*y^2 + 1);
-+rnfdisc(k,x^2-(y^3/2+y^2-5*y/2+1))
-+
- \\ ERRORS, keep at end of file
- rnfdedekind(nf, P, pr2, 1)
- rnfdedekind(nf, P)
diff --git a/nixpkgs/pkgs/applications/science/math/pcalc/default.nix b/nixpkgs/pkgs/applications/science/math/pcalc/default.nix
index cbf07135dec2..97888b712eb1 100644
--- a/nixpkgs/pkgs/applications/science/math/pcalc/default.nix
+++ b/nixpkgs/pkgs/applications/science/math/pcalc/default.nix
@@ -19,8 +19,8 @@ stdenv.mkDerivation rec {
   meta = with lib; {
     homepage = "https://vapier.github.io/pcalc/";
     description = "Programmer's calculator";
-    license = licenses.gpl2;
-    maintainers = with lib.maintainers; [ ftrvxmtrx ];
-    platforms = lib.platforms.linux;
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ ftrvxmtrx ];
+    platforms = platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/applications/science/math/perseus/default.nix b/nixpkgs/pkgs/applications/science/math/perseus/default.nix
index d53236d8070c..4545203dacca 100644
--- a/nixpkgs/pkgs/applications/science/math/perseus/default.nix
+++ b/nixpkgs/pkgs/applications/science/math/perseus/default.nix
@@ -1,7 +1,7 @@
 { lib, stdenv, fetchurl, unzip }:
 
 stdenv.mkDerivation {
-  name = "perseus-4-beta";
+  pname = "perseus";
   version = "4-beta";
   nativeBuildInputs = [ unzip ];
 
@@ -34,7 +34,7 @@ stdenv.mkDerivation {
     '';
     homepage = "http://www.sas.upenn.edu/~vnanda/perseus/index.html";
     license = lib.licenses.gpl3;
-    maintainers = with lib.maintainers; [erikryb];
+    maintainers = with lib.maintainers; [ erikryb ];
     platforms = lib.platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/applications/science/math/polymake/default.nix b/nixpkgs/pkgs/applications/science/math/polymake/default.nix
index 9566801479a3..f4f6366465b8 100644
--- a/nixpkgs/pkgs/applications/science/math/polymake/default.nix
+++ b/nixpkgs/pkgs/applications/science/math/polymake/default.nix
@@ -12,13 +12,13 @@
 
 stdenv.mkDerivation rec {
   pname = "polymake";
-  version = "4.4";
+  version = "4.5";
 
   src = fetchurl {
     # "The minimal version is a packager friendly version which omits
     # the bundled sources of cdd, lrs, libnormaliz, nauty and jReality."
     url = "https://polymake.org/lib/exe/fetch.php/download/polymake-${version}-minimal.tar.bz2";
-    sha256 = "sha256-2nF5F2xznI77pl2TslrxA8HLpw4fmzVnPOM8N3kOwJE=";
+    sha256 = "sha256-6UPUuzHBEvrYUjQONZW8WRwgcGkqFtUBg6OxBFZteZY=";
   };
 
   buildInputs = [
diff --git a/nixpkgs/pkgs/applications/science/math/programmer-calculator/default.nix b/nixpkgs/pkgs/applications/science/math/programmer-calculator/default.nix
index 0238e5333577..e9c7cb985cb9 100644
--- a/nixpkgs/pkgs/applications/science/math/programmer-calculator/default.nix
+++ b/nixpkgs/pkgs/applications/science/math/programmer-calculator/default.nix
@@ -2,13 +2,13 @@
 
 gccStdenv.mkDerivation rec {
   pname = "programmer-calculator";
-  version = "2.1";
+  version = "2.2";
 
   src = fetchFromGitHub {
     owner = "alt-romes";
     repo = pname;
     rev = "v${version}";
-    sha256 = "1vvpbj24ijl9ma0h669n9x0z1im3vqdf8zf2li0xf5h97b14gmv0";
+    sha256 = "sha256-JQcYCYKdjdy8U2XMFzqTH9kAQ7CFv0r+sC1YfuAm7p8=";
   };
 
   buildInputs = [ ncurses ];
diff --git a/nixpkgs/pkgs/applications/science/math/qalculate-gtk/default.nix b/nixpkgs/pkgs/applications/science/math/qalculate-gtk/default.nix
index bc192fe4218b..03f4b223803c 100644
--- a/nixpkgs/pkgs/applications/science/math/qalculate-gtk/default.nix
+++ b/nixpkgs/pkgs/applications/science/math/qalculate-gtk/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "qalculate-gtk";
-  version = "3.20.1";
+  version = "3.22.0";
 
   src = fetchFromGitHub {
     owner = "qalculate";
     repo = "qalculate-gtk";
     rev = "v${version}";
-    sha256 = "sha256-GTOdJ4dxR491WU6WM47xLHO7RGUGXkdHuQIDxJvVvFE=";
+    sha256 = "sha256-BarbO25c103YImOOnjVgwgqpa3mUVvndgJeUHRf2I60=";
   };
 
   hardeningDisable = [ "format" ];
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
   meta = with lib; {
     description = "The ultimate desktop calculator";
     homepage = "http://qalculate.github.io";
-    maintainers = with maintainers; [ gebner ];
+    maintainers = with maintainers; [ gebner doronbehar ];
     license = licenses.gpl2Plus;
     platforms = platforms.all;
   };
diff --git a/nixpkgs/pkgs/applications/science/math/ries/default.nix b/nixpkgs/pkgs/applications/science/math/ries/default.nix
index e46553d7b09e..eb759723256d 100644
--- a/nixpkgs/pkgs/applications/science/math/ries/default.nix
+++ b/nixpkgs/pkgs/applications/science/math/ries/default.nix
@@ -1,10 +1,11 @@
 { lib, stdenv, fetchzip }:
-stdenv.mkDerivation {
-  name = "ries-2018-04-11";
+stdenv.mkDerivation rec {
+  pname = "ries";
+  version = "2018.04.11-1";
 
   # upstream does not provide a stable link
   src = fetchzip {
-    url = "https://salsa.debian.org/debian/ries/-/archive/debian/2018.04.11-1/ries-debian-2018.04.11-1.zip";
+    url = "https://salsa.debian.org/debian/ries/-/archive/debian/${version}/ries-debian-${version}.zip";
     sha256 = "1h2wvd4k7f0l0i1vm9niz453xdbcs3nxccmri50qyrzzzc1b0842";
   };
 
diff --git a/nixpkgs/pkgs/applications/science/math/sage/default.nix b/nixpkgs/pkgs/applications/science/math/sage/default.nix
index b7821db1f9a7..e9dae55fbae3 100644
--- a/nixpkgs/pkgs/applications/science/math/sage/default.nix
+++ b/nixpkgs/pkgs/applications/science/math/sage/default.nix
@@ -15,7 +15,7 @@ let
       sagelib = self.callPackage ./sagelib.nix {
         inherit flint arb;
         inherit sage-src env-locations pynac singular;
-        ecl = maxima-ecl.ecl;
+        inherit (maxima) lisp-compiler;
         linbox = pkgs.linbox.override { withSage = true; };
         pkg-config = pkgs.pkg-config; # not to confuse with pythonPackages.pkg-config
       };
@@ -48,9 +48,8 @@ let
   # the files its looking fore are located. Also see `sage-env`.
   env-locations = callPackage ./env-locations.nix {
     inherit pari_data;
-    inherit singular maxima-ecl;
+    inherit singular maxima;
     inherit three;
-    ecl = maxima-ecl.ecl;
     cysignals = python3.pkgs.cysignals;
     mathjax = nodePackages.mathjax;
   };
@@ -61,22 +60,21 @@ let
     sagelib = python3.pkgs.sagelib;
     sage_docbuild = python3.pkgs.sage_docbuild;
     inherit env-locations;
-    inherit python3 singular palp flint pynac pythonEnv maxima-ecl;
-    ecl = maxima-ecl.ecl;
+    inherit python3 singular palp flint pynac pythonEnv maxima;
     pkg-config = pkgs.pkg-config; # not to confuse with pythonPackages.pkg-config
   };
 
   # The documentation for sage, building it takes a lot of ram.
   sagedoc = callPackage ./sagedoc.nix {
     inherit sage-with-env;
-    inherit python3 maxima-ecl;
+    inherit python3 maxima;
   };
 
   # sagelib with added wrappers and a dependency on sage-tests to make sure thet tests were run.
   sage-with-env = callPackage ./sage-with-env.nix {
     inherit python3 pythonEnv;
     inherit sage-env;
-    inherit pynac singular maxima-ecl;
+    inherit pynac singular maxima;
     inherit three;
     pkg-config = pkgs.pkg-config; # not to confuse with pythonPackages.pkg-config
   };
@@ -118,8 +116,8 @@ let
 
   singular = pkgs.singular.override { inherit flint; };
 
-  maxima-ecl = pkgs.maxima-ecl.override {
-    ecl = pkgs.ecl.override {
+  maxima = pkgs.maxima.override {
+    lisp-compiler = pkgs.ecl.override {
       # "echo syntax error | ecl > /dev/full 2>&1" segfaults in
       # ECL. We apply a patch to fix it (write_error.patch), but it
       # only works if threads are disabled.  sage 9.2 tests this
diff --git a/nixpkgs/pkgs/applications/science/math/sage/env-locations.nix b/nixpkgs/pkgs/applications/science/math/sage/env-locations.nix
index b1ad0aad9c76..45a4799d1a03 100644
--- a/nixpkgs/pkgs/applications/science/math/sage/env-locations.nix
+++ b/nixpkgs/pkgs/applications/science/math/sage/env-locations.nix
@@ -2,13 +2,12 @@
 , pari_data
 , pari
 , singular
-, maxima-ecl
+, maxima
 , conway_polynomials
 , graphs
 , elliptic_curves
 , polytopes_db
 , gap
-, ecl
 , combinatorial_designs
 , jmol
 , mathjax
@@ -30,14 +29,14 @@ writeTextFile rec {
     export SINGULAR_SO='${singular}/lib/libSingular.so'
     export GAP_SO='${gap}/lib/libgap.so'
     export SINGULAR_EXECUTABLE='${singular}/bin/Singular'
-    export MAXIMA_FAS='${maxima-ecl}/lib/maxima/${maxima-ecl.version}/binary-ecl/maxima.fas'
-    export MAXIMA_PREFIX="${maxima-ecl}"
+    export MAXIMA_FAS='${maxima}/lib/maxima/${maxima.version}/binary-ecl/maxima.fas'
+    export MAXIMA_PREFIX="${maxima}"
     export CONWAY_POLYNOMIALS_DATA_DIR='${conway_polynomials}/share/conway_polynomials'
     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_ROOT_DIR='${gap}/share/gap/build-dir'
-    export ECLDIR='${ecl}/lib/ecl-${ecl.version}/'
+    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"
     export JMOL_DIR="${jmol}/share/jmol" # point to the directory that contains JmolData.jar
diff --git a/nixpkgs/pkgs/applications/science/math/sage/patches/fonttools-deprecation-warnings.patch b/nixpkgs/pkgs/applications/science/math/sage/patches/fonttools-deprecation-warnings.patch
new file mode 100644
index 000000000000..93c03a04ddb1
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/sage/patches/fonttools-deprecation-warnings.patch
@@ -0,0 +1,39 @@
+diff --git a/src/doc/en/prep/Advanced-2DPlotting.rst b/src/doc/en/prep/Advanced-2DPlotting.rst
+index 337457afef..f7c76f4b56 100644
+--- a/src/doc/en/prep/Advanced-2DPlotting.rst
++++ b/src/doc/en/prep/Advanced-2DPlotting.rst
+@@ -695,6 +695,8 @@ by the cells.
+ 
+     sage: pdf_savename = name+'.pdf'
+     sage: p.save(pdf_savename)
++    ...
++    DeprecationWarning: The py23 module has been deprecated and will be removed in a future release. Please update your code.
+ 
+ Notably, we can export in formats ready for inclusion in web pages.
+ 
+diff --git a/src/sage/plot/disk.py b/src/sage/plot/disk.py
+index 8680a1c9b1..e83763b678 100644
+--- a/src/sage/plot/disk.py
++++ b/src/sage/plot/disk.py
+@@ -156,6 +156,8 @@ class Disk(GraphicPrimitive):
+             sage: f = tmp_filename(ext='.pdf')
+             sage: p = disk((0,0), 5, (0, pi/4), alpha=0.5)
+             sage: p.save(f)
++            ...
++            DeprecationWarning: The py23 module has been deprecated and will be removed in a future release. Please update your code.
+ 
+         """
+         import matplotlib.patches as patches
+diff --git a/src/sage/plot/text.py b/src/sage/plot/text.py
+index 04cbdedf76..a970f97b79 100644
+--- a/src/sage/plot/text.py
++++ b/src/sage/plot/text.py
+@@ -325,6 +325,8 @@ def text(string, xy, **options):
+     You can save text as part of PDF output::
+ 
+         sage: text("sage", (0,0), rgbcolor=(0,0,0)).save(os.path.join(SAGE_TMP, 'a.pdf'))
++        ...
++        DeprecationWarning: The py23 module has been deprecated and will be removed in a future release. Please update your code.
+ 
+     Some examples of bounding box::
+ 
diff --git a/nixpkgs/pkgs/applications/science/math/sage/sage-env.nix b/nixpkgs/pkgs/applications/science/math/sage/sage-env.nix
index fd67076c97de..ae0b9f7453b5 100644
--- a/nixpkgs/pkgs/applications/science/math/sage/sage-env.nix
+++ b/nixpkgs/pkgs/applications/science/math/sage/sage-env.nix
@@ -15,8 +15,7 @@
 , pkg-config
 , pari
 , gap
-, ecl
-, maxima-ecl
+, maxima
 , singular
 , fflas-ffpack
 , givaro
@@ -77,8 +76,8 @@ let
     pkg-config
     pari
     gap
-    ecl
-    maxima-ecl
+    maxima.lisp-compiler
+    maxima
     singular
     giac
     palp
diff --git a/nixpkgs/pkgs/applications/science/math/sage/sage-src.nix b/nixpkgs/pkgs/applications/science/math/sage/sage-src.nix
index 3ba21cf6c8be..eb07434b4cc0 100644
--- a/nixpkgs/pkgs/applications/science/math/sage/sage-src.nix
+++ b/nixpkgs/pkgs/applications/science/math/sage/sage-src.nix
@@ -23,6 +23,12 @@ let
       # branches (wip patches from tickets), but exports each commit as a separate
       # patch, so merge commits can lead to conflicts. Used if squashed == false.
       #
+      # The above is the preferred option. To use it, find a Trac ticket and pass the
+      # "Commit" field from the ticket as "rev", choosing "base" as an appropriate
+      # release tag, i.e. a tag that doesn't cause the patch to include a lot of
+      # unrelated changes. If there is no such tag (due to nonlinear history, for
+      # example), there are two other options, listed below.
+      #
       # 2) From GitHub's sagemath/sage repo. This lets us use a GH feature that allows
       # us to choose between a .patch file, with one patch per commit, or a .diff file,
       # which squashes all commits into a single diff. This is used if squashed ==
@@ -103,6 +109,14 @@ stdenv.mkDerivation rec {
     # strictly necessary, but keeps us from littering in the user's HOME.
     ./patches/sympow-cache.patch
 
+    # fonttools 4.26.2, used by matplotlib, uses deprecated methods internally.
+    # This is fixed in fonttools 4.27.0, but since fonttools is a dependency of
+    # 2000+ packages and DeprecationWarnings are hidden almost everywhere by
+    # default (not on Sage's doctest harness, though), it doesn't make sense to
+    # backport the fix (see https://github.com/NixOS/nixpkgs/pull/151415).
+    # Let's just assume warnings are expected until we update to 4.27.0.
+    ./patches/fonttools-deprecation-warnings.patch
+
     # https://trac.sagemath.org/ticket/32305
     (fetchSageDiff {
       base = "9.4";
@@ -110,6 +124,46 @@ stdenv.mkDerivation rec {
       rev = "9808325853ba9eb035115e5b056305a1c9d362a0";
       sha256 = "sha256-gJSqycCtbAVr5qnVEbHFUvIuTOvaxFIeffpzd6nH4DE=";
     })
+
+    # https://trac.sagemath.org/ticket/32420
+    (fetchSageDiff {
+      base = "9.5.beta2";
+      name = "sympy-1.9-update.patch";
+      rev = "beed4e16aff32e47d0c3b1c58cb1e2f4c38590f8";
+      sha256 = "sha256-3eJPfWfCrCAQ5filIn7FbzjRQeO9QyTIVl/HyRuqFtE=";
+    })
+
+    # https://trac.sagemath.org/ticket/32567
+    (fetchSageDiff {
+      base = "9.5.beta2";
+      name = "arb-2.21.0-update.patch";
+      rev = "eb3304dd521a3d5a9334e747a08e234bbf16b4eb";
+      sha256 = "sha256-XDkaY4VQGyESXI6zuD7nCNzyQOl/fmBFvAESH9+RRvk=";
+    })
+
+    # https://trac.sagemath.org/ticket/32797
+    (fetchSageDiff {
+      base = "9.5.beta7";
+      name = "pari-2.13.3-update.patch";
+      rev = "f5f7a86908daf60b25e66e6a189c51ada7e0a732";
+      sha256 = "sha256-H/caGx3q4KcdsyGe+ojV9bUTQ5y0siqM+QHgDbeEnbw=";
+    })
+
+    # https://trac.sagemath.org/ticket/32909
+    (fetchSageDiff {
+      base = "9.5.beta7";
+      name = "matplotlib-3.5-deprecation-warnings.patch";
+      rev = "a5127dc56fdf5c2e82f6bc781cfe78dbd04e97b7";
+      sha256 = "sha256-p23qUu9mgEUbdbX6cy7ArxZAtpcFjCKbgyxN4jWvj1o=";
+    })
+
+    # https://trac.sagemath.org/ticket/32968
+    (fetchSageDiff {
+      base = "9.5.beta8";
+      name = "sphinx-4.3-update.patch";
+      rev = "fc84f82f52b6f05f512cb359ec7c100f93cf8841";
+      sha256 = "sha256-bBbfdcnw/9LUOlY8rHJRbFJEdMXK4shosqTNaobTS1Q=";
+    })
   ];
 
   patches = nixPatches ++ bugfixPatches ++ packageUpgradePatches;
diff --git a/nixpkgs/pkgs/applications/science/math/sage/sage-with-env.nix b/nixpkgs/pkgs/applications/science/math/sage/sage-with-env.nix
index f204d97961b6..b74ec4007e62 100644
--- a/nixpkgs/pkgs/applications/science/math/sage/sage-with-env.nix
+++ b/nixpkgs/pkgs/applications/science/math/sage/sage-with-env.nix
@@ -9,7 +9,7 @@
 , singular
 , gap
 , giac
-, maxima-ecl
+, maxima
 , pari
 , gmp
 , gfan
@@ -42,7 +42,7 @@ let
     pari
     gmp
     gfan
-    maxima-ecl
+    maxima
     eclib
     flintqs
     ntl
diff --git a/nixpkgs/pkgs/applications/science/math/sage/sagedoc.nix b/nixpkgs/pkgs/applications/science/math/sage/sagedoc.nix
index d53947d806d1..6016b3baeb48 100644
--- a/nixpkgs/pkgs/applications/science/math/sage/sagedoc.nix
+++ b/nixpkgs/pkgs/applications/science/math/sage/sagedoc.nix
@@ -1,7 +1,7 @@
 { stdenv
 , sage-with-env
 , python3
-, maxima-ecl
+, maxima
 , tachyon
 , jmol
 , cddlib
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
   buildInputs = [
     sage-with-env.env.lib
     python3
-    maxima-ecl
+    maxima
     tachyon
     jmol
     cddlib
@@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
     networkx
     ipykernel
     ipywidgets
-    jupyter_client
+    jupyter-client
   ]);
 
   unpackPhase = ''
diff --git a/nixpkgs/pkgs/applications/science/math/sage/sagelib.nix b/nixpkgs/pkgs/applications/science/math/sage/sagelib.nix
index b9c98ed64d01..a884ad8899d4 100644
--- a/nixpkgs/pkgs/applications/science/math/sage/sagelib.nix
+++ b/nixpkgs/pkgs/applications/science/math/sage/sagelib.nix
@@ -10,7 +10,7 @@
 , cypari2
 , cysignals
 , cython
-, ecl
+, lisp-compiler
 , eclib
 , ecm
 , flint
@@ -74,7 +74,7 @@ buildPythonPackage rec {
     jupyter_core
     pkg-config
     pip # needed to query installed packages
-    ecl
+    lisp-compiler
   ];
 
   buildInputs = [
@@ -92,7 +92,7 @@ buildPythonPackage rec {
     arb
     brial
     cliquer
-    ecl
+    lisp-compiler
     eclib
     ecm
     fflas-ffpack
diff --git a/nixpkgs/pkgs/applications/science/math/scotch/default.nix b/nixpkgs/pkgs/applications/science/math/scotch/default.nix
index b6613f25cbc7..1eb057cfc7c5 100644
--- a/nixpkgs/pkgs/applications/science/math/scotch/default.nix
+++ b/nixpkgs/pkgs/applications/science/math/scotch/default.nix
@@ -1,7 +1,7 @@
 { lib, stdenv, fetchurl, bison, mpi, flex, zlib}:
 
 stdenv.mkDerivation rec {
-  version = "6.0.4";
+  version = "6.1.1";
   pname = "scotch";
   src_name = "scotch_${version}";
 
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "https://gforge.inria.fr/frs/download.php/file/34618/${src_name}.tar.gz";
-    sha256 = "f53f4d71a8345ba15e2dd4e102a35fd83915abf50ea73e1bf6efe1bc2b4220c7";
+    sha256 = "sha256-OQUvWf9HSkppzvwlzzyvhClACIneugEO5kA8oYj4sxE=";
   };
 
   sourceRoot = "${src_name}/src";
diff --git a/nixpkgs/pkgs/applications/science/math/singular/default.nix b/nixpkgs/pkgs/applications/science/math/singular/default.nix
index df298aab2114..b543252e8712 100644
--- a/nixpkgs/pkgs/applications/science/math/singular/default.nix
+++ b/nixpkgs/pkgs/applications/science/math/singular/default.nix
@@ -47,12 +47,13 @@ stdenv.mkDerivation rec {
   };
 
   patches = [
+    # fix timeouts when docbuilding with >= 64 cpus
+    # https://github.com/Singular/Singular/issues/1117
+    ./vspace-MAX_PROCESS.patch
+
     # add aarch64 support to cpu-check.m4. copied from redhat.
     ./redhat-aarch64.patch
 
-    # vspace causes hangs in modstd and other libraries on aarch64
-    ./disable-vspace-on-aarch64.patch
-
     # the newest version of ax-prog-cc-for-build.m4 seems to trigger
     # linker errors. see
     # https://github.com/alsa-project/alsa-firmware/issues/3 for a
diff --git a/nixpkgs/pkgs/applications/science/math/singular/disable-vspace-on-aarch64.patch b/nixpkgs/pkgs/applications/science/math/singular/disable-vspace-on-aarch64.patch
deleted file mode 100644
index 3e51b7fb2cec..000000000000
--- a/nixpkgs/pkgs/applications/science/math/singular/disable-vspace-on-aarch64.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff --git a/kernel/mod2.h b/kernel/mod2.h
-index 867fcae47..2abd84f23 100644
---- a/kernel/mod2.h
-+++ b/kernel/mod2.h
-@@ -60,8 +60,10 @@
- 
- /* define for parallel processes with shared memory */
- #ifndef __CCYGWIN__
-+#ifndef SI_CPU_AARCH64
- #define HAVE_VSPACE 1
- #endif
-+#endif
- 
- /*#define PROFILING*/
- #ifdef PROFILING
diff --git a/nixpkgs/pkgs/applications/science/math/singular/vspace-MAX_PROCESS.patch b/nixpkgs/pkgs/applications/science/math/singular/vspace-MAX_PROCESS.patch
new file mode 100644
index 000000000000..78d658f926ee
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/singular/vspace-MAX_PROCESS.patch
@@ -0,0 +1,35 @@
+diff --git a/kernel/GBEngine/kChinese.cc b/kernel/GBEngine/kChinese.cc
+index 829a66609..84655caf2 100644
+--- a/kernel/GBEngine/kChinese.cc
++++ b/kernel/GBEngine/kChinese.cc
+@@ -209,6 +209,8 @@ ideal id_ChineseRemainder_0(ideal *xx, number *q, int rl, const ring r)
+     return NULL;
+   }
+   int cpus=(int)(long)feOptValue(FE_OPT_CPUS);
++  if (cpus>=vspace::internals::MAX_PROCESS)
++    cpus=vspace::internals::MAX_PROCESS-1;
+   if ((cpus==1) || (2*cpus>=cnt))
+     /* at least 2 polys for each process, or switch to seriell version */
+     return id_ChineseRemainder(xx,q,rl,r);
+@@ -295,6 +297,8 @@ ideal id_Farey_0(ideal x, number N, const ring r)
+ {
+   int cnt=IDELEMS(x)*x->nrows;
+   int cpus=(int)(long)feOptValue(FE_OPT_CPUS);
++  if (cpus>=vspace::internals::MAX_PROCESS)
++    cpus=vspace::internals::MAX_PROCESS-1;
+   if (2*cpus>=cnt) /* at least 2 polys for each process, 
+                      or switch to seriell version */
+     return id_Farey(x,N,r);
+diff --git a/kernel/GBEngine/kverify.cc b/kernel/GBEngine/kverify.cc
+index 909d84994..aa06d6624 100644
+--- a/kernel/GBEngine/kverify.cc
++++ b/kernel/GBEngine/kverify.cc
+@@ -176,6 +176,8 @@ BOOLEAN kVerify2(ideal F, ideal Q)
+   /*---------------------------------------------------------------------*/
+   BOOLEAN all_okay=TRUE;
+   int cpus=(int)(long)feOptValue(FE_OPT_CPUS);
++  if (cpus>=vspace::internals::MAX_PROCESS)
++    cpus=vspace::internals::MAX_PROCESS-1;
+   int parent_pid=getpid();
+   using namespace vspace;
+   vmem_init();
diff --git a/nixpkgs/pkgs/applications/science/math/speedcrunch/default.nix b/nixpkgs/pkgs/applications/science/math/speedcrunch/default.nix
index 4bb39ab73f5f..a4e15060fe3b 100644
--- a/nixpkgs/pkgs/applications/science/math/speedcrunch/default.nix
+++ b/nixpkgs/pkgs/applications/science/math/speedcrunch/default.nix
@@ -1,14 +1,14 @@
-{ mkDerivation, lib, fetchgit, cmake, qtbase, qttools }:
+{ mkDerivation, lib, fetchFromBitbucket, cmake, qtbase, qttools }:
 
 mkDerivation rec {
   pname = "speedcrunch";
-  version = "0.12.0";
+  version = "unstable-2021-10-09";
 
-  src = fetchgit {
-    # the tagging is not standard, so you probably need to check this when updating
-    rev = "refs/tags/release-${version}";
-    url = "https://bitbucket.org/heldercorreia/speedcrunch";
-    sha256 = "0vh7cd1915bjqzkdp3sk25ngy8cq624mkh8c53c5bnzk357kb0fk";
+  src = fetchFromBitbucket {
+    owner = "heldercorreia";
+    repo = pname;
+    rev = "74756f3438149c01e9edc3259b0f411fa319a22f";
+    sha256 = "sha256-XxQv+A5SfYXFIRK7yacxGHHne1Q93pwCGeHhchIKizU=";
   };
 
   buildInputs = [ qtbase qttools ];
@@ -29,7 +29,7 @@ mkDerivation rec {
       precisions, unlimited variable storage, intelligent automatic completion
       full keyboard-friendly and more than 15 built-in math function.
     '';
-    maintainers = with maintainers; [ gebner ];
+    maintainers = with maintainers; [ gebner j0hax ];
     inherit (qtbase.meta) platforms;
     # works with qt 5.6 and qt 5.8
     broken = builtins.compareVersions qtbase.version "5.7.0" == 0;
diff --git a/nixpkgs/pkgs/applications/science/math/wxmaxima/default.nix b/nixpkgs/pkgs/applications/science/math/wxmaxima/default.nix
index 57e4a6f1d336..76d2c782b4d4 100644
--- a/nixpkgs/pkgs/applications/science/math/wxmaxima/default.nix
+++ b/nixpkgs/pkgs/applications/science/math/wxmaxima/default.nix
@@ -1,21 +1,37 @@
-{ lib, stdenv, fetchFromGitHub
-, wrapGAppsHook, cmake, gettext
-, maxima, wxGTK, gnome }:
+{ lib
+, stdenv
+, fetchFromGitHub
+, wrapGAppsHook
+, cmake
+, gettext
+, maxima
+, wxGTK
+, gnome
+}:
 
 stdenv.mkDerivation rec {
   pname = "wxmaxima";
-  version = "21.05.2";
+  version = "21.11.0";
 
   src = fetchFromGitHub {
     owner = "wxMaxima-developers";
     repo = "wxmaxima";
     rev = "Version-${version}";
-    sha256 = "sha256-HPqdxGrPxe5FZNOimTpAP+c9VpDBkXu3Z1c1Aaf3+UA=";
+    sha256 = "sha256-LwuqldMGsmFR8xrNg5vsrogmdi5ysqEQGWITM460IZk=";
   };
 
-  buildInputs = [ wxGTK maxima gnome.adwaita-icon-theme ];
+  buildInputs = [
+    wxGTK
+    maxima
+    # So it won't embed svg files into headers.
+    gnome.adwaita-icon-theme
+  ];
 
-  nativeBuildInputs = [ wrapGAppsHook cmake gettext ];
+  nativeBuildInputs = [
+    wrapGAppsHook
+    cmake
+    gettext
+  ];
 
   preConfigure = ''
     gappsWrapperArgs+=(--prefix PATH ":" ${maxima}/bin)
@@ -25,6 +41,7 @@ stdenv.mkDerivation rec {
     description = "Cross platform GUI for the computer algebra system Maxima";
     license = licenses.gpl2;
     homepage = "https://wxmaxima-developers.github.io/wxmaxima/";
+    maintainers = with maintainers; [ doronbehar ];
     platforms = platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/applications/science/math/yacas/default.nix b/nixpkgs/pkgs/applications/science/math/yacas/default.nix
index 05d1f780bf30..f7dc2a344e18 100644
--- a/nixpkgs/pkgs/applications/science/math/yacas/default.nix
+++ b/nixpkgs/pkgs/applications/science/math/yacas/default.nix
@@ -1,6 +1,21 @@
-{ lib, stdenv, fetchFromGitHub, cmake, perl
-, enableGui ? false, qt5
-, enableJupyter ? false, boost, jsoncpp, openssl, zmqpp
+{ lib
+, stdenv
+, fetchFromGitHub
+, fetchpatch
+, cmake
+, perl
+, enableGui ? false
+, qtbase
+, wrapQtAppsHook
+, qtwebengine
+, enableJupyter ? true
+, boost
+, jsoncpp
+, openssl
+, zmqpp
+, enableJava ? false
+, openjdk
+, gtest
 }:
 
 stdenv.mkDerivation rec {
@@ -19,21 +34,53 @@ stdenv.mkDerivation rec {
   cmakeFlags = [
     "-DENABLE_CYACAS_GUI=${if enableGui then "ON" else "OFF"}"
     "-DENABLE_CYACAS_KERNEL=${if enableJupyter then "ON" else "OFF"}"
+    "-DENABLE_JYACAS=${if enableJava then "ON" else "OFF"}"
+    "-DENABLE_CYACAS_UNIT_TESTS=ON"
   ];
+  patches = [
+    # upstream issue: https://github.com/grzegorzmazur/yacas/issues/340
+    # Upstream patch which doesn't apply on 1.9.1 is:
+    # https://github.com/grzegorzmazur/yacas/pull/342
+    ./jsoncpp-fix-include.patch
+    # Fixes testing - https://github.com/grzegorzmazur/yacas/issues/339
+    # PR: https://github.com/grzegorzmazur/yacas/pull/343
+    (fetchpatch {
+      url = "https://github.com/grzegorzmazur/yacas/commit/8bc22d517ecfdde3ac94800dc8506f5405564d48.patch";
+      sha256 = "sha256-aPO5T8iYNkGtF8j12YxNJyUPJJPKrXje1DmfCPt317A=";
+    })
+  ];
+  preCheck = ''
+    patchShebangs ../tests/test-yacas
+  '';
+  checkInputs = [
+    gtest
+  ];
+  doCheck = true;
 
-  # Perl is only for the documentation
-  nativeBuildInputs = [ cmake perl ];
+  nativeBuildInputs = [
+    cmake
+    # Perl is only for the documentation
+    perl
+  ] ++ lib.optionals enableJava [
+    openjdk
+  ];
   buildInputs = [
-  ] ++ lib.optionals enableGui (with qt5; [ qtbase qtwebkit ])
-    ++ lib.optionals enableJupyter [ boost jsoncpp openssl zmqpp ]
-    ;
+  ] ++ lib.optionals enableGui [
+    qtbase
+    wrapQtAppsHook
+    qtwebengine
+  ] ++ lib.optionals enableJupyter [
+    boost
+    jsoncpp
+    openssl
+    zmqpp
+  ];
 
   meta = {
-    description = "Easy to use, general purpose Computer Algebra System";
+    description = "Easy to use, general purpose Computer Algebra System${lib.optionalString enableGui ", built with GUI."}";
     homepage = "http://www.yacas.org/";
     license = lib.licenses.gpl2Plus;
-    maintainers = with lib.maintainers; [viric];
+    maintainers = with lib.maintainers; [ viric ];
     platforms = with lib.platforms; linux;
-    broken = enableGui || enableJupyter;
   };
 }
diff --git a/nixpkgs/pkgs/applications/science/math/yacas/fix-test-script.patch b/nixpkgs/pkgs/applications/science/math/yacas/fix-test-script.patch
new file mode 100644
index 000000000000..da85f0dc0e1b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/yacas/fix-test-script.patch
@@ -0,0 +1,26 @@
+diff --git i/tests/test-yacas w/tests/test-yacas
+index b375d78b..0e3a616b 100755
+--- i/tests/test-yacas
++++ w/tests/test-yacas
+@@ -35,9 +35,9 @@ FAILED_TESTS=""  # list of failed tests
+ FAILURES=0       # number of failed tests
+ TOTALTESTS=0     # total number of tests
+ 
+-TESTFILE=/tmp/test-yacas.$$
+-TIMEFILE=/tmp/time-yacas.$$
+-VERSIONF=/tmp/version-yacas-$$.ys
++TESTFILE="$(mktemp -t test-yacas.XXX)"
++TIMEFILE="$(mktemp -t time-yacas.XXX)"
++VERSIONF="$(mktemp -t version-yacas-XXX.ys)"
+ LOGFILE=yacas-logfile.txt
+ echo "Print(Version());" > $VERSIONF
+ VERSION=`$CMD $VERSIONF`
+@@ -69,7 +69,7 @@ for scr in $SCRIPTS; do
+ #		fi
+     echo "Running $scr"
+ 	if [ -f $TESTFILE ]; then rm $TESTFILE ; fi
+-    /bin/bash -c "time -p ($CMD $f || echo \"Error: exit status $?\") | tee $TESTFILE" \
++	    bash -c "time -p ($CMD $f || echo \"Error: exit status $?\") | tee $TESTFILE" \
+ 		2> $TIMEFILE \
+ 		|| (echo "Error -- User interrupt" > $TESTFILE)
+ #	cat $TIMEFILE
diff --git a/nixpkgs/pkgs/applications/science/math/yacas/jsoncpp-fix-include.patch b/nixpkgs/pkgs/applications/science/math/yacas/jsoncpp-fix-include.patch
new file mode 100644
index 000000000000..8fe914e55be3
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/yacas/jsoncpp-fix-include.patch
@@ -0,0 +1,63 @@
+diff --git i/cyacas/yacas-kernel/CMakeLists.txt w/cyacas/yacas-kernel/CMakeLists.txt
+index fe1600aa..dcc329f8 100644
+--- i/cyacas/yacas-kernel/CMakeLists.txt
++++ w/cyacas/yacas-kernel/CMakeLists.txt
+@@ -22,8 +22,9 @@ find_library (ZEROMQ_LIBRARY NAMES zmq)
+ find_path (ZMQPP_INCLUDE_DIR zmqpp.hpp)
+ find_library (ZMQPP_LIBRARY NAMES zmqpp)
+ 
+-find_path (JSONCPP_INCLUDE_DIR json.h)
+-find_library (JSONCPP_LIBRARY NAMES jsoncpp)
++# https://github.com/open-source-parsers/jsoncpp/wiki/Building#another-approach-for-cmake
++find_package(jsoncpp REQUIRED)
++get_target_property(JSON_INC_PATH jsoncpp_lib INTERFACE_INCLUDE_DIRECTORIES)
+ 
+ find_package (OpenSSL)
+ find_package (Boost REQUIRED date_time filesystem)
+@@ -31,6 +32,6 @@ find_package (Boost REQUIRED date_time filesystem)
+ include_directories (include)
+ 
+ add_executable (yacas-kernel src/main.cpp src/yacas_kernel.cpp src/yacas_engine.cpp src/hmac_sha256.cpp src/base64.cpp)
+-target_link_libraries (yacas-kernel libyacas ${ZMQPP_LIBRARY} ${ZEROMQ_LIBRARY} ${JSONCPP_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY} ${Boost_LIBRARIES} pthread ${CMAKE_DL_LIBS})
++target_link_libraries (yacas-kernel libyacas ${ZMQPP_LIBRARY} ${ZEROMQ_LIBRARY} jsoncpp_lib ${OPENSSL_CRYPTO_LIBRARY} ${Boost_LIBRARIES} pthread ${CMAKE_DL_LIBS})
+ 
+ install (TARGETS yacas-kernel DESTINATION ${CMAKE_INSTALL_BINDIR})
+diff --git i/cyacas/yacas-kernel/include/yacas_kernel.hpp w/cyacas/yacas-kernel/include/yacas_kernel.hpp
+index 91d36ac0..d12f905c 100644
+--- i/cyacas/yacas-kernel/include/yacas_kernel.hpp
++++ w/cyacas/yacas-kernel/include/yacas_kernel.hpp
+@@ -29,7 +29,7 @@
+ #include "yacas_engine.hpp"
+ 
+ #include <boost/uuid/random_generator.hpp>
+-#include <jsoncpp/json/json.h>
++#include <json/json.h>
+ #include <zmqpp/zmqpp.hpp>
+ 
+ #include <map>
+diff --git i/cyacas/yacas-kernel/src/main.cpp w/cyacas/yacas-kernel/src/main.cpp
+index c31f17f2..832e9128 100644
+--- i/cyacas/yacas-kernel/src/main.cpp
++++ w/cyacas/yacas-kernel/src/main.cpp
+@@ -24,7 +24,7 @@
+ 
+ #include "yacas_kernel.hpp"
+ 
+-#include <jsoncpp/json/json.h>
++#include <json/json.h>
+ 
+ #include <boost/dll/runtime_symbol_info.hpp>
+ 
+diff --git i/cyacas/yacas-kernel/src/yacas_engine.cpp w/cyacas/yacas-kernel/src/yacas_engine.cpp
+index 6ed60ca3..18e9b3fd 100644
+--- i/cyacas/yacas-kernel/src/yacas_engine.cpp
++++ w/cyacas/yacas-kernel/src/yacas_engine.cpp
+@@ -22,7 +22,7 @@
+  * Created on November 7, 2015, 12:52 PM
+  */
+ 
+-#include <jsoncpp/json/writer.h>
++#include <json/writer.h>
+ 
+ #include "yacas_engine.hpp"
+