about summary refs log tree commit diff
path: root/pkgs/applications/science
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/science')
-rw-r--r--pkgs/applications/science/astronomy/astrolog/default.nix2
-rw-r--r--pkgs/applications/science/astronomy/gildas/default.nix10
-rw-r--r--pkgs/applications/science/astronomy/gildas/python-ldflags.patch13
-rw-r--r--pkgs/applications/science/astronomy/gprojector/default.nix4
-rw-r--r--pkgs/applications/science/astronomy/kstars/default.nix4
-rw-r--r--pkgs/applications/science/astronomy/xplanet/default.nix4
-rw-r--r--pkgs/applications/science/biology/ants/default.nix8
-rw-r--r--pkgs/applications/science/biology/bayescan/default.nix2
-rw-r--r--pkgs/applications/science/biology/bcftools/default.nix4
-rw-r--r--pkgs/applications/science/biology/bowtie/default.nix2
-rw-r--r--pkgs/applications/science/biology/cmtk/default.nix2
-rw-r--r--pkgs/applications/science/biology/dcm2niix/default.nix6
-rw-r--r--pkgs/applications/science/biology/diamond/default.nix4
-rw-r--r--pkgs/applications/science/biology/eggnog-mapper/default.nix4
-rw-r--r--pkgs/applications/science/biology/freebayes/default.nix2
-rw-r--r--pkgs/applications/science/biology/igv/default.nix4
-rw-r--r--pkgs/applications/science/biology/inormalize/default.nix2
-rw-r--r--pkgs/applications/science/biology/last/default.nix29
-rw-r--r--pkgs/applications/science/biology/minc-widgets/default.nix3
-rw-r--r--pkgs/applications/science/biology/minia/default.nix2
-rw-r--r--pkgs/applications/science/biology/nest/default.nix85
-rw-r--r--pkgs/applications/science/biology/neuron/default.nix154
-rw-r--r--pkgs/applications/science/biology/neuron/neuron-carbon-disable.patch21
-rw-r--r--pkgs/applications/science/biology/neuron/neuron_darwin_rpath.patch11
-rw-r--r--pkgs/applications/science/biology/niftyreg/default.nix2
-rw-r--r--pkgs/applications/science/biology/octopus/default.nix5
-rw-r--r--pkgs/applications/science/biology/paml/default.nix2
-rw-r--r--pkgs/applications/science/biology/plink-ng/default.nix2
-rw-r--r--pkgs/applications/science/biology/quast/default.nix2
-rw-r--r--pkgs/applications/science/biology/seaview/default.nix2
-rw-r--r--pkgs/applications/science/biology/stacks/default.nix4
-rw-r--r--pkgs/applications/science/biology/strelka/default.nix2
-rw-r--r--pkgs/applications/science/biology/svaba/default.nix2
-rw-r--r--pkgs/applications/science/biology/tandem-aligner/default.nix10
-rw-r--r--pkgs/applications/science/biology/varscan/default.nix4
-rw-r--r--pkgs/applications/science/chemistry/avogadro/default.nix2
-rw-r--r--pkgs/applications/science/chemistry/chemtool/default.nix2
-rw-r--r--pkgs/applications/science/chemistry/d-seams/default.nix4
-rw-r--r--pkgs/applications/science/chemistry/jmol/default.nix4
-rw-r--r--pkgs/applications/science/chemistry/mopac/default.nix43
-rw-r--r--pkgs/applications/science/chemistry/nwchem/default.nix194
-rw-r--r--pkgs/applications/science/chemistry/octopus/default.nix8
-rw-r--r--pkgs/applications/science/chemistry/pymol/default.nix2
-rw-r--r--pkgs/applications/science/chemistry/wxmacmolplt/default.nix41
-rw-r--r--pkgs/applications/science/computer-architecture/timeloop/default.nix6
-rw-r--r--pkgs/applications/science/electronics/appcsxcad/default.nix6
-rw-r--r--pkgs/applications/science/electronics/csxcad/default.nix6
-rw-r--r--pkgs/applications/science/electronics/digital/default.nix23
-rw-r--r--pkgs/applications/science/electronics/digital/pom.xml.patch30
-rw-r--r--pkgs/applications/science/electronics/flatcam/default.nix32
-rw-r--r--pkgs/applications/science/electronics/flatcam/shapely-library-paths.patch31
-rw-r--r--pkgs/applications/science/electronics/fped/default.nix2
-rw-r--r--pkgs/applications/science/electronics/fritzing/default.nix2
-rw-r--r--pkgs/applications/science/electronics/gtkwave/default.nix2
-rw-r--r--pkgs/applications/science/electronics/kicad/base.nix31
-rw-r--r--pkgs/applications/science/electronics/kicad/default.nix27
-rw-r--r--pkgs/applications/science/electronics/kicad/versions.nix48
-rw-r--r--pkgs/applications/science/electronics/magic-vlsi/default.nix2
-rw-r--r--pkgs/applications/science/electronics/nanovna-saver/default.nix19
-rw-r--r--pkgs/applications/science/electronics/nvc/default.nix6
-rw-r--r--pkgs/applications/science/electronics/openboardview/default.nix20
-rw-r--r--pkgs/applications/science/electronics/qucs/default.nix2
-rw-r--r--pkgs/applications/science/electronics/verilator/default.nix18
-rw-r--r--pkgs/applications/science/electronics/xoscope/default.nix2
-rw-r--r--pkgs/applications/science/logic/abc/default.nix6
-rw-r--r--pkgs/applications/science/logic/abella/default.nix4
-rw-r--r--pkgs/applications/science/logic/acgtk/default.nix16
-rw-r--r--pkgs/applications/science/logic/alt-ergo/default.nix4
-rw-r--r--pkgs/applications/science/logic/avy/default.nix2
-rw-r--r--pkgs/applications/science/logic/cbmc/default.nix14
-rw-r--r--pkgs/applications/science/logic/coq/default.nix14
-rw-r--r--pkgs/applications/science/logic/cryptominisat/default.nix34
-rw-r--r--pkgs/applications/science/logic/cryptoverif/default.nix4
-rw-r--r--pkgs/applications/science/logic/cvc4/cvc4-bash-patsub-replacement.patch39
-rw-r--r--pkgs/applications/science/logic/cvc4/default.nix4
-rw-r--r--pkgs/applications/science/logic/cvc5/default.nix13
-rw-r--r--pkgs/applications/science/logic/ekrhyper/default.nix6
-rw-r--r--pkgs/applications/science/logic/hol_light/default.nix4
-rw-r--r--pkgs/applications/science/logic/iprover/default.nix5
-rw-r--r--pkgs/applications/science/logic/klee/default.nix2
-rw-r--r--pkgs/applications/science/logic/leo2/default.nix6
-rw-r--r--pkgs/applications/science/logic/ott/default.nix7
-rw-r--r--pkgs/applications/science/logic/prooftree/default.nix7
-rw-r--r--pkgs/applications/science/logic/proverif/default.nix4
-rw-r--r--pkgs/applications/science/logic/satallax/default.nix9
-rw-r--r--pkgs/applications/science/logic/statverif/default.nix4
-rw-r--r--pkgs/applications/science/logic/tlaplus/tlaps.nix4
-rw-r--r--pkgs/applications/science/logic/why3/default.nix10
-rw-r--r--pkgs/applications/science/logic/yices/default.nix2
-rw-r--r--pkgs/applications/science/logic/z3/default.nix22
-rw-r--r--pkgs/applications/science/machine-learning/finalfrontier/default.nix8
-rwxr-xr-xpkgs/applications/science/machine-learning/streamlit/default.nix4
-rw-r--r--pkgs/applications/science/math/R/default.nix12
-rw-r--r--pkgs/applications/science/math/bliss/default.nix2
-rw-r--r--pkgs/applications/science/math/caffe/default.nix8
-rw-r--r--pkgs/applications/science/math/calc/default.nix4
-rw-r--r--pkgs/applications/science/math/calculix/default.nix2
-rw-r--r--pkgs/applications/science/math/cntk/default.nix2
-rw-r--r--pkgs/applications/science/math/eukleides/default.nix2
-rw-r--r--pkgs/applications/science/math/gap/default.nix2
-rw-r--r--pkgs/applications/science/math/ginac/default.nix4
-rw-r--r--pkgs/applications/science/math/gretl/default.nix2
-rw-r--r--pkgs/applications/science/math/lp_solve/default.nix2
-rw-r--r--pkgs/applications/science/math/mxnet/default.nix8
-rw-r--r--pkgs/applications/science/math/pari/default.nix14
-rw-r--r--pkgs/applications/science/math/perseus/default.nix2
-rw-r--r--pkgs/applications/science/math/polymake/default.nix4
-rw-r--r--pkgs/applications/science/math/programmer-calculator/default.nix4
-rw-r--r--pkgs/applications/science/math/readstat/default.nix4
-rw-r--r--pkgs/applications/science/math/sage/README.md40
-rw-r--r--pkgs/applications/science/math/sage/env-locations.nix3
-rw-r--r--pkgs/applications/science/math/sage/patches/pari-2.15.1-upgrade-rebased.patch26
-rw-r--r--pkgs/applications/science/math/sage/sage-src.nix74
-rw-r--r--pkgs/applications/science/math/sage/sage-tests.nix2
-rw-r--r--pkgs/applications/science/math/scilab-bin/default.nix118
-rw-r--r--pkgs/applications/science/math/singular/default.nix2
-rw-r--r--pkgs/applications/science/misc/cwltool/default.nix4
-rw-r--r--pkgs/applications/science/misc/fityk/default.nix2
-rw-r--r--pkgs/applications/science/misc/openmodelica/mkderivation/default.nix2
-rw-r--r--pkgs/applications/science/misc/openmvg/default.nix7
-rw-r--r--pkgs/applications/science/misc/openmvs/default.nix52
-rw-r--r--pkgs/applications/science/misc/root/default.nix1
-rw-r--r--pkgs/applications/science/molecular-dynamics/gromacs/default.nix6
-rw-r--r--pkgs/applications/science/physics/dawncut/default.nix2
-rw-r--r--pkgs/applications/science/physics/elmerfem/default.nix4
-rw-r--r--pkgs/applications/science/physics/nnpdf/default.nix16
-rw-r--r--pkgs/applications/science/physics/xfitter/default.nix6
-rw-r--r--pkgs/applications/science/robotics/betaflight-configurator/default.nix4
128 files changed, 1100 insertions, 641 deletions
diff --git a/pkgs/applications/science/astronomy/astrolog/default.nix b/pkgs/applications/science/astronomy/astrolog/default.nix
index 26d0639ae67f2..743a58e9e053d 100644
--- a/pkgs/applications/science/astronomy/astrolog/default.nix
+++ b/pkgs/applications/science/astronomy/astrolog/default.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
   '';
 
   buildInputs = [ xorg.libX11 ];
-  NIX_CFLAGS_COMPILE = "-Wno-format-security";
+  env.NIX_CFLAGS_COMPILE = "-Wno-format-security";
 
   installPhase =
   let
diff --git a/pkgs/applications/science/astronomy/gildas/default.nix b/pkgs/applications/science/astronomy/gildas/default.nix
index 703416f074aa8..64e3f8713b2f8 100644
--- a/pkgs/applications/science/astronomy/gildas/default.nix
+++ b/pkgs/applications/science/astronomy/gildas/default.nix
@@ -7,8 +7,8 @@ let
 in
 
 stdenv.mkDerivation rec {
-  srcVersion = "oct22b";
-  version = "20221001_b";
+  srcVersion = "feb23a";
+  version = "20230201_a";
   pname = "gildas";
 
   src = fetchurl {
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
     # source code of the previous release to a different directory
     urls = [ "http://www.iram.fr/~gildas/dist/gildas-src-${srcVersion}.tar.xz"
       "http://www.iram.fr/~gildas/dist/archive/gildas/gildas-src-${srcVersion}.tar.xz" ];
-    sha256 = "sha256-MGfU2gzBbJ8ITpU7OiwCaHbi8s9Y6gvcAvSUuEZjfqk=";
+    sha256 = "sha256-A6jtcC8QMtJ7YcNaPiOjwNPDGPAjmRA3jZLEt5iBONE=";
   };
 
   nativeBuildInputs = [ pkg-config groff perl getopt gfortran which ];
@@ -24,9 +24,9 @@ stdenv.mkDerivation rec {
   buildInputs = [ gtk2-x11 lesstif cfitsio python3Env ncurses ]
     ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ CoreFoundation ]);
 
-  patches = [ ./wrapper.patch ./clang.patch ./aarch64.patch ./python-ldflags.patch ];
+  patches = [ ./wrapper.patch ./clang.patch ./aarch64.patch ];
 
-  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-unused-command-line-argument";
+  env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-unused-command-line-argument";
 
   NIX_LDFLAGS = lib.optionalString stdenv.isDarwin (with darwin.apple_sdk.frameworks; "-F${CoreFoundation}/Library/Frameworks");
 
diff --git a/pkgs/applications/science/astronomy/gildas/python-ldflags.patch b/pkgs/applications/science/astronomy/gildas/python-ldflags.patch
deleted file mode 100644
index 3bbcb9f36e990..0000000000000
--- a/pkgs/applications/science/astronomy/gildas/python-ldflags.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff -ruN gildas-src-oct22b/admin/python-config-ldflags.py gildas-src-oct22b.patched/admin/python-config-ldflags.py
---- gildas-src-oct22b/admin/python-config-ldflags.py	2022-10-03 14:16:33.000000000 +0200
-+++ gildas-src-oct22b.patched/admin/python-config-ldflags.py	2022-10-19 22:03:53.000000000 +0200
-@@ -32,7 +32,7 @@
-   libs.insert(0, '-L' + getvar('LIBDIR'))
- 
- # Framework (specific for Mac)
--if not getvar('PYTHONFRAMEWORK'):
--    libs.extend(getvar('LINKFORSHARED').split())
-+#if not getvar('PYTHONFRAMEWORK'):
-+#    libs.extend(getvar('LINKFORSHARED').split())
- 
- print(' '.join(libs))
diff --git a/pkgs/applications/science/astronomy/gprojector/default.nix b/pkgs/applications/science/astronomy/gprojector/default.nix
index f5fa5f1d1e4b8..5fd698788cc97 100644
--- a/pkgs/applications/science/astronomy/gprojector/default.nix
+++ b/pkgs/applications/science/astronomy/gprojector/default.nix
@@ -10,11 +10,11 @@
 
 stdenvNoCC.mkDerivation rec {
   pname = "gprojector";
-  version = "3.0.4";
+  version = "3.0.6";
 
   src = fetchzip {
     url = "https://www.giss.nasa.gov/tools/gprojector/download/G.ProjectorJ-${version}.tgz";
-    sha256 = "sha256-6EixVNRgYnuY9INb7gAyBzo125DhPEUPD+pGxjzmhy8=";
+    sha256 = "sha256-aw/p6mbTJl023d46NUZV3pnP4WVdYqZTFmgGlHEKfq0=";
   };
 
   desktopItems = [ (makeDesktopItem {
diff --git a/pkgs/applications/science/astronomy/kstars/default.nix b/pkgs/applications/science/astronomy/kstars/default.nix
index d74ad2c4e8788..3769948fd3eff 100644
--- a/pkgs/applications/science/astronomy/kstars/default.nix
+++ b/pkgs/applications/science/astronomy/kstars/default.nix
@@ -14,11 +14,11 @@
 
 mkDerivation rec {
   pname = "kstars";
-  version = "3.6.1";
+  version = "3.6.3";
 
   src = fetchurl {
     url = "mirror://kde/stable/kstars/kstars-${version}.tar.xz";
-    sha256 = "sha256-WWbtfqvGd13+a41z8/MjlchllpuhLX08nu15OlYUeuI=";
+    sha256 = "sha256-sve9q4iM/Y8+K64Ceby/KGx5Un5G0o5cCnIxJkXTgug=";
   };
 
   nativeBuildInputs = [ extra-cmake-modules kdoctools ];
diff --git a/pkgs/applications/science/astronomy/xplanet/default.nix b/pkgs/applications/science/astronomy/xplanet/default.nix
index 8c0cb2be32b9d..94aa92a1b713f 100644
--- a/pkgs/applications/science/astronomy/xplanet/default.nix
+++ b/pkgs/applications/science/astronomy/xplanet/default.nix
@@ -26,11 +26,11 @@ stdenv.mkDerivation rec {
     })
   ];
 
-  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=c++11-narrowing";
+  env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=c++11-narrowing";
 
   meta = with lib; {
     description = "Renders an image of the earth or other planets into the X root window";
-    homepage = "http://xplanet.sourceforge.net";
+    homepage = "https://xplanet.sourceforge.net";
     license = licenses.gpl2;
     maintainers = with maintainers; [ lassulus sander ];
     platforms = platforms.all;
diff --git a/pkgs/applications/science/biology/ants/default.nix b/pkgs/applications/science/biology/ants/default.nix
index e117af03b57dd..4c5f3162febdb 100644
--- a/pkgs/applications/science/biology/ants/default.nix
+++ b/pkgs/applications/science/biology/ants/default.nix
@@ -1,18 +1,18 @@
-{ lib, stdenv, fetchFromGitHub, cmake, makeWrapper, itk, vtk_8, Cocoa }:
+{ lib, stdenv, fetchFromGitHub, cmake, makeWrapper, itk, vtk, Cocoa }:
 
 stdenv.mkDerivation rec {
-  pname    = "ANTs";
+  pname = "ANTs";
   version = "2.4.3";
 
   src = fetchFromGitHub {
     owner  = "ANTsX";
     repo   = "ANTs";
-    rev    = "v${version}";
+    rev    = "refs/tags/v${version}";
     sha256 = "sha256-S4HYhsqof27UXEYjKvbod8N7PkZDmwLdwcEAvJD0W5g=";
   };
 
   nativeBuildInputs = [ cmake makeWrapper ];
-  buildInputs = [ itk vtk_8 ] ++ lib.optionals stdenv.isDarwin [ Cocoa ];
+  buildInputs = [ itk vtk ] ++ lib.optionals stdenv.isDarwin [ Cocoa ];
 
   cmakeFlags = [ "-DANTS_SUPERBUILD=FALSE" "-DUSE_VTK=TRUE" ];
 
diff --git a/pkgs/applications/science/biology/bayescan/default.nix b/pkgs/applications/science/biology/bayescan/default.nix
index cd5bb3210364e..e715ff4b45b06 100644
--- a/pkgs/applications/science/biology/bayescan/default.nix
+++ b/pkgs/applications/science/biology/bayescan/default.nix
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
     cp -r ../*pdf ../input_examples ../"R functions" $out/share/doc/bayescan
   '';
 
-  NIX_CFLAGS_COMPILE = [ "-std=c++14" ];
+  env.NIX_CFLAGS_COMPILE = toString [ "-std=c++14" ];
 
   meta = with lib; {
     description = "Detecting natural selection from population-based genetic data";
diff --git a/pkgs/applications/science/biology/bcftools/default.nix b/pkgs/applications/science/biology/bcftools/default.nix
index 719f450650029..993afff5965e9 100644
--- a/pkgs/applications/science/biology/bcftools/default.nix
+++ b/pkgs/applications/science/biology/bcftools/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "bcftools";
-  version = "1.16";
+  version = "1.17";
 
   src = fetchurl {
     url = "https://github.com/samtools/bcftools/releases/download/${version}/${pname}-${version}.tar.bz2";
-    sha256 = "sha256-kL9kfJrXnhCiQ7gFjIc94Ff9cBLiUNWuZXSDl4ei7NY=";
+    sha256 = "sha256-AfddjnAdhbLHWRckEgCcwE8pthYWrOL6dRFhI95Flsw=";
   };
 
   nativeBuildInputs = [
diff --git a/pkgs/applications/science/biology/bowtie/default.nix b/pkgs/applications/science/biology/bowtie/default.nix
index ccb797d8a227e..bec263a2d9315 100644
--- a/pkgs/applications/science/biology/bowtie/default.nix
+++ b/pkgs/applications/science/biology/bowtie/default.nix
@@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
   meta = with lib; {
     description = "An ultrafast memory-efficient short read aligner";
     license = licenses.artistic2;
-    homepage = "http://bowtie-bio.sourceforge.net";
+    homepage = "https://bowtie-bio.sourceforge.net";
     maintainers = with maintainers; [ prusnak ];
     platforms = platforms.all;
   };
diff --git a/pkgs/applications/science/biology/cmtk/default.nix b/pkgs/applications/science/biology/cmtk/default.nix
index 42ce5f934e826..3eef648372555 100644
--- a/pkgs/applications/science/biology/cmtk/default.nix
+++ b/pkgs/applications/science/biology/cmtk/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  NIX_CFLAGS_COMPILE = [
+  env.NIX_CFLAGS_COMPILE = toString [
     "-std=c++11"
     (lib.optional stdenv.cc.isClang "-Wno-error=c++11-narrowing")
   ];
diff --git a/pkgs/applications/science/biology/dcm2niix/default.nix b/pkgs/applications/science/biology/dcm2niix/default.nix
index 90eef027a8425..cbde1647db9bf 100644
--- a/pkgs/applications/science/biology/dcm2niix/default.nix
+++ b/pkgs/applications/science/biology/dcm2niix/default.nix
@@ -4,7 +4,7 @@
 , substituteAll
 , cmake
 , openjpeg
-, libyamlcpp
+, yaml-cpp
 , batchVersion ? false
 , withJpegLs ? true
 , withOpenJpeg ? true
@@ -40,12 +40,12 @@ stdenv.mkDerivation rec {
   ];
 
   nativeBuildInputs = [ cmake ];
-  buildInputs = lib.optionals batchVersion [ libyamlcpp ]
+  buildInputs = lib.optionals batchVersion [ yaml-cpp ]
     ++ lib.optionals withOpenJpeg [ openjpeg openjpeg.dev ];
 
   cmakeFlags = lib.optionals batchVersion [
     "-DBATCH_VERSION=ON"
-    "-DYAML-CPP_DIR=${libyamlcpp}/lib/cmake/yaml-cpp"
+    "-DYAML-CPP_DIR=${yaml-cpp}/lib/cmake/yaml-cpp"
   ] ++ lib.optionals withJpegLs [
     "-DUSE_JPEGLS=ON"
   ] ++ lib.optionals withOpenJpeg [
diff --git a/pkgs/applications/science/biology/diamond/default.nix b/pkgs/applications/science/biology/diamond/default.nix
index 8073b1bea1634..241585b3579ed 100644
--- a/pkgs/applications/science/biology/diamond/default.nix
+++ b/pkgs/applications/science/biology/diamond/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "diamond";
-  version = "2.0.15";
+  version = "2.1.3";
 
   src = fetchFromGitHub {
     owner = "bbuchfink";
     repo = "diamond";
     rev = "v${version}";
-    sha256 = "17z9vwj58i1zc22gv4qscx0dk3nxf5ix443gxsibh3a5zsnc6dkg";
+    sha256 = "sha256-gvPftUSH+Gnn8LQeORpv7jjHewUKSeo2FVNcoaE2GKU=";
   };
 
 
diff --git a/pkgs/applications/science/biology/eggnog-mapper/default.nix b/pkgs/applications/science/biology/eggnog-mapper/default.nix
index 9aa655932d35a..c555a30b15a8d 100644
--- a/pkgs/applications/science/biology/eggnog-mapper/default.nix
+++ b/pkgs/applications/science/biology/eggnog-mapper/default.nix
@@ -8,13 +8,13 @@
 
 python3Packages.buildPythonApplication rec {
   pname = "eggnog-mapper";
-  version = "2.1.9";
+  version = "2.1.10";
 
   src = fetchFromGitHub {
     owner = "eggnogdb";
     repo = pname;
     rev = "refs/tags/${version}";
-    hash = "sha256-Fn7hJhZG/T8f2nP+ltl1/FBFwXz0Kxz/4mIma/Z0bnE=";
+    hash = "sha256-6R2gl2l2Cl/eva0g+kxDLBI2+5T9cFTgaGMsEfeDVU0=";
   };
 
   postPatch = ''
diff --git a/pkgs/applications/science/biology/freebayes/default.nix b/pkgs/applications/science/biology/freebayes/default.nix
index 5c2f09a4faefa..0ceaab4ab46be 100644
--- a/pkgs/applications/science/biology/freebayes/default.nix
+++ b/pkgs/applications/science/biology/freebayes/default.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
   # gcc-10. Otherwise build fails as:
   #   ld: foomatic_rip-options.o:/build/foomatic-filters-4.0.17/options.c:49: multiple definition of `cupsfilter';
   #     foomatic_rip-foomaticrip.o:/build/foomatic-filters-4.0.17/foomaticrip.c:158: first defined here
-  NIX_CFLAGS_COMPILE = "-fcommon";
+  env.NIX_CFLAGS_COMPILE = "-fcommon";
 
   installPhase = ''
     install -vD bin/freebayes bin/bamleftalign scripts/* -t $out/bin
diff --git a/pkgs/applications/science/biology/igv/default.nix b/pkgs/applications/science/biology/igv/default.nix
index f6d767235b7ff..ec97f0e6aa31d 100644
--- a/pkgs/applications/science/biology/igv/default.nix
+++ b/pkgs/applications/science/biology/igv/default.nix
@@ -2,10 +2,10 @@
 
 stdenv.mkDerivation rec {
   pname = "igv";
-  version = "2.15.5";
+  version = "2.16.0";
   src = fetchzip {
     url = "https://data.broadinstitute.org/igv/projects/downloads/${lib.versions.majorMinor version}/IGV_${version}.zip";
-    sha256 = "sha256-AKKMtR0hU2O84mRJxxsXNCYHeW8d6t3XJpzOKKaxAWw=";
+    sha256 = "sha256-pfFUtPgHzTWMm3sh4un8SwSYF8HM30HbAQznxlu4Irw=";
   };
 
   installPhase = ''
diff --git a/pkgs/applications/science/biology/inormalize/default.nix b/pkgs/applications/science/biology/inormalize/default.nix
index 8ea115c6b25df..b4999193e177e 100644
--- a/pkgs/applications/science/biology/inormalize/default.nix
+++ b/pkgs/applications/science/biology/inormalize/default.nix
@@ -4,7 +4,7 @@
 
 stdenv.mkDerivation rec {
   pname = "inormalize";
-  name  = "${pname}-2014-10-21";
+  version  = "unstable-2014-10-21";
 
   src = fetchFromGitHub {
     owner  = "BIC-MNI";
diff --git a/pkgs/applications/science/biology/last/default.nix b/pkgs/applications/science/biology/last/default.nix
index fe2b773fb0e30..0104a5506bc6a 100644
--- a/pkgs/applications/science/biology/last/default.nix
+++ b/pkgs/applications/science/biology/last/default.nix
@@ -1,20 +1,35 @@
-{ lib, stdenv, fetchFromGitLab, unzip, zlib, python3, parallel }:
+{ lib
+, stdenv
+, fetchFromGitLab
+, unzip
+, zlib
+, python3
+, parallel
+}:
 
 stdenv.mkDerivation rec {
   pname = "last";
-  version = "1422";
+  version = "1447";
 
   src = fetchFromGitLab {
     owner = "mcfrith";
     repo = "last";
-    rev = version;
-    sha256 = "sha256-3OhttOd6qgO6d+sbVkZj8i/K6bJTvlMyfa3E4mIpt24=";
+    rev = "refs/tags/${version}";
+    hash = "sha256-zts1F2tFeBP7CQifpc2M4i6duK8FA7hQXTOizv8/kWM=";
   };
 
-  nativeBuildInputs = [ unzip ];
-  buildInputs = [ zlib python3 ];
+  nativeBuildInputs = [
+    unzip
+  ];
 
-  makeFlags = [ "prefix=${placeholder "out"}" ];
+  buildInputs = [
+    zlib
+    python3
+  ];
+
+  makeFlags = [
+    "prefix=${placeholder "out"}"
+  ];
 
   postFixup = ''
     for f in $out/bin/parallel-* ; do
diff --git a/pkgs/applications/science/biology/minc-widgets/default.nix b/pkgs/applications/science/biology/minc-widgets/default.nix
index e8aef4138b05e..42178722b5517 100644
--- a/pkgs/applications/science/biology/minc-widgets/default.nix
+++ b/pkgs/applications/science/biology/minc-widgets/default.nix
@@ -4,8 +4,7 @@
 
 stdenv.mkDerivation rec {
   pname = "minc-widgets";
-  name  = "${pname}-2016-04-20";
-
+  version = "unstable-2016-04-20";
 
   src = fetchFromGitHub {
     owner  = "BIC-MNI";
diff --git a/pkgs/applications/science/biology/minia/default.nix b/pkgs/applications/science/biology/minia/default.nix
index 6b6bc300e0d9f..023a05d7504f9 100644
--- a/pkgs/applications/science/biology/minia/default.nix
+++ b/pkgs/applications/science/biology/minia/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
 
   patches = [ ./no-bundle.patch ];
 
-  NIX_CFLAGS_COMPILE = [ "-Wformat" ];
+  env.NIX_CFLAGS_COMPILE = toString [ "-Wformat" ];
 
   nativeBuildInputs = [ cmake ];
   buildInputs = [ hdf5 boost ];
diff --git a/pkgs/applications/science/biology/nest/default.nix b/pkgs/applications/science/biology/nest/default.nix
new file mode 100644
index 0000000000000..f26f06a1f298b
--- /dev/null
+++ b/pkgs/applications/science/biology/nest/default.nix
@@ -0,0 +1,85 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, testers
+, cmake
+, gsl
+, libtool
+, findutils
+, llvmPackages
+, mpi
+, nest
+, pkg-config
+, boost
+, python3
+, readline
+, autoPatchelfHook
+, withPython ? false
+, withMpi ? false
+}:
+
+stdenv.mkDerivation rec {
+  pname = "nest";
+  version = "3.3";
+
+  src = fetchFromGitHub {
+    owner = "nest";
+    repo = "nest-simulator";
+    rev = "v${version}";
+    sha256 = "sha256-wmn5LOOHlSuyPdV6O6v7j10dxdcvqpym6MfveZdL+dU=";
+  };
+
+  postPatch = ''
+    patchShebangs cmake/CheckFiles/check_return_val.sh
+    # fix PyNEST installation path
+    # it expects CMAKE_INSTALL_LIBDIR to be relative
+    substituteInPlace cmake/ProcessOptions.cmake \
+      --replace "\''${CMAKE_INSTALL_LIBDIR}/python" "lib/python"
+  '';
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+    findutils
+  ];
+
+  buildInputs = [
+    gsl
+    readline
+    libtool # libltdl
+    boost
+  ] ++ lib.optionals withPython [
+    python3
+    python3.pkgs.cython
+  ] ++ lib.optional withMpi mpi
+    ++ lib.optional stdenv.isDarwin llvmPackages.openmp;
+
+  propagatedBuildInputs = with python3.pkgs; [
+    numpy
+  ];
+
+  cmakeFlags = [
+    "-Dwith-python=${if withPython then "ON" else "OFF"}"
+    "-Dwith-mpi=${if withMpi then "ON" else "OFF"}"
+    "-Dwith-openmp=ON"
+  ];
+
+  postInstall = ''
+    # Alternative to autoPatchElf, moves libraries where
+    # Nest expects them to be
+    find $out/lib/nest -type f -exec ln -s {} $out/lib \;
+  '';
+
+  passthru.tests.version = testers.testVersion {
+    package = nest;
+    command = "nest --version";
+  };
+
+  meta = with lib; {
+    description = "NEST is a command line tool for simulating neural networks";
+    homepage = "https://www.nest-simulator.org/";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ jiegec davidcromp ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/pkgs/applications/science/biology/neuron/default.nix b/pkgs/applications/science/biology/neuron/default.nix
index a35d586b9ac3f..115def63a3097 100644
--- a/pkgs/applications/science/biology/neuron/default.nix
+++ b/pkgs/applications/science/biology/neuron/default.nix
@@ -1,94 +1,104 @@
-{ lib, stdenv
+{ lib
+, stdenv
 , fetchurl
-, pkg-config
-, automake
-, autoconf
-, libtool
-, ncurses
 , readline
-, which
-, python ? null
-, useMpi ? false
+, xorg
 , mpi
-, iv
+, cmake
+, bison
+, flex
+, git
+, perl
+, gsl
+, xcbuild
+, python3
+, useMpi ? false
+, useIv ? true
+, useCore ? false
+, useRx3d ? false
 }:
 
+
 stdenv.mkDerivation rec {
-  pname = "neuron${lib.optionalString useMpi "-mpi"}";
-  version = "7.5";
+  pname = "neuron";
+  version = "8.2.2";
 
-  nativeBuildInputs = [ which pkg-config automake autoconf libtool ];
-  buildInputs = [ ncurses readline python iv ]
-    ++ lib.optional useMpi mpi;
+  # format is for pythonModule conversion
+  format = "other";
 
-  src = fetchurl {
-    url = "https://www.neuron.yale.edu/ftp/neuron/versions/v${version}/nrn-${version}.tar.gz";
-    sha256 = "0f26v3qvzblcdjg7isq0m9j2q8q7x3vhmkfllv8lsr3gyj44lljf";
-  };
+  nativeBuildInputs = [
+    cmake
+    bison
+    flex
+    git
+  ] ++ lib.optional useCore [ perl gsl ]
+  ++ lib.optional stdenv.isDarwin [ xcbuild ];
 
-  patches = (lib.optionals (stdenv.isDarwin) [ ./neuron-carbon-disable.patch ]);
+  buildInputs = lib.optional useIv [
+    xorg.libX11.dev
+    xorg.libXcomposite.dev
+    xorg.libXext.dev
+  ];
 
-  # With LLVM 3.8 and above, clang (really libc++) gets upset if you attempt to redefine these...
-  postPatch = lib.optionalString stdenv.cc.isClang ''
-    substituteInPlace src/gnu/neuron_gnu_builtin.h \
-      --replace 'double abs(double arg);' "" \
-      --replace 'float abs(float arg);' "" \
-      --replace 'short abs(short arg);' "" \
-      --replace 'long abs(long arg);' ""
-  '' + lib.optionalString stdenv.isDarwin ''
-    # we are darwin, but we don't have all the quirks the source wants to compensate for
-    substituteInPlace src/nrnpython/setup.py.in --replace 'readline="edit"' 'readline="readline"'
-    for f in src/nrnpython/*.[ch] ; do
-      substituteInPlace $f --replace "<Python/Python.h>" "<Python.h>"
-    done
-  '';
+  propagatedBuildInputs = [
+    readline
+    python3
+    python3.pkgs.wheel
+    python3.pkgs.setuptools
+    python3.pkgs.scikit-build
+    python3.pkgs.matplotlib
+  ] ++ lib.optional useMpi [
+    mpi
+  ] ++ lib.optional useMpi [
+    python3.pkgs.mpi4py
+  ] ++ lib.optional useRx3d [
+    python3.pkgs.cython
+    python3.pkgs.numpy
+  ];
 
-  enableParallelBuilding = true;
+  patches = [ ./neuron_darwin_rpath.patch ];
 
-  ## neuron install by default everything under prefix/${host_arch}/*
-  ## override this to support nix standard file hierarchy
-  ## without issues: install everything under prefix/
-  preConfigure = ''
-    ./build.sh
-    export prefix="''${prefix} --exec-prefix=''${out}"
+  # Patch build shells for cmake (bin, src, cmake) and submodules (external)
+  postPatch = ''
+    patchShebangs ./bin ./src ./external ./cmake
+    sed -e 's#DESTDIR =#DESTDIR = '"$out"'#' -i external/coreneuron/extra/nrnivmodl_core_makefile.in
   '';
 
-  configureFlags = with lib;
-                    [ "--with-readline=${readline}" "--with-iv=${iv}" ]
-                    ++  optionals (python != null)  [ "--with-nrnpython=${python.interpreter}" ]
-                    ++ (if useMpi then ["--with-mpi" "--with-paranrn"]
-                        else ["--without-mpi"]);
+  cmakeFlags = [
+    "-DNRN_ENABLE_INTERVIEWS=${if useIv then "ON" else "OFF"}"
+    "-DNRN_ENABLE_MPI=${if useMpi then "ON" else "OFF"}"
+    "-DNRN_ENABLE_CORENEURON=${if useCore then "ON" else "OFF"}"
+    "-DNRN_ENABLE_RX3D=${if useRx3d then "ON" else "OFF"}"
+  ];
 
-
-  postInstall = lib.optionalString (python != null) ''
-    ## standardise python neuron install dir if any
-    if [[ -d $out/lib/python ]]; then
-        mkdir -p ''${out}/${python.sitePackages}
-        mv ''${out}/lib/python/*  ''${out}/${python.sitePackages}/
-    fi
+  postInstall = ''
+    mkdir -p $out/${python3.sitePackages}
+    mv $out/lib/python/* $out/${python3.sitePackages}/
+    rm -rf $out/lib/python build
+    for entry in $out/lib/*.so; do
+      # remove references to build
+      patchelf --set-rpath $(patchelf --print-rpath $entry | tr ':' '\n' | sed '/^\/build/d' | tr '\n' ':') $entry
+    done
   '';
 
-  propagatedBuildInputs = [ readline ncurses which libtool ];
+  src = fetchurl {
+    url = "https://github.com/neuronsimulator/nrn/releases/download/${version}/full-src-package-${version}.tar.gz";
+    sha256 = "sha256-orGeBxu3pu4AyAW5P1EGJv8G0dOUZcSOjpUaloqicZU=";
+  };
 
   meta = with lib; {
-    broken = stdenv.isDarwin;
     description = "Simulation environment for empirically-based simulations of neurons and networks of neurons";
-
-    longDescription = "NEURON is a simulation environment for developing and exercising models of
-                neurons and networks of neurons. It is particularly well-suited to problems where
-                cable properties of cells play an important role, possibly including extracellular
-                potential close to the membrane), and where cell membrane properties are complex,
-                involving many ion-specific channels, ion accumulation, and second messengers";
-
-    sourceProvenance = with sourceTypes; [
-      fromSource
-    ] ++ lib.optionals (python != null) [
-      binaryNativeCode  # "geometry3d" bundled libraries
-    ];
-    license     = licenses.bsd3;
-    homepage    = "http://www.neuron.yale.edu/neuron";
-    maintainers = [ maintainers.adev ];
-    # source claims it's only tested for x86 and powerpc
-    platforms   = platforms.x86_64 ++ platforms.i686;
+    longDescription = ''
+      NEURON is a simulation environment for developing and exercising models of
+      neurons and networks of neurons. It is particularly well-suited to problems where
+      cable properties of cells play an important role, possibly including extracellular
+      potential close to the membrane), and where cell membrane properties are complex,
+      involving many ion-specific channels, ion accumulation, and second messengers
+    '';
+    sourceProvenance = with sourceTypes; [ fromSource ];
+    license = licenses.bsd3;
+    homepage = "http://www.neuron.yale.edu/neuron";
+    maintainers = with maintainers; [ adev davidcromp ];
+    platforms = platforms.all;
   };
 }
diff --git a/pkgs/applications/science/biology/neuron/neuron-carbon-disable.patch b/pkgs/applications/science/biology/neuron/neuron-carbon-disable.patch
deleted file mode 100644
index 923bffb1c338e..0000000000000
--- a/pkgs/applications/science/biology/neuron/neuron-carbon-disable.patch
+++ /dev/null
@@ -1,21 +0,0 @@
---- nrn-7.4/src/mac/Makefile.am	2015-11-12 21:42:45.000000000 +0100
-+++ nrn-7.4.new/src/mac/Makefile.am	2016-08-24 17:43:39.000000000 +0200
-@@ -15,18 +15,8 @@
- host_cpu = @host_cpu@
- 
- if MAC_DARWIN
--carbon = @enable_carbon@
- bin_SCRIPTS = $(launch_scripts)
- install: install-am
--if UniversalMacBinary
--	$(CC) -arch ppc -o aoutppc -Dcpu="\"$(host_cpu)\"" -I. $(srcdir)/launch.c $(srcdir)/mac2uxarg.c -framework Carbon
--	$(CC) -arch i386 -o aouti386 -Dcpu="\"$(host_cpu)\"" -I. $(srcdir)/launch.c $(srcdir)/mac2uxarg.c -framework Carbon
--	lipo aouti386 aoutppc -create -output a.out
--else
--	gcc -g -arch i386 -Dncpu="\"$(host_cpu)\"" -I. $(srcdir)/launch.c $(srcdir)/mac2uxarg.c -framework Carbon
--
--endif
--	carbon=$(carbon) sh $(srcdir)/launch_inst.sh "$(host_cpu)" "$(DESTDIR)$(prefix)" "$(srcdir)"
- 	for i in $(S) ; do \
- 		sed "s/^CPU.*/CPU=\"$(host_cpu)\"/" < $(DESTDIR)$(bindir)/$$i > temp; \
- 		mv temp $(DESTDIR)$(bindir)/$$i; \
diff --git a/pkgs/applications/science/biology/neuron/neuron_darwin_rpath.patch b/pkgs/applications/science/biology/neuron/neuron_darwin_rpath.patch
new file mode 100644
index 0000000000000..1b0fa2670782a
--- /dev/null
+++ b/pkgs/applications/science/biology/neuron/neuron_darwin_rpath.patch
@@ -0,0 +1,11 @@
+--- a/src/nrnpython/setup.py.in
++++ b/src/nrnpython/setup.py.in
+@@ -124,7 +124,7 @@ libdirs = [destdir + get_escaped_path("@NRN_LIBDIR@"),
+ rpath_prefix_flag='-Wl,-R'
+ extra_link_args = [@NRN_LINK_FLAGS_COMMA_SEPARATED_STRINGS@]
+ @MAC_DARWIN_FALSE@extra_link_args += [rpath_prefix_flag+lib_path for lib_path in libdirs]
+-@MAC_DARWIN_TRUE@extra_link_args.append("-Wl,-rpath,@loader_path/../../")
++@MAC_DARWIN_TRUE@extra_link_args.append("-Wl,-rpath,@loader_path/../../../")
+ @MAC_DARWIN_TRUE@extra_link_args.append("-Wl,-rpath,%s" % ivlibdir)
+
+ # as neuron module will be built during make, add build/lib
diff --git a/pkgs/applications/science/biology/niftyreg/default.nix b/pkgs/applications/science/biology/niftyreg/default.nix
index d5f625893e925..0be59bcd726a0 100644
--- a/pkgs/applications/science/biology/niftyreg/default.nix
+++ b/pkgs/applications/science/biology/niftyreg/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "07v9v9s41lvw72wpb1jgh2nzanyc994779bd35p76vg8mzifmprl";
   };
 
-  NIX_CFLAGS_COMPILE = [ "-Wno-error=narrowing" ];
+  env.NIX_CFLAGS_COMPILE = toString [ "-Wno-error=narrowing" ];
 
   nativeBuildInputs = [ cmake ];
   buildInputs = [ zlib ];
diff --git a/pkgs/applications/science/biology/octopus/default.nix b/pkgs/applications/science/biology/octopus/default.nix
index 659b1e97f200f..c2948087d8ed7 100644
--- a/pkgs/applications/science/biology/octopus/default.nix
+++ b/pkgs/applications/science/biology/octopus/default.nix
@@ -19,6 +19,11 @@ stdenv.mkDerivation rec {
     sha256 = "sha256-VaUr63v7mzhh4VBghH7a7qrqOYwl6vucmmKzTi9yAjY=";
   }) ];
 
+  env.NIX_CFLAGS_COMPILE = toString [
+    # Needed with GCC 12
+    "-Wno-error=deprecated-declarations"
+  ];
+
   postInstall = ''
     mkdir $out/bin
     mv $out/octopus $out/bin
diff --git a/pkgs/applications/science/biology/paml/default.nix b/pkgs/applications/science/biology/paml/default.nix
index 66ba244cacd68..871c76dc6e31b 100644
--- a/pkgs/applications/science/biology/paml/default.nix
+++ b/pkgs/applications/science/biology/paml/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
   # gcc-10. Otherwise build fails as:
   #   ld: /build/ccKomtcd.o:(.bss+0x4544): multiple definition of `SeqTypes';
   #     /build/ccx7EsgU.o:(.bss+0x2a0dfdc): first defined here
-  NIX_CFLAGS_COMPILE = "-fcommon";
+  env.NIX_CFLAGS_COMPILE = "-fcommon";
 
   preBuild = ''
     cd ./src/
diff --git a/pkgs/applications/science/biology/plink-ng/default.nix b/pkgs/applications/science/biology/plink-ng/default.nix
index b21ef2d71d6c2..00fd0ff0083e0 100644
--- a/pkgs/applications/science/biology/plink-ng/default.nix
+++ b/pkgs/applications/science/biology/plink-ng/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   preBuild = ''
     sed -i 's|zlib-1.2.8/zlib.h|zlib.h|g' *.c *.h
-    ${if stdenv.cc.isClang then "sed -i 's|g++|clang++|g' Makefile.std" else ""}
+    ${lib.optionalString stdenv.cc.isClang "sed -i 's|g++|clang++|g' Makefile.std"}
 
     makeFlagsArray+=(
       ZLIB=-lz
diff --git a/pkgs/applications/science/biology/quast/default.nix b/pkgs/applications/science/biology/quast/default.nix
index 0a33c97673196..e5ee4b53089f6 100644
--- a/pkgs/applications/science/biology/quast/default.nix
+++ b/pkgs/applications/science/biology/quast/default.nix
@@ -27,7 +27,7 @@ pythonPackages.buildPythonApplication rec {
       --replace "/bin/bash" "${bash}/bin/bash"
     mkdir -p "$out/${python.sitePackages}"
     export PYTHONPATH="$out/${python.sitePackages}:$PYTHONPATH"
-    ${python.interpreter} setup.py install \
+    ${python.pythonForBuild.interpreter} setup.py install \
       --install-lib=$out/${python.sitePackages} \
       --prefix="$out"
   '';
diff --git a/pkgs/applications/science/biology/seaview/default.nix b/pkgs/applications/science/biology/seaview/default.nix
index 9cfa7cb933b0c..640d2f5ae4160 100644
--- a/pkgs/applications/science/biology/seaview/default.nix
+++ b/pkgs/applications/science/biology/seaview/default.nix
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
 
           Gouy M., Guindon S. & Gascuel O. (2010) SeaView version 4 : a multiplatform graphical user interface for sequence alignment and phylogenetic tree building. Molecular Biology and Evolution 27(2):221-224.
     '';
-    homepage = "http://doua.prabi.fr/software/seaview";
+    homepage = "https://doua.prabi.fr/software/seaview";
     license = licenses.gpl3;
     maintainers = [ maintainers.iimog ];
     platforms = platforms.linux;
diff --git a/pkgs/applications/science/biology/stacks/default.nix b/pkgs/applications/science/biology/stacks/default.nix
index 5fcb367ce5cb1..04ef7c2e062ba 100644
--- a/pkgs/applications/science/biology/stacks/default.nix
+++ b/pkgs/applications/science/biology/stacks/default.nix
@@ -2,10 +2,10 @@
 
 stdenv.mkDerivation rec {
   pname = "stacks";
-  version = "2.60";
+  version = "2.62";
   src = fetchurl {
     url = "http://catchenlab.life.illinois.edu/stacks/source/${pname}-${version}.tar.gz";
-    sha256 = "sha256-ppKG7Z1TyLwUyqRnGYk3QWPJqKeNcW04GMW7myPFSNM=";
+    sha256 = "sha256-7uhQVLC/AEPAPUdm3+vABoIwG4uhNy/EngjsrZjT0Ts=";
   };
 
   buildInputs = [ zlib ];
diff --git a/pkgs/applications/science/biology/strelka/default.nix b/pkgs/applications/science/biology/strelka/default.nix
index 8585f3770fbcd..9730601e4e7d1 100644
--- a/pkgs/applications/science/biology/strelka/default.nix
+++ b/pkgs/applications/science/biology/strelka/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ cmake ];
   buildInputs = [ zlib python2 ];
 
-  NIX_CFLAGS_COMPILE = [
+  env.NIX_CFLAGS_COMPILE = toString [
     "-Wno-error=maybe-uninitialized"
     "-Wno-error=pessimizing-move"
   ];
diff --git a/pkgs/applications/science/biology/svaba/default.nix b/pkgs/applications/science/biology/svaba/default.nix
index b1a174aaf882d..441c7ed6dcc3d 100644
--- a/pkgs/applications/science/biology/svaba/default.nix
+++ b/pkgs/applications/science/biology/svaba/default.nix
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
   # gcc-10. Otherwise build fails as:
   #   ld: ./libfml.a(rle.o):/build/source/SeqLib/fermi-lite/rle.h:33: multiple definition of
   #     `rle_auxtab'; ./libfml.a(misc.o):/build/source/SeqLib/fermi-lite/rle.h:33: first defined here
-  NIX_CFLAGS_COMPILE = "-fcommon";
+  env.NIX_CFLAGS_COMPILE = "-fcommon";
 
   installPhase = ''
     runHook preInstall
diff --git a/pkgs/applications/science/biology/tandem-aligner/default.nix b/pkgs/applications/science/biology/tandem-aligner/default.nix
index f74ba9d2e4434..53daffbe0677e 100644
--- a/pkgs/applications/science/biology/tandem-aligner/default.nix
+++ b/pkgs/applications/science/biology/tandem-aligner/default.nix
@@ -1,6 +1,7 @@
 { lib
 , stdenv
 , fetchFromGitHub
+, fetchpatch
 , cmake
 , zlib
 }:
@@ -16,6 +17,15 @@ stdenv.mkDerivation {
     hash = "sha256-iMDj1HZ8LzmZckuAM3lbG3eSJSd/5JGVA6SBs7+AgX8=";
   };
 
+  patches = [
+    (fetchpatch {
+      # https://github.com/seryrzu/tandem_aligner/pull/4
+      url = "https://github.com/seryrzu/tandem_aligner/commit/8b516c94f90aaa9cb84278aa811285d4204b03a9.patch";
+      hash = "sha256-kD46SykXklG/avK0+sc61YKFw9Bes8ZgFAjVXmcpN8k=";
+      stripLen = 1;
+    })
+  ];
+
   sourceRoot = "source/tandem_aligner";
 
   nativeBuildInputs = [ cmake ];
diff --git a/pkgs/applications/science/biology/varscan/default.nix b/pkgs/applications/science/biology/varscan/default.nix
index 8b9b086b77b28..2c0cad05596a5 100644
--- a/pkgs/applications/science/biology/varscan/default.nix
+++ b/pkgs/applications/science/biology/varscan/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "varscan";
-  version = "2.4.4";
+  version = "2.4.5";
 
   src = fetchurl {
     url = "https://github.com/dkoboldt/varscan/raw/master/VarScan.v${version}.jar";
-    sha256 = "sha256-+yO3KrZ2+1qJvQIJHCtsmv8hC5a+4E2d7mrvTYtygU0=";
+    sha256 = "sha256-q4jkkKTqXHiaAPRThqo82i43+B4NaHUUuMyefW6tgg0=";
   };
 
   nativeBuildInputs = [ makeWrapper ];
diff --git a/pkgs/applications/science/chemistry/avogadro/default.nix b/pkgs/applications/science/chemistry/avogadro/default.nix
index c6339bab1228e..547123b67957c 100644
--- a/pkgs/applications/science/chemistry/avogadro/default.nix
+++ b/pkgs/applications/science/chemistry/avogadro/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake pkg-config doxygen ];
 
-  NIX_CFLAGS_COMPILE = "-include ${libGLU.dev}/include/GL/glu.h";
+  env.NIX_CFLAGS_COMPILE = "-include ${libGLU.dev}/include/GL/glu.h";
 
   patches = [
     (fetchurl {
diff --git a/pkgs/applications/science/chemistry/chemtool/default.nix b/pkgs/applications/science/chemistry/chemtool/default.nix
index 37057e1c604a4..fe2d658b5a44f 100644
--- a/pkgs/applications/science/chemistry/chemtool/default.nix
+++ b/pkgs/applications/science/chemistry/chemtool/default.nix
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
   # Otherwise built fails as:
   #   ld: inout.o:/build/chemtool-1.6.14/ct1.h:279: multiple definition of
   #     `outtype'; draw.o:/build/chemtool-1.6.14/ct1.h:279: first defined here
-  NIX_CFLAGS_COMPILE = "-fcommon";
+  env.NIX_CFLAGS_COMPILE = "-fcommon";
 
   preFixup = ''
     gappsWrapperArgs+=(--prefix PATH : "${lib.makeBinPath [ fig2dev ]}")
diff --git a/pkgs/applications/science/chemistry/d-seams/default.nix b/pkgs/applications/science/chemistry/d-seams/default.nix
index dc41019d364b0..260b1e24a082f 100644
--- a/pkgs/applications/science/chemistry/d-seams/default.nix
+++ b/pkgs/applications/science/chemistry/d-seams/default.nix
@@ -1,4 +1,4 @@
-{ clangStdenv, fetchFromGitHub, fetchpatch, catch2, rang, fmt, libyamlcpp, cmake
+{ clangStdenv, fetchFromGitHub, fetchpatch, catch2, rang, fmt, yaml-cpp, cmake
 , eigen, lua, luaPackages, liblapack, blas, lib, boost, gsl }:
 
 clangStdenv.mkDerivation rec {
@@ -20,7 +20,7 @@ clangStdenv.mkDerivation rec {
     })
   ];
   nativeBuildInputs = [ cmake lua luaPackages.luafilesystem ];
-  buildInputs = [ fmt rang libyamlcpp eigen catch2 boost gsl liblapack blas ];
+  buildInputs = [ fmt rang yaml-cpp eigen catch2 boost gsl liblapack blas ];
 
   meta = with lib; {
     description =
diff --git a/pkgs/applications/science/chemistry/jmol/default.nix b/pkgs/applications/science/chemistry/jmol/default.nix
index b5b5be84c8ec1..98f7ccbfee02a 100644
--- a/pkgs/applications/science/chemistry/jmol/default.nix
+++ b/pkgs/applications/science/chemistry/jmol/default.nix
@@ -25,14 +25,14 @@ let
   };
 in
 stdenv.mkDerivation rec {
-  version = "14.32.83";
+  version = "16.1.3";
   pname = "jmol";
 
   src = let
     baseVersion = "${lib.versions.major version}.${lib.versions.minor version}";
   in fetchurl {
     url = "mirror://sourceforge/jmol/Jmol/Version%20${baseVersion}/Jmol%20${version}/Jmol-${version}-binary.tar.gz";
-    sha256 = "sha256-otvaDPdGRmtUfWfy7m+CJOyDOFuW/AExbskYnYEikY8=";
+    sha256 = "sha256-k1F4OaER9vg8GIi4eqppeh2f0MtlcBSfd4zkewFp2As=";
   };
 
   patchPhase = ''
diff --git a/pkgs/applications/science/chemistry/mopac/default.nix b/pkgs/applications/science/chemistry/mopac/default.nix
new file mode 100644
index 0000000000000..d2b2b558bb78a
--- /dev/null
+++ b/pkgs/applications/science/chemistry/mopac/default.nix
@@ -0,0 +1,43 @@
+{ stdenv
+, lib
+, gfortran
+, fetchFromGitHub
+, cmake
+, blas
+, lapack
+, python3Packages
+}:
+
+assert blas.isILP64 == lapack.isILP64;
+
+stdenv.mkDerivation rec {
+  pname = "mopac";
+  version = "22.0.6";
+
+  src = fetchFromGitHub {
+    owner = "openmopac";
+    repo = pname;
+    rev = "v${version}";
+    hash = "sha256-j4AP3tki+Ep9Pv+pDg8TwCiJvpF2j5npW3Kpat+7gGg=";
+  };
+
+  nativeBuildInputs = [ gfortran cmake ];
+
+  buildInputs = [ blas lapack ];
+
+  checkInputs = with python3Packages; [ python numpy ];
+
+  doCheck = true;
+
+  preCheck = ''
+    export OMP_NUM_THREADS=2
+  '';
+
+  meta = with lib; {
+    description = "Semiempirical quantum chemistry";
+    homepage = "https://github.com/openmopac/mopac";
+    license = licenses.lgpl3Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ sheepforce markuskowa ];
+  };
+}
diff --git a/pkgs/applications/science/chemistry/nwchem/default.nix b/pkgs/applications/science/chemistry/nwchem/default.nix
new file mode 100644
index 0000000000000..1e76a30595346
--- /dev/null
+++ b/pkgs/applications/science/chemistry/nwchem/default.nix
@@ -0,0 +1,194 @@
+{ lib
+, stdenv
+, pkgs
+, fetchFromGitHub
+, fetchpatch
+, which
+, openssh
+, gcc
+, gfortran
+, perl
+, mpi
+, blas
+, lapack
+, python3
+, tcsh
+, bash
+, automake
+, autoconf
+, libtool
+, makeWrapper
+}:
+
+assert blas.isILP64 == lapack.isILP64;
+
+let
+  versionGA = "5.7.2"; # Fixed by nwchem
+
+  ga_src = fetchFromGitHub {
+    owner = "GlobalArrays";
+    repo = "ga";
+    rev = "v${versionGA}";
+    sha256 = "0c1y9a5jpdw9nafzfmvjcln1xc2gklskaly0r1alm18ng9zng33i";
+  };
+
+in
+stdenv.mkDerivation rec {
+  pname = "nwchem";
+  version = "7.0.2";
+
+  src = fetchFromGitHub {
+    owner = "nwchemgit";
+    repo = "nwchem";
+    rev = "v${version}-release";
+    sha256 = "1ckhcjaw1hzdsmm1x2fva27c4rs3r0h82qivg72v53idz880hbp3";
+  };
+
+  patches = [
+    # Fix Python 3.10 compatibility
+    (fetchpatch {
+      name = "python3.10";
+      url = "https://github.com/nwchemgit/nwchem/commit/638401361c6f294164a4f820ff867a62ac836fd5.patch";
+      sha256 = "sha256-yUZb3wWYZm1dX0HwvffksFwhVdb7ix1p8ooJnqiSgEg=";
+    })
+  ];
+
+  nativeBuildInputs = [
+    perl
+    automake
+    autoconf
+    libtool
+    makeWrapper
+    gfortran
+    which
+  ];
+  buildInputs = [
+    tcsh
+    openssh
+    blas
+    lapack
+    python3
+  ];
+  propagatedBuildInputs = [ mpi ];
+  propagatedUserEnvPkgs = [ mpi ];
+
+  postUnpack = ''
+    cp -r ${ga_src}/ source/src/tools/ga-${versionGA}
+    chmod -R u+w source/src/tools/ga-${versionGA}
+  '';
+
+  postPatch = ''
+    find -type f -executable -exec sed -i "s:/bin/csh:${tcsh}/bin/tcsh:" \{} \;
+    find -type f -name "GNUmakefile" -exec sed -i "s:/usr/bin/gcc:${gcc}/bin/gcc:" \{} \;
+    find -type f -name "GNUmakefile" -exec sed -i "s:/bin/rm:rm:" \{} \;
+    find -type f -executable -exec sed -i "s:/bin/rm:rm:" \{} \;
+    find -type f -name "makelib.h" -exec sed -i "s:/bin/rm:rm:" \{} \;
+
+    # Overwrite script, skipping the download
+    echo -e '#!/bin/sh\n cd ga-${versionGA};autoreconf -ivf' > src/tools/get-tools-github
+
+    patchShebangs ./
+  '';
+
+  # There is no configure script. Instead the build is controlled via
+  # environment variables passed to the Makefile
+  configurePhase = ''
+    runHook preConfigure
+
+    # config parameters
+    export NWCHEM_TARGET="LINUX64"
+
+    export ARMCI_NETWORK="MPI-PR"
+    export USE_MPI="y"
+    export USE_MPIF="y"
+
+    export NWCHEM_MODULES="all python"
+
+    export USE_PYTHONCONFIG="y"
+    export USE_PYTHON64="n"
+    export PYTHONLIBTYPE="so"
+    export PYTHONHOME="${python3}"
+    export PYTHONVERSION=${lib.versions.majorMinor python3.version}
+
+    export BLASOPT="-L${blas}/lib -lblas"
+    export LAPACK_LIB="-L${lapack}/lib -llapack"
+    export BLAS_SIZE=${if blas.isILP64 then "8" else "4"}
+
+    # extra TCE related options
+    export MRCC_METHODS="y"
+    export EACCSD="y"
+    export IPCCSD="y"
+
+    export NWCHEM_TOP="$(pwd)"
+
+    runHook postConfigure
+  '';
+
+  enableParallelBuilding = true;
+
+  preBuild = ''
+    ln -s ${ga_src} src/tools/ga-${versionGA}.tar.gz
+    cd src
+    make nwchem_config
+    ${lib.optionalString (!blas.isILP64) "make 64_to_32"}
+  '';
+
+  postBuild = ''
+    cd $NWCHEM_TOP/src/util
+    make version
+    make
+    cd $NWCHEM_TOP/src
+    make link
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin $out/share/nwchem
+
+    cp $NWCHEM_TOP/bin/LINUX64/nwchem $out/bin/nwchem
+    cp -r $NWCHEM_TOP/src/data $out/share/nwchem/
+    cp -r $NWCHEM_TOP/src/basis/libraries $out/share/nwchem/data
+    cp -r $NWCHEM_TOP/src/nwpw/libraryps $out/share/nwchem/data
+    cp -r $NWCHEM_TOP/QA $out/share/nwchem
+
+    wrapProgram $out/bin/nwchem \
+      --set-default NWCHEM_BASIS_LIBRARY $out/share/nwchem/data/libraries/
+
+    cat > $out/share/nwchem/nwchemrc << EOF
+    nwchem_basis_library $out/share/nwchem/data/libraries/
+    nwchem_nwpw_library $out/share/nwchem//data/libraryps/
+    ffield amber
+    amber_1 $out/share/nwchem/data/amber_s/
+    amber_2 $out/share/nwchem/data/amber_q/
+    amber_3 $out/share/nwchem/data/amber_x/
+    amber_4 $out/share/nwchem/data/amber_u/
+    spce    $out/share/nwchem/data/solvents/spce.rst
+    charmm_s $out/share/nwchem/data/charmm_s/
+    charmm_x $out/share/nwchem/data/charmm_x/
+    EOF
+  '';
+
+  doCheck = false;
+
+  doInstallCheck = true;
+  installCheckPhase = ''
+    export OMP_NUM_THREADS=1
+
+    # Fix to make mpich run in a sandbox
+    export HYDRA_IFACE=lo
+    export OMPI_MCA_rmaps_base_oversubscribe=1
+
+    # run a simple water test
+    mpirun -np 2 $out/bin/nwchem $out/share/nwchem/QA/tests/h2o/h2o.nw > h2o.out
+    grep "Total SCF energy" h2o.out  | grep 76.010538
+  '';
+
+  passthru = { inherit mpi; };
+
+  meta = with lib; {
+    description = "Open Source High-Performance Computational Chemistry";
+    platforms = [ "x86_64-linux" ];
+    maintainers = with maintainers; [ sheepforce markuskowa ];
+    homepage = "https://nwchemgit.github.io";
+    license = licenses.ecl20;
+  };
+}
diff --git a/pkgs/applications/science/chemistry/octopus/default.nix b/pkgs/applications/science/chemistry/octopus/default.nix
index d0058c8650d81..cc145baef037a 100644
--- a/pkgs/applications/science/chemistry/octopus/default.nix
+++ b/pkgs/applications/science/chemistry/octopus/default.nix
@@ -41,12 +41,12 @@ stdenv.mkDerivation rec {
   ];
 
   configureFlags = with lib; [
-    "--with-yaml-prefix=${libyaml}"
+    "--with-yaml-prefix=${lib.getDev libyaml}"
     "--with-blas=-lblas"
     "--with-lapack=-llapack"
-    "--with-fftw-prefix=${fftw.dev}"
-    "--with-gsl-prefix=${gsl}"
-    "--with-libxc-prefix=${libxc}"
+    "--with-fftw-prefix=${lib.getDev fftw}"
+    "--with-gsl-prefix=${lib.getDev gsl}"
+    "--with-libxc-prefix=${lib.getDev libxc}"
     "--enable-openmp"
   ] ++ optional enableFma "--enable-fma3"
     ++ optional enableFma4 "--enable-fma4"
diff --git a/pkgs/applications/science/chemistry/pymol/default.nix b/pkgs/applications/science/chemistry/pymol/default.nix
index 4ad0380ef1e31..15a1e3158233f 100644
--- a/pkgs/applications/science/chemistry/pymol/default.nix
+++ b/pkgs/applications/science/chemistry/pymol/default.nix
@@ -48,7 +48,7 @@ python3Packages.buildPythonApplication rec {
 
   nativeBuildInputs = [ qt5.wrapQtAppsHook ];
   buildInputs = [ python3Packages.numpy python3Packages.pyqt5 glew glm libpng libxml2 freetype msgpack netcdf ];
-  NIX_CFLAGS_COMPILE = "-I ${libxml2.dev}/include/libxml2";
+  env.NIX_CFLAGS_COMPILE = "-I ${libxml2.dev}/include/libxml2";
   hardeningDisable = [ "format" ];
 
   installPhase = ''
diff --git a/pkgs/applications/science/chemistry/wxmacmolplt/default.nix b/pkgs/applications/science/chemistry/wxmacmolplt/default.nix
new file mode 100644
index 0000000000000..455588ee17d18
--- /dev/null
+++ b/pkgs/applications/science/chemistry/wxmacmolplt/default.nix
@@ -0,0 +1,41 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, wxGTK32
+, libGL
+, libGLU
+, pkg-config
+, xorg
+, autoreconfHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "wxmacmolplt";
+  version = "7.7.2";
+
+  src = fetchFromGitHub {
+    owner = "brettbode";
+    repo = pname;
+    rev = "v${version}";
+    hash = "sha256-sNxCjIEJUrDWtcUqBQqvanNfgNQ7T4cabYy+x9D1U+Q=";
+  };
+
+  nativeBuildInputs = [ pkg-config autoreconfHook ];
+  buildInputs = [
+    wxGTK32
+    libGL
+    libGLU
+    xorg.libX11
+    xorg.libX11.dev
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "Graphical user inteface for GAMESS-US";
+    homepage = "https://brettbode.github.io/wxmacmolplt/";
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ sheepforce markuskowa ];
+  };
+}
diff --git a/pkgs/applications/science/computer-architecture/timeloop/default.nix b/pkgs/applications/science/computer-architecture/timeloop/default.nix
index e1ed24be78350..4e794aaa29e24 100644
--- a/pkgs/applications/science/computer-architecture/timeloop/default.nix
+++ b/pkgs/applications/science/computer-architecture/timeloop/default.nix
@@ -5,7 +5,7 @@
 , libconfig
 , boost
 , libyaml
-, libyamlcpp
+, yaml-cpp
 , ncurses
 , gpm
 , enableAccelergy ? true
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
     libconfig
     boost
     libyaml
-    libyamlcpp
+    yaml-cpp
     ncurses
     accelergy
    ] ++ lib.optionals stdenv.isLinux [ gpm ];
@@ -43,7 +43,7 @@ stdenv.mkDerivation rec {
 
   #link-time optimization fails on darwin
   #see https://github.com/NixOS/nixpkgs/issues/19098
-  NIX_CFLAGS_COMPILE = lib.optional stdenv.isDarwin "-fno-lto";
+  env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-fno-lto";
 
   postPatch = ''
     # use nix ar/ranlib
diff --git a/pkgs/applications/science/electronics/appcsxcad/default.nix b/pkgs/applications/science/electronics/appcsxcad/default.nix
index 9645e5426ab11..2e882aff361dc 100644
--- a/pkgs/applications/science/electronics/appcsxcad/default.nix
+++ b/pkgs/applications/science/electronics/appcsxcad/default.nix
@@ -15,13 +15,13 @@
 
 mkDerivation {
   pname = "appcsxcad";
-  version = "unstable-2020-01-04";
+  version = "unstable-2023-01-06";
 
   src = fetchFromGitHub {
     owner = "thliebig";
     repo = "AppCSXCAD";
-    rev = "de8c271ec8b57e80233cb2a432e3d7fd54d30876";
-    sha256 = "0shnfa0if3w588a68gr82qi6k7ldg1j2921fnzji90mmay21birp";
+    rev = "379ede4b8e00c11e8d0fb724c35547991b30c423";
+    hash = "sha256-L0ZEyovnfMzM7JuITBuhb4tJ2Aqgw52IiKEfEGq7Yo0=";
   };
 
   nativeBuildInputs = [
diff --git a/pkgs/applications/science/electronics/csxcad/default.nix b/pkgs/applications/science/electronics/csxcad/default.nix
index d9953a7857390..f6b0ff93fff5e 100644
--- a/pkgs/applications/science/electronics/csxcad/default.nix
+++ b/pkgs/applications/science/electronics/csxcad/default.nix
@@ -13,13 +13,13 @@
 
 stdenv.mkDerivation rec {
   pname = "csxcad";
-  version = "unstable-2020-02-08";
+  version = "unstable-2022-05-18";
 
   src = fetchFromGitHub {
     owner = "thliebig";
     repo = "CSXCAD";
-    rev = "ef6e40931dbd80e0959f37c8e9614c437bf7e518";
-    sha256 = "072s765jyzpdq8qqysdy0dld17m6sr9zfcs0ip2zk8c4imxaysnb";
+    rev = "cd9decb4d9cebe3c8bf115e2c0ee73f730f22da1";
+    sha256 = "1604amhvp7dm8ych7gwzxwawqvb9hpjglk5ffd4qm0y3k6r89arn";
   };
 
   patches = [./searchPath.patch ];
diff --git a/pkgs/applications/science/electronics/digital/default.nix b/pkgs/applications/science/electronics/digital/default.nix
index 0515809dffebb..72b931f1d11cc 100644
--- a/pkgs/applications/science/electronics/digital/default.nix
+++ b/pkgs/applications/science/electronics/digital/default.nix
@@ -4,8 +4,8 @@
 
 let
   pkgDescription = "A digital logic designer and circuit simulator.";
-  version = "0.29";
-  buildDate = "2022-02-11T18:10:34+01:00"; # v0.29 commit date
+  version = "0.30";
+  buildDate = "2023-02-03T08:00:56+01:00"; # v0.30 commit date
 
   desktopItem = makeDesktopItem {
     type = "Application";
@@ -24,7 +24,8 @@ let
   # inspect the .git folder to find the version number we are building, we then
   # provide that version number manually as a property.
   # (see https://github.com/hneemann/Digital/issues/289#issuecomment-513721481)
-  mvnOptions = "-Pno-git-rev -Dgit.commit.id.describe=${version} -Dproject.build.outputTimestamp=${buildDate}";
+  # Also use the commit date as a build and output timestamp.
+  mvnOptions = "-Pno-git-rev -Dgit.commit.id.describe=${version} -Dproject.build.outputTimestamp=${buildDate} -DbuildTimestamp=${buildDate}";
 in
 stdenv.mkDerivation rec {
   pname = "digital";
@@ -33,20 +34,16 @@ stdenv.mkDerivation rec {
   src = fetchFromGitHub {
     owner = "hneemann";
     repo = "Digital";
-    rev = "287dd939d6f2d4d02c0d883c6178c3425c28d39c";
-    sha256 = "o5gaExUTTbk6WgQVw7/IeXhpNkj1BLkwD752snQqjIg=";
+    rev = "932791eb6486d04f2ea938d83bcdb71b56d3a3f6";
+    sha256 = "cDykYlcFvDLFBy9UnX07iCR2LCq28SNU+h9vRT/AoJM=";
   };
 
-  # Use fixed dates in the pom.xml and upgrade the jar and assembly plugins to
-  # a version where they support reproducible builds
-  patches = [ ./pom.xml.patch ];
-
   # Fetching maven dependencies from "central" needs the network at build phase,
   # we do that in this extra derivation that explicitely specifies its
   # outputHash to ensure determinism.
   mavenDeps = stdenv.mkDerivation {
     name = "${pname}-${version}-maven-deps";
-    inherit src nativeBuildInputs version patches postPatch;
+    inherit src nativeBuildInputs version;
     dontFixup = true;
     buildPhase = ''
       mvn package ${mvnOptions} -Dmaven.repo.local=$out
@@ -62,15 +59,11 @@ stdenv.mkDerivation rec {
     '';
     outputHashAlgo = "sha256";
     outputHashMode = "recursive";
-    outputHash = "X5ppGUVwNQrMnjzD4Kin1Xmt4O3x+qr7jK4jr6E8tCI=";
+    outputHash = "1Cgw+5V2E/RENMRMm368+2yvY7y6v9gTlo+LRgrCXcE=";
   };
 
   nativeBuildInputs = [ copyDesktopItems maven makeWrapper ];
 
-  postPatch = ''
-    substituteInPlace pom.xml --subst-var-by buildDate "${buildDate}"
-  '';
-
   buildPhase = ''
     mvn package --offline ${mvnOptions} -Dmaven.repo.local=${mavenDeps}
   '';
diff --git a/pkgs/applications/science/electronics/digital/pom.xml.patch b/pkgs/applications/science/electronics/digital/pom.xml.patch
deleted file mode 100644
index cdc5a777c49d1..0000000000000
--- a/pkgs/applications/science/electronics/digital/pom.xml.patch
+++ /dev/null
@@ -1,30 +0,0 @@
-diff --git a/pom.xml b/pom.xml
-index d5f8330b4..58ed18b63 100644
---- a/pom.xml
-+++ b/pom.xml
-@@ -129,7 +130,7 @@
-             <plugin>
-                 <groupId>org.apache.maven.plugins</groupId>
-                 <artifactId>maven-jar-plugin</artifactId>
--                <version>2.5</version>
-+                <version>3.2.0</version>
-                 <configuration>
-                     <archive>
-                         <manifest>
-@@ -188,6 +189,7 @@
-             <plugin>
-                 <groupId>org.apache.maven.plugins</groupId>
-                 <artifactId>maven-assembly-plugin</artifactId>
-+                <version>3.2.0</version>
-                 <configuration>
-                     <finalName>Digital</finalName>
-                     <appendAssemblyId>false</appendAssemblyId>
-@@ -202,7 +204,7 @@
-                         </manifest>
-                         <manifestEntries>
-                             <Build-SCM-Revision>${git.commit.id.describe}</Build-SCM-Revision>
--                            <Build-Time>${maven.build.timestamp}</Build-Time>
-+                            <Build-Time>@buildDate@</Build-Time>
-                             <SplashScreen-Image>icons/splash.png</SplashScreen-Image>
-                         </manifestEntries>
-                     </archive>
diff --git a/pkgs/applications/science/electronics/flatcam/default.nix b/pkgs/applications/science/electronics/flatcam/default.nix
index 1f6679625ec77..25efbd754b2a5 100644
--- a/pkgs/applications/science/electronics/flatcam/default.nix
+++ b/pkgs/applications/science/electronics/flatcam/default.nix
@@ -1,10 +1,36 @@
 { lib
-, python3Packages
+, stdenv
+, python3
 , fetchFromBitbucket
 , fetchpatch
+, substituteAll
+, geos
 }:
 
-python3Packages.buildPythonApplication rec {
+let
+  python = python3.override {
+    packageOverrides = self: super: {
+      shapely = super.shapely.overridePythonAttrs (old: rec {
+        version = "1.8.4";
+        src = self.fetchPypi {
+          pname = "Shapely";
+          inherit version;
+          hash = "sha256-oZXlHKr6IYKR8suqP+9p/TNTyT7EtlsqRyLEz0DDGYw=";
+        };
+        # Environment variable used in shapely/_buildcfg.py
+        GEOS_LIBRARY_PATH = "${geos}/lib/libgeos_c${stdenv.hostPlatform.extensions.sharedLibrary}";
+        patches = [
+          # Patch to search form GOES .so/.dylib files in a Nix-aware way
+          (substituteAll {
+            src = ./shapely-library-paths.patch;
+            libgeos_c = GEOS_LIBRARY_PATH;
+            libc = lib.optionalString (!stdenv.isDarwin) "${stdenv.cc.libc}/lib/libc${stdenv.hostPlatform.extensions.sharedLibrary}.6";
+          })
+        ];
+      });
+    };
+  };
+in python.pkgs.buildPythonApplication rec {
   pname = "flatcam";
   version = "8.5";
 
@@ -15,7 +41,7 @@ python3Packages.buildPythonApplication rec {
     sha256 = "199kiiml18k34z1zhk2hbhibphmnv0kb11kxiajq52alps0mjb3m";
   };
 
-  propagatedBuildInputs = with python3Packages; [
+  propagatedBuildInputs = with python.pkgs; [
     matplotlib
     numpy
     packaging
diff --git a/pkgs/applications/science/electronics/flatcam/shapely-library-paths.patch b/pkgs/applications/science/electronics/flatcam/shapely-library-paths.patch
new file mode 100644
index 0000000000000..d095eada9d6e1
--- /dev/null
+++ b/pkgs/applications/science/electronics/flatcam/shapely-library-paths.patch
@@ -0,0 +1,31 @@
+diff --git a/shapely/geos.py b/shapely/geos.py
+index 88c5f53..1ccd6e4 100644
+--- a/shapely/geos.py
++++ b/shapely/geos.py
+@@ -96,6 +96,7 @@ if sys.platform.startswith('linux'):
+         alt_paths = [
+             'libgeos_c.so.1',
+             'libgeos_c.so',
++            '@libgeos_c@',
+         ]
+         _lgeos = load_dll('geos_c', fallbacks=alt_paths)
+ 
+@@ -160,6 +161,7 @@ elif sys.platform == 'darwin':
+             "/usr/local/lib/libgeos_c.dylib",
+             # homebrew Apple Silicon
+             "/opt/homebrew/lib/libgeos_c.dylib",
++            "@libgeos_c@",
+         ]
+         _lgeos = load_dll('geos_c', fallbacks=alt_paths)
+ 
+diff --git a/tests/test_dlls.py b/tests/test_dlls.py
+index c71da8e..c36262c 100644
+--- a/tests/test_dlls.py
++++ b/tests/test_dlls.py
+@@ -18,4 +18,5 @@ class LoadingTestCase(unittest.TestCase):
+             '/opt/homebrew/lib/libgeos_c.dylib',  # homebrew (macOS)
+             os.path.join(sys.prefix, "lib", "libgeos_c.so"), # anaconda (Linux)
+             'libgeos_c.so.1',
+-            'libgeos_c.so'])
++            'libgeos_c.so',
++            '@libgeos_c@'])
diff --git a/pkgs/applications/science/electronics/fped/default.nix b/pkgs/applications/science/electronics/fped/default.nix
index b1244b79a89f8..138d45c787cdd 100644
--- a/pkgs/applications/science/electronics/fped/default.nix
+++ b/pkgs/applications/science/electronics/fped/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation {
   # Workaround build failure on -fno-common toolchains:
   #   ld: postscript.o:postscript.h:29: multiple definition of
   #     `postscript_params'; fped.o:postscript.h:29: first defined here
-  NIX_CFLAGS_COMPILE = "-fcommon";
+  env.NIX_CFLAGS_COMPILE = "-fcommon";
 
   # This uses '/bin/bash', '/usr/local' and 'lex' by default
   makeFlags = [
diff --git a/pkgs/applications/science/electronics/fritzing/default.nix b/pkgs/applications/science/electronics/fritzing/default.nix
index 22b65f2da313a..fdda4b2b0af2c 100644
--- a/pkgs/applications/science/electronics/fritzing/default.nix
+++ b/pkgs/applications/science/electronics/fritzing/default.nix
@@ -61,7 +61,7 @@ stdenv.mkDerivation rec {
     cp -a ${parts}/* parts/
   '';
 
-  NIX_CFLAGS_COMPILE = "-I${lib.getDev quazip}/include/QuaZip-Qt${lib.versions.major qtbase.version}-${quazip.version}/quazip";
+  env.NIX_CFLAGS_COMPILE = "-I${lib.getDev quazip}/include/QuaZip-Qt${lib.versions.major qtbase.version}-${quazip.version}/quazip";
 
   qmakeFlags = [
     "phoenix.pro"
diff --git a/pkgs/applications/science/electronics/gtkwave/default.nix b/pkgs/applications/science/electronics/gtkwave/default.nix
index 57a832fed2423..cc03a2e8c8196 100644
--- a/pkgs/applications/science/electronics/gtkwave/default.nix
+++ b/pkgs/applications/science/electronics/gtkwave/default.nix
@@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     description = "VCD/Waveform viewer for Unix and Win32";
-    homepage = "http://gtkwave.sourceforge.net";
+    homepage = "https://gtkwave.sourceforge.net";
     license = lib.licenses.gpl2Plus;
     maintainers = with lib.maintainers; [ thoughtpolice jiegec ];
     platforms = lib.platforms.linux ++ lib.platforms.darwin;
diff --git a/pkgs/applications/science/electronics/kicad/base.nix b/pkgs/applications/science/electronics/kicad/base.nix
index d7250db07b491..697c27842081d 100644
--- a/pkgs/applications/science/electronics/kicad/base.nix
+++ b/pkgs/applications/science/electronics/kicad/base.nix
@@ -22,6 +22,7 @@
 , libXdmcp
 , lndir
 , unixODBC
+, fetchpatch
 
 , util-linux
 , libselinux
@@ -34,6 +35,7 @@
 , at-spi2-core
 , libXtst
 , pcre2
+, libdeflate
 
 , swig4
 , python
@@ -50,7 +52,6 @@
 , withNgspice
 , withScripting
 , withI18n
-, withPCM
 , debug
 , sanitizeAddress
 , sanitizeThreads
@@ -71,16 +72,28 @@ stdenv.mkDerivation rec {
   patches = [
     # upstream issue 12941 (attempted to upstream, but appreciably unacceptable)
     ./writable.patch
+  ]
+  ++ optionals (stable) # the 2 wxGTK ones should in the next stable point release
+  [
+    (fetchpatch { # for wxGTK 3.2.2.1's .1 field
+      name = "support wxWidgets subrelease field";
+      url = "https://gitlab.com/kicad/code/kicad/-/commit/b536580119c59fde78e38d8d6388f2540ecb6cf9.diff";
+      hash = "sha256-F+J5oZO0BsT1VWKpx0KGA7ecn5/PBgCw8uiScihM+54=";
+    })
+    (fetchpatch { # for wxGTK 3.2.2.1's .1 field, but for wxPython
+      name = "relax wxPython check to just major.minor";
+      url = "https://gitlab.com/kicad/code/kicad/-/commit/1e8cc6855d6a8fc1f9dfc933224c3a10fb759f9c.diff";
+      hash = "sha256-CGNgxZ7QiVLkaauNl7Pmcl152lwyDZqA/HSyFdOswwU=";
+    })
   ];
 
   # tagged releases don't have "unknown"
   # kicad nightlies use git describe --dirty
   # nix removes .git, so its approximated here
-  postPatch = if (!stable) then ''
+  postPatch = lib.optionalString (!stable) ''
     substituteInPlace cmake/KiCadVersion.cmake \
       --replace "unknown" "${builtins.substring 0 10 src.rev}"
-  ''
-  else "";
+  '';
 
   makeFlags = optionals (debug) [ "CFLAGS+=-Og" "CFLAGS+=-ggdb" ];
 
@@ -88,6 +101,7 @@ stdenv.mkDerivation rec {
     # RPATH of binary /nix/store/.../bin/... contains a forbidden reference to /build/
     "-DCMAKE_SKIP_BUILD_RPATH=ON"
     "-DKICAD_USE_EGL=ON"
+    "-DCMAKE_CTEST_ARGUMENTS='--exclude-regex;qa_eeschema'"  # upstream issue 12491
   ]
   ++ optionals (withScripting) [
     "-DKICAD_SCRIPTING_WXPYTHON=ON"
@@ -117,12 +131,6 @@ stdenv.mkDerivation rec {
   ]
   ++ optionals (withI18n) [
     "-DKICAD_BUILD_I18N=ON"
-  ]
-  ++ optionals (!withPCM && stable) [
-    "-DKICAD_PCM=OFF"
-  ]
-  ++ optionals (!stable) [ # upstream issue 12491
-    "-DCMAKE_CTEST_ARGUMENTS='--exclude-regex;qa_eeschema'"
   ];
 
   nativeBuildInputs = [
@@ -167,8 +175,9 @@ stdenv.mkDerivation rec {
     boost
     swig4
     python
+    unixODBC
+    libdeflate
   ]
-  ++ optional (!stable) unixODBC
   ++ optional (withScripting) wxPython
   ++ optional (withNgspice) libngspice
   ++ optional (withOCC) opencascade-occt
diff --git a/pkgs/applications/science/electronics/kicad/default.nix b/pkgs/applications/science/electronics/kicad/default.nix
index 6aeb63d671148..c7eb9d69522c9 100644
--- a/pkgs/applications/science/electronics/kicad/default.nix
+++ b/pkgs/applications/science/electronics/kicad/default.nix
@@ -15,7 +15,7 @@
 , pname ? "kicad"
 , stable ? true
 , withOCC ? true
-, withNgspice ? true
+, withNgspice ? !stdenv.isDarwin
 , libngspice
 , withScripting ? true
 , python3
@@ -24,7 +24,6 @@
 , sanitizeThreads ? false
 , with3d ? true
 , withI18n ? true
-, withPCM ? true # Plugin and Content Manager
 , srcs ? { }
 }:
 
@@ -118,7 +117,7 @@ stdenv.mkDerivation rec {
     inherit stable baseName;
     inherit kicadSrc kicadVersion;
     inherit wxGTK python wxPython;
-    inherit withOCC withNgspice withScripting withI18n withPCM;
+    inherit withOCC withNgspice withScripting withI18n;
     inherit debug sanitizeAddress sanitizeThreads;
   };
 
@@ -150,15 +149,15 @@ stdenv.mkDerivation rec {
     "--prefix GIO_EXTRA_MODULES : ${dconf}/lib/gio/modules"
     # required to open a bug report link in firefox-wayland
     "--set-default MOZ_DBUS_REMOTE 1"
-    "--set-default KICAD6_FOOTPRINT_DIR ${footprints}/share/kicad/footprints"
-    "--set-default KICAD6_SYMBOL_DIR ${symbols}/share/kicad/symbols"
-    "--set-default KICAD6_TEMPLATE_DIR ${templates}/share/kicad/template"
-    "--prefix KICAD6_TEMPLATE_DIR : ${symbols}/share/kicad/template"
-    "--prefix KICAD6_TEMPLATE_DIR : ${footprints}/share/kicad/template"
+    "--set-default KICAD7_FOOTPRINT_DIR ${footprints}/share/kicad/footprints"
+    "--set-default KICAD7_SYMBOL_DIR ${symbols}/share/kicad/symbols"
+    "--set-default KICAD7_TEMPLATE_DIR ${templates}/share/kicad/template"
+    "--prefix KICAD7_TEMPLATE_DIR : ${symbols}/share/kicad/template"
+    "--prefix KICAD7_TEMPLATE_DIR : ${footprints}/share/kicad/template"
   ]
   ++ optionals (with3d)
   [
-    "--set-default KICAD6_3DMODEL_DIR ${packages3d}/share/kicad/3dmodels"
+    "--set-default KICAD7_3DMODEL_DIR ${packages3d}/share/kicad/3dmodels"
   ]
   ++ optionals (withNgspice) [ "--prefix LD_LIBRARY_PATH : ${libngspice}/lib" ]
 
@@ -170,8 +169,9 @@ stdenv.mkDerivation rec {
   # $out and $program_PYTHONPATH don't exist when makeWrapperArgs gets set?
   installPhase =
     let
+      bin = if stdenv.isDarwin then "*.app/Contents/MacOS" else "bin";
       tools = [ "kicad" "pcbnew" "eeschema" "gerbview" "pcb_calculator" "pl_editor" "bitmap2component" ];
-      utils = [ "dxf2idf" "idf2vrml" "idfcyl" "idfrect" "kicad2step" ];
+      utils = [ "dxf2idf" "idf2vrml" "idfcyl" "idfrect" "kicad-cli" ];
     in
     (concatStringsSep "\n"
       (flatten [
@@ -181,13 +181,13 @@ stdenv.mkDerivation rec {
 
         # wrap each of the directly usable tools
         (map
-          (tool: "makeWrapper ${base}/bin/${tool} $out/bin/${tool} $makeWrapperArgs"
+          (tool: "makeWrapper ${base}/${bin}/${tool} $out/bin/${tool} $makeWrapperArgs"
             + optionalString (withScripting) " --set PYTHONPATH \"$program_PYTHONPATH\""
           )
           tools)
 
         # link in the CLI utils
-        (map (util: "ln -s ${base}/bin/${util} $out/bin/${util}") utils)
+        (map (util: "ln -s ${base}/${bin}/${util} $out/bin/${util}") utils)
 
         "runHook postInstall"
       ])
@@ -213,7 +213,7 @@ stdenv.mkDerivation rec {
     description = (if (stable)
     then "Open Source Electronics Design Automation suite"
     else "Open Source EDA suite, development build")
-    + (if (!with3d) then ", without 3D models" else "");
+    + (lib.optionalString (!with3d) ", without 3D models");
     homepage = "https://www.kicad.org/";
     longDescription = ''
       KiCad is an open source software suite for Electronic Design Automation.
@@ -223,6 +223,7 @@ stdenv.mkDerivation rec {
     maintainers = with lib.maintainers; [ evils kiwi ];
     # kicad is cross platform
     platforms = lib.platforms.all;
+    broken = stdenv.isDarwin;
 
     hydraPlatforms = if (with3d) then [ ] else platforms;
     # We can't download the 3d models on Hydra,
diff --git a/pkgs/applications/science/electronics/kicad/versions.nix b/pkgs/applications/science/electronics/kicad/versions.nix
index 811a405853634..4562e8447624f 100644
--- a/pkgs/applications/science/electronics/kicad/versions.nix
+++ b/pkgs/applications/science/electronics/kicad/versions.nix
@@ -3,45 +3,45 @@
 {
   "kicad" = {
     kicadVersion = {
-      version =			"6.0.10";
+      version =			"7.0.0";
       src = {
-        rev =			"86aedd382b4ece39e27bef209e81792915103704";
-        sha256 =		"0pz8d96imc0q3nh7npr5zf0jkzi94wchvw57spcrgqfac9yrld3q";
+        rev =			"da2b9df05c3ccd5ec104cf8cd8ded34f5dd25216";
+        sha256 =		"1zgpj1rvf97qv36hg4dja46pbzyixlh2g04wlh7cizcrs16b9mzw";
       };
     };
     libVersion = {
-      version =			"6.0.10";
+      version =			"7.0.0";
       libSources = {
-        symbols.rev =		"3ec40517b37d78faf7ff5504c81362420c4b601f";
-        symbols.sha256 =	"1fwnr8x345jbifk71rhyd4b88c4ijp2rcw3pmivnwfb444hbr1lp";
-        templates.rev =		"ae2b46f8756d79379b90fec01d4fdde1ccfd73c1";
-        templates.sha256 =	"08zxh83fbygh1x2jhca8nrp3f9kihf7kmg65qmyp95wvps4p5h8v";
-        footprints.rev =	"24671f7754c74dfa528e6b62ebef33b161aa4ab6";
-        footprints.sha256 =	"1rs05n1wjb2w3x7xqkkijbdxyw3fj0fph8znvnsxp9bgwaaipd4h";
-        packages3d.rev =	"417c4ea884a0d1501061f511730604890bbb0a35";
-        packages3d.sha256 =	"0nmvfchp25i4bkx6yf7fz1rwy7w6whj2w7mlp02ag3w5v4f137vz";
+        symbols.rev =		"08a25991d07924b263cbf87c6e513feac2b2169f";
+        symbols.sha256 =	"1r87xr1453dpfglkg1m4p5d7kcv9gxls1anwk3vp2yppnwz24ydm";
+        templates.rev =		"66d76556d9e81f8a5be74457686d211c666ed200";
+        templates.sha256 =	"02i279269mhq7wjhb1yqk90820ncssxl9n7b20qr2r4fmm7jpvxv";
+        footprints.rev =	"a0388d07e4a37e8db13a716efb3ad4750c839f9c";
+        footprints.sha256 =	"1akhifnjm8jvqsvscn2rr1wpzrls73bpdc6sk40355r1in2djmry";
+        packages3d.rev =	"bbee2295519bcf469d97f5e06bcf7175cddd2037";
+        packages3d.sha256 =	"1qw5xm0wbhv6gqvd8mn0jp4abjbizrkx79r6y8f6911mkzi47r6n";
       };
     };
   };
   "kicad-unstable" = {
     kicadVersion = {
-      version =			"2022-12-19";
+      version =			"2023-02-14";
       src = {
-        rev =			"a3a2e2e5b1981ebfbb60f1e8e40bd02625d33692";
-        sha256 =		"1584n2gn68vdyzlm9805ln1bdgzf831j5l4v29z08dkbi2sl3rg0";
+        rev =			"29c4482bc898f627cebcd5f64e063e8a813a5445";
+        sha256 =		"1hs1p79skmrn2k7qrpnkynzkk2g8ry20lqivzfqg87c56rd1522y";
       };
     };
     libVersion = {
-      version =			"2022-12-19";
+      version =			"2023-02-14";
       libSources = {
-        symbols.rev =		"2fa69d6d1dce065f8d0998733f66d2cd7db31b9e";
-        symbols.sha256 =	"1kp8v0q1pirpi4v485j5bg72jpnxglbpgxjxda6kvq8d2124pwlb";
-        templates.rev =		"ae2b46f8756d79379b90fec01d4fdde1ccfd73c1";
-        templates.sha256 =	"08zxh83fbygh1x2jhca8nrp3f9kihf7kmg65qmyp95wvps4p5h8v";
-        footprints.rev =	"24671f7754c74dfa528e6b62ebef33b161aa4ab6";
-        footprints.sha256 =	"1rs05n1wjb2w3x7xqkkijbdxyw3fj0fph8znvnsxp9bgwaaipd4h";
-        packages3d.rev =	"7aeaa02a2e7438fbbe94a00ca321366a39dc1267";
-        packages3d.sha256 =	"13wfcm7fgsgl3a0g00ra3v35c8wqw9yzgdiai54f1m77r2cr7bhp";
+        symbols.rev =		"3ad8b98287ddf528ce8ff07bbe70aed85cb4410a";
+        symbols.sha256 =	"1p0wa3bhw2qgdvb5vzwvrbhkb6sqpc93d754rbcs2xh79d75l9nn";
+        templates.rev =		"867eef383a0f61015cb69677d5c632d78a2ea01a";
+        templates.sha256 =	"1qi20mrsfn4fxmr1fyphmil2i9p2nzmwk5rlfchc5aq2194nj3lq";
+        footprints.rev =	"a168dd18ea63c2df948c2de3026dc19730cb70cf";
+        footprints.sha256 =	"0y3cl9fcyi8z4yrn0kfgfy28gn9ngrdvnpgbpwykbbp8fpx401nk";
+        packages3d.rev =	"a0919e5e805157bccd65af313806de3833c1673e";
+        packages3d.sha256 =	"1yizw9g3skz7i9x9iwbnn3gk3lnh10krf6xg32plb2plxfynz3cw";
       };
     };
   };
diff --git a/pkgs/applications/science/electronics/magic-vlsi/default.nix b/pkgs/applications/science/electronics/magic-vlsi/default.nix
index edee5946d9460..fc68969bd498a 100644
--- a/pkgs/applications/science/electronics/magic-vlsi/default.nix
+++ b/pkgs/applications/science/electronics/magic-vlsi/default.nix
@@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
     patchShebangs scripts/*
   '';
 
-  NIX_CFLAGS_COMPILE = "-Wno-implicit-function-declaration";
+  env.NIX_CFLAGS_COMPILE = "-Wno-implicit-function-declaration";
 
   patches = [
     ./0001-strip-bin-prefix.patch
diff --git a/pkgs/applications/science/electronics/nanovna-saver/default.nix b/pkgs/applications/science/electronics/nanovna-saver/default.nix
index 22950326e8674..84551eeb6311f 100644
--- a/pkgs/applications/science/electronics/nanovna-saver/default.nix
+++ b/pkgs/applications/science/electronics/nanovna-saver/default.nix
@@ -2,19 +2,30 @@
   lib,
   python3,
   fetchFromGitHub,
+  fetchpatch,
   wrapQtAppsHook,
 }:
 python3.pkgs.buildPythonApplication rec {
   pname = "nanovna-saver";
-  version = "0.5.3";
+  version = "0.5.4";
 
   src = fetchFromGitHub {
     owner = "NanoVNA-Saver";
     repo = pname;
-    rev = "refs/tags/v${version}";
-    sha256 = "sha256-wKKjMcOx7NS2VAIk3OTAj7KWE1+CeAzctdgdidT+HMA=";
+    rev = "v${version}";
+    sha256 = "sha256-CLfgDQt2rOXtWwvEhlXEstPp28nFhuhiAPYL6EjZVu4=";
   };
 
+  # Fix for https://github.com/NanoVNA-Saver/nanovna-saver/issues/579
+  # Try dropping the patch in the next release after v0.5.4
+  patches = [
+    (fetchpatch {
+      name = "remote-changelog-from-setup-py.patch";
+      url = "https://github.com/NanoVNA-Saver/${pname}/commit/d654ea0441939e4e1c599d1333b587a185394fbe.diff";
+      sha256 = "sha256-ifOhiWD0EYyQZRKp2W3G6crmWslca+/21APmhpfP/xE=";
+    })
+  ];
+
   nativeBuildInputs = [ wrapQtAppsHook ];
 
   propagatedBuildInputs = with python3.pkgs; [
@@ -47,6 +58,6 @@ python3.pkgs.buildPythonApplication rec {
       generally display and analyze the resulting data.
     '';
     license = licenses.gpl3Only;
-    maintainers = with maintainers; [ zaninime ];
+    maintainers = with maintainers; [ zaninime tmarkus ];
   };
 }
diff --git a/pkgs/applications/science/electronics/nvc/default.nix b/pkgs/applications/science/electronics/nvc/default.nix
index 97571eeb36b45..cff9809b03065 100644
--- a/pkgs/applications/science/electronics/nvc/default.nix
+++ b/pkgs/applications/science/electronics/nvc/default.nix
@@ -8,19 +8,20 @@
 , which
 , elfutils
 , libelf
+, libffi
 , llvm
 , zlib
 }:
 
 stdenv.mkDerivation rec {
   pname = "nvc";
-  version = "1.7.2";
+  version = "1.8.2";
 
   src = fetchFromGitHub {
     owner = "nickg";
     repo = pname;
     rev = "r${version}";
-    sha256 = "sha256-7N11S7OiAogyuNqrf7R5NZyVbiXgXxJ5t6lwBzL0YAU=";
+    hash = "sha256-s7QgufD3sQ6sZh2H78E8x0dMidHRKHUm8tASXoKK3xk=";
   };
 
   nativeBuildInputs = [
@@ -32,6 +33,7 @@ stdenv.mkDerivation rec {
   ];
 
   buildInputs = [
+    libffi
     llvm
     zlib
   ] ++ [
diff --git a/pkgs/applications/science/electronics/openboardview/default.nix b/pkgs/applications/science/electronics/openboardview/default.nix
index d4aa6e6dfc0b5..9fd9d56295d88 100644
--- a/pkgs/applications/science/electronics/openboardview/default.nix
+++ b/pkgs/applications/science/electronics/openboardview/default.nix
@@ -9,8 +9,12 @@
 , fontconfig
 , gtk3
 , wrapGAppsHook
+, darwin
 }:
 
+let
+  inherit (darwin.apple_sdk.frameworks) Cocoa;
+in
 stdenv.mkDerivation rec {
   pname = "openboardview";
   version = "9.0.3";
@@ -24,11 +28,14 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [ cmake pkg-config python3 wrapGAppsHook ];
-  buildInputs = [ SDL2 fontconfig gtk3 ];
+  buildInputs = [ SDL2 fontconfig gtk3 ] ++ lib.optionals stdenv.isDarwin [
+    Cocoa
+  ];
 
   postPatch = ''
     substituteInPlace src/openboardview/CMakeLists.txt \
       --replace "SDL2::SDL2main" ""
+    substituteInPlace CMakeLists.txt --replace "fixup_bundle" "#fixup_bundle"
   '';
 
   cmakeFlags = [
@@ -37,9 +44,12 @@ stdenv.mkDerivation rec {
   ];
 
   dontWrapGApps = true;
-  postFixup = ''
-    wrapGApp "$out/bin/${pname}" \
-      --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ gtk3 ]}
+  postFixup = lib.optionalString stdenv.isDarwin ''
+      mkdir -p "$out/Applications"
+      mv "$out/openboardview.app" "$out/Applications/OpenBoardView.app"
+  '' + lib.optionalString (!stdenv.isDarwin) ''
+      wrapGApp "$out/bin/${pname}" \
+        --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ gtk3 ]}
   '';
 
   passthru.updateScript = gitUpdater {
@@ -50,7 +60,7 @@ stdenv.mkDerivation rec {
     description = "Linux SDL/ImGui edition software for viewing .brd files";
     homepage = "https://github.com/OpenBoardView/OpenBoardView";
     license = licenses.mit;
-    platforms = platforms.linux;
+    platforms = platforms.unix;
     maintainers = with maintainers; [ k3a ];
   };
 }
diff --git a/pkgs/applications/science/electronics/qucs/default.nix b/pkgs/applications/science/electronics/qucs/default.nix
index a5f2cf394b44f..eeb10b3a5a1dc 100644
--- a/pkgs/applications/science/electronics/qucs/default.nix
+++ b/pkgs/applications/science/electronics/qucs/default.nix
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     description = "Integrated circuit simulator";
-    homepage = "http://qucs.sourceforge.net";
+    homepage = "https://qucs.sourceforge.net";
     license = lib.licenses.gpl2Plus;
     maintainers = with lib.maintainers; [viric];
     platforms = with lib.platforms; linux;
diff --git a/pkgs/applications/science/electronics/verilator/default.nix b/pkgs/applications/science/electronics/verilator/default.nix
index 33d145c007566..e77f6aeeb29b2 100644
--- a/pkgs/applications/science/electronics/verilator/default.nix
+++ b/pkgs/applications/science/electronics/verilator/default.nix
@@ -1,22 +1,22 @@
 { lib, stdenv, fetchFromGitHub
 , perl, flex, bison, python3, autoconf
-, which, cmake
+, which, cmake, help2man
 }:
 
 stdenv.mkDerivation rec {
   pname = "verilator";
-  version = "5.002";
+  version = "5.006";
 
   src = fetchFromGitHub {
     owner = pname;
     repo = pname;
     rev = "v${version}";
-    hash = "sha256-RNoKAEF7zl+WqqbxGP/VvdQqQP8VI3hoQku3b/g0XpU=";
+    hash = "sha256-PA8hbE6XECapuaO5YcgEodOoxSDqpMucdijJBBb7fZg=";
   };
 
   enableParallelBuilding = true;
   buildInputs = [ perl ];
-  nativeBuildInputs = [ flex bison python3 autoconf ];
+  nativeBuildInputs = [ flex bison python3 autoconf help2man ];
   nativeCheckInputs = [ which ];
 
   doCheck = stdenv.isLinux; # darwin tests are broken for now...
@@ -24,14 +24,8 @@ stdenv.mkDerivation rec {
 
   preConfigure = "autoconf";
 
-  preCheck = ''
-    patchShebangs \
-      src/flexfix \
-      src/vlcovgen \
-      bin/verilator \
-      bin/verilator_coverage \
-      test_regress/driver.pl \
-      test_regress/t/*.pl
+  postPatch = ''
+    patchShebangs bin/* src/{flexfix,vlcovgen} test_regress/{driver.pl,t/*.pl}
   '';
 
   meta = with lib; {
diff --git a/pkgs/applications/science/electronics/xoscope/default.nix b/pkgs/applications/science/electronics/xoscope/default.nix
index 7a9f58a0c6e34..9f9224b5543cd 100644
--- a/pkgs/applications/science/electronics/xoscope/default.nix
+++ b/pkgs/applications/science/electronics/xoscope/default.nix
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     description = "Oscilloscope through the sound card";
-    homepage = "http://xoscope.sourceforge.net";
+    homepage = "https://xoscope.sourceforge.net";
     license = lib.licenses.gpl2Plus;
     maintainers = with lib.maintainers; [viric];
     platforms = with lib.platforms; linux;
diff --git a/pkgs/applications/science/logic/abc/default.nix b/pkgs/applications/science/logic/abc/default.nix
index 6a20a68324f1e..6ac9dd64982f1 100644
--- a/pkgs/applications/science/logic/abc/default.nix
+++ b/pkgs/applications/science/logic/abc/default.nix
@@ -4,13 +4,13 @@
 
 stdenv.mkDerivation rec {
   pname   = "abc-verifier";
-  version = "unstable-2022-11-09";
+  version = "unstable-2023-02-04";
 
   src = fetchFromGitHub {
     owner = "yosyshq";
     repo  = "abc";
-    rev   = "be9a35c0363174a7cef21d55ed80d92a9ef95ab1";
-    hash  = "sha256-IN9YgJONcC55N89OXMrMuNuznTdjXNWxR0IngH8OWC8=";
+    rev   = "a8f0ef2368aa56b3ad20a52298a02e63b2a93e2d";
+    hash  = "sha256-48i6AKQhMG5hcnkS0vejOy1PqFbeb6FpU7Yx0rEvHDI=";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/pkgs/applications/science/logic/abella/default.nix b/pkgs/applications/science/logic/abella/default.nix
index 3d752b7d7b931..1d0c72359cfcc 100644
--- a/pkgs/applications/science/logic/abella/default.nix
+++ b/pkgs/applications/science/logic/abella/default.nix
@@ -9,7 +9,9 @@ stdenv.mkDerivation rec {
     sha256 = "sha256-/eOiebMFHgrurtrSHPlgZO3xmmxBOUmyAzswXZLd3Yc=";
   };
 
-  buildInputs = [ rsync ] ++ (with ocamlPackages; [ ocaml ocamlbuild findlib ]);
+  strictDeps = true;
+
+  nativeBuildInputs = [ rsync ] ++ (with ocamlPackages; [ ocaml ocamlbuild findlib ]);
 
   installPhase = ''
     mkdir -p $out/bin
diff --git a/pkgs/applications/science/logic/acgtk/default.nix b/pkgs/applications/science/logic/acgtk/default.nix
index d4f0ac3e5044a..c627b8a3c8f5a 100644
--- a/pkgs/applications/science/logic/acgtk/default.nix
+++ b/pkgs/applications/science/logic/acgtk/default.nix
@@ -13,11 +13,19 @@ stdenv.mkDerivation {
     sha256 = "sha256-W/BDhbng5iYuiB7desMKvRtDFdhoaxiJNvNvtbLlA6E=";
   };
 
-  buildInputs = [ dune_2 ] ++ (with ocamlPackages; [
-    ocaml findlib ansiterminal cairo2 cmdliner fmt logs menhir menhirLib mtime sedlex yojson
-  ]);
+  strictDeps = true;
 
-  buildPhase = "dune build --profile=release";
+  nativeBuildInputs = with ocamlPackages; [ menhir ocaml findlib dune_2 ];
+
+  buildInputs = with ocamlPackages; [
+    ansiterminal cairo2 cmdliner fmt logs menhirLib mtime sedlex yojson
+  ];
+
+  buildPhase = ''
+    runHook preBuild
+    dune build --profile=release ''${enableParallelBuilding:+-j $NIX_BUILD_CORES}
+    runHook postBuild
+  '';
 
   installPhase = ''
     dune install --prefix $out --libdir $OCAMLFIND_DESTDIR
diff --git a/pkgs/applications/science/logic/alt-ergo/default.nix b/pkgs/applications/science/logic/alt-ergo/default.nix
index 7077d56f8069b..75288b5ff80bf 100644
--- a/pkgs/applications/science/logic/alt-ergo/default.nix
+++ b/pkgs/applications/science/logic/alt-ergo/default.nix
@@ -9,8 +9,8 @@ let
   src = fetchFromGitHub {
     owner = "OCamlPro";
     repo = pname;
-    rev = version;
-    sha256 = "sha256-8pJ/1UAbheQaLFs5Uubmmf5D0oFJiPxF6e2WTZgRyAc=";
+    rev = "refs/tags/${version}";
+    hash = "sha256-8pJ/1UAbheQaLFs5Uubmmf5D0oFJiPxF6e2WTZgRyAc=";
   };
 in
 
diff --git a/pkgs/applications/science/logic/avy/default.nix b/pkgs/applications/science/logic/avy/default.nix
index f6f43f1b0bb30..38fef51c56e6d 100644
--- a/pkgs/applications/science/logic/avy/default.nix
+++ b/pkgs/applications/science/logic/avy/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
   buildInputs = [ zlib boost.out boost.dev ];
-  NIX_CFLAGS_COMPILE = toString ([ "-Wno-narrowing" ]
+  env.NIX_CFLAGS_COMPILE = toString ([ "-Wno-narrowing" ]
     # Squelch endless stream of warnings on same few things
     ++ lib.optionals stdenv.cc.isClang [
       "-Wno-empty-body"
diff --git a/pkgs/applications/science/logic/cbmc/default.nix b/pkgs/applications/science/logic/cbmc/default.nix
index 4009761e8dc3c..ddfa999fcc7e3 100644
--- a/pkgs/applications/science/logic/cbmc/default.nix
+++ b/pkgs/applications/science/logic/cbmc/default.nix
@@ -13,13 +13,13 @@
 
 stdenv.mkDerivation rec {
   pname = "cbmc";
-  version = "5.74.0";
+  version = "5.76.1";
 
   src = fetchFromGitHub {
     owner = "diffblue";
     repo = pname;
     rev = "${pname}-${version}";
-    sha256 = "sha256-n4a/0Ak2psHDCXykVSPYavuIl22uq2ZP7LUcdSzg1ow=";
+    sha256 = "sha256-OVOoAfoqev33c7pIzBGK9HD+zgji/+BWKD33RYJaSDc=";
   };
 
   nativeBuildInputs = [
@@ -60,9 +60,13 @@ stdenv.mkDerivation rec {
       --prefix PATH : "$out/share/cbmc" \
   '';
 
-  # fix "argument unused during compilation"
-  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang
-    "-Wno-unused-command-line-argument";
+  env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isGNU [
+    # Needed with GCC 12 but breaks on darwin (with clang)
+    "-Wno-error=maybe-uninitialized"
+  ] ++ lib.optionals stdenv.cc.isClang [
+    # fix "argument unused during compilation"
+    "-Wno-unused-command-line-argument"
+  ]);
 
   # TODO: add jbmc support
   cmakeFlags = [ "-DWITH_JBMC=OFF" "-Dsat_impl=cadical" "-Dcadical_INCLUDE_DIR=${cadical.dev}/include" ];
diff --git a/pkgs/applications/science/logic/coq/default.nix b/pkgs/applications/science/logic/coq/default.nix
index 8a40216c3ecba..49c9fc47fef26 100644
--- a/pkgs/applications/science/logic/coq/default.nix
+++ b/pkgs/applications/science/logic/coq/default.nix
@@ -66,10 +66,10 @@ let
   buildIde = args.buildIde or (!coqAtLeast "8.14");
   ideFlags = optionalString (buildIde && !coqAtLeast "8.10")
     "-lablgtkdir ${ocamlPackages.lablgtk}/lib/ocaml/*/site-lib/lablgtk2 -coqide opt";
-  csdpPatch = if csdp != null then ''
+  csdpPatch = lib.optionalString (csdp != null) ''
     substituteInPlace plugins/micromega/sos.ml --replace "; csdp" "; ${csdp}/bin/csdp"
     substituteInPlace plugins/micromega/coq_micromega.ml --replace "System.is_in_system_path \"csdp\"" "true"
-  '' else "";
+  '';
   ocamlPackages = if !isNull customOCamlPackages then customOCamlPackages
     else with versions; switch coq-version [
       { case = range "8.16" "8.17"; out = ocamlPackages_4_14; }
@@ -91,7 +91,7 @@ self = stdenv.mkDerivation {
   passthru = {
     inherit coq-version;
     inherit ocamlPackages ocamlNativeBuildInputs;
-    inherit ocamlPropagatedBuildInputs ocamlPropagatedNativeBuildInputs;
+    inherit ocamlPropagatedBuildInputs;
     # For compatibility
     inherit (ocamlPackages) ocaml camlp5 findlib num ;
     emacsBufferSetup = pkgs: ''
@@ -158,7 +158,7 @@ self = stdenv.mkDerivation {
     UNAME=$(type -tp uname)
     RM=$(type -tp rm)
     substituteInPlace tools/beautify-archive --replace "/bin/rm" "$RM"
-    ${if !coqAtLeast "8.7" then "substituteInPlace configure.ml --replace \"md5 -q\" \"md5sum\"" else ""}
+    ${lib.optionalString (!coqAtLeast "8.7") "substituteInPlace configure.ml --replace \"md5 -q\" \"md5sum\""}
     ${csdpPatch}
   '';
 
@@ -196,7 +196,7 @@ self = stdenv.mkDerivation {
     categories = [ "Development" "Science" "Math" "IDE" "GTK" ];
   });
 
-  postInstall = let suffix = if coqAtLeast "8.14" then "-core" else ""; in optionalString (!coqAtLeast "8.17") ''
+  postInstall = let suffix = optionalString (coqAtLeast "8.14") "-core"; in optionalString (!coqAtLeast "8.17") ''
     cp bin/votour $out/bin/
   '' + ''
     ln -s $out/lib/coq${suffix} $OCAMLFIND_DESTDIR/coq${suffix}
@@ -227,12 +227,12 @@ if coqAtLeast "8.17" then self.overrideAttrs(_: {
   buildPhase = ''
     runHook preBuild
     make dunestrap
-    dune build -p coq-core,coq-stdlib,coq,coqide-server${if buildIde then ",coqide" else ""} -j $NIX_BUILD_CORES
+    dune build -p coq-core,coq-stdlib,coq,coqide-server${lib.optionalString buildIde ",coqide"} -j $NIX_BUILD_CORES
     runHook postBuild
   '';
   installPhase = ''
     runHook preInstall
-    dune install --prefix $out coq-core coq-stdlib coq coqide-server${if buildIde then " coqide" else ""}
+    dune install --prefix $out coq-core coq-stdlib coq coqide-server${lib.optionalString buildIde " coqide"}
     runHook postInstall
   '';
 }) else self
diff --git a/pkgs/applications/science/logic/cryptominisat/default.nix b/pkgs/applications/science/logic/cryptominisat/default.nix
index 33de2d27dc90b..cd04d612b5290 100644
--- a/pkgs/applications/science/logic/cryptominisat/default.nix
+++ b/pkgs/applications/science/logic/cryptominisat/default.nix
@@ -1,32 +1,30 @@
-{ lib, stdenv, fetchFromGitHub, cmake, python3, xxd, boost, fetchpatch }:
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, python3
+, boost
+}:
 
 stdenv.mkDerivation rec {
   pname = "cryptominisat";
-  version = "5.8.0";
+  version = "5.11.4";
 
   src = fetchFromGitHub {
-    owner  = "msoos";
-    repo   = "cryptominisat";
-    rev    = version;
-    sha256 = "00hmxdlyhn7pwk9jlvc5g0l5z5xqfchjzf5jgn3pkj9xhl8yqq50";
+    owner = "msoos";
+    repo = "cryptominisat";
+    rev = version;
+    hash = "sha256-7JNfFKSYWgyyNnWNzXGLqWRwSW+5r6PBMelKeAmx8sc=";
   };
 
-  patches = [
-    (fetchpatch {
-      # https://github.com/msoos/cryptominisat/pull/621
-      url = "https://github.com/msoos/cryptominisat/commit/11a97003b0bfbfb61ed6c4e640212110d390c28c.patch";
-      sha256 = "0hdy345bwcbxz0jl1jdxfa6mmfh77s2pz9rnncsr0jzk11b3j0cw";
-    })
-  ];
-
   buildInputs = [ python3 boost ];
-  nativeBuildInputs = [ cmake xxd ];
+  nativeBuildInputs = [ cmake ];
 
   meta = with lib; {
     description = "An advanced SAT Solver";
-    homepage    = "https://github.com/msoos/cryptominisat";
-    license     = licenses.mit;
+    homepage = "https://github.com/msoos/cryptominisat";
+    license = licenses.mit;
     maintainers = with maintainers; [ mic92 ];
-    platforms   = platforms.unix;
+    platforms = platforms.unix;
   };
 }
diff --git a/pkgs/applications/science/logic/cryptoverif/default.nix b/pkgs/applications/science/logic/cryptoverif/default.nix
index 195dd98aa3b4a..f056b3e433fbc 100644
--- a/pkgs/applications/science/logic/cryptoverif/default.nix
+++ b/pkgs/applications/science/logic/cryptoverif/default.nix
@@ -9,7 +9,9 @@ stdenv.mkDerivation rec {
     sha256 = "sha256-F5eVN5ATYo9Ivpi2eYh96ktuTWUeoqgWMR4BqHu8EFs=";
   };
 
-  buildInputs = [ ocaml ];
+  strictDeps = true;
+
+  nativeBuildInputs = [ ocaml ];
 
   /* Fix up the frontend to load the 'default' cryptoverif library
   ** from under $out/libexec. By default, it expects to find the files
diff --git a/pkgs/applications/science/logic/cvc4/cvc4-bash-patsub-replacement.patch b/pkgs/applications/science/logic/cvc4/cvc4-bash-patsub-replacement.patch
new file mode 100644
index 0000000000000..a97665c2f86c4
--- /dev/null
+++ b/pkgs/applications/science/logic/cvc4/cvc4-bash-patsub-replacement.patch
@@ -0,0 +1,39 @@
+Per https://bodhi.fedoraproject.org/updates/FEDORA-2022-dc47174c36:
+
+This update fixes a failure to build with source with bash 5.2. Bash's
+`patsub_replacement` feature makes ampersand a special character when doing
+variable substitution, which was not previously the case. This update instructs
+bash to turn off the new behavior.
+
+The patch itself is adapted from
+https://src.fedoraproject.org/rpms/cvc4/blob/f7c24c6ad72a8812d244313f13032fa23d393315/f/cvc4-bash-patsub-replacement.patch.
+--- a/src/expr/mkexpr	2020-06-19 10:59:27.000000000 -0600
++++ b/src/expr/mkexpr	2022-10-11 14:28:31.120453409 -0600
+@@ -16,6 +16,7 @@
+ #
+ 
+ copyright=2010-2014
++shopt -u patsub_replacement
+ 
+ filename=`basename "$1" | sed 's,_template,,'`
+ 
+--- a/src/expr/mkkind	2020-06-19 10:59:27.000000000 -0600
++++ b/src/expr/mkkind	2022-10-11 14:34:17.008996126 -0600
+@@ -15,6 +15,7 @@
+ #
+ 
+ copyright=2010-2014
++shopt -u patsub_replacement
+ 
+ filename=`basename "$1" | sed 's,_template,,'`
+ 
+--- a/src/expr/mkmetakind	2020-06-19 10:59:27.000000000 -0600
++++ b/src/expr/mkmetakind	2022-10-11 14:34:32.248020036 -0600
+@@ -18,6 +18,7 @@
+ #
+ 
+ copyright=2010-2014
++shopt -u patsub_replacement
+ 
+ cat <<EOF
+ /*********************                                                        */
diff --git a/pkgs/applications/science/logic/cvc4/default.nix b/pkgs/applications/science/logic/cvc4/default.nix
index 873c3ca57c0c9..e9f04d2044dc7 100644
--- a/pkgs/applications/science/logic/cvc4/default.nix
+++ b/pkgs/applications/science/logic/cvc4/default.nix
@@ -28,6 +28,10 @@ stdenv.mkDerivation rec {
     patch -p1 -i ${./minisat-fenv.patch} -d src/prop/bvminisat
   '';
 
+  patches = [
+    ./cvc4-bash-patsub-replacement.patch
+  ];
+
   preConfigure = ''
     patchShebangs ./src/
   '';
diff --git a/pkgs/applications/science/logic/cvc5/default.nix b/pkgs/applications/science/logic/cvc5/default.nix
index 5bce776771d35..f0cb044b3beb3 100644
--- a/pkgs/applications/science/logic/cvc5/default.nix
+++ b/pkgs/applications/science/logic/cvc5/default.nix
@@ -1,18 +1,21 @@
-{ lib, stdenv, fetchFromGitHub, pkg-config, cmake, cadical, symfpu, gmp, git, python3, gtest, libantlr3c, antlr3_4, boost, jdk }:
+{ lib, stdenv, fetchFromGitHub, pkg-config, cmake, flex, cadical, symfpu, gmp, python3, gtest, libantlr3c, antlr3_4, boost, jdk }:
 
 stdenv.mkDerivation rec {
   pname = "cvc5";
-  version = "1.0.3";
+  version = "1.0.4";
 
   src = fetchFromGitHub {
     owner  = "cvc5";
     repo   = "cvc5";
     rev    = "cvc5-${version}";
-    sha256 = "sha256-CVXK6yehfUrSbo8R1Dk1oc/siCtmV9DjEp6q+aLuVQA=";
+    hash  = "sha256-1yJZtPZ4nMg9Kn3jHpN8b5XeFZ8ZeVLrKYWh7Rp3/oQ=";
   };
 
-  nativeBuildInputs = [ pkg-config cmake ];
-  buildInputs = [ cadical.dev symfpu gmp git python3 python3.pkgs.toml gtest libantlr3c antlr3_4 boost jdk ];
+  nativeBuildInputs = [ pkg-config cmake flex ];
+  buildInputs = [
+    cadical.dev symfpu gmp gtest libantlr3c antlr3_4 boost jdk
+    (python3.withPackages (ps: with ps; [ pyparsing toml ]))
+  ];
 
   preConfigure = ''
     patchShebangs ./src/
diff --git a/pkgs/applications/science/logic/ekrhyper/default.nix b/pkgs/applications/science/logic/ekrhyper/default.nix
index d6d9bb11a9a0a..187cbc9a92ae4 100644
--- a/pkgs/applications/science/logic/ekrhyper/default.nix
+++ b/pkgs/applications/science/logic/ekrhyper/default.nix
@@ -9,10 +9,8 @@ stdenv.mkDerivation rec {
     sha256 = "sha256-fEe0DIMGj7wO+79/BZf45kykgyTXpbZJsyFSt31XqpM=";
   };
 
-  buildInputs = [
-    ocaml
-    perl
-  ];
+  strictDeps = true;
+  nativeBuildInputs = [ ocaml perl ];
   setSourceRoot = "export sourceRoot=$(echo */ekrh/src/)";
   preInstall = "export INSTALLDIR=$out";
   postInstall = ''for i in "$out/casc"/*; do ln -s "$i" "$out/bin/ekrh-casc-$(basename $i)"; done '';
diff --git a/pkgs/applications/science/logic/hol_light/default.nix b/pkgs/applications/science/logic/hol_light/default.nix
index e66fe992e189a..4c105a40e20db 100644
--- a/pkgs/applications/science/logic/hol_light/default.nix
+++ b/pkgs/applications/science/logic/hol_light/default.nix
@@ -38,7 +38,9 @@ stdenv.mkDerivation {
     })
   ];
 
-  buildInputs = [ ocaml camlp5 ];
+  strictDeps = true;
+
+  nativeBuildInputs = [ ocaml camlp5 ];
   propagatedBuildInputs = [ num ];
 
   installPhase = ''
diff --git a/pkgs/applications/science/logic/iprover/default.nix b/pkgs/applications/science/logic/iprover/default.nix
index ff88586e0353b..6485681e3313f 100644
--- a/pkgs/applications/science/logic/iprover/default.nix
+++ b/pkgs/applications/science/logic/iprover/default.nix
@@ -9,7 +9,10 @@ stdenv.mkDerivation rec {
     sha256 = "0lik8p7ayhjwpkln1iwf0ri84ramhch74j5nj6z7ph6wfi92pgg8";
   };
 
-  buildInputs = [ ocaml eprover zlib ];
+  strictDeps = true;
+
+  nativeBuildInputs = [ ocaml eprover ];
+  buildInputs = [ zlib ];
 
   preConfigure = "patchShebangs .";
 
diff --git a/pkgs/applications/science/logic/klee/default.nix b/pkgs/applications/science/logic/klee/default.nix
index 024e6e526c4e4..898e344f2a453 100644
--- a/pkgs/applications/science/logic/klee/default.nix
+++ b/pkgs/applications/science/logic/klee/default.nix
@@ -96,7 +96,7 @@ in stdenv.mkDerivation rec {
   ];
 
   # Silence various warnings during the compilation of fortified bitcode.
-  NIX_CFLAGS_COMPILE = ["-Wno-macro-redefined"];
+  env.NIX_CFLAGS_COMPILE = toString ["-Wno-macro-redefined"];
 
   prePatch = ''
     patchShebangs .
diff --git a/pkgs/applications/science/logic/leo2/default.nix b/pkgs/applications/science/logic/leo2/default.nix
index cbc85c5544ccd..4087763aa0c54 100644
--- a/pkgs/applications/science/logic/leo2/default.nix
+++ b/pkgs/applications/science/logic/leo2/default.nix
@@ -9,8 +9,10 @@ stdenv.mkDerivation rec {
     sha256 = "sha256:1b2q7vsz6s9ighypsigqjm1mzjiq3xgnz5id5ssb4rh9zm190r82";
   };
 
-  nativeBuildInputs = [ makeWrapper ];
-  buildInputs = [ eprover ocaml camlp4 perl zlib ];
+  strictDeps = true;
+
+  nativeBuildInputs = [ makeWrapper eprover ocaml camlp4 perl ];
+  buildInputs = [ zlib ];
 
   patches = [ (fetchpatch {
       url = "https://github.com/niklasso/minisat/commit/7eb6015313561a2586032574788fcb133eeaa19f.patch";
diff --git a/pkgs/applications/science/logic/ott/default.nix b/pkgs/applications/science/logic/ott/default.nix
index bbc96b2b681cc..a00c565fb4e06 100644
--- a/pkgs/applications/science/logic/ott/default.nix
+++ b/pkgs/applications/science/logic/ott/default.nix
@@ -11,8 +11,11 @@ stdenv.mkDerivation rec {
     hash = "sha256-GzeEiok5kigcmfqf/K/UxvlKkl55zy0vOyiRZ2HyMiE=";
   };
 
-  nativeBuildInputs = [ pkg-config opaline ];
-  buildInputs = with ocamlPackages; [ ocaml findlib ocamlgraph ];
+
+  strictDeps = true;
+
+  nativeBuildInputs = [ pkg-config opaline ] ++ (with ocamlPackages; [ findlib ocaml ]);
+  buildInputs = with ocamlPackages; [ ocamlgraph ];
 
   installTargets = "ott.install";
 
diff --git a/pkgs/applications/science/logic/prooftree/default.nix b/pkgs/applications/science/logic/prooftree/default.nix
index 2606b94f4bbb5..4e65c018d1a20 100644
--- a/pkgs/applications/science/logic/prooftree/default.nix
+++ b/pkgs/applications/science/logic/prooftree/default.nix
@@ -9,9 +9,10 @@ stdenv.mkDerivation rec {
     sha256 = "0z1z4wqbqwgppkh2bm89fgy07a0y2m6g4lvcyzs09sm1ysklk2dh";
   };
 
-  nativeBuildInputs = [ pkg-config ];
-  buildInputs = [ ncurses ] ++ (with ocamlPackages; [
-    ocaml findlib camlp5 lablgtk ]);
+  strictDeps = true;
+
+  nativeBuildInputs = [ pkg-config ] ++ (with ocamlPackages; [ ocaml findlib camlp5 ]);
+  buildInputs = [ ncurses ] ++ (with ocamlPackages; [ lablgtk ]);
 
   dontAddPrefix = true;
   configureFlags = [ "--prefix" "$(out)" ];
diff --git a/pkgs/applications/science/logic/proverif/default.nix b/pkgs/applications/science/logic/proverif/default.nix
index b6d15162fec35..57220aa523cf8 100644
--- a/pkgs/applications/science/logic/proverif/default.nix
+++ b/pkgs/applications/science/logic/proverif/default.nix
@@ -9,7 +9,9 @@ stdenv.mkDerivation rec {
     sha256 = "sha256:0xgwnp59779xc40sb7ck8rmfn620pilxyq79l3bymj9m7z0mwvm9";
   };
 
-  buildInputs = with ocamlPackages; [ ocaml findlib ];
+  strictDeps = true;
+
+  nativeBuildInputs = with ocamlPackages; [ ocaml findlib ];
 
   buildPhase = "./build -nointeract";
   installPhase = ''
diff --git a/pkgs/applications/science/logic/satallax/default.nix b/pkgs/applications/science/logic/satallax/default.nix
index 648ebee6550c0..af11cd0d6d8f9 100644
--- a/pkgs/applications/science/logic/satallax/default.nix
+++ b/pkgs/applications/science/logic/satallax/default.nix
@@ -3,8 +3,11 @@ stdenv.mkDerivation rec {
   pname = "satallax";
   version = "2.7";
 
-  nativeBuildInputs = [ makeWrapper ];
-  buildInputs = [ ocaml zlib which eprover coq ];
+  strictDeps = true;
+
+  nativeBuildInputs = [ makeWrapper ocaml which eprover coq ];
+  buildInputs = [ zlib ];
+
   src = fetchurl {
     url = "https://www.ps.uni-saarland.de/~cebrown/satallax/downloads/${pname}-${version}.tar.gz";
     sha256 = "1kvxn8mc35igk4vigi5cp7w3wpxk2z3bgwllfm4n3h2jfs0vkpib";
@@ -46,7 +49,7 @@ stdenv.mkDerivation rec {
   '';
 
   # error: invalid suffix on literal; C++11 requires a space between literal and identifier
-  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-Wno-reserved-user-defined-literal";
+  env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-Wno-reserved-user-defined-literal";
 
   installPhase = ''
     mkdir -p "$out/share/doc/satallax" "$out/bin" "$out/lib" "$out/lib/satallax"
diff --git a/pkgs/applications/science/logic/statverif/default.nix b/pkgs/applications/science/logic/statverif/default.nix
index 07365eef33fac..1f62389775517 100644
--- a/pkgs/applications/science/logic/statverif/default.nix
+++ b/pkgs/applications/science/logic/statverif/default.nix
@@ -14,7 +14,9 @@ stdenv.mkDerivation rec {
     sha256 = "113jjhi1qkcggbsmbw8fa9ln8vs7vy2r288szks7rn0jjn0wxmbw";
   };
 
-  buildInputs = [ ocaml ];
+  strictDeps = true;
+
+  nativeBuildInputs = [ ocaml ];
 
   patchPhase = "patch -p1 < ${pf-patch}";
   buildPhase = "./build";
diff --git a/pkgs/applications/science/logic/tlaplus/tlaps.nix b/pkgs/applications/science/logic/tlaplus/tlaps.nix
index 14b3055ab36b0..59afbc094e40d 100644
--- a/pkgs/applications/science/logic/tlaplus/tlaps.nix
+++ b/pkgs/applications/science/logic/tlaplus/tlaps.nix
@@ -17,7 +17,9 @@ stdenv.mkDerivation rec {
     sha256 = "c296998acd14d5b93a8d5be7ee178007ef179957465966576bda26944b1b7fca";
   };
 
-  buildInputs = [ ocaml isabelle cvc3 perl wget which ];
+  strictDeps = true;
+
+  nativeBuildInputs = [ ocaml isabelle cvc3 perl wget which ];
 
   installPhase = ''
     mkdir -pv "$out"
diff --git a/pkgs/applications/science/logic/why3/default.nix b/pkgs/applications/science/logic/why3/default.nix
index 8ca2a6baa8890..55b59ff2e3b06 100644
--- a/pkgs/applications/science/logic/why3/default.nix
+++ b/pkgs/applications/science/logic/why3/default.nix
@@ -10,8 +10,16 @@ stdenv.mkDerivation rec {
     sha256 = "sha256-vNR7WeiSvg+763GcovoZBFDfncekJMeqNegP4fVw06I=";
   };
 
+  strictDeps = true;
+
+  nativeBuildInputs = with ocamlPackages;  [
+    ocaml findlib menhir
+    # Coq Support
+    coqPackages.coq
+  ];
+
   buildInputs = with ocamlPackages; [
-    ocaml findlib ocamlgraph zarith menhir
+    ocamlgraph zarith
     # Emacs compilation of why3.el
     emacs
     # Documentation
diff --git a/pkgs/applications/science/logic/yices/default.nix b/pkgs/applications/science/logic/yices/default.nix
index fb14723241b81..83fbb6d6546b0 100644
--- a/pkgs/applications/science/logic/yices/default.nix
+++ b/pkgs/applications/science/logic/yices/default.nix
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
 
   meta = with lib; {
     description = "A high-performance theorem prover and SMT solver";
-    homepage    = "http://yices.csl.sri.com";
+    homepage    = "https://yices.csl.sri.com";
     license     = licenses.gpl3;
     platforms   = with platforms; linux ++ darwin;
     maintainers = with maintainers; [ thoughtpolice ];
diff --git a/pkgs/applications/science/logic/z3/default.nix b/pkgs/applications/science/logic/z3/default.nix
index 75cfa2568f85a..f810a5a56739a 100644
--- a/pkgs/applications/science/logic/z3/default.nix
+++ b/pkgs/applications/science/logic/z3/default.nix
@@ -18,23 +18,26 @@ assert ocamlBindings -> ocaml != null && findlib != null && zarith != null;
 
 with lib;
 
-let common = { version, sha256, patches ? [ ] }:
+let common = { version, sha256, patches ? [ ], tag ? "z3" }:
   stdenv.mkDerivation rec {
     pname = "z3";
     inherit version sha256 patches;
     src = fetchFromGitHub {
       owner = "Z3Prover";
       repo = pname;
-      rev = "z3-${version}";
+      rev = "${tag}-${version}";
       sha256 = sha256;
     };
 
-    nativeBuildInputs = optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
-    buildInputs = [ python ]
+    strictDeps = true;
+
+    nativeBuildInputs = [ python ]
+      ++ optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames
       ++ optional javaBindings jdk
-      ++ optionals ocamlBindings [ ocaml findlib zarith ]
+      ++ optionals ocamlBindings [ ocaml findlib ]
     ;
-    propagatedBuildInputs = [ python.pkgs.setuptools ];
+    propagatedBuildInputs = [ python.pkgs.setuptools ]
+      ++ optionals ocamlBindings [ zarith ];
     enableParallelBuilding = true;
 
     postPatch = optionalString ocamlBindings ''
@@ -44,7 +47,7 @@ let common = { version, sha256, patches ? [ ] }:
 
     configurePhase = concatStringsSep " "
       (
-        [ "${python.interpreter} scripts/mk_make.py --prefix=$out" ]
+        [ "${python.pythonForBuild.interpreter} scripts/mk_make.py --prefix=$out" ]
           ++ optional javaBindings "--java"
           ++ optional ocamlBindings "--ml"
           ++ optional pythonBindings "--python --pypkgdir=$out/${python.sitePackages}"
@@ -92,4 +95,9 @@ in
     version = "4.8.15";
     sha256 = "0xkwqz0y5d1lfb6kfqy8wn8n2dqalzf4c8ghmjsajc1bpdl70yc5";
   };
+  z3_4_8_5 = common {
+    tag = "Z3";
+    version = "4.8.5";
+    sha256 = "sha256-ytG5O9HczbIVJAiIGZfUXC/MuYH7d7yLApaeTRlKXoc=";
+  };
 }
diff --git a/pkgs/applications/science/machine-learning/finalfrontier/default.nix b/pkgs/applications/science/machine-learning/finalfrontier/default.nix
index 1644ca3d1433c..6b76eea33cefa 100644
--- a/pkgs/applications/science/machine-learning/finalfrontier/default.nix
+++ b/pkgs/applications/science/machine-learning/finalfrontier/default.nix
@@ -11,16 +11,16 @@
 
 rustPlatform.buildRustPackage rec {
   pname = "finalfrontier";
-  version = "0.9.4";
+  version = "unstable-2022-01-06";
 
   src = fetchFromGitHub {
     owner = "finalfusion";
     repo = pname;
-    rev = version;
-    sha256 = "1lvwv238p8hrl4sc5pmnvaargl2dd25p44gxl3kibq5ng03afd0n";
+    rev = "2461fb1dde13b73039926aa66606e470907a1b59";
+    sha256 = "sha256-bnRzXIYairlBjv2JxU16UXYc5BB3VeKZNiJ4+XDzub4=";
   };
 
-  cargoSha256 = "0lhcazcih48gc23q484h344bzz7p3lh189ljhswdyph2i11caarp";
+  cargoSha256 = "sha256-C/D9EPfifyajrCyXE8w/qRuzWEoyJJIcj4xii94/9l4=";
 
   nativeBuildInputs = [
     installShellFiles
diff --git a/pkgs/applications/science/machine-learning/streamlit/default.nix b/pkgs/applications/science/machine-learning/streamlit/default.nix
index 9479011d5f149..ad22d57882ed6 100755
--- a/pkgs/applications/science/machine-learning/streamlit/default.nix
+++ b/pkgs/applications/science/machine-learning/streamlit/default.nix
@@ -26,12 +26,12 @@
 
 buildPythonApplication rec {
   pname = "streamlit";
-  version = "1.16.0";
+  version = "1.18.1";
   format = "wheel"; # source currently requires pipenv
 
   src = fetchPypi {
     inherit pname version format;
-    hash = "sha256-TBNWIe3m646dbnOMxUltkNZr23g0Dqsestvxl4zHr4A=";
+    hash = "sha256-lO2QfM/G+4M55f8JCZBwk10SkMp4gXb68KncHm90k7g=";
   };
 
   propagatedBuildInputs = [
diff --git a/pkgs/applications/science/math/R/default.nix b/pkgs/applications/science/math/R/default.nix
index 83acfcfe9c37d..580de87bdb23f 100644
--- a/pkgs/applications/science/math/R/default.nix
+++ b/pkgs/applications/science/math/R/default.nix
@@ -8,15 +8,18 @@
 # R as of writing does not support outputting both .so and .a files; it outputs:
 #     --enable-R-static-lib conflicts with --enable-R-shlib and will be ignored
 , static ? false
+, testers
 }:
 
 assert (!blas.isILP64) && (!lapack.isILP64);
 
-stdenv.mkDerivation rec {
+stdenv.mkDerivation (finalAttrs: {
   pname = "R";
   version = "4.2.2";
 
-  src = fetchurl {
+  src = let
+    inherit (finalAttrs) pname version;
+  in fetchurl {
     url = "https://cran.r-project.org/src/base/R-${lib.versions.major version}/${pname}-${version}.tar.gz";
     sha256 = "sha256-D/YrQuxRr6VxPK7nxP3noMRZQLo5vvjFyUh/7wyVPfU=";
   };
@@ -97,6 +100,8 @@ stdenv.mkDerivation rec {
 
   setupHook = ./setup-hook.sh;
 
+  passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
+
   meta = with lib; {
     homepage = "http://www.r-project.org/";
     description = "Free software environment for statistical computing and graphics";
@@ -121,8 +126,9 @@ stdenv.mkDerivation rec {
       user-defined recursive functions and input and output facilities.
     '';
 
+    pkgConfigModules = [ "libR" ];
     platforms = platforms.all;
 
     maintainers = with maintainers; [ jbedo ] ++ teams.sage.members;
   };
-}
+})
diff --git a/pkgs/applications/science/math/bliss/default.nix b/pkgs/applications/science/math/bliss/default.nix
index fe68d9d245c52..4fccc3a464039 100644
--- a/pkgs/applications/science/math/bliss/default.nix
+++ b/pkgs/applications/science/math/bliss/default.nix
@@ -32,6 +32,6 @@ stdenv.mkDerivation rec {
     description = "An open source tool for computing automorphism groups and canonical forms of graphs. It has both a command line user interface as well as C++ and C programming language APIs";
     homepage = "http://www.tcs.hut.fi/Software/bliss/";
     license = licenses.lgpl3;
-    platforms = [ "i686-linux" "x86_64-linux" ];
+    platforms = [ "i686-linux" "x86_64-linux" "aarch64-linux" ];
   };
 }
diff --git a/pkgs/applications/science/math/caffe/default.nix b/pkgs/applications/science/math/caffe/default.nix
index d6c95633dd520..ed6836afbd92a 100644
--- a/pkgs/applications/science/math/caffe/default.nix
+++ b/pkgs/applications/science/math/caffe/default.nix
@@ -21,7 +21,13 @@
 }:
 
 let
-  inherit (cudaPackages) cudatoolkit cudnn nccl;
+  inherit (cudaPackages) cudatoolkit nccl;
+  # The default for cudatoolkit 10.1 is CUDNN 8.0.5, the last version to support CUDA 10.1.
+  # However, this caffe does not build with CUDNN 8.x, so we use CUDNN 7.6.5 instead.
+  # Earlier versions of cudatoolkit use pre-8.x CUDNN, so we use the default.
+  cudnn = if lib.versionOlder cudatoolkit.version "10.1"
+    then cudaPackages.cudnn
+    else cudaPackages.cudnn_7_6_5;
 in
 
 assert leveldbSupport -> (leveldb != null && snappy != null);
diff --git a/pkgs/applications/science/math/calc/default.nix b/pkgs/applications/science/math/calc/default.nix
index d521da2f114cd..75dbccced193c 100644
--- a/pkgs/applications/science/math/calc/default.nix
+++ b/pkgs/applications/science/math/calc/default.nix
@@ -3,14 +3,14 @@
 
 stdenv.mkDerivation rec {
   pname = "calc";
-  version = "2.14.1.2";
+  version = "2.14.1.3";
 
   src = fetchurl {
     urls = [
       "https://github.com/lcn2/calc/releases/download/v${version}/${pname}-${version}.tar.bz2"
       "http://www.isthe.com/chongo/src/calc/${pname}-${version}.tar.bz2"
     ];
-    sha256 = "sha256-3o8jKmEYxNQtExOkjqTVU24mtSok+T/RnRw6goNzThM=";
+    sha256 = "sha256-5aAvYzjAkpLZGf9UE+Ta18Io9EwP769yYlVykiH4qd0=";
   };
 
   postPatch = ''
diff --git a/pkgs/applications/science/math/calculix/default.nix b/pkgs/applications/science/math/calculix/default.nix
index 4b0ae6f8ac9d9..7a89fdd73c848 100644
--- a/pkgs/applications/science/math/calculix/default.nix
+++ b/pkgs/applications/science/math/calculix/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ arpack spooles blas lapack ];
 
-  NIX_CFLAGS_COMPILE = [
+  env.NIX_CFLAGS_COMPILE = toString [
     "-I${spooles}/include/spooles"
     "-std=legacy"
   ];
diff --git a/pkgs/applications/science/math/cntk/default.nix b/pkgs/applications/science/math/cntk/default.nix
index bffd208f9ef61..f885dae444ba6 100644
--- a/pkgs/applications/science/math/cntk/default.nix
+++ b/pkgs/applications/science/math/cntk/default.nix
@@ -60,7 +60,7 @@ in stdenv.mkDerivation rec {
   OMPI_CXX = "g++";
 
   # Uses some deprecated tensorflow functions
-  NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations";
+  env.NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations";
 
   buildInputs = [ openblas opencv3 libzip boost protobuf mpi ]
              ++ lib.optional cudaSupport cudatoolkit
diff --git a/pkgs/applications/science/math/eukleides/default.nix b/pkgs/applications/science/math/eukleides/default.nix
index 507fa0815298b..42e17c70673e6 100644
--- a/pkgs/applications/science/math/eukleides/default.nix
+++ b/pkgs/applications/science/math/eukleides/default.nix
@@ -36,7 +36,7 @@ lib.fix (eukleides: stdenv.mkDerivation rec {
   # gcc-10. Otherwise build fails as:
   #   ld: eukleides_build/triangle.o:(.bss+0x28): multiple definition of `A';
   #     eukleides_build/quadrilateral.o:(.bss+0x18): first defined here
-  NIX_CFLAGS_COMPILE = "-fcommon";
+  env.NIX_CFLAGS_COMPILE = "-fcommon";
 
   preInstall = ''
     mkdir -p $out/bin
diff --git a/pkgs/applications/science/math/gap/default.nix b/pkgs/applications/science/math/gap/default.nix
index 677e7d9a0d96c..7a466f8c000c5 100644
--- a/pkgs/applications/science/math/gap/default.nix
+++ b/pkgs/applications/science/math/gap/default.nix
@@ -134,8 +134,6 @@ stdenv.mkDerivation rec {
     # https://github.com/NixOS/nixpkgs/pull/192548#discussion_r992824942
     rm -r "$out/share/gap/pkg"
     cp -ar pkg tst "$out/share/gap"
-
-    makeWrapper "$out/lib/gap/gap" "$out/bin/gap" --add-flags "-l $out/share/gap"
   '';
 
   preFixup = ''
diff --git a/pkgs/applications/science/math/ginac/default.nix b/pkgs/applications/science/math/ginac/default.nix
index 7357f024c90d4..1b5a0622f4e29 100644
--- a/pkgs/applications/science/math/ginac/default.nix
+++ b/pkgs/applications/science/math/ginac/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "ginac";
-  version = "1.8.4";
+  version = "1.8.5";
 
   src = fetchurl {
     url = "https://www.ginac.de/ginac-${version}.tar.bz2";
-    sha256 = "sha256-J84Wrt/nRlGyI725JGwAWWt/+b9yeg06Rz9GcADaxJI=";
+    sha256 = "sha256-wks3oecJ9mDQl4eH6GszSAPNKOwXaJzzbd/zgAc+omE=";
   };
 
   propagatedBuildInputs = [ cln ];
diff --git a/pkgs/applications/science/math/gretl/default.nix b/pkgs/applications/science/math/gretl/default.nix
index a2624c29662e4..315433feb1c2a 100644
--- a/pkgs/applications/science/math/gretl/default.nix
+++ b/pkgs/applications/science/math/gretl/default.nix
@@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
       gretl is a cross-platform software package for econometric analysis,
       written in the C programming language.
     '';
-    homepage = "http://gretl.sourceforge.net";
+    homepage = "https://gretl.sourceforge.net";
     license = licenses.gpl3;
     maintainers = with maintainers; [ dmrauh ];
     platforms = with platforms; all;
diff --git a/pkgs/applications/science/math/lp_solve/default.nix b/pkgs/applications/science/math/lp_solve/default.nix
index f4c117267d568..6a1bc86abced3 100644
--- a/pkgs/applications/science/math/lp_solve/default.nix
+++ b/pkgs/applications/science/math/lp_solve/default.nix
@@ -53,7 +53,7 @@ stdenv.mkDerivation rec {
 
   meta = with lib; {
     description = "A Mixed Integer Linear Programming (MILP) solver";
-    homepage = "http://lpsolve.sourceforge.net";
+    homepage = "https://lpsolve.sourceforge.net";
     license = licenses.gpl2Plus;
     maintainers = with maintainers; [ smironov ];
     platforms = platforms.unix;
diff --git a/pkgs/applications/science/math/mxnet/default.nix b/pkgs/applications/science/math/mxnet/default.nix
index dcba888ce2fb1..c1a329c608864 100644
--- a/pkgs/applications/science/math/mxnet/default.nix
+++ b/pkgs/applications/science/math/mxnet/default.nix
@@ -50,10 +50,16 @@ stdenv.mkDerivation rec {
       "-DUSE_OLDCMAKECUDA=ON"  # see https://github.com/apache/incubator-mxnet/issues/10743
       "-DCUDA_ARCH_NAME=All"
       "-DCUDA_HOST_COMPILER=${cudatoolkit.cc}/bin/cc"
-      "-DMXNET_CUDA_ARCH=${cudaFlags.cudaCapabilitiesSemiColonString}"
+      "-DMXNET_CUDA_ARCH=${builtins.concatStringsSep ";" cudaFlags.cudaRealArches}"
     ] else [ "-DUSE_CUDA=OFF" ])
     ++ lib.optional (!cudnnSupport) "-DUSE_CUDNN=OFF";
 
+  env.NIX_CFLAGS_COMPILE = toString [
+    # Needed with GCC 12
+    "-Wno-error=maybe-uninitialized"
+    "-Wno-error=uninitialized"
+  ];
+
   postPatch = ''
     substituteInPlace 3rdparty/mkldnn/tests/CMakeLists.txt \
       --replace "/bin/bash" "${bash}/bin/bash"
diff --git a/pkgs/applications/science/math/pari/default.nix b/pkgs/applications/science/math/pari/default.nix
index 91cf4ae4f3894..41dff3adede5a 100644
--- a/pkgs/applications/science/math/pari/default.nix
+++ b/pkgs/applications/science/math/pari/default.nix
@@ -1,6 +1,7 @@
 { lib
 , stdenv
 , fetchurl
+, fetchpatch
 , gmp
 , libX11
 , libpthreadstubs
@@ -14,7 +15,7 @@ assert withThread -> libpthreadstubs != null;
 
 stdenv.mkDerivation rec {
   pname = "pari";
-  version = "2.15.1";
+  version = "2.15.2";
 
   src = fetchurl {
     urls = [
@@ -22,9 +23,18 @@ 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"
     ];
-    hash = "sha256-RUGdt3xmhb7mfkLg7LeOGe9WK+eq/GN8ikGXDy6Qnj0=";
+    hash = "sha256-sEYoER7iKHZRmksc2vsy/rqjTq+iT56B9Y+NBX++4N0=";
   };
 
+  patches = [
+    # https://pari.math.u-bordeaux.fr/cgi-bin/bugreport.cgi?bug=2441
+    (fetchpatch {
+      name = "fix-find_isogenous_from_Atkin.patch";
+      url = "https://git.sagemath.org/sage.git/plain/build/pkgs/pari/patches/bug2441.patch?id=9.8.rc0";
+      hash = "sha256-DvOUFlFDnopN+MJY6GYRPNabuoHPFch/nNn+49ygznc=";
+    })
+  ];
+
   buildInputs = [
     gmp
     libX11
diff --git a/pkgs/applications/science/math/perseus/default.nix b/pkgs/applications/science/math/perseus/default.nix
index d9921e68edb11..bbfc8aed44284 100644
--- a/pkgs/applications/science/math/perseus/default.nix
+++ b/pkgs/applications/science/math/perseus/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
   };
 
   sourceRoot = ".";
-  NIX_CFLAGS_COMPILE = [ "-std=c++14" ];
+  env.NIX_CFLAGS_COMPILE = toString [ "-std=c++14" ];
   buildPhase = ''
     g++ Pers.cpp -O3 -fpermissive -o perseus
   '';
diff --git a/pkgs/applications/science/math/polymake/default.nix b/pkgs/applications/science/math/polymake/default.nix
index 0eecff0a17989..4dc11db532fdf 100644
--- a/pkgs/applications/science/math/polymake/default.nix
+++ b/pkgs/applications/science/math/polymake/default.nix
@@ -25,13 +25,13 @@
 
 stdenv.mkDerivation rec {
   pname = "polymake";
-  version = "4.8";
+  version = "4.9";
 
   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-GfsAypJBpHwpvoEl/IzJ1gQfeMcYwB7oNe01xWJ+86w=";
+    sha256 = "sha256-BMkLgms6JsWmPhi+MZv/Eqie8BKL+KaPtk3xBZSyWfM=";
   };
 
   nativeBuildInputs = [
diff --git a/pkgs/applications/science/math/programmer-calculator/default.nix b/pkgs/applications/science/math/programmer-calculator/default.nix
index e9c7cb985cb9b..ee48a1d0f1a3e 100644
--- a/pkgs/applications/science/math/programmer-calculator/default.nix
+++ b/pkgs/applications/science/math/programmer-calculator/default.nix
@@ -2,13 +2,13 @@
 
 gccStdenv.mkDerivation rec {
   pname = "programmer-calculator";
-  version = "2.2";
+  version = "3.0";
 
   src = fetchFromGitHub {
     owner = "alt-romes";
     repo = pname;
     rev = "v${version}";
-    sha256 = "sha256-JQcYCYKdjdy8U2XMFzqTH9kAQ7CFv0r+sC1YfuAm7p8=";
+    sha256 = "sha256-9mv8Jac6j3fKWLLCu1Bd/T5dbegUB8rRgsj9MaQhFDw=";
   };
 
   buildInputs = [ ncurses ];
diff --git a/pkgs/applications/science/math/readstat/default.nix b/pkgs/applications/science/math/readstat/default.nix
index bb945b06ba137..e58674f344971 100644
--- a/pkgs/applications/science/math/readstat/default.nix
+++ b/pkgs/applications/science/math/readstat/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   name = "readstat";
-  version = "1.1.8";
+  version = "1.1.9";
 
   src = fetchFromGitHub {
     owner = "WizardMac";
     repo = "ReadStat";
     rev = "v${version}";
-    sha256 = "1r04lq45h1yn34v1mgfiqjfzyaqv4axqlby0nkandamcsqyhc7y4";
+    sha256 = "sha256-4lRJgZPB2gfaQ9fQKvDDpGhy1eDNT/nT1QmeZlCmCis=";
   };
 
   nativeBuildInputs = [ pkg-config autoreconfHook ];
diff --git a/pkgs/applications/science/math/sage/README.md b/pkgs/applications/science/math/sage/README.md
index c3a81c2109ee4..c4de5da45dbf0 100644
--- a/pkgs/applications/science/math/sage/README.md
+++ b/pkgs/applications/science/math/sage/README.md
@@ -10,7 +10,7 @@ First you should find out which change to nixpkgs is at fault (if you don't alre
 
 If the build broke as a result of a package update, try those solutions in order:
 
-- search the [sage trac](https://trac.sagemath.org/) for keywords like "Upgrade <package>". Maybe somebody has already proposed a patch that fixes the issue. You can then add a `fetchpatch` to `sage-src.nix`.
+- search the [sage GitHub repo](https://github.com/sagemath/sage) for keywords like "Upgrade <package>". Maybe somebody has already proposed a patch that fixes the issue. You can then add a `fetchpatch` to `sage-src.nix`.
 
 - check if [gentoo](https://github.com/cschwan/sage-on-gentoo/tree/master/sci-mathematics/sage), [debian](https://salsa.debian.org/science-team/sagemath/tree/master/debian) or [arch linux](https://git.archlinux.org/svntogit/community.git/tree/trunk?h=packages/sagemath) already solved the problem. You can then again add a `fetchpatch` to `sage-src.nix`. If applicable you should also [propose the patch upstream](#proposing-a-sage-patch).
 
@@ -19,7 +19,7 @@ If the build broke as a result of a package update, try those solutions in order
 ```
 [user@localhost ~]$ git clone https://github.com/sagemath/sage.git
 [user@localhost ~]$ cd sage
-[user@localhost sage]$ git checkout 8.2 # substitute the relevant version here
+[user@localhost sage]$ git checkout 9.8 # substitute the relevant version here
 ```
 
 Then make the needed changes and generate a patch with `git diff`:
@@ -29,42 +29,10 @@ Then make the needed changes and generate a patch with `git diff`:
 [user@localhost ~]$ git diff -u > /path/to/nixpkgs/pkgs/applications/science/math/sage/patches/name-of-patch.patch
 ```
 
-Now just add the patch to `sage-src.nix` and test your changes. If they fix the problem, [propose them upstream](#proposing-a-sage-patch) and add a link to the trac ticket.
+Now just add the patch to `sage-src.nix` and test your changes. If they fix the problem, submit a PR upstream (refer to sages [Developer's Guide](http://doc.sagemath.org/html/en/developer/index.html) for further details).
 
 - pin the package version in `default.nix` and add a note that explains why that is necessary.
 
-
-## Proposing a sage patch
-
-You can [login the sage trac using GitHub](https://trac.sagemath.org/login). Your username will then be `gh-<your-github-name>`. The only other way is to request a trac account via email. After that refer to [git the hard way](http://doc.sagemath.org/html/en/developer/manual_git.html#chapter-manual-git) in the sage documentation. The "easy way" requires a non-GitHub account (requested via email) and a special tool. The "hard way" is really not all that hard if you're a bit familiar with git.
-
-Here's the gist, assuming you want to use ssh key authentication. First, [add your public ssh key](https://trac.sagemath.org/prefs/sshkeys). Then:
-
-```
-[user@localhost ~]$ git clone https://github.com/sagemath/sage.git
-[user@localhost ~]$ cd sage
-[user@localhost sage]$ git remote add trac git@trac.sagemath.org:sage.git -t master
-[user@localhost sage]$ git checkout -b u/gh-<your-github-username>/<your-branch-name> develop
-[user@localhost sage]$ <make changes>
-[user@localhost sage]$ git add .
-[user@localhost sage]$ git commit
-[user@localhost sage]$ git show # review your changes
-[user@localhost sage]$ git push --set-upstream trac u/gh-<your-github-username>/<your-branch-name>
-```
-
-You now created a branch on the trac server (you *must* follow the naming scheme as you only have push access to branches with the `u/gh-<your-github-username>/` prefix).
-Now you can [create a new trac ticket](https://trac.sagemath.org/newticket).
-- Write a description of the change
-- set the type and component as appropriate
-- write your real name in the "Authors" field
-- write `u/gh-<your-github-username>/<your-branch-name>` in the "Branch" field
-- click "Create ticket"
-- click "Modify" on the top right of your ticket (for some reason you can only change the ticket status after you have created it)
-- set the ticket status from `new` to `needs_review`
-- click "Save changes"
-
-Refer to sages [Developer's Guide](http://doc.sagemath.org/html/en/developer/index.html) for further details.
-
 ## I want to update sage
 
 You'll need to change the `version` field in `sage-src.nix`. Afterwards just try to build and let nix tell you which patches no longer apply (hopefully because they were adopted upstream). Remove those.
@@ -74,5 +42,5 @@ If the problem is not obvious, you can try to first update sage to an intermedia
 
 ## Well, that didn't help!
 
-If you couldn't fix the problem, create a GitHub issue on the nixpkgs repo and ping @timokau (or whoever is listed in the `maintainers` list of the sage package).
+If you couldn't fix the problem, create a GitHub issue on the nixpkgs repo and ping the sage maintainers (as listed in the sage package).
 Describe what you did and why it didn't work. Afterwards it would be great if you help the next guy out and improve this documentation!
diff --git a/pkgs/applications/science/math/sage/env-locations.nix b/pkgs/applications/science/math/sage/env-locations.nix
index 1f8b33f687384..39d358a1f9a83 100644
--- a/pkgs/applications/science/math/sage/env-locations.nix
+++ b/pkgs/applications/science/math/sage/env-locations.nix
@@ -35,7 +35,8 @@ writeTextFile rec {
     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'
+    export GAP_LIB_DIR='${gap}/lib/gap'
+    export GAP_SHARE_DIR='${gap}/share/gap'
     export ECLDIR='${maxima.lisp-compiler}/lib/${maxima.lisp-compiler.pname}-${maxima.lisp-compiler.version}/'
     export COMBINATORIAL_DESIGN_DATA_DIR="${combinatorial_designs}/share/combinatorial_designs"
     export CREMONA_MINI_DATA_DIR="${elliptic_curves}/share/cremona"
diff --git a/pkgs/applications/science/math/sage/patches/pari-2.15.1-upgrade-rebased.patch b/pkgs/applications/science/math/sage/patches/pari-2.15.1-upgrade-rebased.patch
deleted file mode 100644
index 40bbbe23f1a3f..0000000000000
--- a/pkgs/applications/science/math/sage/patches/pari-2.15.1-upgrade-rebased.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-diff --git a/src/sage/geometry/polyhedron/backend_normaliz.py b/src/sage/geometry/polyhedron/backend_normaliz.py
-index 86b89632a5..ca8a43b248 100644
---- a/src/sage/geometry/polyhedron/backend_normaliz.py
-+++ b/src/sage/geometry/polyhedron/backend_normaliz.py
-@@ -53,7 +53,7 @@ def _number_field_elements_from_algebraics_list_of_lists_of_lists(listss, **kwds
-         1.732050807568878?
-         sage: from sage.geometry.polyhedron.backend_normaliz import _number_field_elements_from_algebraics_list_of_lists_of_lists
-         sage: K, results, hom = _number_field_elements_from_algebraics_list_of_lists_of_lists([[[rt2], [1]], [[rt3]], [[1], []]]); results  # optional - sage.rings.number_field
--        [[[-a^3 + 3*a], [1]], [[-a^2 + 2]], [[1], []]]
-+        [[[-a^3 + 3*a], [1]], [[a^2 - 2]], [[1], []]]
-     """
-     from sage.rings.qqbar import number_field_elements_from_algebraics
-     numbers = []
-diff --git a/src/sage/lfunctions/pari.py b/src/sage/lfunctions/pari.py
-index d2b20f1891..6c31efe239 100644
---- a/src/sage/lfunctions/pari.py
-+++ b/src/sage/lfunctions/pari.py
-@@ -339,7 +339,7 @@ def lfun_eta_quotient(scalings, exponents):
-         0.0374412812685155
- 
-         sage: lfun_eta_quotient([6],[4])
--        [[Vecsmall([7]), [Vecsmall([6]), Vecsmall([4])]], 0, [0, 1], 2, 36, 1]
-+        [[Vecsmall([7]), [Vecsmall([6]), Vecsmall([4]), 0]], 0, [0, 1], 2, 36, 1]
- 
-         sage: lfun_eta_quotient([2,1,4], [5,-2,-2])
-         Traceback (most recent call last):
diff --git a/pkgs/applications/science/math/sage/sage-src.nix b/pkgs/applications/science/math/sage/sage-src.nix
index d68a2c8a107ac..5e18b7415632e 100644
--- a/pkgs/applications/science/math/sage/sage-src.nix
+++ b/pkgs/applications/science/math/sage/sage-src.nix
@@ -57,14 +57,14 @@ let
   );
 in
 stdenv.mkDerivation rec {
-  version = "9.7";
+  version = "9.8";
   pname = "sage-src";
 
   src = fetchFromGitHub {
     owner = "sagemath";
     repo = "sage";
     rev = version;
-    sha256 = "sha256-MYpCp18wqKwCa+tcJ7He14p1FXDlVm1vubQqQS9g3LY=";
+    sha256 = "sha256-dDbrzJXsOBARYfJz0r7n3LbaoXHnx7Acz6HBa95NV9o=";
   };
 
   # Patches needed because of particularities of nix or the way this is packaged.
@@ -89,14 +89,6 @@ stdenv.mkDerivation rec {
     # To help debug the transient error in
     # https://trac.sagemath.org/ticket/23087 when it next occurs.
     ./patches/configurationpy-error-verbose.patch
-
-    # https://trac.sagemath.org/ticket/33907
-    (fetchSageDiff {
-      name = "interfaces-expectpy-intermittent.patch";
-      base = "9.8.beta6";
-      rev = "6f5c1c2fc8bcfb5e6555716d05ce70511795ffa1";
-      sha256 = "sha256-z8FQxtrk62MHzPjrUTad+fMAE6XV8GTsLWKgGOM3zBg=";
-    })
   ];
 
   # Patches needed because of package updates. We could just pin the versions of
@@ -119,28 +111,12 @@ stdenv.mkDerivation rec {
     # adapted from https://trac.sagemath.org/ticket/23712#comment:22
     ./patches/tachyon-renamed-focallength.patch
 
-    # https://trac.sagemath.org/ticket/34118
-    (fetchSageDiff {
-      name = "sympy-1.11-upgrade.patch";
-      base = "9.7";
-      rev = "52815744bde2b682245b6f985a112f7cb8666056";
-      sha256 = "sha256-gv6z6JkQ6S6oCJQNkVgcPVvzlplyvR1nC7pWmcUiSc0=";
-    })
-
-    # https://trac.sagemath.org/ticket/34460
-    (fetchSageDiff {
-      name = "ipywidgets-8-upgrade.patch";
-      base = "9.7";
-      rev = "2816dbacb342398a23bb3099e20c92c8020ab0fa";
-      sha256 = "sha256-tCOsMxXwPkRg3FJGVvTqDzlWdra78UfDY6nci0Nr9GI=";
-    })
-
     # https://trac.sagemath.org/ticket/34391
     (fetchSageDiff {
       name = "gap-4.12-upgrade.patch";
-      base = "9.8.beta2";
-      rev = "eb8cd42feb58963adba67599bf6e311e03424328";
-      sha256 = "sha256-0dKewOZe2n3PqSdxCJt18FkqwTdrD0VA5MXAMiTW8Tw=";
+      base = "9.8.beta7";
+      rev = "dd4a17281adcda74e11f998ef519b6bd0dafb043";
+      sha256 = "sha256-UQT9DO9xd5hh5RucvUkIm+rggPKu8bc1YaSI6LVYH98=";
     })
 
     # https://trac.sagemath.org/ticket/34701
@@ -151,46 +127,6 @@ stdenv.mkDerivation rec {
       sha256 = "sha256-9BhQLFB3wUhiXRQsK9L+I62lSjvTfrqMNi7QUIQvH4U=";
     })
 
-    # https://trac.sagemath.org/ticket/34537
-    (fetchSageDiff {
-      name = "pari-2.15.1-upgrade.patch";
-      squashed = true;
-      base = "54cd6fe6de52aee5a433e0569e8c370618cb2047"; # 9.8.beta1
-      rev = "1e86aa26790d84bf066eca67f98a60a8aa3d4d3a";
-      sha256 = "sha256-LUgcMqrKXWb72Kxl0n6MV5unLXlQSeG8ncN41F7TRSc=";
-      excludes = ["build/*"
-                  "src/sage/geometry/polyhedron/base_number_field.py"
-                  "src/sage/geometry/polyhedron/backend_normaliz.py"
-                  "src/sage/lfunctions/pari.py"];
-    })
-    # Some files were excluded from the above patch due to
-    # conflicts. The patch below contains rebased versions.
-    ./patches/pari-2.15.1-upgrade-rebased.patch
-
-    # https://trac.sagemath.org/ticket/34668
-    (fetchSageDiff {
-      name = "matplotlib-3.6-upgrade.patch";
-      base = "9.8.beta2";
-      rev = "5501e0de0dca1cff0355326dd42bd8c7e5749568";
-      sha256 = "sha256-ceJkVaecIsZewN8v/3gPQXFbFjv5Akz6zEFg/ToXdek=";
-    })
-
-    # https://trac.sagemath.org/ticket/34693
-    (fetchSageDiff {
-      name = "matplotlib-3.6-docbuilding.patch";
-      base = "9.8.beta4";
-      rev = "64589686c261d33e6b5aff2589bcae8af004bcc6";
-      sha256 = "sha256-j5AMY1TmhP+HBBBYaFZSkABJ5vtwe6iP2LRfGEgSm8Q=";
-    })
-
-    # https://trac.sagemath.org/ticket/34615
-    (fetchSageDiff {
-      name = "sphinx-5.2-upgrade.patch";
-      base = "9.8.beta1";
-      rev = "8f8af65e54d3a9962cfab40f15dc23f4e955b43f";
-      sha256 = "sha256-yhDdyxnXSSkqLcuOPBWSEBc26rk1Od3gLcWW8S2p8bY=";
-    })
-
     # temporarily paper over https://github.com/jupyter-widgets/ipywidgets/issues/3669
     ./patches/ipywidgets-on_submit-deprecationwarning.patch
 
diff --git a/pkgs/applications/science/math/sage/sage-tests.nix b/pkgs/applications/science/math/sage/sage-tests.nix
index 79d4f78082e09..4910f5e8bf1d2 100644
--- a/pkgs/applications/science/math/sage/sage-tests.nix
+++ b/pkgs/applications/science/math/sage/sage-tests.nix
@@ -18,7 +18,7 @@ let
   src = sage-with-env.env.lib.src;
   runAllTests = files == null;
   testArgs = if runAllTests then "--all" else testFileList;
-  patienceSpecifier = if longTests then "--long" else "";
+  patienceSpecifier = lib.optionalString longTests "--long";
   timeSpecifier = if timeLimit == null then "" else "--short ${toString timeLimit}";
   relpathToArg = relpath: lib.escapeShellArg "${src}/${relpath}"; # paths need to be absolute
   testFileList = lib.concatStringsSep " " (map relpathToArg files);
diff --git a/pkgs/applications/science/math/scilab-bin/default.nix b/pkgs/applications/science/math/scilab-bin/default.nix
index 59e64bd0b8eff..f6da20531385b 100644
--- a/pkgs/applications/science/math/scilab-bin/default.nix
+++ b/pkgs/applications/science/math/scilab-bin/default.nix
@@ -1,4 +1,13 @@
-{ lib, stdenv, fetchurl, undmg, makeWrapper, xorg }:
+{ lib
+, stdenv
+, fetchurl
+, makeWrapper
+, undmg
+, autoPatchelfHook
+, alsa-lib
+, ncurses5
+, xorg
+}:
 
 let
   pname = "scilab-bin";
@@ -26,88 +35,69 @@ let
     platforms = [ "aarch64-darwin" "x86_64-darwin" "x86_64-linux" ];
     sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
     license = lib.licenses.gpl2Only;
+    mainProgram = "scilab";
   };
 
   darwin = stdenv.mkDerivation rec {
     inherit pname version src meta;
 
-    nativeBuildInputs = [ undmg makeWrapper ];
+    nativeBuildInputs = [
+      makeWrapper
+      undmg
+    ];
 
     sourceRoot = "scilab-${version}.app";
 
     installPhase = ''
+      runHook preInstall
+
       mkdir -p $out/{Applications/scilab.app,bin}
       cp -R . $out/Applications/scilab.app
       makeWrapper $out/{Applications/scilab.app/Contents/MacOS,bin}/scilab
+
+      runHook postInstall
     '';
   };
 
   linux = stdenv.mkDerivation rec {
     inherit pname version src meta;
 
-  libPath = lib.makeLibraryPath [
-    stdenv.cc.cc
-    xorg.libX11
-    xorg.libXext
-    xorg.libXi
-    xorg.libXrender
-    xorg.libXtst
-    xorg.libXxf86vm
-  ];
-
-  fixupPhase = ''
-    sed -i 's|\$(/bin/|$(|g' bin/scilab
-    sed -i 's|/usr/bin/||g' bin/scilab
-
-    sci="$out/opt/scilab-${version}"
-    fullLibPath="$sci/lib/scilab:$sci/lib/thirdparty:$libPath"
-    fullLibPath="$fullLibPath:$sci/lib/thirdparty/redist"
-
-    patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
-             --set-rpath "$fullLibPath" bin/scilab-bin
-    find . -name '*.so' -type f | while read file; do
-      patchelf --set-rpath "$fullLibPath" "$file" 2>/dev/null
-    done
-  '';
-
-  installPhase = ''
-    mkdir -p "$out/opt/scilab-${version}"
-    cp -r . "$out/opt/scilab-${version}/"
-
-    # Create bin/ dir
-    mkdir "$out/bin"
-
-    # Creating executable symlinks
-    ln -s "$out/opt/scilab-${version}/bin/scilab" "$out/bin/scilab"
-    ln -s "$out/opt/scilab-${version}/bin/scilab-cli" "$out/bin/scilab-cli"
-    ln -s "$out/opt/scilab-${version}/bin/scilab-adv-cli" "$out/bin/scilab-adv-cli"
+    nativeBuildInputs = [
+      autoPatchelfHook
+    ];
+
+    buildInputs = [
+      alsa-lib
+      ncurses5
+      stdenv.cc.cc
+    ] ++ (with xorg; [
+      libX11
+      libXcursor
+      libXext
+      libXft
+      libXi
+      libXrandr
+      libXrender
+      libXtst
+      libXxf86vm
+    ]);
 
-    # Creating desktop config dir
-    mkdir -p "$out/share/applications"
-
-    # Moving desktop config files
-    mv $out/opt/scilab-${version}/share/applications/*.desktop $out/share/applications
-
-    # Fixing Exec paths and launching each app with a terminal
-    sed -i -e "s|Exec=|Exec=$out/opt/scilab-${version}/bin/|g" \
-           -e "s|Terminal=.*$|Terminal=true|g" $out/share/applications/*.desktop
-
-    # Moving icons to the appropriate locations
-    for path in $out/opt/scilab-${version}/share/icons/hicolor/*/*/*
-    do
-      newpath=$(echo $path | sed 's|/opt/scilab-${version}||g')
-      filename=$(echo $path | sed 's|.*/||g')
-      dir=$(echo $newpath | sed "s|$filename||g")
-      mkdir -p $dir
-      mv $path $newpath
-    done
-
-    # Removing emptied folders
-    rm -rf $out/opt/scilab-${version}/share/{applications,icons}
-
-    # Moving other share/ folders
-    mv $out/opt/scilab-${version}/share/{appdata,locale,mime} $out/share
-  '';
+    installPhase = ''
+      runHook preInstall
+
+      mkdir -p $out
+      mv -t $out bin include lib share thirdparty
+      sed -i \
+        -e 's|\$(/bin/|$(|g' \
+        -e 's|/usr/bin/||g' \
+        $out/bin/{scilab,xcos}
+      sed -i \
+        -e "s|Exec=|Exec=$out/bin/|g" \
+        -e "s|Terminal=.*$|Terminal=true|g" \
+        $out/share/applications/*.desktop
+
+      runHook postInstall
+    '';
   };
 in
 if stdenv.isDarwin then darwin else linux
diff --git a/pkgs/applications/science/math/singular/default.nix b/pkgs/applications/science/math/singular/default.nix
index 3ca1501e382e6..e41d851cf7e87 100644
--- a/pkgs/applications/science/math/singular/default.nix
+++ b/pkgs/applications/science/math/singular/default.nix
@@ -166,7 +166,7 @@ stdenv.mkDerivation rec {
     # https://www.singular.uni-kl.de:8002/trac/ticket/837
     platforms = subtractLists platforms.i686 platforms.unix;
     license = licenses.gpl3; # Or GPLv2 at your option - but not GPLv4
-    homepage = "http://www.singular.uni-kl.de";
+    homepage = "https://www.singular.uni-kl.de";
     downloadPage = "http://www.mathematik.uni-kl.de/ftp/pub/Math/Singular/SOURCES/";
     mainProgram = "Singular";
   };
diff --git a/pkgs/applications/science/misc/cwltool/default.nix b/pkgs/applications/science/misc/cwltool/default.nix
index f6d9f4510faf8..7c28f65f3bf7b 100644
--- a/pkgs/applications/science/misc/cwltool/default.nix
+++ b/pkgs/applications/science/misc/cwltool/default.nix
@@ -7,14 +7,14 @@
 
 python3.pkgs.buildPythonApplication rec {
   pname = "cwltool";
-  version = "3.1.20221201130942";
+  version = "3.1.20230213100550";
   format = "setuptools";
 
   src = fetchFromGitHub {
     owner = "common-workflow-language";
     repo = pname;
     rev = "refs/tags/${version}";
-    hash = "sha256-PeddmHMJYtj/AAItmUVeyETizF7SKzkJ3bXYkeZU+xs=";
+    hash = "sha256-BtHkIVadcccnYYX8lRqiCzO+/qFeBaZfdUuu6qrjysk=";
   };
 
   postPatch = ''
diff --git a/pkgs/applications/science/misc/fityk/default.nix b/pkgs/applications/science/misc/fityk/default.nix
index a4aa6457d608d..5ec7973065d2f 100644
--- a/pkgs/applications/science/misc/fityk/default.nix
+++ b/pkgs/applications/science/misc/fityk/default.nix
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
     swig3
   ];
 
-  NIX_CFLAGS_COMPILE = [
+  env.NIX_CFLAGS_COMPILE = toString [
     "-std=c++11"
   ];
 
diff --git a/pkgs/applications/science/misc/openmodelica/mkderivation/default.nix b/pkgs/applications/science/misc/openmodelica/mkderivation/default.nix
index 088fa83b7d92e..ffa0a158ac95a 100644
--- a/pkgs/applications/science/misc/openmodelica/mkderivation/default.nix
+++ b/pkgs/applications/science/misc/openmodelica/mkderivation/default.nix
@@ -16,7 +16,7 @@ let
   # getAttr-like helper for optional append to string:
   # "Hello" + appendByAttr "a" " " {a = "world";} = "Hello world"
   # "Hello" + appendByAttr "a" " " {} = "Hello"
-  appendByAttr = attr: sep: x: if hasAttr attr x then sep + (getAttr attr x) else "";
+  appendByAttr = attr: sep: x: lib.optionalString (hasAttr attr x) (sep + (getAttr attr x));
 
   # Are there any OM dependencies at all?
   ifDeps = length pkg.omdeps != 0;
diff --git a/pkgs/applications/science/misc/openmvg/default.nix b/pkgs/applications/science/misc/openmvg/default.nix
index 1c173b75238ce..f9bcfa5df73c5 100644
--- a/pkgs/applications/science/misc/openmvg/default.nix
+++ b/pkgs/applications/science/misc/openmvg/default.nix
@@ -4,6 +4,8 @@
 , libpng ? null
 , eigen ? null
 , libtiff ? null
+, ceres-solver
+, enableShared ? !stdenv.hostPlatform.isStatic
 , enableExamples ? false
 , enableDocs ? false }:
 
@@ -19,7 +21,7 @@ stdenv.mkDerivation rec {
     fetchSubmodules = true;
   };
 
-  buildInputs = [ libjpeg zlib libpng eigen libtiff cereal openmp ];
+  buildInputs = [ libjpeg zlib libpng eigen libtiff cereal openmp ceres-solver ];
 
   nativeBuildInputs = [ cmake pkg-config ];
 
@@ -27,7 +29,8 @@ stdenv.mkDerivation rec {
     "-DCMAKE_CXX_FLAGS=-std=c++11"
     "-DOpenMVG_BUILD_EXAMPLES=${if enableExamples then "ON" else "OFF"}"
     "-DOpenMVG_BUILD_DOC=${if enableDocs then "ON" else "OFF"}"
-  ];
+    "-DTARGET_ARCHITECTURE=generic"
+  ] ++ lib.optional enableShared "-DOpenMVG_BUILD_SHARED=ON";
 
   cmakeDir = "./src";
 
diff --git a/pkgs/applications/science/misc/openmvs/default.nix b/pkgs/applications/science/misc/openmvs/default.nix
index 031f1655b0af3..fde756181cca4 100644
--- a/pkgs/applications/science/misc/openmvs/default.nix
+++ b/pkgs/applications/science/misc/openmvs/default.nix
@@ -1,4 +1,24 @@
-{ lib, stdenv, fetchFromGitHub, pkg-config, cmake, eigen, opencv, cgal, ceres-solver, boost, vcg, glfw, zstd }:
+{ lib
+, boost
+, breakpad
+, ceres-solver
+, cgal
+, cmake
+, eigen
+, fetchFromGitHub
+, glfw
+, gmp
+, libjpeg
+, libpng
+, libtiff
+, mpfr
+, opencv
+, openmp
+, pkg-config
+, stdenv
+, vcg
+, zstd
+}:
 
 let
   boostWithZstd = boost.overrideAttrs (old: {
@@ -20,10 +40,38 @@ stdenv.mkDerivation rec {
   # SSE is enabled by default
   cmakeFlags = lib.optional (!stdenv.isx86_64) "-DOpenMVS_USE_SSE=OFF";
 
-  buildInputs = [ eigen opencv cgal ceres-solver vcg glfw boostWithZstd ];
+  buildInputs = [
+    boostWithZstd
+    breakpad
+    ceres-solver
+    cgal
+    eigen
+    glfw
+    gmp
+    libjpeg
+    libpng
+    libtiff
+    mpfr
+    opencv
+    openmp
+    vcg
+  ];
 
   nativeBuildInputs = [ cmake pkg-config ];
 
+  postInstall = ''
+    mv $out/bin/OpenMVS/* $out/bin
+    rmdir $out/bin/OpenMVS
+    rm $out/bin/Tests
+  '';
+
+  doCheck = true;
+  checkPhase = ''
+    runHook preCheck
+    ctest
+    runHook postCheck
+  '';
+
   meta = {
     description = "Open Multi-View Stereo reconstruction library";
     homepage = "https://github.com/cdcseacave/openMVS";
diff --git a/pkgs/applications/science/misc/root/default.nix b/pkgs/applications/science/misc/root/default.nix
index af6aed851e09c..cfda819a42ca7 100644
--- a/pkgs/applications/science/misc/root/default.nix
+++ b/pkgs/applications/science/misc/root/default.nix
@@ -207,6 +207,7 @@ stdenv.mkDerivation rec {
     "-Druntime_cxxmodules=OFF"
   ];
 
+  # https://github.com/NixOS/nixpkgs/issues/201254
   NIX_LDFLAGS = lib.optionalString (stdenv.isLinux && stdenv.isAarch64 && stdenv.cc.isGNU) "-lgcc";
 
   # Workaround the xrootd runpath bug #169677 by prefixing [DY]LD_LIBRARY_PATH with ${lib.makeLibraryPath xrootd}.
diff --git a/pkgs/applications/science/molecular-dynamics/gromacs/default.nix b/pkgs/applications/science/molecular-dynamics/gromacs/default.nix
index 5093a586a85af..cdc5bc855731b 100644
--- a/pkgs/applications/science/molecular-dynamics/gromacs/default.nix
+++ b/pkgs/applications/science/molecular-dynamics/gromacs/default.nix
@@ -19,11 +19,11 @@ let
 
 in stdenv.mkDerivation rec {
   pname = "gromacs";
-  version = "2022.4";
+  version = "2023";
 
   src = fetchurl {
     url = "ftp://ftp.gromacs.org/pub/gromacs/gromacs-${version}.tar.gz";
-    sha256 = "sha256-xRG+YC/ylAIGW1CQaEHe+YdSY5uSqV8bChBg2bXicpc=";
+    sha256 = "sha256-rJLG2nL7vMpBT9io2Xnlbs8XxMHNq+0tpc+05yd7e6g=";
   };
 
   nativeBuildInputs = [ cmake ];
@@ -70,7 +70,7 @@ in stdenv.mkDerivation rec {
   '';
 
   meta = with lib; {
-    homepage = "http://www.gromacs.org";
+    homepage = "https://www.gromacs.org";
     license = licenses.gpl2;
     description = "Molecular dynamics software package";
     longDescription = ''
diff --git a/pkgs/applications/science/physics/dawncut/default.nix b/pkgs/applications/science/physics/dawncut/default.nix
index 8c0bc1ae6394a..5c17837d2e952 100644
--- a/pkgs/applications/science/physics/dawncut/default.nix
+++ b/pkgs/applications/science/physics/dawncut/default.nix
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
 
   dontConfigure = true;
 
-  NIX_CFLAGS_COMPILE="-std=c++98";
+  env.NIX_CFLAGS_COMPILE = "-std=c++98";
 
   installPhase = ''
     runHook preInstall
diff --git a/pkgs/applications/science/physics/elmerfem/default.nix b/pkgs/applications/science/physics/elmerfem/default.nix
index a203db1204cb3..9221f4bcdbdd1 100644
--- a/pkgs/applications/science/physics/elmerfem/default.nix
+++ b/pkgs/applications/science/physics/elmerfem/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchFromGitHub, cmake, git, gfortran, mpi, blas, liblapack, pkg-config, libGL, libGLU, opencascade, libsForQt5, vtkWithQt5}:
+{ lib, stdenv, fetchFromGitHub, cmake, git, gfortran, mpi, blas, liblapack, pkg-config, libGL, libGLU, opencascade, libsForQt5, vtk_8_withQt5}:
 
 stdenv.mkDerivation rec {
   pname = "elmerfem";
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
     libGL
     libGLU
     opencascade
-    vtkWithQt5
+    vtk_8_withQt5
   ];
 
   preConfigure = ''
diff --git a/pkgs/applications/science/physics/nnpdf/default.nix b/pkgs/applications/science/physics/nnpdf/default.nix
index bc9e3c7e90cd1..ec29c02054df2 100644
--- a/pkgs/applications/science/physics/nnpdf/default.nix
+++ b/pkgs/applications/science/physics/nnpdf/default.nix
@@ -1,14 +1,13 @@
 { lib
 , stdenv
 , fetchFromGitHub
-, fetchpatch
 , cmake
 , pkg-config
 , apfel
 , gsl
 , lhapdf
 , libarchive
-, libyamlcpp
+, yaml-cpp
 , python3
 , sqlite
 , swig
@@ -16,22 +15,15 @@
 
 stdenv.mkDerivation rec {
   pname = "nnpdf";
-  version = "4.0.4";
+  version = "4.0.6";
 
   src = fetchFromGitHub {
     owner = "NNPDF";
     repo = pname;
     rev = version;
-    sha256 = "sha256-Alx4W0TkPzJBsnRXcKBrlEU6jWTnOjrji/IPk+dNCw0=";
+    hash = "sha256-mwOMNlYFhHZq/wakO1/HGwcxvKGKh5OyFa2D9d3Y3IA=";
   };
 
-  patches = [
-    (fetchpatch {
-      url = "https://github.com/NNPDF/nnpdf/commit/7943b62a91d3a41fd4f6366b18881d50695f4b45.diff";
-      hash = "sha256-UXhTO7vZgJiY8h3bgjg7SQC0gMUQsYQ/V/PgtCEQ7VU=";
-    })
-  ];
-
   postPatch = ''
     for file in CMakeLists.txt buildmaster/CMakeLists.txt; do
       substituteInPlace $file \
@@ -49,7 +41,7 @@ stdenv.mkDerivation rec {
     gsl
     lhapdf
     libarchive
-    libyamlcpp
+    yaml-cpp
     python3
     python3.pkgs.numpy
     sqlite
diff --git a/pkgs/applications/science/physics/xfitter/default.nix b/pkgs/applications/science/physics/xfitter/default.nix
index 4e6f6626602f9..1852ef3ff1c8e 100644
--- a/pkgs/applications/science/physics/xfitter/default.nix
+++ b/pkgs/applications/science/physics/xfitter/default.nix
@@ -13,7 +13,7 @@
 , lhapdf
 , libtirpc
 , libyaml
-, libyamlcpp
+, yaml-cpp
 , pkg-config
 , qcdnum
 , root
@@ -38,13 +38,13 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake gfortran pkg-config ];
   buildInputs =
-    [ apfel blas ceres-solver lhapdf lapack libyaml root qcdnum gsl libyamlcpp zlib ]
+    [ apfel blas ceres-solver lhapdf lapack libyaml root qcdnum gsl yaml-cpp zlib ]
     ++ lib.optionals ("5" == lib.versions.major root.version) [ apfelgrid applgrid ]
     ++ lib.optionals (stdenv.system == "x86_64-darwin") [ memorymappingHook memstreamHook ]
     ++ lib.optional (stdenv.hostPlatform.libc == "glibc") libtirpc
     ;
 
-  NIX_CFLAGS_COMPILE = lib.optional (stdenv.hostPlatform.libc == "glibc") "-I${libtirpc.dev}/include/tirpc";
+  env.NIX_CFLAGS_COMPILE = lib.optionalString (stdenv.hostPlatform.libc == "glibc") "-I${libtirpc.dev}/include/tirpc";
   NIX_LDFLAGS = lib.optional (stdenv.hostPlatform.libc == "glibc") "-ltirpc";
 
   # workaround wrong library IDs
diff --git a/pkgs/applications/science/robotics/betaflight-configurator/default.nix b/pkgs/applications/science/robotics/betaflight-configurator/default.nix
index 271274126b754..a76327b854b0d 100644
--- a/pkgs/applications/science/robotics/betaflight-configurator/default.nix
+++ b/pkgs/applications/science/robotics/betaflight-configurator/default.nix
@@ -13,10 +13,10 @@ let
 in
 stdenv.mkDerivation rec {
   inherit pname;
-  version = "10.8.0";
+  version = "10.9.0";
   src = fetchurl {
     url = "https://github.com/betaflight/${pname}/releases/download/${version}/${pname}_${version}_linux64-portable.zip";
-    sha256 = "sha256-Xn0ga2Z1UKd++TriL47ulV6idVTNBR8uiSW7FnL7r1g=";
+    sha256 = "sha256-9FzMyBIR2u1zXHtTWJABM6RF1+OyjYdEPlRwtig9blI=";
   };
 
   nativeBuildInputs = [ wrapGAppsHook unzip ];