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/calcmysky/default.nix4
-rw-r--r--pkgs/applications/science/astronomy/celestia/default.nix6
-rw-r--r--pkgs/applications/science/astronomy/gildas/default.nix14
-rw-r--r--pkgs/applications/science/astronomy/gnuastro/default.nix37
-rw-r--r--pkgs/applications/science/astronomy/gravit/default.nix6
-rw-r--r--pkgs/applications/science/astronomy/kstars/default.nix6
-rw-r--r--pkgs/applications/science/astronomy/siril/default.nix4
-rw-r--r--pkgs/applications/science/astronomy/stellarium/default.nix28
-rw-r--r--pkgs/applications/science/biology/EZminc/default.nix70
-rw-r--r--pkgs/applications/science/biology/ants/default.nix6
-rw-r--r--pkgs/applications/science/biology/bamtools/default.nix2
-rw-r--r--pkgs/applications/science/biology/bcftools/default.nix4
-rw-r--r--pkgs/applications/science/biology/blast/bin.nix4
-rw-r--r--pkgs/applications/science/biology/blast/default.nix2
-rw-r--r--pkgs/applications/science/biology/bowtie2/default.nix2
-rw-r--r--pkgs/applications/science/biology/bwa-mem2/default.nix2
-rw-r--r--pkgs/applications/science/biology/cmtk/default.nix2
-rw-r--r--pkgs/applications/science/biology/dcm2niix/default.nix19
-rw-r--r--pkgs/applications/science/biology/delly/default.nix11
-rw-r--r--pkgs/applications/science/biology/dssp/default.nix2
-rw-r--r--pkgs/applications/science/biology/febio-studio/default.nix62
-rw-r--r--pkgs/applications/science/biology/febio-studio/febio-studio-cmake.patch38
-rw-r--r--pkgs/applications/science/biology/gatk/default.nix4
-rw-r--r--pkgs/applications/science/biology/genmap/default.nix2
-rw-r--r--pkgs/applications/science/biology/igv/default.nix4
-rw-r--r--pkgs/applications/science/biology/iqtree/default.nix6
-rw-r--r--pkgs/applications/science/biology/iv/default.nix2
-rw-r--r--pkgs/applications/science/biology/jbrowse/default.nix6
-rw-r--r--pkgs/applications/science/biology/kalign/default.nix2
-rw-r--r--pkgs/applications/science/biology/kallisto/default.nix4
-rw-r--r--pkgs/applications/science/biology/kent/default.nix4
-rw-r--r--pkgs/applications/science/biology/last/default.nix4
-rw-r--r--pkgs/applications/science/biology/macs2/default.nix15
-rw-r--r--pkgs/applications/science/biology/messer-slim/default.nix4
-rw-r--r--pkgs/applications/science/biology/migrate/default.nix4
-rw-r--r--pkgs/applications/science/biology/minc-tools/default.nix60
-rw-r--r--pkgs/applications/science/biology/minimap2/default.nix2
-rw-r--r--pkgs/applications/science/biology/mrbayes/default.nix4
-rw-r--r--pkgs/applications/science/biology/mrtrix/default.nix2
-rw-r--r--pkgs/applications/science/biology/muscle/default.nix28
-rw-r--r--pkgs/applications/science/biology/muscle/muscle-darwin-g++.patch15
-rw-r--r--pkgs/applications/science/biology/nest/default.nix7
-rw-r--r--pkgs/applications/science/biology/neuron/default.nix8
-rw-r--r--pkgs/applications/science/biology/obitools/obitools3.nix2
-rw-r--r--pkgs/applications/science/biology/paml/default.nix4
-rw-r--r--pkgs/applications/science/biology/picard-tools/default.nix4
-rw-r--r--pkgs/applications/science/biology/plink-ng/default.nix4
-rw-r--r--pkgs/applications/science/biology/repseek/default.nix2
-rw-r--r--pkgs/applications/science/biology/sambamba/default.nix2
-rw-r--r--pkgs/applications/science/biology/sortmerna/default.nix2
-rw-r--r--pkgs/applications/science/biology/sratoolkit/default.nix56
-rw-r--r--pkgs/applications/science/biology/subread/default.nix4
-rw-r--r--pkgs/applications/science/biology/svaba/default.nix2
-rw-r--r--pkgs/applications/science/biology/tandem-aligner/default.nix67
-rw-r--r--pkgs/applications/science/biology/trimal/default.nix4
-rw-r--r--pkgs/applications/science/biology/truvari/default.nix9
-rw-r--r--pkgs/applications/science/biology/veryfasttree/default.nix4
-rw-r--r--pkgs/applications/science/biology/whisper/default.nix2
-rw-r--r--pkgs/applications/science/chemistry/apbs/default.nix2
-rw-r--r--pkgs/applications/science/chemistry/autodock-vina/default.nix2
-rw-r--r--pkgs/applications/science/chemistry/avogadro2/default.nix4
-rw-r--r--pkgs/applications/science/chemistry/chemtool/default.nix57
-rw-r--r--pkgs/applications/science/chemistry/cp2k/default.nix231
-rw-r--r--pkgs/applications/science/chemistry/cp2k/remove-compiler-options.patch37
-rw-r--r--pkgs/applications/science/chemistry/element/default.nix2
-rw-r--r--pkgs/applications/science/chemistry/ergoscf/default.nix2
-rw-r--r--pkgs/applications/science/chemistry/gwyddion/default.nix31
-rw-r--r--pkgs/applications/science/chemistry/jmol/default.nix4
-rw-r--r--pkgs/applications/science/chemistry/marvin/default.nix10
-rw-r--r--pkgs/applications/science/chemistry/nwchem/default.nix16
-rw-r--r--pkgs/applications/science/chemistry/octopus/default.nix2
-rw-r--r--pkgs/applications/science/chemistry/pymol/default.nix7
-rw-r--r--pkgs/applications/science/chemistry/quantum-espresso/default.nix1
-rw-r--r--pkgs/applications/science/chemistry/wxmacmolplt/default.nix3
-rw-r--r--pkgs/applications/science/computer-architecture/accelergy/default.nix2
-rw-r--r--pkgs/applications/science/computer-architecture/timeloop/default.nix10
-rw-r--r--pkgs/applications/science/electronics/caneda/default.nix2
-rw-r--r--pkgs/applications/science/electronics/dataexplorer/default.nix82
-rw-r--r--pkgs/applications/science/electronics/digital/default.nix8
-rw-r--r--pkgs/applications/science/electronics/diylc/default.nix2
-rw-r--r--pkgs/applications/science/electronics/dsview/default.nix4
-rw-r--r--pkgs/applications/science/electronics/dwfv/default.nix21
-rw-r--r--pkgs/applications/science/electronics/flopoco/default.nix6
-rw-r--r--pkgs/applications/science/electronics/fped/default.nix3
-rw-r--r--pkgs/applications/science/electronics/fritzing/default.nix4
-rw-r--r--pkgs/applications/science/electronics/gtkwave/default.nix2
-rw-r--r--pkgs/applications/science/electronics/hal-hardware-analyzer/default.nix4
-rw-r--r--pkgs/applications/science/electronics/horizon-eda/base.nix10
-rw-r--r--pkgs/applications/science/electronics/kicad/base.nix6
-rw-r--r--pkgs/applications/science/electronics/kicad/default.nix10
-rw-r--r--pkgs/applications/science/electronics/kicad/libraries.nix1
-rw-r--r--pkgs/applications/science/electronics/kicad/versions.nix22
-rw-r--r--pkgs/applications/science/electronics/kingstvis/default.nix1
-rw-r--r--pkgs/applications/science/electronics/librepcb/default.nix2
-rw-r--r--pkgs/applications/science/electronics/magic-vlsi/default.nix55
-rw-r--r--pkgs/applications/science/electronics/nanovna-saver/default.nix9
-rw-r--r--pkgs/applications/science/electronics/nvc/default.nix4
-rw-r--r--pkgs/applications/science/electronics/openboardview/default.nix8
-rw-r--r--pkgs/applications/science/electronics/openroad/default.nix5
-rw-r--r--pkgs/applications/science/electronics/picoscope/default.nix22
-rw-r--r--pkgs/applications/science/electronics/pulseview/default.nix4
-rw-r--r--pkgs/applications/science/electronics/sv-lang/default.nix2
-rw-r--r--pkgs/applications/science/electronics/systemc/default.nix2
-rw-r--r--pkgs/applications/science/electronics/tkgate/1.x.nix4
-rw-r--r--pkgs/applications/science/electronics/verilator/default.nix84
-rw-r--r--pkgs/applications/science/electronics/verilog/default.nix80
-rw-r--r--pkgs/applications/science/electronics/vhd2vl/default.nix4
-rw-r--r--pkgs/applications/science/electronics/xoscope/default.nix2
-rw-r--r--pkgs/applications/science/electronics/xschem/default.nix2
-rw-r--r--pkgs/applications/science/electronics/xyce/default.nix4
-rw-r--r--pkgs/applications/science/geometry/antiprism/default.nix29
-rw-r--r--pkgs/applications/science/geometry/tetgen/default.nix2
-rw-r--r--pkgs/applications/science/logic/alt-ergo/default.nix30
-rw-r--r--pkgs/applications/science/logic/beluga/default.nix4
-rw-r--r--pkgs/applications/science/logic/bitwuzla/default.nix2
-rw-r--r--pkgs/applications/science/logic/boolector/default.nix6
-rw-r--r--pkgs/applications/science/logic/btor2tools/default.nix16
-rw-r--r--pkgs/applications/science/logic/cadical/default.nix4
-rw-r--r--pkgs/applications/science/logic/cbmc/default.nix6
-rw-r--r--pkgs/applications/science/logic/coq/default.nix64
-rw-r--r--pkgs/applications/science/logic/cryptoverif/default.nix20
-rw-r--r--pkgs/applications/science/logic/cvc4/default.nix4
-rw-r--r--pkgs/applications/science/logic/cvc5/default.nix6
-rw-r--r--pkgs/applications/science/logic/dafny/default.nix41
-rw-r--r--pkgs/applications/science/logic/dafny/deps.nix346
-rw-r--r--pkgs/applications/science/logic/elan/default.nix13
-rw-r--r--pkgs/applications/science/logic/formula/default.nix4
-rw-r--r--pkgs/applications/science/logic/hol/default.nix6
-rw-r--r--pkgs/applications/science/logic/hol_light/0004-Fix-compilation-with-camlp5-7.11.patch66
-rw-r--r--pkgs/applications/science/logic/hol_light/default.nix15
-rw-r--r--pkgs/applications/science/logic/isabelle/components/default.nix5
-rw-r--r--pkgs/applications/science/logic/isabelle/components/isabelle-linter.nix35
-rw-r--r--pkgs/applications/science/logic/isabelle/default.nix251
-rw-r--r--pkgs/applications/science/logic/key/default.nix50
-rw-r--r--pkgs/applications/science/logic/key/deps.json387
-rw-r--r--pkgs/applications/science/logic/klee/default.nix58
-rw-r--r--pkgs/applications/science/logic/klee/klee-uclibc.nix32
-rw-r--r--pkgs/applications/science/logic/lean/default.nix2
-rw-r--r--pkgs/applications/science/logic/lean2/default.nix2
-rw-r--r--pkgs/applications/science/logic/lean4/default.nix7
-rw-r--r--pkgs/applications/science/logic/logisim-evolution/default.nix2
-rw-r--r--pkgs/applications/science/logic/logisim/default.nix2
-rw-r--r--pkgs/applications/science/logic/mcrl2/default.nix2
-rw-r--r--pkgs/applications/science/logic/mcy/default.nix2
-rw-r--r--pkgs/applications/science/logic/monosat/default.nix6
-rw-r--r--pkgs/applications/science/logic/msat/default.nix2
-rw-r--r--pkgs/applications/science/logic/naproche/default.nix35
-rw-r--r--pkgs/applications/science/logic/nuXmv/default.nix8
-rw-r--r--pkgs/applications/science/logic/nusmv/default.nix2
-rw-r--r--pkgs/applications/science/logic/open-wbo/default.nix2
-rw-r--r--pkgs/applications/science/logic/opensmt/default.nix2
-rw-r--r--pkgs/applications/science/logic/picosat/default.nix2
-rw-r--r--pkgs/applications/science/logic/prover9/default.nix2
-rw-r--r--pkgs/applications/science/logic/redprl/default.nix2
-rw-r--r--pkgs/applications/science/logic/satallax/default.nix4
-rw-r--r--pkgs/applications/science/logic/stp/default.nix38
-rw-r--r--pkgs/applications/science/logic/surelog/default.nix6
-rw-r--r--pkgs/applications/science/logic/symbiyosys/default.nix62
-rw-r--r--pkgs/applications/science/logic/tamarin-prover/default.nix2
-rw-r--r--pkgs/applications/science/logic/tlaplus/default.nix4
-rw-r--r--pkgs/applications/science/logic/uhdm/default.nix6
-rw-r--r--pkgs/applications/science/logic/verifast/default.nix4
-rw-r--r--pkgs/applications/science/logic/workcraft/default.nix4
-rw-r--r--pkgs/applications/science/logic/yices/default.nix9
-rw-r--r--pkgs/applications/science/logic/yices/linux-no-ldconfig.patch13
-rw-r--r--pkgs/applications/science/logic/z3/default.nix28
-rw-r--r--pkgs/applications/science/machine-learning/finalfrontier/default.nix6
-rw-r--r--pkgs/applications/science/machine-learning/finalfusion-utils/default.nix6
-rw-r--r--pkgs/applications/science/machine-learning/sc2-headless/default.nix2
-rw-r--r--pkgs/applications/science/machine-learning/shogun/default.nix2
-rw-r--r--pkgs/applications/science/machine-learning/starspace/default.nix40
-rw-r--r--pkgs/applications/science/machine-learning/uarmsolver/default.nix4
-rw-r--r--pkgs/applications/science/math/4ti2/default.nix38
-rw-r--r--pkgs/applications/science/math/R/default.nix6
-rw-r--r--pkgs/applications/science/math/bcal/default.nix2
-rw-r--r--pkgs/applications/science/math/caffe/default.nix6
-rw-r--r--pkgs/applications/science/math/cbc/default.nix2
-rw-r--r--pkgs/applications/science/math/cemu-ti/default.nix28
-rw-r--r--pkgs/applications/science/math/colpack/default.nix2
-rw-r--r--pkgs/applications/science/math/cplex/default.nix7
-rw-r--r--pkgs/applications/science/math/dap/default.nix37
-rw-r--r--pkgs/applications/science/math/ecm/default.nix2
-rw-r--r--pkgs/applications/science/math/eigenmath/default.nix6
-rw-r--r--pkgs/applications/science/math/fricas/default.nix4
-rw-r--r--pkgs/applications/science/math/gap/default.nix8
-rw-r--r--pkgs/applications/science/math/geogebra/default.nix2
-rw-r--r--pkgs/applications/science/math/geogebra/geogebra6.nix27
-rw-r--r--pkgs/applications/science/math/getdp/default.nix7
-rw-r--r--pkgs/applications/science/math/gfan/default.nix8
-rw-r--r--pkgs/applications/science/math/giac/default.nix39
-rw-r--r--pkgs/applications/science/math/giac/fix-fltk-guard.patch28
-rw-r--r--pkgs/applications/science/math/giac/increase-pari-stack-size.patch18
-rw-r--r--pkgs/applications/science/math/giac/remove-old-functional-patterns.patch294
-rw-r--r--pkgs/applications/science/math/ginac/default.nix2
-rw-r--r--pkgs/applications/science/math/glsurf/default.nix4
-rw-r--r--pkgs/applications/science/math/gmsh/default.nix2
-rw-r--r--pkgs/applications/science/math/gurobi/default.nix4
-rw-r--r--pkgs/applications/science/math/lp_solve/default.nix8
-rw-r--r--pkgs/applications/science/math/mathematica/10.nix132
-rw-r--r--pkgs/applications/science/math/mathematica/11.nix146
-rw-r--r--pkgs/applications/science/math/mathematica/9.nix118
-rw-r--r--pkgs/applications/science/math/mathematica/default.nix14
-rw-r--r--pkgs/applications/science/math/mathematica/generic.nix28
-rw-r--r--pkgs/applications/science/math/mathematica/versions.nix42
-rw-r--r--pkgs/applications/science/math/maxima/5.47.0-CVE-2024-34490.patch86
-rw-r--r--pkgs/applications/science/math/maxima/default.nix8
-rw-r--r--pkgs/applications/science/math/msieve/default.nix6
-rw-r--r--pkgs/applications/science/math/mxnet/default.nix2
-rw-r--r--pkgs/applications/science/math/nota/default.nix2
-rw-r--r--pkgs/applications/science/math/numworks-epsilon/default.nix4
-rw-r--r--pkgs/applications/science/math/palp/default.nix2
-rw-r--r--pkgs/applications/science/math/qalculate-gtk/default.nix6
-rw-r--r--pkgs/applications/science/math/qalculate-qt/default.nix8
-rw-r--r--pkgs/applications/science/math/ratpoints/default.nix2
-rw-r--r--pkgs/applications/science/math/ripser/default.nix19
-rw-r--r--pkgs/applications/science/math/sage/README.md2
-rw-r--r--pkgs/applications/science/math/sage/default.nix3
-rw-r--r--pkgs/applications/science/math/sage/dist-tests.nix8
-rw-r--r--pkgs/applications/science/math/sage/patches/disable-singular-doctest.patch36
-rw-r--r--pkgs/applications/science/math/sage/patches/gap-element-crash.patch18
-rw-r--r--pkgs/applications/science/math/sage/patches/silence-linker.patch27
-rw-r--r--pkgs/applications/science/math/sage/patches/sphinx-docbuild-subprocesses.patch10
-rw-r--r--pkgs/applications/science/math/sage/python-modules/sage-docbuild.nix2
-rw-r--r--pkgs/applications/science/math/sage/sage-env.nix6
-rw-r--r--pkgs/applications/science/math/sage/sage-src.nix49
-rw-r--r--pkgs/applications/science/math/sage/sage-tests.nix2
-rw-r--r--pkgs/applications/science/math/sage/sage.nix2
-rw-r--r--pkgs/applications/science/math/sage/sagelib.nix9
-rw-r--r--pkgs/applications/science/math/scalp/default.nix4
-rw-r--r--pkgs/applications/science/math/scilab-bin/default.nix2
-rw-r--r--pkgs/applications/science/math/singular/default.nix24
-rw-r--r--pkgs/applications/science/math/speedcrunch/default.nix2
-rw-r--r--pkgs/applications/science/math/symmetrica/default.nix4
-rw-r--r--pkgs/applications/science/math/wolfram-engine/default.nix10
-rw-r--r--pkgs/applications/science/math/wolfram-engine/l10ns.nix17
-rw-r--r--pkgs/applications/science/math/wolfram-engine/notebook.nix2
-rw-r--r--pkgs/applications/science/math/wxmaxima/default.nix4
-rw-r--r--pkgs/applications/science/math/yacas/default.nix2
-rw-r--r--pkgs/applications/science/medicine/dcmtk/default.nix3
-rw-r--r--pkgs/applications/science/medicine/xmedcon/default.nix2
-rw-r--r--pkgs/applications/science/misc/bada-bib/default.nix1
-rw-r--r--pkgs/applications/science/misc/boinc/default.nix8
-rw-r--r--pkgs/applications/science/misc/colmap/default.nix35
-rw-r--r--pkgs/applications/science/misc/cwltool/default.nix7
-rw-r--r--pkgs/applications/science/misc/fityk/default.nix4
-rw-r--r--pkgs/applications/science/misc/foldingathome/client.nix6
-rw-r--r--pkgs/applications/science/misc/foldingathome/control.nix57
-rw-r--r--pkgs/applications/science/misc/foldingathome/viewer.nix56
-rw-r--r--pkgs/applications/science/misc/gephi/default.nix8
-rw-r--r--pkgs/applications/science/misc/golly/default.nix4
-rw-r--r--pkgs/applications/science/misc/gplates/default.nix11
-rw-r--r--pkgs/applications/science/misc/graphia/default.nix2
-rw-r--r--pkgs/applications/science/misc/openmvg/default.nix2
-rw-r--r--pkgs/applications/science/misc/openmvs/default.nix4
-rw-r--r--pkgs/applications/science/misc/openrefine/default.nix17
-rw-r--r--pkgs/applications/science/misc/reason-shell/default.nix2
-rw-r--r--pkgs/applications/science/misc/rink/default.nix14
-rw-r--r--pkgs/applications/science/misc/root/5.nix8
-rw-r--r--pkgs/applications/science/misc/root/default.nix37
-rw-r--r--pkgs/applications/science/misc/root/tests/test-thisroot.nix1
-rw-r--r--pkgs/applications/science/misc/sasview/xhtml2pdf.nix33
-rw-r--r--pkgs/applications/science/misc/simgrid/default.nix71
-rw-r--r--pkgs/applications/science/misc/snakemake/default.nix69
-rw-r--r--pkgs/applications/science/misc/toil/default.nix90
-rw-r--r--pkgs/applications/science/misc/tulip/default.nix8
-rw-r--r--pkgs/applications/science/misc/vite/default.nix2
-rw-r--r--pkgs/applications/science/molecular-dynamics/gromacs/default.nix18
-rw-r--r--pkgs/applications/science/molecular-dynamics/lammps/default.nix121
-rw-r--r--pkgs/applications/science/networking/sumo/default.nix6
-rw-r--r--pkgs/applications/science/physics/crystfel/default.nix8
-rw-r--r--pkgs/applications/science/physics/elmerfem/default.nix1
-rw-r--r--pkgs/applications/science/physics/fasthenry/default.nix2
-rw-r--r--pkgs/applications/science/physics/nnpdf/default.nix2
-rw-r--r--pkgs/applications/science/physics/professor/default.nix2
-rw-r--r--pkgs/applications/science/physics/sacrifice/default.nix6
-rw-r--r--pkgs/applications/science/physics/sherpa/default.nix2
-rw-r--r--pkgs/applications/science/physics/xfitter/default.nix2
-rw-r--r--pkgs/applications/science/physics/xnec2c/default.nix2
-rw-r--r--pkgs/applications/science/programming/groove/default.nix2
-rw-r--r--pkgs/applications/science/robotics/emuflight-configurator/default.nix4
-rw-r--r--pkgs/applications/science/robotics/mavproxy/default.nix2
-rw-r--r--pkgs/applications/science/robotics/mujoco/default.nix192
-rw-r--r--pkgs/applications/science/robotics/mujoco/mujoco-system-deps-dont-fetch.patch519
-rw-r--r--pkgs/applications/science/robotics/mujoco/sdflib-system-deps.patch192
-rw-r--r--pkgs/applications/science/robotics/qgroundcontrol/default.nix82
-rw-r--r--pkgs/applications/science/robotics/sumorobot-manager/default.nix2
-rw-r--r--pkgs/applications/science/robotics/yarp/default.nix4
287 files changed, 2345 insertions, 4263 deletions
diff --git a/pkgs/applications/science/astronomy/calcmysky/default.nix b/pkgs/applications/science/astronomy/calcmysky/default.nix
index 9b7f50415ecde..2fe51ba98d925 100644
--- a/pkgs/applications/science/astronomy/calcmysky/default.nix
+++ b/pkgs/applications/science/astronomy/calcmysky/default.nix
@@ -11,13 +11,13 @@
 
 stdenv.mkDerivation rec {
   pname = "calcmysky";
-  version = "0.3.2";
+  version = "0.3.3";
 
   src = fetchFromGitHub {
     owner = "10110111";
     repo = "CalcMySky";
     rev = "refs/tags/v${version}";
-    hash = "sha256-AP6YkORbvH8PzF869s2OWbTwTfwMC+RLJx3V3BqVy88=";
+    hash = "sha256-18ZNnLK2zMT7P0MDXS6Z38LffE8EqXKBH89TPPxVWlo=";
   };
 
   nativeBuildInputs = [ cmake wrapQtAppsHook ];
diff --git a/pkgs/applications/science/astronomy/celestia/default.nix b/pkgs/applications/science/astronomy/celestia/default.nix
index 8b40196fdbff5..2d227389d4298 100644
--- a/pkgs/applications/science/astronomy/celestia/default.nix
+++ b/pkgs/applications/science/astronomy/celestia/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchFromGitHub, pkg-config, freeglut, gtk2, gtkglext
+{ lib, stdenv, fetchFromGitHub, pkg-config, libglut, gtk2, gtkglext
 , libjpeg_turbo, libtheora, libXmu, lua, libGLU, libGL, perl, autoreconfHook
 }:
 
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ pkg-config autoreconfHook ];
   buildInputs = [
-    freeglut gtk2 gtkglext lua perl
+    libglut gtk2 gtkglext lua perl
     libjpeg_turbo libtheora libXmu libGLU libGL
   ];
 
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
   enableParallelBuilding = true;
 
   meta = with lib; {
-    homepage = "https://celestia.space/";
+    homepage = "https://celestiaproject.space/";
     description = "Real-time 3D simulation of space";
     mainProgram = "celestia";
     changelog = "https://github.com/CelestiaProject/Celestia/releases/tag/${version}";
diff --git a/pkgs/applications/science/astronomy/gildas/default.nix b/pkgs/applications/science/astronomy/gildas/default.nix
index 5767efab733cb..eafc631ef92c1 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 = "apr24a";
-  version = "20240401_a";
+  srcVersion = "sep24a";
+  version = "20240901_a";
   pname = "gildas";
 
   src = fetchurl {
@@ -16,23 +16,23 @@ 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-Eq6S5S8xrhkCo6O2wUaHnoMDVG9WeiSurGvOc+2JKbM=";
+    sha256 = "sha256-dZ03J3I1dgoSgSc9yGfO13ZvNawCSYKN3+SGvp1eyGA=";
   };
 
   nativeBuildInputs = [ pkg-config groff perl getopt gfortran which ];
 
   buildInputs = [ gtk2-x11 lesstif cfitsio python3Env ncurses ]
-    ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ CoreFoundation ]);
+    ++ lib.optionals stdenv.hostPlatform.isDarwin (with darwin.apple_sdk.frameworks; [ CoreFoundation ]);
 
   patches = [ ./wrapper.patch ]
-    ++ lib.optionals stdenv.isDarwin ([ ./clang.patch ./cpp-darwin.patch ]);
+    ++ lib.optionals stdenv.hostPlatform.isDarwin ([ ./clang.patch ./cpp-darwin.patch ]);
 
   env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-unused-command-line-argument";
 
   # Workaround for https://github.com/NixOS/nixpkgs/issues/304528
-  env.GAG_CPP = lib.optionalString stdenv.isDarwin "${gfortran.outPath}/bin/cpp";
+  env.GAG_CPP = lib.optionalString stdenv.hostPlatform.isDarwin "${gfortran.outPath}/bin/cpp";
 
-  NIX_LDFLAGS = lib.optionalString stdenv.isDarwin (with darwin.apple_sdk.frameworks; "-F${CoreFoundation}/Library/Frameworks");
+  NIX_LDFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin (with darwin.apple_sdk.frameworks; "-F${CoreFoundation}/Library/Frameworks");
 
   configurePhase=''
     substituteInPlace admin/wrapper.sh --replace '%%OUT%%' $out
diff --git a/pkgs/applications/science/astronomy/gnuastro/default.nix b/pkgs/applications/science/astronomy/gnuastro/default.nix
deleted file mode 100644
index d1c40d3fefb3e..0000000000000
--- a/pkgs/applications/science/astronomy/gnuastro/default.nix
+++ /dev/null
@@ -1,37 +0,0 @@
-{ lib, stdenv, fetchurl, libtool
-, cfitsio, curl, ghostscript, gsl, libgit2, libjpeg, libtiff, lzlib, wcslib }:
-
-stdenv.mkDerivation rec {
-  pname = "gnuastro";
-  version = "0.22";
-
-  src = fetchurl {
-    url = "mirror://gnu/gnuastro/gnuastro-${version}.tar.gz";
-    sha256 = "sha256-f9fxaga95VrtliggkM2SITW+6pAjaeWvgUOJ6rnMcwg=";
-  };
-
-  nativeBuildInputs = [ libtool ];
-
-  buildInputs = [
-    cfitsio
-    curl
-    ghostscript
-    gsl
-    libgit2
-    libjpeg
-    libtiff
-    lzlib
-    wcslib
-  ];
-
-  enableParallelBuilding = true;
-
-  meta = with lib; {
-    description = "GNU astronomy utilities and library";
-    homepage = "https://www.gnu.org/software/gnuastro/";
-    changelog = "https://git.savannah.gnu.org/cgit/gnuastro.git/plain/NEWS?id=gnuastro_v${version}";
-    license = licenses.gpl3Plus;
-    platforms = platforms.unix;
-    maintainers = with maintainers; [ sikmir ];
-  };
-}
diff --git a/pkgs/applications/science/astronomy/gravit/default.nix b/pkgs/applications/science/astronomy/gravit/default.nix
index 36f58d8d18a1b..b734ea9750dcc 100644
--- a/pkgs/applications/science/astronomy/gravit/default.nix
+++ b/pkgs/applications/science/astronomy/gravit/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchFromGitHub, fetchpatch, SDL, SDL_ttf, SDL_image, libSM, libICE, libGLU, libGL, libpng, lua5, autoconf, automake }:
+{ lib, stdenv, fetchFromGitHub, fetchpatch, SDL, SDL_ttf, SDL_image, libSM, libICE, libGLU, libGL, libpng, lua5, autoconf, automake, mesa }:
 
 stdenv.mkDerivation rec {
   pname = "gravit";
@@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
   enableParallelBuilding = true;
 
   meta = {
-    broken = (stdenv.isLinux && stdenv.isAarch64);
+    broken = (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64);
     homepage = "https://github.com/gak/gravit";
     description = "Beautiful OpenGL-based gravity simulator";
     mainProgram = "gravit";
@@ -51,7 +51,7 @@ stdenv.mkDerivation rec {
       view in 3D and zoom in and out.
     '';
 
-    platforms = lib.platforms.mesaPlatforms;
+    inherit (mesa.meta) platforms;
     hydraPlatforms = lib.platforms.linux; # darwin times out
   };
 }
diff --git a/pkgs/applications/science/astronomy/kstars/default.nix b/pkgs/applications/science/astronomy/kstars/default.nix
index 863c5b70e0211..5f9fe55b9b5f3 100644
--- a/pkgs/applications/science/astronomy/kstars/default.nix
+++ b/pkgs/applications/science/astronomy/kstars/default.nix
@@ -37,11 +37,11 @@
 
 stdenv.mkDerivation (finalAttrs: {
   pname = "kstars";
-  version = "3.7.0";
+  version = "3.7.2";
 
   src = fetchurl {
-    url = "mirror://kde/stable/kstars/kstars-${finalAttrs.version}.tar.xz";
-    hash = "sha256-yvN1k0LqUi5Odb34Nk8UP5qoIbFUcvUiyESpoMKmuqg=";
+    url = "mirror://kde/stable/kstars/${finalAttrs.version}/kstars-${finalAttrs.version}.tar.xz";
+    hash = "sha256-fEu3BGBW5cgrY38zBB3iL0/SRrobEtJVsGNWRNtT40s=";
   };
 
   nativeBuildInputs = [
diff --git a/pkgs/applications/science/astronomy/siril/default.nix b/pkgs/applications/science/astronomy/siril/default.nix
index 569d537172542..2f572350bae02 100644
--- a/pkgs/applications/science/astronomy/siril/default.nix
+++ b/pkgs/applications/science/astronomy/siril/default.nix
@@ -7,13 +7,13 @@
 
 stdenv.mkDerivation rec {
   pname = "siril";
-  version = "1.2.1";
+  version = "1.2.3";
 
   src = fetchFromGitLab {
     owner = "free-astro";
     repo = "siril";
     rev = version;
-    hash = "sha256-njvByA8nbG3qHKfv8eX20TrIhngVI0nzIHmhYIN6htE=";
+    hash = "sha256-JUMk2XHMOeocSpeeI+k3s9TsEQCdqz3oigTzuwRHbT4=";
   };
 
   nativeBuildInputs = [
diff --git a/pkgs/applications/science/astronomy/stellarium/default.nix b/pkgs/applications/science/astronomy/stellarium/default.nix
index 687c0b3a2dda2..7ddaf5357e7c3 100644
--- a/pkgs/applications/science/astronomy/stellarium/default.nix
+++ b/pkgs/applications/science/astronomy/stellarium/default.nix
@@ -20,17 +20,19 @@
 , qttools
 , exiv2
 , nlopt
+, testers
+, xvfb-run
 }:
 
 stdenv.mkDerivation (finalAttrs: {
   pname = "stellarium";
-  version = "24.1";
+  version = "24.2";
 
   src = fetchFromGitHub {
     owner = "Stellarium";
     repo = "stellarium";
     rev = "v${finalAttrs.version}";
-    hash = "sha256-t3eFmiG9X2cmnjc/PQwZ2bw1SCHaNRA83wiT1cPbKJc=";
+    hash = "sha256-tqyLwlf8hugixZSsFCZPTtchO3VXk3m/nX1kuDoLOAY=";
   };
 
   patches = [
@@ -41,7 +43,7 @@ stdenv.mkDerivation (finalAttrs: {
     })
   ];
 
-  postPatch = lib.optionalString stdenv.isDarwin ''
+  postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
     substituteInPlace CMakeLists.txt \
       --replace 'SET(CMAKE_INSTALL_PREFIX "''${PROJECT_BINARY_DIR}/Stellarium.app/Contents")' \
                 'SET(CMAKE_INSTALL_PREFIX "${placeholder "out"}/Applications/Stellarium.app/Contents")'
@@ -70,22 +72,22 @@ stdenv.mkDerivation (finalAttrs: {
     libnova
     exiv2
     nlopt
-  ] ++ lib.optionals stdenv.isLinux [
+  ] ++ lib.optionals stdenv.hostPlatform.isLinux [
     qtwayland
   ];
 
   preConfigure = ''
     export SOURCE_DATE_EPOCH=$(date -d 20${lib.versions.major finalAttrs.version}0101 +%s)
-  '' + lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.hostPlatform.isDarwin ''
     export LC_ALL=en_US.UTF-8
   '';
 
   # fatal error: 'QtSerialPort/QSerialPortInfo' file not found
-  env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-F${qtserialport}/lib";
+  env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-F${qtserialport}/lib";
 
   dontWrapGApps = true;
 
-  postInstall = lib.optionalString stdenv.isDarwin ''
+  postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
     makeWrapper $out/Applications/Stellarium.app/Contents/MacOS/Stellarium $out/bin/stellarium
   '';
 
@@ -93,6 +95,18 @@ stdenv.mkDerivation (finalAttrs: {
     qtWrapperArgs+=("''${gappsWrapperArgs[@]}")
   '';
 
+  passthru.tests.version = testers.testVersion {
+    package = finalAttrs.finalPackage;
+    command = ''
+      # Create a temporary home directory because stellarium aborts with an
+      # error if it can't write some configuration files.
+      tmpdir=$(mktemp -d)
+
+      # stellarium can't be run in headless mode, therefore we need xvfb-run.
+      HOME="$tmpdir" ${xvfb-run}/bin/xvfb-run stellarium --version
+    '';
+  };
+
   meta =  {
     description = "Free open-source planetarium";
     mainProgram = "stellarium";
diff --git a/pkgs/applications/science/biology/EZminc/default.nix b/pkgs/applications/science/biology/EZminc/default.nix
index a4bb8c62f1c42..e2e33b5c5d589 100644
--- a/pkgs/applications/science/biology/EZminc/default.nix
+++ b/pkgs/applications/science/biology/EZminc/default.nix
@@ -1,30 +1,60 @@
-{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, libminc, bicpl, itk, fftwFloat, gsl }:
+{
+  lib,
+  stdenv,
+  fetchFromGitHub,
+  cmake,
+  pkg-config,
+  perl,
+  libminc,
+  bicpl,
+  itk_5_2,
+  fftwFloat,
+  gsl,
+}:
 
-stdenv.mkDerivation rec {
+stdenv.mkDerivation (finalAttrs: {
   pname = "EZminc";
-  version = "unstable-2019-03-12";
+  version = "2.2.00-unstable-2023-10-06";
 
   src = fetchFromGitHub {
-    owner  = "BIC-MNI";
-    repo   = pname;
-    rev    = "5e3333ee356f914d34d66d33ea8df809c7f7fa51";
-    sha256 = "0wy8cppf5xpgfqvgb3mqs1cjh81n6qzkk6zxv29wvng8nar9wsy4";
+    owner = "BIC-MNI";
+    repo = "EZminc";
+    rev = "5fdf112e837000d155891e423041d7065ea13c3f";
+    hash = "sha256-0KdFIWRHnIHrau0ysGMVpg3oz01UdIvna1y2I4YEWJw=";
   };
 
-  nativeBuildInputs = [ cmake pkg-config ];
-  buildInputs = [ itk libminc bicpl fftwFloat gsl ];
+  postPatch = ''
+    patchShebangs scripts/*
+  '';
 
-  cmakeFlags = [ "-DLIBMINC_DIR=${libminc}/lib/cmake"
-                 "-DEZMINC_BUILD_TOOLS=TRUE"
-                 "-DEZMINC_BUILD_MRFSEG=TRUE"
-                 "-DEZMINC_BUILD_DD=TRUE" ];
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+  ];
 
-  meta = with lib; {
-    homepage = "https://github.com/BIC-MNI/${pname}";
+  buildInputs = [
+    itk_5_2
+    libminc
+    bicpl
+    fftwFloat
+    gsl
+    perl
+  ];
+
+  cmakeFlags = [
+    "-DLIBMINC_DIR=${libminc}/lib/cmake"
+    "-DEZMINC_BUILD_TOOLS=TRUE"
+    "-DEZMINC_BUILD_MRFSEG=TRUE"
+    # "-DEZMINC_BUILD_DD=TRUE" # numerous compilation issues
+  ];
+
+  doCheck = false; # test programs/data exist but no actual test harness
+
+  meta = {
+    homepage = "https://github.com/BIC-MNI/EZminc";
     description = "Collection of Perl and shell scripts for processing MINC files";
-    maintainers = with maintainers; [ bcdarwin ];
-    platforms = platforms.unix;
-    license = licenses.free;
-    broken = true;  # ITK5 compatibility issue (https://github.com/BIC-MNI/EZminc/issues/15)
+    maintainers = with lib.maintainers; [ bcdarwin ];
+    platforms = lib.platforms.linux; # can't detect opengl on Darwin
+    license = lib.licenses.free;
   };
-}
+})
diff --git a/pkgs/applications/science/biology/ants/default.nix b/pkgs/applications/science/biology/ants/default.nix
index c4b932f6dbae8..b42eb791d27f5 100644
--- a/pkgs/applications/science/biology/ants/default.nix
+++ b/pkgs/applications/science/biology/ants/default.nix
@@ -10,13 +10,13 @@
 
 stdenv.mkDerivation (finalAttrs: {
   pname = "ANTs";
-  version = "2.5.2";
+  version = "2.5.3";
 
   src = fetchFromGitHub {
     owner = "ANTsX";
     repo = "ANTs";
     rev = "refs/tags/v${finalAttrs.version}";
-    hash = "sha256-crvLxUP/uM0u1oakxcpsiULAKUo+86hGATs/kHNseaw=";
+    hash = "sha256-DZzuHMC0XymFCnDn+H1pRFx9jUt+s03PaN88R4ZBRwY=";
   };
 
   nativeBuildInputs = [
@@ -27,7 +27,7 @@ stdenv.mkDerivation (finalAttrs: {
   buildInputs = [
     itk
     vtk
-  ] ++ lib.optionals stdenv.isDarwin [
+  ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
     Cocoa
   ];
 
diff --git a/pkgs/applications/science/biology/bamtools/default.nix b/pkgs/applications/science/biology/bamtools/default.nix
index 602254e2966ad..820459e00003b 100644
--- a/pkgs/applications/science/biology/bamtools/default.nix
+++ b/pkgs/applications/science/biology/bamtools/default.nix
@@ -34,7 +34,7 @@ stdenv.mkDerivation (finalAttrs: {
     description = "C++ API & command-line toolkit for working with BAM data";
     mainProgram = "bamtools";
     homepage = "https://github.com/pezmaster31/bamtools";
-    changelog = "https://github.com/pezmaster31/bamtools/releases/tag/${finalAttrs.src.rev}";
+    changelog = "https://github.com/pezmaster31/bamtools/releases/tag/${lib.removePrefix "refs/tags/" finalAttrs.src.rev}";
     license = licenses.mit;
     maintainers = with maintainers; [ natsukium ];
     platforms = platforms.unix;
diff --git a/pkgs/applications/science/biology/bcftools/default.nix b/pkgs/applications/science/biology/bcftools/default.nix
index cafc952dec4c7..1e44835302385 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.20";
+  version = "1.21";
 
   src = fetchurl {
     url = "https://github.com/samtools/bcftools/releases/download/${version}/${pname}-${version}.tar.bz2";
-    sha256 = "sha256-MSuDKd5RMN06N2eMcSlR5h5XcVV8cSmnCjJ6MA/ahiA=";
+    sha256 = "sha256-UopMwdNVU2jbdacAsio8ldqJP9GCf20wRxbf1F6k4oI=";
   };
 
   nativeBuildInputs = [
diff --git a/pkgs/applications/science/biology/blast/bin.nix b/pkgs/applications/science/biology/blast/bin.nix
index 48537a568e4ba..1e3975f9f5ffa 100644
--- a/pkgs/applications/science/biology/blast/bin.nix
+++ b/pkgs/applications/science/biology/blast/bin.nix
@@ -35,9 +35,9 @@ in
 stdenv.mkDerivation {
   inherit pname version src;
 
-  nativeBuildInputs = lib.optionals stdenv.isLinux [ autoPatchelfHook ];
+  nativeBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ];
 
-  buildInputs = [ python3 perl ] ++ lib.optionals stdenv.isLinux [ zlib bzip2 glib libxml2 ];
+  buildInputs = [ python3 perl ] ++ lib.optionals stdenv.hostPlatform.isLinux [ zlib bzip2 glib libxml2 ];
 
   installPhase = ''
     runHook preInstall
diff --git a/pkgs/applications/science/biology/blast/default.nix b/pkgs/applications/science/biology/blast/default.nix
index 407d38970b0f8..791d6049ad6da 100644
--- a/pkgs/applications/science/biology/blast/default.nix
+++ b/pkgs/applications/science/biology/blast/default.nix
@@ -81,7 +81,7 @@ stdenv.mkDerivation rec {
   # perl is necessary in buildInputs so that installed perl scripts get patched
   # correctly
   buildInputs = [ coreutils perl gawk zlib bzip2 cpio ]
-    ++ lib.optionals stdenv.isDarwin [ ApplicationServices ];
+    ++ lib.optionals stdenv.hostPlatform.isDarwin [ ApplicationServices ];
   hardeningDisable = [ "format" ];
 
   postInstall = ''
diff --git a/pkgs/applications/science/biology/bowtie2/default.nix b/pkgs/applications/science/biology/bowtie2/default.nix
index 576b46288c885..2a1358f2e5b77 100644
--- a/pkgs/applications/science/biology/bowtie2/default.nix
+++ b/pkgs/applications/science/biology/bowtie2/default.nix
@@ -54,7 +54,7 @@ stdenv.mkDerivation (finalAttrs: {
     description = "Ultrafast and memory-efficient tool for aligning sequencing reads to long reference sequences";
     license = licenses.gpl3Plus;
     homepage = "http://bowtie-bio.sf.net/bowtie2";
-    changelog = "https://github.com/BenLangmead/bowtie2/releases/tag/${finalAttrs.src.rev}";
+    changelog = "https://github.com/BenLangmead/bowtie2/releases/tag/${lib.removePrefix "refs/tags/" finalAttrs.src.rev}";
     maintainers = with maintainers; [ rybern ];
     platforms = platforms.all;
     mainProgram = "bowtie2";
diff --git a/pkgs/applications/science/biology/bwa-mem2/default.nix b/pkgs/applications/science/biology/bwa-mem2/default.nix
index c339baf446d2d..0a2d2c8d20529 100644
--- a/pkgs/applications/science/biology/bwa-mem2/default.nix
+++ b/pkgs/applications/science/biology/bwa-mem2/default.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation (finalAttrs: {
   buildInputs = [ zlib ];
 
   # see https://github.com/bwa-mem2/bwa-mem2/issues/93
-  postPatch = lib.optionalString stdenv.isDarwin ''
+  postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
     sed -i 's/memset_s/memset8_s/g' ext/safestringlib/include/safe_mem_lib.h
     sed -i 's/memset_s/memset8_s/g' ext/safestringlib/safeclib/memset16_s.c
     sed -i 's/memset_s/memset8_s/g' ext/safestringlib/safeclib/memset32_s.c
diff --git a/pkgs/applications/science/biology/cmtk/default.nix b/pkgs/applications/science/biology/cmtk/default.nix
index d7d23dd2d46ea..1263f8194c9f2 100644
--- a/pkgs/applications/science/biology/cmtk/default.nix
+++ b/pkgs/applications/science/biology/cmtk/default.nix
@@ -31,7 +31,7 @@ stdenv.mkDerivation (finalAttrs: {
   env.NIX_CFLAGS_COMPILE = toString [
     (lib.optionalString stdenv.cc.isGNU "-std=c++11")
     (lib.optionalString stdenv.cc.isClang "-Wno-error=c++11-narrowing")
-    (lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) "-Dfinite=isfinite")
+    (lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) "-Dfinite=isfinite")
   ];
 
   meta = with lib; {
diff --git a/pkgs/applications/science/biology/dcm2niix/default.nix b/pkgs/applications/science/biology/dcm2niix/default.nix
index a7f30dbc075df..acf43e52764da 100644
--- a/pkgs/applications/science/biology/dcm2niix/default.nix
+++ b/pkgs/applications/science/biology/dcm2niix/default.nix
@@ -21,15 +21,15 @@ let
     sha256 = "sha256-8HNFUGx2uuEb8UrGUiqkN+uVDX83YIisT2uO1Z7GCxc=";
   };
 in
-stdenv.mkDerivation rec {
-  version = "1.0.20230411";
+stdenv.mkDerivation (finalAttrs: {
+  version = "1.0.20240202";
   pname = "dcm2niix";
 
   src = fetchFromGitHub {
     owner = "rordenlab";
     repo = "dcm2niix";
-    rev = "v${version}";
-    sha256 = "sha256-kOVEoqrk4l6sH8iDVx1QmOYP5tCufxsWnCnn9BibZ08=";
+    rev = "v${finalAttrs.version}";
+    sha256 = "sha256-vJUPv/6KNCsU8UjwfktHdTlsweG7+UGgAEZeESfBkD8=";
   };
 
   patches = lib.optionals withCloudflareZlib [
@@ -55,15 +55,16 @@ stdenv.mkDerivation rec {
     "-DZLIB_IMPLEMENTATION=Cloudflare"
   ];
 
-  meta = with lib; {
+  meta = {
     description = "DICOM to NIfTI converter";
     mainProgram = "dcm2niix";
     longDescription = ''
       dcm2niix is designed to convert neuroimaging data from the DICOM format to the NIfTI format.
     '';
     homepage = "https://www.nitrc.org/projects/dcm2nii";
-    license = licenses.bsd3;
-    maintainers = with maintainers; [ ashgillman rbreslow ];
-    platforms = platforms.all;
+    changelog = "https://github.com/rordenlab/dcm2niix/releases/tag/v${finalAttrs.version}";
+    license = lib.licenses.bsd3;
+    maintainers = with lib.maintainers; [ ashgillman rbreslow ];
+    platforms = lib.platforms.all;
   };
-}
+})
diff --git a/pkgs/applications/science/biology/delly/default.nix b/pkgs/applications/science/biology/delly/default.nix
index 34ea942b4f5c7..f122b24d465f1 100644
--- a/pkgs/applications/science/biology/delly/default.nix
+++ b/pkgs/applications/science/biology/delly/default.nix
@@ -13,22 +13,27 @@
 
 stdenv.mkDerivation (finalAttrs: {
   pname = "delly";
-  version = "1.2.6";
+  version = "1.2.9";
 
   src = fetchFromGitHub {
     owner = "dellytools";
     repo = "delly";
     rev = "v${finalAttrs.version}";
-    hash = "sha256-OO5nnaIcfNAV8pc03Z8YS5kE96bFOrJXA9QTiLi7vPc=";
+    hash = "sha256-HeLqf/bUkZQJrW1LHl3XmecW3wS3QmjifoH34VNr3A4=";
   };
 
+  postPatch = lib.optionalString stdenv.cc.isClang ''
+    substituteInPlace Makefile \
+      --replace-fail "-std=c++17" "-std=c++14"
+  '';
+
   buildInputs = [
     boost
     bzip2
     htslib
     xz
     zlib
-  ] ++ lib.optional stdenv.isDarwin llvmPackages.openmp;
+  ] ++ lib.optional stdenv.hostPlatform.isDarwin llvmPackages.openmp;
 
   makeFlags = [
     "EBROOTHTSLIB=${htslib}"
diff --git a/pkgs/applications/science/biology/dssp/default.nix b/pkgs/applications/science/biology/dssp/default.nix
index 56eb023805a3e..680fc67ffcd14 100644
--- a/pkgs/applications/science/biology/dssp/default.nix
+++ b/pkgs/applications/science/biology/dssp/default.nix
@@ -34,7 +34,7 @@ stdenv.mkDerivation (finalAttrs: {
     description = "Calculate the most likely secondary structure assignment given the 3D structure of a protein";
     mainProgram = "mkdssp";
     homepage = "https://github.com/PDB-REDO/dssp";
-    changelog = "https://github.com/PDB-REDO/libcifpp/releases/tag/${finalAttrs.src.rev}";
+    changelog = "https://github.com/PDB-REDO/dssp/releases/tag/${lib.removePrefix "refs/tags/" finalAttrs.src.rev}";
     license = licenses.bsd2;
     maintainers = with maintainers; [ natsukium ];
     platforms = platforms.unix;
diff --git a/pkgs/applications/science/biology/febio-studio/default.nix b/pkgs/applications/science/biology/febio-studio/default.nix
deleted file mode 100644
index 708bd0f4305a4..0000000000000
--- a/pkgs/applications/science/biology/febio-studio/default.nix
+++ /dev/null
@@ -1,62 +0,0 @@
-{ lib, stdenv, fetchFromGitHub, cmake, zlib, libglvnd, libGLU, wrapQtAppsHook
-, sshSupport ? true, openssl, libssh
-, tetgenSupport ? true, tetgen
-, ffmpegSupport ? true, ffmpeg_4
-, dicomSupport  ? false, dcmtk
-, withModelRepo ? true
-, withCadFeatures ? false
-}:
-
-stdenv.mkDerivation rec {
-  pname = "febio-studio";
-  version = "1.6.1";
-
-  src = fetchFromGitHub {
-    owner = "febiosoftware";
-    repo = "FEBioStudio";
-    rev = "v${version}";
-    sha256 = "0r6pg49i0q9idp7pjymj7mlxd63qjvmfvg0l7fmx87y1yd2hfw4h";
-  };
-
-  patches = [
-    ./febio-studio-cmake.patch # Fix Errors that appear with certain Cmake flags
-  ];
-
-  cmakeFlags = [
-    "-DQt_Ver=5"
-    "-DNOT_FIRST=On"
-    "-DOpenGL_GL_PREFERENCE=GLVND"
-  ]
-    ++ lib.optional sshSupport "-DUSE_SSH=On"
-    ++ lib.optional tetgenSupport "-DUSE_TETGEN=On"
-    ++ lib.optional ffmpegSupport "-DUSE_FFMPEG=On"
-    ++ lib.optional dicomSupport "-DUSE_DICOM=On"
-    ++ lib.optional withModelRepo "-DMODEL_REPO=On"
-    ++ lib.optional withCadFeatures "-DCAD_FEATURES=On"
-  ;
-
-
-  installPhase = ''
-    runHook preInstall
-    mkdir -p $out/
-    cp -R bin $out/
-    runHook postInstall
-  '';
-
-  nativeBuildInputs = [ cmake wrapQtAppsHook ];
-  buildInputs = [ zlib libglvnd libGLU openssl libssh ]
-    ++ lib.optional sshSupport openssl
-    ++ lib.optional tetgenSupport tetgen
-    ++ lib.optional ffmpegSupport ffmpeg_4
-    ++ lib.optional dicomSupport dcmtk
-  ;
-
-  meta = with lib; {
-    description = "FEBio Suite Solver";
-    mainProgram = "FEBioStudio";
-    license = with licenses; [ mit ];
-    homepage = "https://febio.org/";
-    platforms = platforms.unix;
-    maintainers = with maintainers; [ Scriptkiddi ];
-  };
-}
diff --git a/pkgs/applications/science/biology/febio-studio/febio-studio-cmake.patch b/pkgs/applications/science/biology/febio-studio/febio-studio-cmake.patch
deleted file mode 100644
index e694f6c3b89f2..0000000000000
--- a/pkgs/applications/science/biology/febio-studio/febio-studio-cmake.patch
+++ /dev/null
@@ -1,38 +0,0 @@
-diff --git a/FEBioStudio/RepositoryPanel.cpp b/FEBioStudio/RepositoryPanel.cpp
-index 382db303..314cdc68 100644
---- a/FEBioStudio/RepositoryPanel.cpp
-+++ b/FEBioStudio/RepositoryPanel.cpp
-@@ -1364,10 +1364,10 @@ void CRepositoryPanel::loadingPageProgress(qint64 bytesSent, qint64 bytesTotal)
- 

- #else

- 

--CRepositoryPanel::CRepositoryPanel(CMainWindow* pwnd, QWidget* parent){}

-+CRepositoryPanel::CRepositoryPanel(CMainWindow* pwnd, QDockWidget* parent){}

- CRepositoryPanel::~CRepositoryPanel(){}

- void CRepositoryPanel::OpenLink(const QString& link) {}

--// void CRepositoryPanel::Raise() {}

-+void CRepositoryPanel::Raise() {}

- void CRepositoryPanel::SetModelList(){}

- void CRepositoryPanel::ShowMessage(QString message) {}

- void CRepositoryPanel::ShowWelcomeMessage(QByteArray messages) {}

-@@ -1396,6 +1396,7 @@ void CRepositoryPanel::on_actionSearch_triggered() {}
- void CRepositoryPanel::on_actionClearSearch_triggered() {}

- void CRepositoryPanel::on_actionDeleteRemote_triggered() {}

- void CRepositoryPanel::on_actionModify_triggered() {}

-+void CRepositoryPanel::on_actionCopyPermalink_triggered() {}

- void CRepositoryPanel::on_treeWidget_itemSelectionChanged() {}

- void CRepositoryPanel::on_treeWidget_customContextMenuRequested(const QPoint &pos) {}

- void CRepositoryPanel::DownloadItem(CustomTreeWidgetItem *item) {}

-diff --git a/FEBioStudio/WzdUpload.cpp b/FEBioStudio/WzdUpload.cpp
-index 5ce74346..20062e06 100644
---- a/FEBioStudio/WzdUpload.cpp
-+++ b/FEBioStudio/WzdUpload.cpp
-@@ -1183,7 +1183,7 @@ void CWzdUpload::on_saveJson_triggered()
- 		getProjectJson(&projectInfo);
- 
- 		QFile file(filedlg.selectedFiles()[0]);
--		file.open(QIODeviceBase::WriteOnly);
-+		file.open(QIODevice::WriteOnly);
- 		file.write(projectInfo);
- 		file.close();
- 	}
diff --git a/pkgs/applications/science/biology/gatk/default.nix b/pkgs/applications/science/biology/gatk/default.nix
index 41623bf640dda..50dc0613c743f 100644
--- a/pkgs/applications/science/biology/gatk/default.nix
+++ b/pkgs/applications/science/biology/gatk/default.nix
@@ -2,10 +2,10 @@
 
 stdenv.mkDerivation rec {
   pname = "gatk";
-  version = "4.5.0.0";
+  version = "4.6.0.0";
   src = fetchzip {
     url = "https://github.com/broadinstitute/gatk/releases/download/${version}/gatk-${version}.zip";
-    sha256 = "sha256-c3YZsSCjZY75jooiqtc8x/xsWTvYm9labUcOydDlSRQ=";
+    sha256 = "sha256-AwGRkgVbG2gA4K1JG0WPr4v18JHG5YzYUKdJ2EJZX+Y=";
   };
 
   nativeBuildInputs = [ makeWrapper ];
diff --git a/pkgs/applications/science/biology/genmap/default.nix b/pkgs/applications/science/biology/genmap/default.nix
index 235135cb60506..772975fc6450b 100644
--- a/pkgs/applications/science/biology/genmap/default.nix
+++ b/pkgs/applications/science/biology/genmap/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
     repo = "genmap";
     rev = "genmap-v${version}";
     fetchSubmodules = true;
-    sha256 = "sha256-7sIKBRMNzyCrZ/c2nXkknb6a5YsXe6DRE2IFhp6AviY=";
+    hash = "sha256-7sIKBRMNzyCrZ/c2nXkknb6a5YsXe6DRE2IFhp6AviY=";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/pkgs/applications/science/biology/igv/default.nix b/pkgs/applications/science/biology/igv/default.nix
index 0c74b65c98a26..e2502248a50ae 100644
--- a/pkgs/applications/science/biology/igv/default.nix
+++ b/pkgs/applications/science/biology/igv/default.nix
@@ -13,10 +13,10 @@ stdenv.mkDerivation rec {
     cp -Rv * $out/share/
 
     sed -i "s#prefix=.*#prefix=$out/share#g" $out/share/igv.sh
-    sed -i 's#java#${jdk17}/bin/java#g' $out/share/igv.sh
+    sed -i 's#\bjava\b#${jdk17}/bin/java#g' $out/share/igv.sh
 
     sed -i "s#prefix=.*#prefix=$out/share#g" $out/share/igvtools
-    sed -i 's#java#${jdk17}/bin/java#g' $out/share/igvtools
+    sed -i 's#\bjava\b#${jdk17}/bin/java#g' $out/share/igvtools
 
     ln -s $out/share/igv.sh $out/bin/igv
     ln -s $out/share/igvtools $out/bin/igvtools
diff --git a/pkgs/applications/science/biology/iqtree/default.nix b/pkgs/applications/science/biology/iqtree/default.nix
index 4dfbaa25b36a4..ce6218449a7e8 100644
--- a/pkgs/applications/science/biology/iqtree/default.nix
+++ b/pkgs/applications/science/biology/iqtree/default.nix
@@ -10,13 +10,13 @@
 
 stdenv.mkDerivation rec {
   pname = "iqtree";
-  version = "2.3.4";
+  version = "2.3.6";
 
   src = fetchFromGitHub {
     owner = "iqtree";
     repo = "iqtree2";
     rev = "v${version}";
-    hash = "sha256-dnUFllqcABB3JDYoCwPGtIYD/h5lzX2XKOroDpijPpU=";
+    hash = "sha256-8d5zqZIevv3bnq7z7Iyo/x8i445y1RAFtRMeK8s/ieQ=";
     fetchSubmodules = true;
   };
 
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
     boost
     eigen
     zlib
-  ] ++ lib.optionals stdenv.isDarwin [
+  ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
     llvmPackages.openmp
   ];
 
diff --git a/pkgs/applications/science/biology/iv/default.nix b/pkgs/applications/science/biology/iv/default.nix
index ba1b91298bb32..a4b408b14a012 100644
--- a/pkgs/applications/science/biology/iv/default.nix
+++ b/pkgs/applications/science/biology/iv/default.nix
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
         break
       fi
     done
-  '' + lib.optionalString stdenv.isLinux ''
+  '' + lib.optionalString stdenv.hostPlatform.isLinux ''
     patchelf --add-needed ${libX11}/lib/libX11.so $out/lib/libIVhines.so
   '';
 
diff --git a/pkgs/applications/science/biology/jbrowse/default.nix b/pkgs/applications/science/biology/jbrowse/default.nix
index 395e5b5dcd9ab..88db9190465f2 100644
--- a/pkgs/applications/science/biology/jbrowse/default.nix
+++ b/pkgs/applications/science/biology/jbrowse/default.nix
@@ -1,12 +1,12 @@
-{ lib, fetchurl, appimageTools, wrapGAppsHook3 }:
+{ lib, fetchurl, appimageTools }:
 
 let
   pname = "jbrowse";
-  version = "2.11.2";
+  version = "2.15.1";
 
   src = fetchurl {
     url = "https://github.com/GMOD/jbrowse-components/releases/download/v${version}/jbrowse-desktop-v${version}-linux.AppImage";
-    sha256 = "sha256-7kZsK3vYgxubgtoIG1dByHgEBOlh9GUq+i3u/1eo0/o=";
+    sha256 = "sha256-/dpHUrigO0wnWay0jIkg6eG75ynrVXd7zcIAss6DhSs=";
   };
 
   appimageContents = appimageTools.extractType2 {
diff --git a/pkgs/applications/science/biology/kalign/default.nix b/pkgs/applications/science/biology/kalign/default.nix
index 55df8d875bbd5..4dc720290adce 100644
--- a/pkgs/applications/science/biology/kalign/default.nix
+++ b/pkgs/applications/science/biology/kalign/default.nix
@@ -39,7 +39,7 @@ stdenv.mkDerivation (finalAttrs: {
     description = "Fast multiple sequence alignment program";
     mainProgram = "kalign";
     homepage = "https://github.com/TimoLassmann/kalign";
-    changelog = "https://github.com/TimoLassmann/kalign/releases/tag/${finalAttrs.src.rev}";
+    changelog = "https://github.com/TimoLassmann/kalign/releases/tag/${lib.removePrefix "refs/tags/" finalAttrs.src.rev}";
     license = lib.licenses.gpl3Plus;
     maintainers = with lib.maintainers; [ natsukium ];
     platforms = lib.platforms.unix;
diff --git a/pkgs/applications/science/biology/kallisto/default.nix b/pkgs/applications/science/biology/kallisto/default.nix
index 55c555e387de7..a375df35dd3ee 100644
--- a/pkgs/applications/science/biology/kallisto/default.nix
+++ b/pkgs/applications/science/biology/kallisto/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "kallisto";
-  version = "0.50.1";
+  version = "0.51.1";
 
   src = fetchFromGitHub {
     repo = "kallisto";
     owner = "pachterlab";
     rev = "v${version}";
-    sha256 = "sha256-JJZJOl4u6FzngrrMuC2AfD5ry2LBOT8tdz2piH+9LFE=";
+    sha256 = "sha256-hfdeztEyHvuOnLS71oSv8sPqFe2UCX5KlANqrT/Gfx8=";
   };
 
   nativeBuildInputs = [ autoconf cmake ];
diff --git a/pkgs/applications/science/biology/kent/default.nix b/pkgs/applications/science/biology/kent/default.nix
index 56cfa5168a486..7d73ed90856dc 100644
--- a/pkgs/applications/science/biology/kent/default.nix
+++ b/pkgs/applications/science/biology/kent/default.nix
@@ -13,13 +13,13 @@
 }:
 stdenv.mkDerivation rec {
   pname = "kent";
-  version = "466";
+  version = "468";
 
   src = fetchFromGitHub {
     owner = "ucscGenomeBrowser";
     repo = pname;
     rev = "v${version}_base";
-    hash = "sha256-zoDZ+8G0SHKfWmkXBqp+WSjQXtmkcTIZjrjPhUIJw1c=";
+    hash = "sha256-OM/noraW2X8WV5wqWEFiI5/JPOBmsp0fTeDdcZoXxAA=";
   };
 
   buildInputs = [ libpng libuuid zlib bzip2 xz openssl curl libmysqlclient ];
diff --git a/pkgs/applications/science/biology/last/default.nix b/pkgs/applications/science/biology/last/default.nix
index 700b2cf3b4548..9057e767c1759 100644
--- a/pkgs/applications/science/biology/last/default.nix
+++ b/pkgs/applications/science/biology/last/default.nix
@@ -9,13 +9,13 @@
 
 stdenv.mkDerivation rec {
   pname = "last";
-  version = "1544";
+  version = "1550";
 
   src = fetchFromGitLab {
     owner = "mcfrith";
     repo = "last";
     rev = "refs/tags/${version}";
-    hash = "sha256-jxNudfUvSqV1QUzdvG8LWtL977oho9QuOQImmwbQiIM=";
+    hash = "sha256-kvI3m2FIPscU/a3GEH+O3yx5TgdNHdYP6OW3/mI2roM=";
   };
 
   nativeBuildInputs = [
diff --git a/pkgs/applications/science/biology/macs2/default.nix b/pkgs/applications/science/biology/macs2/default.nix
index 26ec138048f7e..153f85535f943 100644
--- a/pkgs/applications/science/biology/macs2/default.nix
+++ b/pkgs/applications/science/biology/macs2/default.nix
@@ -1,9 +1,11 @@
-{ lib, python3, fetchpatch, fetchPypi }:
+{ lib, python311, fetchpatch, fetchPypi }:
 
-python3.pkgs.buildPythonPackage rec {
+# pin python311 because macs2 does not support python 3.12
+# https://github.com/macs3-project/MACS/issues/598#issuecomment-1812622572
+python311.pkgs.buildPythonPackage rec {
   pname = "macs2";
   version = "2.2.9.1";
-  format = "pyproject";
+  pyproject = true;
 
   src = fetchPypi {
     pname = lib.toUpper pname;
@@ -20,20 +22,19 @@ python3.pkgs.buildPythonPackage rec {
     })
   ];
 
-  nativeBuildInputs = with python3.pkgs; [
+  build-system = with python311.pkgs; [
     cython_0
     numpy
     setuptools
-    wheel
   ];
 
-  propagatedBuildInputs = with python3.pkgs; [
+  dependencies = with python311.pkgs; [
     numpy
   ];
 
   __darwinAllowLocalNetworking = true;
 
-  nativeCheckInputs = with python3.pkgs; [
+  nativeCheckInputs = with python311.pkgs; [
     unittestCheckHook
   ];
 
diff --git a/pkgs/applications/science/biology/messer-slim/default.nix b/pkgs/applications/science/biology/messer-slim/default.nix
index 3812e9980cdfe..24b9a96019da6 100644
--- a/pkgs/applications/science/biology/messer-slim/default.nix
+++ b/pkgs/applications/science/biology/messer-slim/default.nix
@@ -1,14 +1,14 @@
 { lib, stdenv, fetchFromGitHub, cmake, gcc, gcc-unwrapped }:
 
 stdenv.mkDerivation rec {
-  version = "4.2.2";
+  version = "4.3";
   pname = "messer-slim";
 
   src = fetchFromGitHub {
     owner = "MesserLab";
     repo = "SLiM";
     rev = "v${version}";
-    sha256 = "sha256-TlB7Hj4pVN4p4VanACWjQBeTxP9/DvRvdCdgelrXx60=";
+    hash = "sha256-Hgh1ianEdITRUIDKLiLW32kQlPlXKIfN4PSv3cOXTGI=";
   };
 
   nativeBuildInputs = [ cmake gcc gcc-unwrapped ];
diff --git a/pkgs/applications/science/biology/migrate/default.nix b/pkgs/applications/science/biology/migrate/default.nix
index 7820f177bfb7b..aceb010875d74 100644
--- a/pkgs/applications/science/biology/migrate/default.nix
+++ b/pkgs/applications/science/biology/migrate/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation (finalAttrs: {
   pname = "migrate";
 
   src = fetchurl {
-    url = "https://peterbeerli.com/migrate-html5/download_version4/${finalAttrs.pname}-${finalAttrs.version}.src.tar.gz";
+    url = "https://peterbeerli.com/migrate-html5/download_version4/migrate-${finalAttrs.version}.src.tar.gz";
     hash = "sha256-twkoR9L6VPUye12OC0B5w0PxcxyKain6RkhCswLEdwg=";
   };
 
@@ -28,7 +28,7 @@ stdenv.mkDerivation (finalAttrs: {
   ];
 
   meta = with lib; {
-    broken = stdenv.isDarwin;
+    broken = stdenv.hostPlatform.isDarwin;
     description = "Estimates population size, migration, population splitting parameters using genetic/genomic data";
     homepage = "https://peterbeerli.com/migrate-html5/index.html";
     license = licenses.mit;
diff --git a/pkgs/applications/science/biology/minc-tools/default.nix b/pkgs/applications/science/biology/minc-tools/default.nix
index 3dece25915b47..d4b98fce87197 100644
--- a/pkgs/applications/science/biology/minc-tools/default.nix
+++ b/pkgs/applications/science/biology/minc-tools/default.nix
@@ -1,24 +1,54 @@
-{ lib, stdenv, fetchFromGitHub, cmake, makeWrapper, flex, bison, perl, TextFormat,
-  libminc, libjpeg, nifticlib, zlib }:
+{
+  lib,
+  stdenv,
+  fetchFromGitHub,
+  cmake,
+  makeWrapper,
+  flex,
+  bison,
+  perl,
+  TextFormat,
+  libminc,
+  libjpeg,
+  nifticlib,
+  zlib,
+}:
 
 stdenv.mkDerivation rec {
-  pname   = "minc-tools";
-  version = "unstable-2020-07-25";
+  pname = "minc-tools";
+  version = "2.3.06-unstable-2023-08-12";
 
   src = fetchFromGitHub {
-    owner  = "BIC-MNI";
-    repo   = pname;
-    rev    = "fb0a68a07d281e4e099c5d54df29925240de14c1";
-    sha256 = "0zcv2sdj3k6k0xjqdq8j5bxq8smm48dzai90vwsmz8znmbbm6kvw";
+    owner = "BIC-MNI";
+    repo = pname;
+    rev = "c86a767dbb63aaa05ee981306fa09f6133bde427";
+    hash = "sha256-PLNcuDU0ht1PcjloDhrPzpOpE42gbhPP3rfHtP7WnM4=";
   };
 
-  nativeBuildInputs = [ cmake flex bison makeWrapper ];
-  buildInputs = [ libminc libjpeg nifticlib zlib ];
-  propagatedBuildInputs = [ perl TextFormat ];
+  nativeBuildInputs = [
+    cmake
+    flex
+    bison
+    makeWrapper
+  ];
 
-  cmakeFlags = [ "-DLIBMINC_DIR=${libminc}/lib/cmake"
-                 "-DZNZ_INCLUDE_DIR=${nifticlib}/include/nifti"
-                 "-DNIFTI_INCLUDE_DIR=${nifticlib}/include/nifti" ];
+  buildInputs = [
+    libminc
+    libjpeg
+    nifticlib
+    zlib
+  ];
+
+  propagatedBuildInputs = [
+    perl
+    TextFormat
+  ];
+
+  cmakeFlags = [
+    "-DLIBMINC_DIR=${libminc}/lib/cmake"
+    "-DZNZ_INCLUDE_DIR=${nifticlib}/include/nifti"
+    "-DNIFTI_INCLUDE_DIR=${nifticlib}/include/nifti"
+  ];
 
   postFixup = ''
     for prog in minccomplete minchistory mincpik; do
@@ -31,6 +61,6 @@ stdenv.mkDerivation rec {
     description = "Command-line utilities for working with MINC files";
     maintainers = with maintainers; [ bcdarwin ];
     platforms = platforms.unix;
-    license   = licenses.free;
+    license = licenses.free;
   };
 }
diff --git a/pkgs/applications/science/biology/minimap2/default.nix b/pkgs/applications/science/biology/minimap2/default.nix
index 5597b5504678d..1c523a909241a 100644
--- a/pkgs/applications/science/biology/minimap2/default.nix
+++ b/pkgs/applications/science/biology/minimap2/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ zlib ];
 
-  makeFlags = lib.optionals stdenv.isAarch64 [ "arm_neon=1" "aarch64=1" ];
+  makeFlags = lib.optionals stdenv.hostPlatform.isAarch64 [ "arm_neon=1" "aarch64=1" ];
 
   installPhase = ''
     mkdir -p $out/bin
diff --git a/pkgs/applications/science/biology/mrbayes/default.nix b/pkgs/applications/science/biology/mrbayes/default.nix
index 54f5b9bbb3703..88b402712016b 100644
--- a/pkgs/applications/science/biology/mrbayes/default.nix
+++ b/pkgs/applications/science/biology/mrbayes/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchFromGitHub, readline }:
+{ lib, stdenv, fetchFromGitHub }:
 
 stdenv.mkDerivation rec {
   pname = "mrbayes";
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
       MrBayes uses a simulation technique called Markov chain Monte Carlo (or
       MCMC) to approximate the posterior probabilities of trees.
     '';
-    maintainers = with maintainers; [ ];
+    maintainers = [ ];
     license = licenses.gpl2Plus;
     homepage = "https://nbisweden.github.io/MrBayes/";
     platforms = platforms.linux;
diff --git a/pkgs/applications/science/biology/mrtrix/default.nix b/pkgs/applications/science/biology/mrtrix/default.nix
index 64eafa0f69686..e17aa3ca038c7 100644
--- a/pkgs/applications/science/biology/mrtrix/default.nix
+++ b/pkgs/applications/science/biology/mrtrix/default.nix
@@ -102,7 +102,7 @@ stdenv.mkDerivation rec {
   '';
 
   meta = with lib; {
-    broken = (stdenv.isLinux && stdenv.isAarch64);
+    broken = (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64);
     homepage = "https://github.com/MRtrix3/mrtrix3";
     description = "Suite of tools for diffusion imaging";
     maintainers = with maintainers; [ bcdarwin ];
diff --git a/pkgs/applications/science/biology/muscle/default.nix b/pkgs/applications/science/biology/muscle/default.nix
index cdcf6c7b50aa8..33a56d6e26d6d 100644
--- a/pkgs/applications/science/biology/muscle/default.nix
+++ b/pkgs/applications/science/biology/muscle/default.nix
@@ -1,10 +1,9 @@
-{ lib, stdenv, fetchFromGitHub }:
+{ lib, gccStdenv, fetchFromGitHub }:
 
-stdenv.mkDerivation rec {
-  pname   = "muscle";
+gccStdenv.mkDerivation rec {
+  pname = "muscle";
   version = "5.1.0";
 
-
   src = fetchFromGitHub {
     owner = "rcedgar";
     repo = pname;
@@ -14,15 +13,26 @@ stdenv.mkDerivation rec {
 
   sourceRoot = "${src.name}/src";
 
-  installPhase = ''
-    install -m755 -D Linux/muscle $out/bin/muscle
-  '';
+  patches = [
+    ./muscle-darwin-g++.patch
+  ];
+
+  installPhase =
+    let
+      target =
+        if gccStdenv.hostPlatform.isDarwin
+        then "Darwin"
+        else "Linux";
+    in
+    ''
+      install -m755 -D ${target}/muscle $out/bin/muscle
+    '';
 
   meta = with lib; {
     description = "Multiple sequence alignment with top benchmark scores scalable to thousands of sequences";
     mainProgram = "muscle";
-    license     = licenses.gpl3Plus;
-    homepage    = "https://www.drive5.com/muscle/";
+    license = licenses.gpl3Plus;
+    homepage = "https://www.drive5.com/muscle/";
     maintainers = with maintainers; [ unode thyol ];
   };
 }
diff --git a/pkgs/applications/science/biology/muscle/muscle-darwin-g++.patch b/pkgs/applications/science/biology/muscle/muscle-darwin-g++.patch
new file mode 100644
index 0000000000000..41e5fc7ae476c
--- /dev/null
+++ b/pkgs/applications/science/biology/muscle/muscle-darwin-g++.patch
@@ -0,0 +1,15 @@
+
+diff --git a/Makefile b/Makefile
+index df16673..be3bd0d 100644
+--- a/Makefile
++++ b/Makefile
+@@ -20,9 +20,6 @@ OS := $(shell uname)
+ CPPFLAGS := $(CPPFLAGS) -DNDEBUG -pthread
+ 
+ CXX := g++
+-ifeq ($(OS),Darwin)
+-	CXX := g++-11
+-endif
+ 
+ CXXFLAGS := $(CXXFLAGS) -O3 -fopenmp -ffast-math
+ 
diff --git a/pkgs/applications/science/biology/nest/default.nix b/pkgs/applications/science/biology/nest/default.nix
index 807af7ce488ac..9714f015f71a4 100644
--- a/pkgs/applications/science/biology/nest/default.nix
+++ b/pkgs/applications/science/biology/nest/default.nix
@@ -13,20 +13,19 @@
 , boost
 , python3
 , readline
-, autoPatchelfHook
 , withPython ? false
 , withMpi ? false
 }:
 
 stdenv.mkDerivation rec {
   pname = "nest";
-  version = "3.7";
+  version = "3.8";
 
   src = fetchFromGitHub {
     owner = "nest";
     repo = "nest-simulator";
     rev = "v${version}";
-    hash = "sha256-EwhpsfRmBLJnPiH6hXQXgG9jSNoC2oqq5lZ6t038VpI=";
+    hash = "sha256-hysOe1ZZpCClVOGo0+UeCP7imAakXrZlnJ4V95zfiyA=";
   };
 
   postPatch = ''
@@ -52,7 +51,7 @@ stdenv.mkDerivation rec {
     python3
     python3.pkgs.cython
   ] ++ lib.optional withMpi mpi
-    ++ lib.optional stdenv.isDarwin llvmPackages.openmp;
+    ++ lib.optional stdenv.hostPlatform.isDarwin llvmPackages.openmp;
 
   propagatedBuildInputs = with python3.pkgs; [
     numpy
diff --git a/pkgs/applications/science/biology/neuron/default.nix b/pkgs/applications/science/biology/neuron/default.nix
index ef79fb11a824d..fe5de3c68fab5 100644
--- a/pkgs/applications/science/biology/neuron/default.nix
+++ b/pkgs/applications/science/biology/neuron/default.nix
@@ -23,7 +23,7 @@ let
 in
 stdenv.mkDerivation (finalAttrs: {
   pname = "neuron";
-  version = "8.2.4";
+  version = "8.2.6";
 
   # format is for pythonModule conversion
   format = "other";
@@ -34,7 +34,7 @@ stdenv.mkDerivation (finalAttrs: {
     flex
     git
   ] ++ optionals useCore [ perl gsl ]
-  ++ optionals stdenv.isDarwin [ xcbuild ];
+  ++ optionals stdenv.hostPlatform.isDarwin [ xcbuild ];
 
   buildInputs = optionals useIv [
     xorg.libX11.dev
@@ -54,7 +54,7 @@ stdenv.mkDerivation (finalAttrs: {
   ] ++ optionals useMpi [
     python3.pkgs.mpi4py
   ] ++ optionals useRx3d [
-    python3.pkgs.cython_0 # NOTE: cython<3 is required as of 8.2.4
+    python3.pkgs.cython_0 # NOTE: cython<3 is required as of 8.2.6
     python3.pkgs.numpy
   ];
 
@@ -89,7 +89,7 @@ stdenv.mkDerivation (finalAttrs: {
     repo = "nrn";
     rev = finalAttrs.version;
     fetchSubmodules = true;
-    hash = "sha256-KsULc+LHoWmrkGYebpoUot6DhStKidbLQf5a3S+pi4s=";
+    hash = "sha256-xASBpsF8rIzrb5G+4Qi6rvWC2wqL7nAGlSeMsBAI6WM=";
   };
 
   meta = with lib; {
diff --git a/pkgs/applications/science/biology/obitools/obitools3.nix b/pkgs/applications/science/biology/obitools/obitools3.nix
index f415c9c39141d..53aa177307dfa 100644
--- a/pkgs/applications/science/biology/obitools/obitools3.nix
+++ b/pkgs/applications/science/biology/obitools/obitools3.nix
@@ -11,7 +11,7 @@ python3Packages.buildPythonApplication rec {
 
   nativeBuildInputs = [ python3Packages.cython cmake ];
 
-  postPatch = lib.optionalString stdenv.isAarch64 ''
+  postPatch = lib.optionalString stdenv.hostPlatform.isAarch64 ''
       substituteInPlace setup.py \
       --replace "'-msse2'," ""
   '';
diff --git a/pkgs/applications/science/biology/paml/default.nix b/pkgs/applications/science/biology/paml/default.nix
index c593b5ed3d34c..1e21d18242bd2 100644
--- a/pkgs/applications/science/biology/paml/default.nix
+++ b/pkgs/applications/science/biology/paml/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation (finalAttrs: {
     hash = "sha256-P/oHaLxoQzjFuvmHyRdShHv1ayruy6O/I9w8aTyya2s=";
   };
 
-  env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-D_POSIX_C_SOURCE";
+  env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-D_POSIX_C_SOURCE";
 
   preBuild = ''
     cd ./src/
@@ -42,7 +42,7 @@ stdenv.mkDerivation (finalAttrs: {
     longDescription = "PAML is a package of programs for phylogenetic analyses of DNA or protein sequences using maximum likelihood. It is maintained and distributed for academic use free of charge by Ziheng Yang. ANSI C source codes are distributed for UNIX/Linux/Mac OSX, and executables are provided for MS Windows. PAML is not good for tree making. It may be used to estimate parameters and test hypotheses to study the evolutionary process, when you have reconstructed trees using other programs such as PAUP*, PHYLIP, MOLPHY, PhyML, RaxML, etc.";
     license     = lib.licenses.gpl3Only;
     homepage    = "http://abacus.gene.ucl.ac.uk/software/paml.html";
-    changelog = "https://github.com/abacus-gene/paml/releases/tag/${finalAttrs.src.rev}";
+    changelog = "https://github.com/abacus-gene/paml/releases/tag/${lib.removePrefix "refs/tags/" finalAttrs.src.rev}";
     platforms = lib.platforms.unix;
   };
 })
diff --git a/pkgs/applications/science/biology/picard-tools/default.nix b/pkgs/applications/science/biology/picard-tools/default.nix
index 880ea77e9d245..e8786fe4b9c0e 100644
--- a/pkgs/applications/science/biology/picard-tools/default.nix
+++ b/pkgs/applications/science/biology/picard-tools/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "picard-tools";
-  version = "3.1.1";
+  version = "3.2.0";
 
   src = fetchurl {
     url = "https://github.com/broadinstitute/picard/releases/download/${version}/picard.jar";
-    sha256 = "sha256-FcefUf0KwAEEn53XubrB2991ncsCMKicf20fJG6LurQ=";
+    sha256 = "sha256-4lj6Lj9fphzWeZ7I4HP0mpX73OrxY9imCXGyYZuG+kE=";
   };
 
   nativeBuildInputs = [ makeWrapper ];
diff --git a/pkgs/applications/science/biology/plink-ng/default.nix b/pkgs/applications/science/biology/plink-ng/default.nix
index b91655ac8fdac..b66bed97a94a5 100644
--- a/pkgs/applications/science/biology/plink-ng/default.nix
+++ b/pkgs/applications/science/biology/plink-ng/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "1zhffjbwpd50dxywccbnv1rxy9njwz73l4awc5j7i28rgj3davcq";
   };
 
-  buildInputs = [ zlib ] ++ (if stdenv.isDarwin then [ darwin.apple_sdk.frameworks.Accelerate ] else [ blas lapack ]) ;
+  buildInputs = [ zlib ] ++ (if stdenv.hostPlatform.isDarwin then [ darwin.apple_sdk.frameworks.Accelerate ] else [ blas lapack ]) ;
 
   preBuild = ''
     sed -i 's|zlib-1.2.8/zlib.h|zlib.h|g' *.c *.h
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
   '';
 
   meta = {
-    broken = (stdenv.isLinux && stdenv.isAarch64);
+    broken = (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64);
     description = "Comprehensive update to the PLINK association analysis toolset";
     mainProgram = "plink";
     homepage = "https://www.cog-genomics.org/plink2";
diff --git a/pkgs/applications/science/biology/repseek/default.nix b/pkgs/applications/science/biology/repseek/default.nix
index e5e0193f7911a..9b38171b34ef2 100644
--- a/pkgs/applications/science/biology/repseek/default.nix
+++ b/pkgs/applications/science/biology/repseek/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
     substituteInPlace Makefile \
       --replace "INSTALLDIR = \$\$HOME/bin" "INSTALLDIR = $out/bin/" \
       --replace "CC= gcc" "CC = $CC"
-  '' + lib.optionalString stdenv.isLinux ''
+  '' + lib.optionalString stdenv.hostPlatform.isLinux ''
     substituteInPlace Makefile --replace "MACHINE = MACOSX" "MACHINE = LINUX"
   '';
 
diff --git a/pkgs/applications/science/biology/sambamba/default.nix b/pkgs/applications/science/biology/sambamba/default.nix
index b6635f02aacdf..e62a5bb14aae4 100644
--- a/pkgs/applications/science/biology/sambamba/default.nix
+++ b/pkgs/applications/science/biology/sambamba/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
     owner = "biod";
     repo = "sambamba";
     rev = "v${version}";
-    sha256 = "sha256-3O9bHGpMuCgdR2Wm7Dv1VUjMT1QTn8K1hdwgjvwhFDw=";
+    hash = "sha256-3O9bHGpMuCgdR2Wm7Dv1VUjMT1QTn8K1hdwgjvwhFDw=";
     fetchSubmodules = true;
   };
 
diff --git a/pkgs/applications/science/biology/sortmerna/default.nix b/pkgs/applications/science/biology/sortmerna/default.nix
index c19556318843b..b6291ea852975 100644
--- a/pkgs/applications/science/biology/sortmerna/default.nix
+++ b/pkgs/applications/science/biology/sortmerna/default.nix
@@ -56,6 +56,6 @@ stdenv.mkDerivation rec {
     platforms = platforms.x86_64;
     homepage = "https://bioinfo.lifl.fr/RNA/sortmerna/";
     maintainers = with maintainers; [ luispedro ];
-    broken = stdenv.isDarwin;
+    broken = stdenv.hostPlatform.isDarwin;
   };
 }
diff --git a/pkgs/applications/science/biology/sratoolkit/default.nix b/pkgs/applications/science/biology/sratoolkit/default.nix
deleted file mode 100644
index 62c21a23eb66a..0000000000000
--- a/pkgs/applications/science/biology/sratoolkit/default.nix
+++ /dev/null
@@ -1,56 +0,0 @@
-{ stdenv
-, lib
-, fetchurl
-, autoPatchelfHook
-, libidn
-, zlib
-, bzip2
-}:
-
-
-let
-  libidn11 = libidn.overrideAttrs (old: {
-    pname = "libidn";
-    version = "1.34";
-    src = fetchurl {
-      url = "mirror://gnu/libidn/libidn-1.34.tar.gz";
-      sha256 = "0g3fzypp0xjcgr90c5cyj57apx1cmy0c6y9lvw2qdcigbyby469p";
-    };
-  });
-
-in
-
-stdenv.mkDerivation rec {
-  pname = "sratoolkit";
-  version = "2.11.3";
-
-  src = fetchurl {
-    url = "https://ftp-trace.ncbi.nlm.nih.gov/sra/sdk/${version}/sratoolkit.${version}-ubuntu64.tar.gz";
-    sha256 = "1590lc4cplxr3lhjqci8fjncy67imn2h14qd2l87chmhjh243qvx";
-  };
-
-  nativeBuildInputs = [
-    autoPatchelfHook
-  ];
-
-  buildInputs = [
-    libidn11
-    zlib
-    bzip2
-    stdenv.cc.cc.lib
-  ];
-
-  sourceRoot = "sratoolkit.${version}-ubuntu64/bin";
-
-  installPhase = ''
-    find -L . -executable -type f -! -name "*remote-fuser*" -exec install -m755 -D {} $out/bin/{} \;
-  '';
-
-  meta = with lib; {
-    homepage = "https://github.com/ncbi/sra-tools";
-    description = "SRA Toolkit and SDK from NCBI is a collection of tools and libraries for using data in the INSDC Sequence Read Archives";
-    license = licenses.ncbiPd;
-    maintainers = with maintainers; [ thyol ];
-    platforms = [ "x86_64-linux" ];
-  };
-}
diff --git a/pkgs/applications/science/biology/subread/default.nix b/pkgs/applications/science/biology/subread/default.nix
index 62ea61af91926..d2ee518883b54 100644
--- a/pkgs/applications/science/biology/subread/default.nix
+++ b/pkgs/applications/science/biology/subread/default.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
 
   configurePhase = ''
     cd src
-    cp Makefile.${if stdenv.isLinux then "Linux" else "MacOS"} Makefile
+    cp Makefile.${if stdenv.hostPlatform.isLinux then "Linux" else "MacOS"} Makefile
   '';
 
   makeFlags = [ "CC_EXEC=cc" ];
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
   '';
 
   meta = with lib; {
-    broken = stdenv.isDarwin;
+    broken = stdenv.hostPlatform.isDarwin;
     description = "High-performance read alignment, quantification and mutation discovery";
     license = licenses.gpl3;
     maintainers = with maintainers; [ jbedo ];
diff --git a/pkgs/applications/science/biology/svaba/default.nix b/pkgs/applications/science/biology/svaba/default.nix
index fec5a5a3b92dc..cdb6c4f9c8aa4 100644
--- a/pkgs/applications/science/biology/svaba/default.nix
+++ b/pkgs/applications/science/biology/svaba/default.nix
@@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
   '';
 
   meta = with lib; {
-    broken = (stdenv.isLinux && stdenv.isAarch64);
+    broken = (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64);
     description = "Structural variant and INDEL caller for DNA sequencing data, using genome-wide local assembly";
     mainProgram = "svaba";
     license = licenses.gpl3;
diff --git a/pkgs/applications/science/biology/tandem-aligner/default.nix b/pkgs/applications/science/biology/tandem-aligner/default.nix
deleted file mode 100644
index d44489debbb62..0000000000000
--- a/pkgs/applications/science/biology/tandem-aligner/default.nix
+++ /dev/null
@@ -1,67 +0,0 @@
-{ lib
-, stdenv
-, fetchFromGitHub
-, fetchpatch
-, cmake
-, zlib
-}:
-
-stdenv.mkDerivation (finalAttrs: {
-  pname = "TandemAligner";
-  version = "0.1";
-
-  src = fetchFromGitHub {
-    owner = "seryrzu";
-    repo = "tandem_aligner";
-    rev = "v${finalAttrs.version}";
-    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 = "${finalAttrs.src.name}/tandem_aligner";
-
-  nativeBuildInputs = [ cmake ];
-
-  buildInputs = [ zlib ];
-
-  installPhase = ''
-    runHook preInstall
-    mkdir -p $out/bin
-    cp src/projects/tandem_aligner/tandem_aligner $out/bin
-    runHook postInstall
-  '';
-
-  doCheck = true;
-
-  # adapted from target test_launch in Makefile
-  checkPhase = ''
-    runHook preCheck
-    mkdir -p $TMPDIR/test_launch
-    src/projects/tandem_aligner/tandem_aligner \
-      --first $src/tandem_aligner/test_dataset/first.fasta \
-      --second $src/tandem_aligner/test_dataset/second.fasta \
-      -o $TMPDIR/test_launch \
-      --debug
-    grep -q "Thank you for using TandemAligner!" $TMPDIR/test_launch/tandem_aligner.log
-    diff $TMPDIR/test_launch/cigar.txt $src/tandem_aligner/test_dataset/true_cigar.txt
-    runHook postCheck
-  '';
-
-  meta = {
-    description = "Parameter-free algorithm for sequence alignment";
-    homepage = "https://github.com/seryrzu/tandem_aligner";
-    changelog = "https://github.com/seryrzu/tandem_aligner/releases/tag/v${finalAttrs.version}";
-    license = lib.licenses.bsd3;
-    maintainers = with lib.maintainers; [ amesgen ];
-    platforms = lib.platforms.linux;
-    mainProgram = "tandem_aligner";
-  };
-})
diff --git a/pkgs/applications/science/biology/trimal/default.nix b/pkgs/applications/science/biology/trimal/default.nix
index b2ef121caa9a2..f822fe50b1648 100644
--- a/pkgs/applications/science/biology/trimal/default.nix
+++ b/pkgs/applications/science/biology/trimal/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "trimal";
-  version = "1.4.1";
+  version = "1.5.0";
 
   src = fetchFromGitHub {
     repo = pname;
     owner = "scapella";
     rev = "v${version}";
-    sha256 = "0isc7s3514di4z953xq53ncjkbi650sh4q9yyw5aag1n9hqnh7k0";
+    sha256 = "sha256-6GXirih7nY0eD2XS8aplLcYf53EeLuae+ewdUgBiKQQ=";
   };
 
   postUnpack = ''
diff --git a/pkgs/applications/science/biology/truvari/default.nix b/pkgs/applications/science/biology/truvari/default.nix
index 946f4be606326..3c523b21fc641 100644
--- a/pkgs/applications/science/biology/truvari/default.nix
+++ b/pkgs/applications/science/biology/truvari/default.nix
@@ -15,14 +15,14 @@ let
   };
 in python3Packages.buildPythonApplication rec {
   pname = "truvari";
-  version = "4.1.0";
+  version = "4.2.2";
   pyproject = true;
 
   src = fetchFromGitHub {
     owner = "ACEnglish";
     repo = "truvari";
     rev = "v${version}";
-    hash = "sha256-HFVAv1TTL/nMjr62tQKhMdwh25P/y4nBGzSbxoJxMmo=";
+    hash = "sha256-SFBVatcVavBfQtFbBcXifBX3YnKsxJS669vCcyjsBA4=";
   };
 
   postPatch = ''
@@ -31,11 +31,11 @@ in python3Packages.buildPythonApplication rec {
     patchShebangs repo_utils/test_files
   '';
 
-  nativeBuildInputs = [
+  build-system = [
     python3Packages.setuptools
   ];
 
-  propagatedBuildInputs = with python3Packages; [
+  dependencies = with python3Packages; [
     pywfa
     rich
     edlib
@@ -46,6 +46,7 @@ in python3Packages.buildPythonApplication rec {
     pytabix
     bwapy
     pandas
+    pyabpoa
   ];
 
   makeWrapperArgs = [
diff --git a/pkgs/applications/science/biology/veryfasttree/default.nix b/pkgs/applications/science/biology/veryfasttree/default.nix
index 6c054fecd7428..27c34f67d952a 100644
--- a/pkgs/applications/science/biology/veryfasttree/default.nix
+++ b/pkgs/applications/science/biology/veryfasttree/default.nix
@@ -7,13 +7,13 @@
 
 stdenv.mkDerivation (finalAttrs: {
   pname = "veryfasttree";
-  version = "4.0.3";
+  version = "4.0.4";
 
   src = fetchFromGitHub {
     owner = "citiususc";
     repo = "veryfasttree";
     rev = "v${finalAttrs.version}";
-    hash = "sha256-Sp331VJRaYv/BTwFj3HwUcUsWjYf6YEXWjYdOzDhBBA=";
+    hash = "sha256-S4FW91VEdTPOIwRamz62arLSN9inxoKXpKsen2ISXMo=";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/pkgs/applications/science/biology/whisper/default.nix b/pkgs/applications/science/biology/whisper/default.nix
index a69b39f4e0898..6c8bb21df6a52 100644
--- a/pkgs/applications/science/biology/whisper/default.nix
+++ b/pkgs/applications/science/biology/whisper/default.nix
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
   '';
 
   meta = with lib; {
-    broken = stdenv.isDarwin;
+    broken = stdenv.hostPlatform.isDarwin;
     description = "Short read sequence mapper";
     license = licenses.gpl3;
     homepage = "https://github.com/refresh-bio/whisper";
diff --git a/pkgs/applications/science/chemistry/apbs/default.nix b/pkgs/applications/science/chemistry/apbs/default.nix
index ec8f8e7ffbf61..766e4dcbd5575 100644
--- a/pkgs/applications/science/chemistry/apbs/default.nix
+++ b/pkgs/applications/science/chemistry/apbs/default.nix
@@ -84,7 +84,7 @@ stdenv.mkDerivation (finalAttrs: {
     suitesparse
     blas
     python3
-  ] ++ lib.optionals stdenv.isDarwin [
+  ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
     libintl
     libiconv
   ];
diff --git a/pkgs/applications/science/chemistry/autodock-vina/default.nix b/pkgs/applications/science/chemistry/autodock-vina/default.nix
index d56b8a02a20d0..844fe5fea7ed5 100644
--- a/pkgs/applications/science/chemistry/autodock-vina/default.nix
+++ b/pkgs/applications/science/chemistry/autodock-vina/default.nix
@@ -27,7 +27,7 @@ stdenv.mkDerivation (finalAttrs: {
 
   buildInputs = [
     boost'
-  ] ++ lib.optionals stdenv.isLinux [
+  ] ++ lib.optionals stdenv.hostPlatform.isLinux [
     glibc.static
   ];
 
diff --git a/pkgs/applications/science/chemistry/avogadro2/default.nix b/pkgs/applications/science/chemistry/avogadro2/default.nix
index 7ee42c1a793c4..f69f10164cc1c 100644
--- a/pkgs/applications/science/chemistry/avogadro2/default.nix
+++ b/pkgs/applications/science/chemistry/avogadro2/default.nix
@@ -1,5 +1,5 @@
 { lib, stdenv, fetchFromGitHub, cmake, eigen, avogadrolibs, molequeue, hdf5
-, openbabel, qttools, wrapQtAppsHook
+, openbabel, qttools, wrapQtAppsHook, mesa
 }:
 
 let
@@ -44,7 +44,7 @@ in stdenv.mkDerivation rec {
     mainProgram = "avogadro2";
     maintainers = with maintainers; [ sheepforce ];
     homepage = "https://github.com/OpenChemistry/avogadroapp";
-    platforms = platforms.mesaPlatforms;
+    inherit (mesa.meta) platforms;
     license = licenses.bsd3;
   };
 }
diff --git a/pkgs/applications/science/chemistry/chemtool/default.nix b/pkgs/applications/science/chemistry/chemtool/default.nix
deleted file mode 100644
index 82b1834671619..0000000000000
--- a/pkgs/applications/science/chemistry/chemtool/default.nix
+++ /dev/null
@@ -1,57 +0,0 @@
-{ lib
-, stdenv
-, fetchurl
-, pkg-config
-, libX11
-, gtk2
-, fig2dev
-, wrapGAppsHook3
-}:
-
-stdenv.mkDerivation rec {
-  pname = "chemtool";
-  version = "1.6.14";
-
-  src = fetchurl {
-    url = "http://ruby.chemie.uni-freiburg.de/~martin/${pname}/${pname}-${version}.tar.gz";
-    sha256 = "hhYaBGE4azNKX/sXzfCUpJGUGIRngnL0V0mBNRTdr8s=";
-  };
-
-  nativeBuildInputs = [ pkg-config wrapGAppsHook3 ];
-  buildInputs = [
-    libX11
-    gtk2
-    fig2dev
-  ];
-
-  # Workaround build on -fno-common toolchains like upstream gcc-10.
-  # 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
-  env.NIX_CFLAGS_COMPILE = "-fcommon";
-
-  preFixup = ''
-    gappsWrapperArgs+=(--prefix PATH : "${lib.makeBinPath [ fig2dev ]}")
-  '';
-
-  meta = with lib; {
-    homepage = "http://ruby.chemie.uni-freiburg.de/~martin/chemtool/";
-    description = "Draw chemical structures";
-    longDescription = ''
-      Chemtool is a program for drawing organic molecules. It runs under the X
-      Window System using the GTK widget set.
-
-      Most operations in chemtool can be accomplished using the mouse - the
-      first (usually the left) button is used to select or place things, the
-      middle button modifies properties (e.g. reverses the direction of a bond),
-      and the right button is used to delete objects.
-
-      The program offers essentially unlimited undo/redo, two text fonts plus
-      symbols, seven colors, drawing at several zoom scales, and square and
-      hexagonal backdrop grids for easier alignment.
-    '';
-    license = licenses.mit;
-    maintainers = with maintainers; [ AndersonTorres ];
-    platforms = platforms.linux;
-  };
-}
diff --git a/pkgs/applications/science/chemistry/cp2k/default.nix b/pkgs/applications/science/chemistry/cp2k/default.nix
deleted file mode 100644
index 8a831fe23b742..0000000000000
--- a/pkgs/applications/science/chemistry/cp2k/default.nix
+++ /dev/null
@@ -1,231 +0,0 @@
-{ lib
-, stdenv
-, fetchFromGitHub
-, mpiCheckPhaseHook
-, python3
-, gfortran
-, blas
-, lapack
-, fftw
-, libint
-, libvori
-, libxc
-, mpi
-, gsl
-, scalapack
-, openssh
-, makeWrapper
-, libxsmm
-, spglib
-, which
-, pkg-config
-, plumed
-, zlib
-, hdf5-fortran
-, sirius
-, libvdwxc
-, spla
-, spfft
-, enableElpa ? false
-, elpa
-, cudaPackages
-, rocmPackages
-, config
-, gpuBackend ? (
-  if config.cudaSupport
-  then "cuda"
-  else if config.rocmSupport
-  then "rocm"
-  else "none"
-)
-# Change to a value suitable for your target GPU.
-# For AMD values see https://github.com/cp2k/cp2k/blob/master/INSTALL.md#2v-rocmhip-support-for-amd-gpu
-# and for Nvidia see https://github.com/cp2k/cp2k/blob/master/INSTALL.md#2i-cuda-optional-improved-performance-on-gpu-systems
-, gpuVersion ? ( if gpuBackend == "cuda" then "A100" else "Mi100" )
-, gpuArch ? ( if gpuBackend == "cuda" then "sm_80" else "gfx908" )
-}:
-
-assert builtins.elem gpuBackend [ "none" "cuda" "rocm" ];
-
-let
-  cp2kVersion = "psmp";
-  arch = "Linux-x86-64-gfortran";
-
-in
-stdenv.mkDerivation rec {
-  pname = "cp2k";
-  version = "2024.1";
-
-  src = fetchFromGitHub {
-    owner = "cp2k";
-    repo = "cp2k";
-    rev = "v${version}";
-    hash = "sha256-6PB6wjdTOa55dXV7QIsjxI77hhc95WFEjNePfupBUJQ=";
-    fetchSubmodules = true;
-  };
-
-  patches = [
-    # Remove the build command line from the source.
-    # This avoids dependencies to .dev inputs
-    ./remove-compiler-options.patch
-  ];
-
-  nativeBuildInputs = [ python3 which openssh makeWrapper pkg-config ]
-    ++ lib.optional (gpuBackend == "cuda") cudaPackages.cuda_nvcc;
-
-  buildInputs = [
-    gfortran
-    fftw
-    gsl
-    libint
-    libvori
-    libxc
-    libxsmm
-    mpi
-    spglib
-    scalapack
-    blas
-    lapack
-    plumed
-    zlib
-    hdf5-fortran
-    sirius
-    spla
-    spfft
-    libvdwxc
-  ]
-  ++ lib.optional enableElpa elpa
-  ++ lib.optionals (gpuBackend == "cuda") [
-    cudaPackages.cuda_cudart
-    cudaPackages.libcublas
-    cudaPackages.cuda_nvrtc
-  ] ++ lib.optionals (gpuBackend == "rocm") [
-    rocmPackages.clr
-    rocmPackages.rocm-core
-    rocmPackages.hipblas
-    rocmPackages.hipfft
-    rocmPackages.rocblas
-  ]
-  ;
-
-  propagatedBuildInputs = [ (lib.getBin mpi) ];
-  propagatedUserEnvPkgs = [ mpi ];
-
-  makeFlags = [
-    "ARCH=${arch}"
-    "VERSION=${cp2kVersion}"
-  ];
-
-  doCheck = gpuBackend == "none";
-
-  enableParallelBuilding = true;
-
-  postPatch = ''
-    patchShebangs tools exts/dbcsr/tools/build_utils exts/dbcsr/.cp2k
-    substituteInPlace exts/build_dbcsr/Makefile \
-      --replace '/usr/bin/env python3' '${python3}/bin/python' \
-      --replace 'SHELL = /bin/sh' 'SHELL = bash'
-  '';
-
-  configurePhase = ''
-    cat > arch/${arch}.${cp2kVersion} << EOF
-    CC         = mpicc
-    CPP        =
-    FC         = mpif90
-    LD         = mpif90
-    AR         = ar -r
-    ${lib.strings.optionalString (gpuBackend == "cuda") ''
-    OFFLOAD_CC = nvcc
-    OFFLOAD_FLAGS = -O3 -g -w --std=c++11 -arch ${gpuArch}
-    OFFLOAD_TARGET = cuda
-    GPUVER = ${gpuVersion}
-    CXX = mpicxx
-    CXXFLAGS = -std=c++11 -fopenmp
-    ''}
-    ${lib.strings.optionalString (gpuBackend == "rocm") ''
-    GPUVER = ${gpuVersion}
-    OFFLOAD_CC = hipcc
-    OFFLOAD_FLAGS = -fopenmp -m64 -pthread -fPIC -D__GRID_HIP -O2 --offload-arch=${gpuArch} --rocm-path=${rocmPackages.rocm-core}
-    OFFLOAD_TARGET = hip
-    CXX = mpicxx
-    CXXFLAGS = -std=c++11 -fopenmp -D__HIP_PLATFORM_AMD__
-    ''}
-    DFLAGS     = -D__FFTW3 -D__LIBXC -D__LIBINT -D__parallel -D__SCALAPACK \
-                 -D__MPI_VERSION=3 -D__F2008 -D__LIBXSMM -D__SPGLIB \
-                 -D__MAX_CONTR=4 -D__LIBVORI ${lib.optionalString enableElpa "-D__ELPA"} \
-                 -D__PLUMED2 -D__HDF5 -D__GSL -D__SIRIUS -D__LIBVDWXC -D__SPFFT -D__SPLA \
-                 ${lib.strings.optionalString (gpuBackend == "cuda") "-D__OFFLOAD_CUDA -D__ACC -D__DBCSR_ACC -D__NO_OFFLOAD_PW"} \
-                 ${lib.strings.optionalString (gpuBackend == "rocm") "-D__OFFLOAD_HIP -D__DBCSR_ACC -D__NO_OFFLOAD_PW"}
-    CFLAGS    = -fopenmp
-    FCFLAGS    = \$(DFLAGS) -O2 -ffree-form -ffree-line-length-none \
-                 -ftree-vectorize -funroll-loops -msse2 \
-                 -std=f2008 \
-                 -fopenmp -ftree-vectorize -funroll-loops \
-                   ${lib.optionalString enableElpa "$(pkg-config --variable=fcflags elpa)"} \
-                 -I${lib.getDev libint}/include  \
-                 -I${lib.getDev sirius}/include/sirius \
-                 -I${lib.getDev libxc}/include \
-                 -I${lib.getDev libxsmm}/include \
-                 -I${lib.getDev hdf5-fortran}/include \
-                 -fallow-argument-mismatch
-    LIBS       = -lfftw3 -lfftw3_threads \
-                 -lscalapack -lblas -llapack \
-                 -lxcf03 -lxc -lxsmmf -lxsmm -lsymspg \
-                 -lint2 -lstdc++ -lvori \
-                 -lgomp -lpthread -lm \
-                 -fopenmp ${lib.optionalString enableElpa "$(pkg-config --libs elpa)"} \
-                 -lz -ldl ${lib.optionalString (mpi.pname == "openmpi") "$(mpicxx --showme:link)"} \
-                 -lplumed -lhdf5_fortran -lhdf5_hl -lhdf5 -lgsl -lsirius -lspla -lspfft -lvdwxc \
-                 ${lib.strings.optionalString (gpuBackend == "cuda") ''
-                   -L${cudaPackages.cuda_cudart}/lib/stubs/ \
-                   -lcudart -lnvrtc -lcuda -lcublas
-                   ''
-                 } \
-                 ${lib.strings.optionalString (gpuBackend == "rocm") "-lamdhip64 -lhipfft -lhipblas -lrocblas"}
-    LDFLAGS    = \$(FCFLAGS) \$(LIBS)
-    include ${plumed}/lib/plumed/src/lib/Plumed.inc
-    EOF
-  '';
-
-  nativeCheckInputs = [
-    mpiCheckPhaseHook
-    openssh
-  ];
-
-  checkPhase = ''
-    runHook preCheck
-
-    export CP2K_DATA_DIR=data
-    mpirun -np 2 exe/${arch}/libcp2k_unittest.${cp2kVersion}
-
-    runHook postCheck
-  '';
-
-  installPhase = ''
-    mkdir -p $out/bin $out/share/cp2k
-
-    cp exe/${arch}/* $out/bin
-    rm $out/bin/*_unittest.*
-
-    for i in cp2k cp2k_shell graph; do
-      wrapProgram $out/bin/$i.${cp2kVersion} \
-        --set-default CP2K_DATA_DIR $out/share/cp2k
-    done
-
-    wrapProgram $out/bin/cp2k.popt \
-      --set-default CP2K_DATA_DIR $out/share/cp2k \
-      --set OMP_NUM_THREADS 1
-
-    cp -r data/* $out/share/cp2k
-  '';
-
-  passthru = { inherit mpi; };
-
-  meta = with lib; {
-    description = "Quantum chemistry and solid state physics program";
-    homepage = "https://www.cp2k.org";
-    license = licenses.gpl2Plus;
-    maintainers = [ maintainers.sheepforce ];
-    platforms = [ "x86_64-linux" ];
-  };
-}
diff --git a/pkgs/applications/science/chemistry/cp2k/remove-compiler-options.patch b/pkgs/applications/science/chemistry/cp2k/remove-compiler-options.patch
deleted file mode 100644
index e6cf81494aa33..0000000000000
--- a/pkgs/applications/science/chemistry/cp2k/remove-compiler-options.patch
+++ /dev/null
@@ -1,37 +0,0 @@
-diff --git a/src/start/cp2k.F b/src/start/cp2k.F
-index f69146ea3..a195f0620 100644
---- a/src/start/cp2k.F
-+++ b/src/start/cp2k.F
-@@ -58,8 +58,7 @@ PROGRAM cp2k
-    USE input_cp2k,                      ONLY: create_cp2k_root_section
-    USE input_section_types,             ONLY: section_release,&
-                                               section_type
--   USE iso_fortran_env,                 ONLY: compiler_options,&
--                                              compiler_version
-+   USE iso_fortran_env,                 ONLY: compiler_version
-    USE kinds,                           ONLY: default_path_length
-    USE machine,                         ONLY: default_output_unit
- #include "../base/base_uses.f90"
-@@ -70,7 +69,6 @@ PROGRAM cp2k
-                                            arg_att, command
-    CHARACTER(LEN=default_path_length), &
-       DIMENSION(:, :), ALLOCATABLE      :: initial_variables, initial_variables_tmp
--   CHARACTER(LEN=:), ALLOCATABLE        :: compiler_options_string
-    INTEGER                              :: output_unit, l, i, var_set_sep, inp_var_idx
-    INTEGER                              :: ierr, i_arg
-    LOGICAL                              :: check, usage, echo_input, command_line_error
-@@ -328,14 +326,6 @@ PROGRAM cp2k
-                WRITE (output_unit, "(T2,A)") cp2k_version, &
-                   "Source code revision "//TRIM(compile_revision), &
-                   TRIM(cp2k_flags())
--               compiler_options_string = compiler_options()
--               WRITE (output_unit, "(T2,A,A)") "compiler: ", compiler_version()
--               WRITE (output_unit, "(T2,A)") "compiler options:"
--               DO i = 0, (LEN(compiler_options_string) - 1)/68
--                  WRITE (output_unit, "(T4,A)") &
--                     compiler_options_string(i*68 + 1:MIN(LEN(compiler_options_string), (i + 1)*68))
--               END DO
--               DEALLOCATE (compiler_options_string)
-             END IF
-          END IF
- 
diff --git a/pkgs/applications/science/chemistry/element/default.nix b/pkgs/applications/science/chemistry/element/default.nix
index cc80cb058d92c..dc03eac51028d 100644
--- a/pkgs/applications/science/chemistry/element/default.nix
+++ b/pkgs/applications/science/chemistry/element/default.nix
@@ -19,6 +19,6 @@ buildGoModule rec {
     homepage = "https://github.com/gennaro-tedesco/element";
     license = licenses.asl20;
     maintainers = [ maintainers.j0hax ];
-    broken = stdenv.isDarwin;
+    broken = stdenv.hostPlatform.isDarwin;
   };
 }
diff --git a/pkgs/applications/science/chemistry/ergoscf/default.nix b/pkgs/applications/science/chemistry/ergoscf/default.nix
index 3ee33cf19b746..ceaeb3336427d 100644
--- a/pkgs/applications/science/chemistry/ergoscf/default.nix
+++ b/pkgs/applications/science/chemistry/ergoscf/default.nix
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
   configureFlags = [
     "--enable-linalgebra-templates"
     "--enable-performance"
-  ] ++ lib.optional stdenv.isx86_64 "--enable-sse-intrinsics";
+  ] ++ lib.optional stdenv.hostPlatform.isx86_64 "--enable-sse-intrinsics";
 
   LDFLAGS = "-lblas -llapack";
 
diff --git a/pkgs/applications/science/chemistry/gwyddion/default.nix b/pkgs/applications/science/chemistry/gwyddion/default.nix
index c379e432bdeb2..c7440e3fad81e 100644
--- a/pkgs/applications/science/chemistry/gwyddion/default.nix
+++ b/pkgs/applications/science/chemistry/gwyddion/default.nix
@@ -11,7 +11,7 @@
   zlibSupport ? true, zlib,
   libuniqueSupport ? true, libunique,
   libpngSupport ? true, libpng,
-  openglSupport ? !stdenv.isDarwin, libGL
+  openglSupport ? !stdenv.hostPlatform.isDarwin, libGL
 }:
 
 stdenv.mkDerivation rec {
@@ -24,19 +24,18 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ pkg-config file ];
 
-  buildInputs = with lib;
-    [ gtk2 fftw ] ++
-    optionals openglSupport [ gnome2.gtkglext libGL ] ++
-    optional openexrSupport openexr ++
-    optional libXmuSupport xorg.libXmu ++
-    optional fitsSupport cfitsio ++
-    optional libpngSupport libpng ++
-    optional libxsltSupport libxslt ++
-    optional libxml2Support libxml2 ++
-    optional libwebpSupport libwebp ++
-    optional zlibSupport zlib ++
-    optional libuniqueSupport libunique ++
-    optional libzipSupport libzip;
+  buildInputs = [ gtk2 fftw ] ++
+    lib.optionals openglSupport [ gnome2.gtkglext libGL ] ++
+    lib.optional openexrSupport openexr ++
+    lib.optional libXmuSupport xorg.libXmu ++
+    lib.optional fitsSupport cfitsio ++
+    lib.optional libpngSupport libpng ++
+    lib.optional libxsltSupport libxslt ++
+    lib.optional libxml2Support libxml2 ++
+    lib.optional libwebpSupport libwebp ++
+    lib.optional zlibSupport zlib ++
+    lib.optional libuniqueSupport libunique ++
+    lib.optional libzipSupport libzip;
 
   # This patch corrects problems with python support, but should apply cleanly
   # regardless of whether python support is enabled, and have no effects if
@@ -59,8 +58,8 @@ stdenv.mkDerivation rec {
     '';
     license = lib.licenses.gpl2;
     platforms = with lib.platforms; linux ++ darwin;
-    maintainers = [ lib.maintainers.cge ];
+    maintainers = [ ];
     # never built on aarch64-darwin since first introduction in nixpkgs
-    broken = stdenv.isDarwin && stdenv.isAarch64;
+    broken = stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64;
   };
 }
diff --git a/pkgs/applications/science/chemistry/jmol/default.nix b/pkgs/applications/science/chemistry/jmol/default.nix
index cba6a40b59923..a48019febb1de 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 = "16.2.17";
+  version = "16.2.21";
   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";
-    hash = "sha256-1iBLLfaoztbphhrG3NVWH+PVSbCZd+HQqvCYF3H9S/E=";
+    hash = "sha256-9gIOrHoy0JyoPXaHOfBDHCL+ykmmHNam+Um12sHqZsE=";
   };
 
   patchPhase = ''
diff --git a/pkgs/applications/science/chemistry/marvin/default.nix b/pkgs/applications/science/chemistry/marvin/default.nix
index 4228e818e4887..e1e911e2d4dfb 100644
--- a/pkgs/applications/science/chemistry/marvin/default.nix
+++ b/pkgs/applications/science/chemistry/marvin/default.nix
@@ -1,14 +1,12 @@
 { lib, stdenv, fetchurl, dpkg, makeWrapper, coreutils, gawk, gnugrep, gnused, openjdk17 }:
 
-with lib;
-
 stdenv.mkDerivation rec {
   pname = "marvin";
   version = "23.17.0";
 
   src = fetchurl {
     name = "marvin-${version}.deb";
-    url = "http://dl.chemaxon.com/marvin/${version}/marvin_linux_${versions.majorMinor version}.deb";
+    url = "http://dl.chemaxon.com/marvin/${version}/marvin_linux_${lib.versions.majorMinor version}.deb";
     hash = "sha256-zE/9EaOsNJwzE4Doasm9N8QG4t7wDOxqpV/Nhc4p7Ws=";
   };
 
@@ -22,7 +20,7 @@ stdenv.mkDerivation rec {
     wrapBin() {
       makeWrapper $1 $out/bin/$(basename $1) \
         --set INSTALL4J_JAVA_HOME "${openjdk17}" \
-        --prefix PATH : ${makeBinPath [ coreutils gawk gnugrep gnused ]}
+        --prefix PATH : ${lib.makeBinPath [ coreutils gawk gnugrep gnused ]}
     }
     cp -r opt $out
     mkdir -p $out/bin $out/share/pixmaps $out/share/applications
@@ -33,12 +31,12 @@ stdenv.mkDerivation rec {
     for name in cxcalc cxtrain evaluate molconvert mview msketch; do
       wrapBin $out/opt/chemaxon/marvinsuite/bin/$name
     done
-    ${concatStrings (map (name: ''
+    ${lib.concatStrings (map (name: ''
       substitute ${./. + "/${name}.desktop"} $out/share/applications/${name}.desktop --subst-var out
     '') [ "LicenseManager" "MarvinSketch" "MarvinView" ])}
   '';
 
-  meta = {
+  meta = with lib; {
     description = "Chemical modelling, analysis and structure drawing program";
     homepage = "https://chemaxon.com/products/marvin";
     maintainers = with maintainers; [ fusion809 ];
diff --git a/pkgs/applications/science/chemistry/nwchem/default.nix b/pkgs/applications/science/chemistry/nwchem/default.nix
index 61266a9f02854..fb24f903f5224 100644
--- a/pkgs/applications/science/chemistry/nwchem/default.nix
+++ b/pkgs/applications/science/chemistry/nwchem/default.nix
@@ -1,6 +1,5 @@
 { lib
 , stdenv
-, pkgs
 , fetchFromGitHub
 , fetchurl
 , mpiCheckPhaseHook
@@ -14,7 +13,6 @@
 , lapack
 , python3
 , tcsh
-, bash
 , automake
 , autoconf
 , libtool
@@ -34,7 +32,7 @@ let
   };
 
   dftd3Src = fetchurl {
-    url = "https://www.chemiebn.uni-bonn.de/pctc/mulliken-center/software/dft-d3/dftd3.tgz";
+    url = "https://www.chemie.uni-bonn.de/grimme/software/dft-d3/dftd3.tgz";
     hash = "sha256-2Xz5dY9hqoH9hUJUSPv0pujOB8EukjZzmDGjrzKID1k=";
   };
 
@@ -47,20 +45,20 @@ let
   plumedSrc = fetchFromGitHub {
     owner = "edoapra";
     repo = "plumed2";
-    rev = "e7c908da50bde1c6399c9f0e445d6ea3330ddd9b";
-    hash = "sha256-CNlb6MTEkD977hj3xonYqZH1/WlQ1EdVD7cvL//heRM=";
+    rev = "88f06db71173e7893713a582e5ada7193e8ae1c9";
+    hash = "sha256-p5XNxHcE/QkJ5WdQH/xPp2EyrqCNjA/w/e1R2fkwYts=";
   };
 
 in
 stdenv.mkDerivation rec {
   pname = "nwchem";
-  version = "7.2.2";
+  version = "7.2.3";
 
   src = fetchFromGitHub {
     owner = "nwchemgit";
     repo = "nwchem";
     rev = "v${version}-release";
-    hash = "sha256-BcYRqPaPR24OTRY0MJgBxi46HvUG4uFaY0unZmu5b9k=";
+    hash = "sha256-2qc4kLb/WmUJuJGonIyS7pgCfyt8yXdcpDAKU0RMY58=";
   };
 
   nativeBuildInputs = [
@@ -166,6 +164,8 @@ stdenv.mkDerivation rec {
   '';
 
   installPhase = ''
+    runHook preInstall
+
     mkdir -p $out/bin $out/share/nwchem
 
     cp $NWCHEM_TOP/bin/LINUX64/nwchem $out/bin/nwchem
@@ -188,6 +188,8 @@ stdenv.mkDerivation rec {
     charmm_s $out/share/nwchem/data/charmm_s/
     charmm_x $out/share/nwchem/data/charmm_x/
     EOF
+
+    runHook postInstall
   '';
 
   doCheck = false;
diff --git a/pkgs/applications/science/chemistry/octopus/default.nix b/pkgs/applications/science/chemistry/octopus/default.nix
index 2e87cf3db51aa..a9b881b2cdc01 100644
--- a/pkgs/applications/science/chemistry/octopus/default.nix
+++ b/pkgs/applications/science/chemistry/octopus/default.nix
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
     owner = "octopus-code";
     repo = "octopus";
     rev = version;
-    sha256 = "sha256-8wZR+bYdxJFsUPMWbIGYxRdNzjLgHm+KFLjY7fSN7io=";
+    hash = "sha256-8wZR+bYdxJFsUPMWbIGYxRdNzjLgHm+KFLjY7fSN7io=";
   };
 
   nativeBuildInputs = [
diff --git a/pkgs/applications/science/chemistry/pymol/default.nix b/pkgs/applications/science/chemistry/pymol/default.nix
index 1733ba2f236c9..295ac7e14cb23 100644
--- a/pkgs/applications/science/chemistry/pymol/default.nix
+++ b/pkgs/applications/science/chemistry/pymol/default.nix
@@ -2,7 +2,6 @@
 , lib
 , fetchFromGitHub
 , makeDesktopItem
-, python3
 , python3Packages
 , netcdf
 , glew
@@ -50,7 +49,7 @@ python3Packages.buildPythonApplication rec {
 
   postPatch = ''
     substituteInPlace setup.py \
-      --replace-fail "self.install_libbase" '"${placeholder "out"}/${python3.sitePackages}"'
+      --replace-fail "self.install_libbase" '"${placeholder "out"}/${python3Packages.python.sitePackages}"'
   '';
 
   build-system = [
@@ -63,10 +62,10 @@ python3Packages.buildPythonApplication rec {
 
   postInstall = with python3Packages; ''
     wrapProgram $out/bin/pymol \
-      --prefix PYTHONPATH : ${lib.makeSearchPathOutput "lib" python3.sitePackages [ pyqt5 pyqt5.pyqt5-sip ]}
+      --prefix PYTHONPATH : ${lib.makeSearchPathOutput "lib" python3Packages.python.sitePackages [ pyqt5 pyqt5.pyqt5-sip ]}
 
     mkdir -p "$out/share/icons/"
-    ln -s $out/${python3.sitePackages}/pymol/pymol_path/data/pymol/icons/icon2.svg "$out/share/icons/pymol.svg"
+    ln -s $out/${python3Packages.python.sitePackages}/pymol/pymol_path/data/pymol/icons/icon2.svg "$out/share/icons/pymol.svg"
   '' + lib.optionalString stdenv.hostPlatform.isLinux ''
     cp -r "${desktopItem}/share/applications/" "$out/share/"
   '';
diff --git a/pkgs/applications/science/chemistry/quantum-espresso/default.nix b/pkgs/applications/science/chemistry/quantum-espresso/default.nix
index 2c565cb5db9f0..2156c1d269691 100644
--- a/pkgs/applications/science/chemistry/quantum-espresso/default.nix
+++ b/pkgs/applications/science/chemistry/quantum-espresso/default.nix
@@ -4,7 +4,6 @@
 , fetchFromGitHub
 , git
 , cmake
-, gnum4
 , gfortran
 , pkg-config
 , fftw
diff --git a/pkgs/applications/science/chemistry/wxmacmolplt/default.nix b/pkgs/applications/science/chemistry/wxmacmolplt/default.nix
index ae6c0df879056..0ec45053bf67c 100644
--- a/pkgs/applications/science/chemistry/wxmacmolplt/default.nix
+++ b/pkgs/applications/science/chemistry/wxmacmolplt/default.nix
@@ -7,6 +7,7 @@
 , pkg-config
 , xorg
 , autoreconfHook
+, wrapGAppsHook4
 }:
 
 stdenv.mkDerivation rec {
@@ -20,7 +21,7 @@ stdenv.mkDerivation rec {
     hash = "sha256-gFGstyq9bMmBaIS4QE6N3EIC9GxRvyJYUr8DUvwRQBc=";
   };
 
-  nativeBuildInputs = [ pkg-config autoreconfHook ];
+  nativeBuildInputs = [ pkg-config autoreconfHook wrapGAppsHook4 ];
   buildInputs = [
     wxGTK32
     libGL
diff --git a/pkgs/applications/science/computer-architecture/accelergy/default.nix b/pkgs/applications/science/computer-architecture/accelergy/default.nix
index 9eb6f341b714d..42609ada09a38 100644
--- a/pkgs/applications/science/computer-architecture/accelergy/default.nix
+++ b/pkgs/applications/science/computer-architecture/accelergy/default.nix
@@ -1,4 +1,4 @@
-{ lib, fetchFromGitHub, python3Packages, pkgs }:
+{ lib, fetchFromGitHub, python3Packages }:
 
 python3Packages.buildPythonApplication rec {
   pname = "accelergy";
diff --git a/pkgs/applications/science/computer-architecture/timeloop/default.nix b/pkgs/applications/science/computer-architecture/timeloop/default.nix
index ec8ec3ed8abc6..3a70478262d55 100644
--- a/pkgs/applications/science/computer-architecture/timeloop/default.nix
+++ b/pkgs/applications/science/computer-architecture/timeloop/default.nix
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
     yaml-cpp
     ncurses
     accelergy
-   ] ++ lib.optionals stdenv.isLinux [ gpm ];
+   ] ++ lib.optionals stdenv.hostPlatform.isLinux [ gpm ];
 
   preConfigure = ''
     cp -r ./pat-public/src/pat ./src/pat
@@ -41,10 +41,6 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  #link-time optimization fails on darwin
-  #see https://github.com/NixOS/nixpkgs/issues/19098
-  env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-fno-lto";
-
   postPatch = ''
     # Fix gcc-13 build failure due to missing includes:
     sed -e '1i #include <cstdint>' -i \
@@ -54,7 +50,7 @@ stdenv.mkDerivation rec {
     substituteInPlace ./SConstruct \
       --replace-fail "env.Replace(AR = \"gcc-ar\")" "pass" \
       --replace-fail "env.Replace(RANLIB = \"gcc-ranlib\")" "pass"
-    '' + lib.optionalString stdenv.isDarwin ''
+    '' + lib.optionalString stdenv.hostPlatform.isDarwin ''
     # prevent clang from dying on errors that gcc is fine with
     substituteInPlace ./src/SConscript --replace "-Werror" "-Wno-inconsistent-missing-override"
 
@@ -80,7 +76,7 @@ stdenv.mkDerivation rec {
   sconsFlags =
     # will fail on clang/darwin on link without --static due to undefined extern
     # however, will fail with static on linux as nixpkgs deps aren't static
-    lib.optional stdenv.isDarwin "--static"
+    lib.optional stdenv.hostPlatform.isDarwin "--static"
     ++ lib.optional enableAccelergy "--accelergy"
     ++ lib.optional enableISL "--with-isl";
 
diff --git a/pkgs/applications/science/electronics/caneda/default.nix b/pkgs/applications/science/electronics/caneda/default.nix
index 4a4cf61c7f658..7eac675eca4e6 100644
--- a/pkgs/applications/science/electronics/caneda/default.nix
+++ b/pkgs/applications/science/electronics/caneda/default.nix
@@ -19,7 +19,7 @@ mkDerivation rec {
     mainProgram = "caneda";
     homepage = "http://caneda.org";
     license = lib.licenses.gpl2Plus;
-    maintainers = with lib.maintainers; [viric];
+    maintainers = [ ];
     platforms = with lib.platforms; linux;
   };
 }
diff --git a/pkgs/applications/science/electronics/dataexplorer/default.nix b/pkgs/applications/science/electronics/dataexplorer/default.nix
deleted file mode 100644
index 224d804ee1f69..0000000000000
--- a/pkgs/applications/science/electronics/dataexplorer/default.nix
+++ /dev/null
@@ -1,82 +0,0 @@
-{ lib
-, stdenv
-, fetchurl
-, ant
-, jdk
-, makeWrapper
-, strip-nondeterminism
-}:
-
-stdenv.mkDerivation (finalAttrs: {
-  pname = "dataexplorer";
-  version = "3.8.5";
-
-  src = fetchurl {
-    url = "mirror://savannah/dataexplorer/dataexplorer-${finalAttrs.version}-src.tar.gz";
-    hash = "sha256-b68xIZNbzHdPyZwLngcnjcoBtI6AeTdrblz/qx/HbGQ=";
-  };
-
-  nativeBuildInputs = [
-    ant
-    jdk
-    makeWrapper
-    strip-nondeterminism
-  ];
-
-  buildPhase = ''
-    runHook preBuild
-    ant -f build/build.xml dist
-    runHook postBuild
-  '';
-
-  doCheck = false;
-  # Missing dependencies (e.g. junit). Does not work.
-  #checkPhase = ''
-  #  ant -f build/build.xml check
-  #'';
-
-  installPhase = ''
-    runHook preInstall
-
-    ant -Dprefix=$out/share/ -f build/build.xml install
-
-    # The sources contain a wrapper script in $out/share/DataExplorer/DataExplorer
-    # but it hardcodes bash shebang and does not pin the java path.
-    # So we create our own wrapper, using similar cmdline args as upstream.
-    mkdir -p $out/bin
-    makeWrapper ${jdk}/bin/java $out/bin/DataExplorer \
-      --add-flags "-Xms64m -Xmx3092m -jar $out/share/DataExplorer/DataExplorer.jar" \
-      --set SWT_GTK3 0
-
-    makeWrapper ${jdk}/bin/java $out/bin/DevicePropertiesEditor \
-      --add-flags "-Xms32m -Xmx512m -classpath $out/share/DataExplorer/DataExplorer.jar gde.ui.dialog.edit.DevicePropertiesEditor" \
-      --set SWT_GTK3 0 \
-      --set LIBOVERLAY_SCROLLBAR 0
-
-    install -Dvm644 build/misc/GNU_LINUX_JUNSI_ICHARER_USB_UDEV_RULE/50-Junsi-iCharger-USB.rules \
-      $out/etc/udev/rules.d/50-Junsi-iCharger-USB.rules
-    install -Dvm644 build/misc/GNU_LINUX_SKYRC_UDEV_RULE/50-SkyRC-Charger.rules \
-      $out/etc/udev/rules.d/50-SkyRC-Charger.rules
-
-    runHook postInstall
-  '';
-
-  # manually call strip-nondeterminism because using stripJavaArchivesHook takes
-  # too long to strip bundled jars
-  postFixup = ''
-    strip-nondeterminism --type jar $out/share/DataExplorer/{DataExplorer.jar,devices/*.jar}
-  '';
-
-  meta = with lib; {
-    description = "Graphical tool to analyze data, gathered from various hardware devices";
-    homepage = "https://www.nongnu.org/dataexplorer/index.html";
-    license = licenses.gpl3Plus;
-    maintainers = with maintainers; [ panicgh ];
-    platforms = [ "x86_64-linux" ];
-    sourceProvenance = with sourceTypes; [
-      fromSource
-      binaryNativeCode  # contains RXTXcomm (JNI library with *.so files)
-      binaryBytecode    # contains thirdparty jar files, e.g. javax.json, org.glassfish.json
-    ];
-  };
-})
diff --git a/pkgs/applications/science/electronics/digital/default.nix b/pkgs/applications/science/electronics/digital/default.nix
index 7619e43e80332..a929b962481b0 100644
--- a/pkgs/applications/science/electronics/digital/default.nix
+++ b/pkgs/applications/science/electronics/digital/default.nix
@@ -5,8 +5,8 @@
 let
   pname = "digital";
   pkgDescription = "A digital logic designer and circuit simulator.";
-  version = "0.30";
-  buildDate = "2023-02-03T08:00:56+01:00"; # v0.30 commit date
+  version = "0.31";
+  buildDate = "2024-09-03T14:02:31+02:00"; # v0.31 commit date
 
   desktopItem = makeDesktopItem {
     type = "Application";
@@ -35,7 +35,7 @@ maven.buildMavenPackage rec {
     owner = "hneemann";
     repo = "Digital";
     rev = "v${version}";
-    hash = "sha256-cDykYlcFvDLFBy9UnX07iCR2LCq28SNU+h9vRT/AoJM=";
+    hash = "sha256-6XaM3U1x/yvoCrkJ2nMtBmj972gCFlWn3F4DM7TLWgw=";
   };
 
   inherit mvnParameters;
@@ -71,7 +71,7 @@ maven.buildMavenPackage rec {
     description = pkgDescription;
     mainProgram = "digital";
     license = licenses.gpl3Only;
-    platforms = [ "x86_64-linux" "x86_64-darwin" ];
+    platforms = platforms.all;
     maintainers = with maintainers; [ Dettorer ];
   };
 }
diff --git a/pkgs/applications/science/electronics/diylc/default.nix b/pkgs/applications/science/electronics/diylc/default.nix
index ced8c72d2155d..072faf3a8a5b9 100644
--- a/pkgs/applications/science/electronics/diylc/default.nix
+++ b/pkgs/applications/science/electronics/diylc/default.nix
@@ -73,6 +73,6 @@ stdenv.mkDerivation rec {
     license = licenses.gpl3Plus;
     sourceProvenance = with sourceTypes; [ binaryBytecode ];
     platforms = platforms.linux;
-    maintainers = with maintainers; [ ];
+    maintainers = [ ];
   };
 }
diff --git a/pkgs/applications/science/electronics/dsview/default.nix b/pkgs/applications/science/electronics/dsview/default.nix
index 5d6c83f5dfaa1..48a94468ef0b2 100644
--- a/pkgs/applications/science/electronics/dsview/default.nix
+++ b/pkgs/applications/science/electronics/dsview/default.nix
@@ -21,12 +21,12 @@ stdenv.mkDerivation rec {
   ];
 
   nativeBuildInputs = [ cmake pkg-config wrapQtAppsHook ]
-    ++ lib.optional stdenv.isDarwin desktopToDarwinBundle;
+    ++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle;
 
   buildInputs = [
     boost fftw qtbase qtsvg libusb1 libzip
     python3
-  ] ++ lib.optional stdenv.isLinux qtwayland;
+  ] ++ lib.optional stdenv.hostPlatform.isLinux qtwayland;
 
   meta = with lib; {
     description = "GUI program for supporting various instruments from DreamSourceLab, including logic analyzer, oscilloscope, etc";
diff --git a/pkgs/applications/science/electronics/dwfv/default.nix b/pkgs/applications/science/electronics/dwfv/default.nix
deleted file mode 100644
index 415cc29812d3d..0000000000000
--- a/pkgs/applications/science/electronics/dwfv/default.nix
+++ /dev/null
@@ -1,21 +0,0 @@
-{ lib, rustPlatform, fetchCrate }:
-
-rustPlatform.buildRustPackage rec {
-  pname = "dwfv";
-  version = "0.4.1";
-
-  src = fetchCrate {
-    inherit version pname;
-    sha256 = "0xxgwbbbzaldbl04k5ksk61wa6i4f9mc84q04ljg438z0k8q6cr7";
-  };
-
-  cargoSha256 = "1z51yx3psdxdzmwny0rzlch5hjx2pssll73q79qij2bc7wgyjscy";
-
-  meta = with lib; {
-    description = "Simple digital waveform viewer with vi-like key bindings";
-    mainProgram = "dwfv";
-    homepage = "https://github.com/psurply/dwfv";
-    license = licenses.mit;
-    maintainers = with maintainers; [ newam ];
-  };
-}
diff --git a/pkgs/applications/science/electronics/flopoco/default.nix b/pkgs/applications/science/electronics/flopoco/default.nix
index 2da80512e2b2c..ef6f297c63ccc 100644
--- a/pkgs/applications/science/electronics/flopoco/default.nix
+++ b/pkgs/applications/science/electronics/flopoco/default.nix
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
     repo = pname;
     # flopoco-4.1.3 is not tagged on GitLab
     rev = "67598298207c9f3261c35679c8a5966480c4343c";
-    sha256 = "sha256-0jRjg4/qciqBcjsi6BTbKO4VJkcoEzpC98wFkUOIGbI=";
+    hash = "sha256-0jRjg4/qciqBcjsi6BTbKO4VJkcoEzpC98wFkUOIGbI=";
   };
 
   patches = [
@@ -45,7 +45,7 @@ stdenv.mkDerivation rec {
     })
   ];
 
-  postPatch = lib.optionalString (stdenv.isDarwin && stdenv.isx86_64) ''
+  postPatch = lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) ''
     sed -i "s/-pg//g" {,src/Apps/TaMaDi/}CMakeLists.txt
   '';
 
@@ -54,12 +54,12 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [
     bison
     cmake
+    flex
     installShellFiles
   ];
 
   buildInputs = [
     boost
-    flex
     gmp
     libxml2
     mpfi
diff --git a/pkgs/applications/science/electronics/fped/default.nix b/pkgs/applications/science/electronics/fped/default.nix
index edfe34c0e25e8..e3984dba77d8d 100644
--- a/pkgs/applications/science/electronics/fped/default.nix
+++ b/pkgs/applications/science/electronics/fped/default.nix
@@ -3,7 +3,6 @@
 , pkg-config
 }:
 
-with lib;
 stdenv.mkDerivation {
   pname = "fped";
   version = "unstable-2017-05-11";
@@ -39,7 +38,7 @@ stdenv.mkDerivation {
     gtk2
   ];
 
-  meta = {
+  meta = with lib; {
     description = "Editor that allows the interactive creation of footprints electronic components";
     mainProgram = "fped";
     homepage = "http://projects.qi-hardware.com/index.php/p/fped/";
diff --git a/pkgs/applications/science/electronics/fritzing/default.nix b/pkgs/applications/science/electronics/fritzing/default.nix
index 9eb7b50445020..04ca24861c0d8 100644
--- a/pkgs/applications/science/electronics/fritzing/default.nix
+++ b/pkgs/applications/science/electronics/fritzing/default.nix
@@ -60,7 +60,7 @@ stdenv.mkDerivation {
     quazip
     libngspice
     clipper
-  ] ++ lib.optionals stdenv.isLinux [
+  ] ++ lib.optionals stdenv.hostPlatform.isLinux [
     qtwayland
   ];
 
@@ -93,7 +93,7 @@ stdenv.mkDerivation {
     "phoenix.pro"
   ];
 
-  postInstall = lib.optionalString stdenv.isDarwin ''
+  postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
     mkdir $out/Applications
     mv $out/bin/Fritzing.app $out/Applications/Fritzing.app
     cp FritzingInfo.plist $out/Applications/Fritzing.app/Contents/Info.plist
diff --git a/pkgs/applications/science/electronics/gtkwave/default.nix b/pkgs/applications/science/electronics/gtkwave/default.nix
index d28a5cf809065..5649b6bb5a77f 100644
--- a/pkgs/applications/science/electronics/gtkwave/default.nix
+++ b/pkgs/applications/science/electronics/gtkwave/default.nix
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ pkg-config wrapGAppsHook3 ];
   buildInputs = [ bzip2 glib gperf gtk3 judy tcl tk xz ]
-    ++ lib.optional stdenv.isDarwin gtk-mac-integration;
+    ++ lib.optional stdenv.hostPlatform.isDarwin gtk-mac-integration;
 
   # fix compilation under Darwin
   # remove these patches upon next release
diff --git a/pkgs/applications/science/electronics/hal-hardware-analyzer/default.nix b/pkgs/applications/science/electronics/hal-hardware-analyzer/default.nix
index c193352eb4559..acf52931c7ed7 100644
--- a/pkgs/applications/science/electronics/hal-hardware-analyzer/default.nix
+++ b/pkgs/applications/science/electronics/hal-hardware-analyzer/default.nix
@@ -38,7 +38,7 @@ let
         hash = "sha256-adU5SctH+H54UaAmr5BZInytD3wjUzLtQbCwngAWs4o=";
       })
     ];
-    postPatch = prev.postPatch + lib.optionalString stdenv.isAarch64 ''
+    postPatch = prev.postPatch + lib.optionalString stdenv.hostPlatform.isAarch64 ''
       # https://github.com/igraph/igraph/issues/1694
       substituteInPlace tests/CMakeLists.txt \
         --replace "igraph_scg_grouping3" "" \
@@ -136,7 +136,7 @@ in stdenv.mkDerivation rec {
   cmakeBuildType = "MinSizeRel";
 
   # some plugins depend on other plugins and need to be able to load them
-  postFixup = lib.optionalString stdenv.isLinux ''
+  postFixup = lib.optionalString stdenv.hostPlatform.isLinux ''
     find $out/lib/hal_plugins -name '*.so*' | while read -r f ; do
       patchelf --set-rpath "$(patchelf --print-rpath "$f"):$out/lib/hal_plugins" "$f"
     done
diff --git a/pkgs/applications/science/electronics/horizon-eda/base.nix b/pkgs/applications/science/electronics/horizon-eda/base.nix
index 0292ee493a829..d39fc83823a23 100644
--- a/pkgs/applications/science/electronics/horizon-eda/base.nix
+++ b/pkgs/applications/science/electronics/horizon-eda/base.nix
@@ -1,4 +1,5 @@
 { lib
+, cmake
 , cppzmq
 , curl
 , fetchFromGitHub
@@ -9,6 +10,8 @@
 , libgit2
 , librsvg
 , libuuid
+, meson
+, ninja
 , opencascade-occt_7_6
 , pkg-config
 , podofo
@@ -20,16 +23,19 @@ in
 # This base is used in horizon-eda and python3Packages.horizon-eda
 rec {
   pname = "horizon-eda";
-  version = "2.5.0";
+  version = "2.6.0";
 
   src = fetchFromGitHub {
     owner = "horizon-eda";
     repo = "horizon";
     rev = "v${version}";
-    hash = "sha256-UcjbDJR6shyETpanNkRoH8LF8r6gFjsyNHVSCMHKqS8=";
+    hash = "sha256-0ikCR10r/WPb+H+Ut2GO6y4A/9bctJLanL/RR4r9GWs=";
   };
 
   nativeBuildInputs = [
+    meson
+    ninja
+    cmake
     pkg-config
   ];
 
diff --git a/pkgs/applications/science/electronics/kicad/base.nix b/pkgs/applications/science/electronics/kicad/base.nix
index b5f721c3d772d..3d39261bc7a52 100644
--- a/pkgs/applications/science/electronics/kicad/base.nix
+++ b/pkgs/applications/science/electronics/kicad/base.nix
@@ -39,7 +39,7 @@
 , pcre2
 , libdeflate
 
-, swig4
+, swig
 , python
 , wxPython
 , opencascade-occt_7_6
@@ -137,7 +137,7 @@ stdenv.mkDerivation rec {
   ]
   # wanted by configuration on linux, doesn't seem to affect performance
   # no effect on closure size
-  ++ optionals (stdenv.isLinux) [
+  ++ optionals (stdenv.hostPlatform.isLinux) [
     util-linux
     libselinux
     libsepol
@@ -168,7 +168,7 @@ stdenv.mkDerivation rec {
     curl
     openssl
     boost
-    swig4
+    swig
     python
     unixODBC
     libdeflate
diff --git a/pkgs/applications/science/electronics/kicad/default.nix b/pkgs/applications/science/electronics/kicad/default.nix
index 1cec011fae33f..a5cceb492522e 100644
--- a/pkgs/applications/science/electronics/kicad/default.nix
+++ b/pkgs/applications/science/electronics/kicad/default.nix
@@ -7,7 +7,7 @@
 , callPackage
 , callPackages
 
-, gnome
+, adwaita-icon-theme
 , dconf
 , gtk3
 , wxGTK32
@@ -22,7 +22,7 @@
 , pname ? "kicad"
 , stable ? true
 , testing ? false
-, withNgspice ? !stdenv.isDarwin
+, withNgspice ? !stdenv.hostPlatform.isDarwin
 , libngspice
 , withScripting ? true
 , python3
@@ -197,7 +197,7 @@ stdenv.mkDerivation rec {
   makeWrapperArgs = with passthru.libraries; [
     "--prefix XDG_DATA_DIRS : ${base}/share"
     "--prefix XDG_DATA_DIRS : ${hicolor-icon-theme}/share"
-    "--prefix XDG_DATA_DIRS : ${gnome.adwaita-icon-theme}/share"
+    "--prefix XDG_DATA_DIRS : ${adwaita-icon-theme}/share"
     "--prefix XDG_DATA_DIRS : ${gtk3}/share/gsettings-schemas/${gtk3.name}"
     "--prefix XDG_DATA_DIRS : ${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}"
     # wrapGAppsHook3 did these two as well, no idea if it matters...
@@ -234,7 +234,7 @@ 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";
+      bin = if stdenv.hostPlatform.isDarwin then "*.app/Contents/MacOS" else "bin";
       tools = [ "kicad" "pcbnew" "eeschema" "gerbview" "pcb_calculator" "pl_editor" "bitmap2component" ];
       utils = [ "dxf2idf" "idf2vrml" "idfcyl" "idfrect" "kicad-cli" ];
     in
@@ -286,7 +286,7 @@ stdenv.mkDerivation rec {
     license = lib.licenses.gpl3Plus;
     maintainers = with lib.maintainers; [ evils ];
     platforms = lib.platforms.all;
-    broken = stdenv.isDarwin;
+    broken = stdenv.hostPlatform.isDarwin;
     mainProgram = "kicad";
   };
 }
diff --git a/pkgs/applications/science/electronics/kicad/libraries.nix b/pkgs/applications/science/electronics/kicad/libraries.nix
index 327f77d1c42fa..4a3e40a3166d2 100644
--- a/pkgs/applications/science/electronics/kicad/libraries.nix
+++ b/pkgs/applications/science/electronics/kicad/libraries.nix
@@ -1,6 +1,5 @@
 { lib, stdenv
 , cmake
-, gettext
 , libSrc
 , stepreduce
 , parallel
diff --git a/pkgs/applications/science/electronics/kicad/versions.nix b/pkgs/applications/science/electronics/kicad/versions.nix
index b3ddbd5b604fe..b76db0040088d 100644
--- a/pkgs/applications/science/electronics/kicad/versions.nix
+++ b/pkgs/applications/science/electronics/kicad/versions.nix
@@ -3,23 +3,23 @@
 {
   "kicad" = {
     kicadVersion = {
-      version =			"8.0.3";
+      version =			"8.0.5";
       src = {
-        rev =			"8ba5ba46af8502ea7a7d2a9754363167c2742399";
-        sha256 =		"0hafvcjjwylgcpgyyasmb2q210k82wvcswvgjvwwh76bwshwcpwa";
+        rev =			"1413b8bfab256aa09ae3f23027b9ffe278161ca6";
+        sha256 =		"1g0w3g1gq6p72gg0jikdrh5mczcv5y16jmqi79bkp6nfl8gbx4l5";
       };
     };
     libVersion = {
-      version =			"8.0.3";
+      version =			"8.0.5";
       libSources = {
-        symbols.rev =		"2bc103c46a8daacbba2cded8b9f095b330ba928d";
-        symbols.sha256 =	"1za0spq09bbj7xwfwr1abmwjnqfd3zx0crayaz7915ja0ifi75hd";
-        templates.rev =		"0f57b59d365d1f8b8fdd0745e10beb035e88ba37";
+        symbols.rev =		"3bd95a02b135941ba00e5e4671e7c3ebc7672db4";
+        symbols.sha256 =	"12v8g48fgbalp0xrlgn3vm3ld79ymmwccv5aib6jz2qycdjxmznf";
+        templates.rev =		"4644b7570ba73dfe03a06a674c98d3fe2a7fe1e4";
         templates.sha256 =	"03idwrk3vj9h2az8j8lqpbdbnfxdbkzh4db68kq3644yj3cnlcza";
-        footprints.rev =	"539ffd8c0898ad8c8c51c2ab85ba56bfd77271c7";
-        footprints.sha256 =	"0ik4hjl5m65wnpaymg58zbvsfvchhyq5x3psvj6005mgv2hrican";
-        packages3d.rev =	"3172a1cc0931c1734efad68623374d5277f8ab60";
-        packages3d.sha256 =	"1yjlg7cxwhlzcdbxjqyqamr140sz8gvzi63k2401mhdbh88c9kii";
+        footprints.rev =	"4d2be8bf917b9c31f0510fa953532b88ef8b8be8";
+        footprints.sha256 =	"0ixfiraahi09gvszzxsdz21mdr9wsxyby5qp3n57pzid42gs35a1";
+        packages3d.rev =	"2f3ea516116cc553c9d488424fbb196f4e65ef29";
+        packages3d.sha256 =	"03yicqv36zx0wrb0njpkk45l4ysvv3dlsjlpi4j8j75gla060mai";
       };
     };
   };
diff --git a/pkgs/applications/science/electronics/kingstvis/default.nix b/pkgs/applications/science/electronics/kingstvis/default.nix
index 3699aebbbff0e..0a39c66bc662a 100644
--- a/pkgs/applications/science/electronics/kingstvis/default.nix
+++ b/pkgs/applications/science/electronics/kingstvis/default.nix
@@ -6,7 +6,6 @@
 , glib
 , lib
 , libGL
-, stdenv
 , xkeyboard_config
 , xorg
 , zlib
diff --git a/pkgs/applications/science/electronics/librepcb/default.nix b/pkgs/applications/science/electronics/librepcb/default.nix
index cff52d67dc477..061043a67d411 100644
--- a/pkgs/applications/science/electronics/librepcb/default.nix
+++ b/pkgs/applications/science/electronics/librepcb/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     owner  = pname;
     repo   = pname;
     rev    = version;
-    sha256 = "sha256-Vyp7asVqvKFkkEb67LXapMkT1AQSburN3+B2dXIPcEU=";
+    hash = "sha256-Vyp7asVqvKFkkEb67LXapMkT1AQSburN3+B2dXIPcEU=";
     fetchSubmodules = true;
   };
 
diff --git a/pkgs/applications/science/electronics/magic-vlsi/default.nix b/pkgs/applications/science/electronics/magic-vlsi/default.nix
deleted file mode 100644
index 0be742f76e3c6..0000000000000
--- a/pkgs/applications/science/electronics/magic-vlsi/default.nix
+++ /dev/null
@@ -1,55 +0,0 @@
-{ lib, stdenv
-, fetchurl
-, python3
-, m4
-, cairo
-, libX11
-, mesa_glu
-, ncurses
-, tcl
-, tcsh
-, tk
-}:
-
-stdenv.mkDerivation rec {
-  pname = "magic-vlsi";
-  version = "8.3.483";
-
-  src = fetchurl {
-    url    = "http://opencircuitdesign.com/magic/archive/magic-${version}.tgz";
-    sha256 = "sha256-JyawlH/zUTJ7fGf63zHvZ3q8AYRwFELwh+63RN9IkBA=";
-  };
-
-  nativeBuildInputs = [ python3 ];
-  buildInputs = [
-    cairo
-    libX11
-    m4
-    mesa_glu
-    ncurses
-    tcl
-    tcsh
-    tk
-  ];
-
-  enableParallelBuilding = true;
-
-  configureFlags = [
-    "--with-tcl=${tcl}"
-    "--with-tk=${tk}"
-    "--disable-werror"
-  ];
-
-  postPatch = ''
-    patchShebangs scripts/*
-  '';
-
-  env.NIX_CFLAGS_COMPILE = "-Wno-implicit-function-declaration";
-
-  meta = with lib; {
-    description = "VLSI layout tool written in Tcl";
-    homepage    = "http://opencircuitdesign.com/magic/";
-    license     = licenses.mit;
-    maintainers = with maintainers; [ thoughtpolice AndersonTorres ];
-  };
-}
diff --git a/pkgs/applications/science/electronics/nanovna-saver/default.nix b/pkgs/applications/science/electronics/nanovna-saver/default.nix
index dd58794ed182c..1f483034d2b19 100644
--- a/pkgs/applications/science/electronics/nanovna-saver/default.nix
+++ b/pkgs/applications/science/electronics/nanovna-saver/default.nix
@@ -1,25 +1,28 @@
 {
   lib,
+  stdenv,
   python3,
   fetchFromGitHub,
   qt6,
 }:
 python3.pkgs.buildPythonApplication rec {
   pname = "nanovna-saver";
-  version = "0.6.3";
+  version = "0.6.4";
 
   src = fetchFromGitHub {
     owner = "NanoVNA-Saver";
     repo = pname;
     rev = "refs/tags/v${version}";
-    sha256 = "sha256-lL6n3hcsIbLmrRKPi/ckWW2XUAtmBqvMSplkWOF4VKQ=";
+    sha256 = "sha256-fAVsjknhLhsrGdHu2Q6JWLoFoxZoc+wDCNja+ySCsR4=";
   };
 
-   nativeBuildInputs = [
+  nativeBuildInputs = [
     qt6.wrapQtAppsHook
     qt6.qtbase
   ];
 
+  buildInputs = lib.optional stdenv.hostPlatform.isLinux qt6.qtwayland;
+
   propagatedBuildInputs = with python3.pkgs; [
     cython
     scipy
diff --git a/pkgs/applications/science/electronics/nvc/default.nix b/pkgs/applications/science/electronics/nvc/default.nix
index 62b62ff15faae..0c557fbeca3e1 100644
--- a/pkgs/applications/science/electronics/nvc/default.nix
+++ b/pkgs/applications/science/electronics/nvc/default.nix
@@ -15,13 +15,13 @@
 
 stdenv.mkDerivation rec {
   pname = "nvc";
-  version = "1.12.2";
+  version = "1.14.0";
 
   src = fetchFromGitHub {
     owner = "nickg";
     repo = "nvc";
     rev = "r${version}";
-    hash = "sha256-9nqho+iDqy8oQLSxBppXoafzEuS6AkcUuqEY3xxfFs4=";
+    hash = "sha256-xaJt3zMAv+Op7cQAaKJOyI28oEssMw/7zvEnfReS4aw=";
   };
 
   nativeBuildInputs = [
diff --git a/pkgs/applications/science/electronics/openboardview/default.nix b/pkgs/applications/science/electronics/openboardview/default.nix
index 4aa9ab2b66f29..a3a906c25c2b4 100644
--- a/pkgs/applications/science/electronics/openboardview/default.nix
+++ b/pkgs/applications/science/electronics/openboardview/default.nix
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
     owner = "OpenBoardView";
     repo = "OpenBoardView";
     rev = version;
-    sha256 = "sha256-sKDDOPpCagk7rBRlMlZhx+RYYbtoLzJsrnL8qKZMKW8=";
+    hash = "sha256-sKDDOPpCagk7rBRlMlZhx+RYYbtoLzJsrnL8qKZMKW8=";
     fetchSubmodules = true;
   };
 
@@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
   ];
 
   nativeBuildInputs = [ cmake pkg-config python3 wrapGAppsHook3 ];
-  buildInputs = [ SDL2 fontconfig gtk3 ] ++ lib.optionals stdenv.isDarwin [
+  buildInputs = [ SDL2 fontconfig gtk3 ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
     Cocoa
   ];
 
@@ -53,10 +53,10 @@ stdenv.mkDerivation rec {
   ];
 
   dontWrapGApps = true;
-  postFixup = lib.optionalString stdenv.isDarwin ''
+  postFixup = lib.optionalString stdenv.hostPlatform.isDarwin ''
       mkdir -p "$out/Applications"
       mv "$out/openboardview.app" "$out/Applications/OpenBoardView.app"
-  '' + lib.optionalString (!stdenv.isDarwin) ''
+  '' + lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
       wrapGApp "$out/bin/${pname}" \
         --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ gtk3 ]}
   '';
diff --git a/pkgs/applications/science/electronics/openroad/default.nix b/pkgs/applications/science/electronics/openroad/default.nix
index 16659892a6ee7..65bf094c2a2c1 100644
--- a/pkgs/applications/science/electronics/openroad/default.nix
+++ b/pkgs/applications/science/electronics/openroad/default.nix
@@ -8,14 +8,13 @@
 , flex
 , git
 , python3
-, swig4
+, swig
 , boost179
 , cbc       # for clp
 , cimg
 , clp       # for or-tools
 , eigen
 , glpk
-, gtest
 , lcov
 , lemon-graph
 , libjpeg
@@ -52,7 +51,7 @@ mkDerivation rec {
     flex
     git
     pkg-config
-    swig4
+    swig
   ];
 
   buildInputs = [
diff --git a/pkgs/applications/science/electronics/picoscope/default.nix b/pkgs/applications/science/electronics/picoscope/default.nix
index 3aa5cb22aa52c..27e527a01d876 100644
--- a/pkgs/applications/science/electronics/picoscope/default.nix
+++ b/pkgs/applications/science/electronics/picoscope/default.nix
@@ -15,13 +15,12 @@
 ] }:
 
 let
-  shared_meta = lib:
-    with lib; {
-      homepage = "https://www.picotech.com/downloads/linux";
-      maintainers = with maintainers; [ expipiplus1 wirew0rm ] ++ teams.lumiguide.members;
-      platforms = [ "x86_64-linux" ];
-      license = licenses.unfree;
-    };
+  shared_meta = lib: {
+    homepage = "https://www.picotech.com/downloads/linux";
+    maintainers = with lib.maintainers; [ expipiplus1 wirew0rm ] ++ lib.teams.lumiguide.members;
+    platforms = [ "x86_64-linux" ];
+    license = lib.licenses.unfree;
+  };
 
   libpicoipp = callPackage ({ stdenv, lib, fetchurl, autoPatchelfHook, dpkg }:
     stdenv.mkDerivation rec {
@@ -39,11 +38,10 @@ let
         install -Dt $out/usr/share/doc/libpicoipp usr/share/doc/libpicoipp/copyright
         runHook postInstall
       '';
-      meta = with lib;
-        shared_meta lib // {
-          sourceProvenance = with sourceTypes; [ binaryNativeCode ];
-          description = "library for picotech oscilloscope software";
-        };
+      meta = shared_meta lib // {
+        sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
+        description = "library for picotech oscilloscope software";
+      };
     }) { };
 
   # If we don't have a platform available, put a dummy version here, so at
diff --git a/pkgs/applications/science/electronics/pulseview/default.nix b/pkgs/applications/science/electronics/pulseview/default.nix
index b6d40a19a14bd..3a40b107817db 100644
--- a/pkgs/applications/science/electronics/pulseview/default.nix
+++ b/pkgs/applications/science/electronics/pulseview/default.nix
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
     pkg-config
     qttools
     wrapQtAppsHook
-  ] ++ lib.optional stdenv.isDarwin desktopToDarwinBundle;
+  ] ++ lib.optional stdenv.hostPlatform.isDarwin desktopToDarwinBundle;
 
   buildInputs = [
     glib
@@ -51,7 +51,7 @@ stdenv.mkDerivation rec {
     pcre
     python3
     qtsvg
-  ] ++ lib.optionals stdenv.isLinux [ bluez ];
+  ] ++ lib.optionals stdenv.hostPlatform.isLinux [ bluez ];
 
   meta = with lib; {
     description = "Qt-based LA/scope/MSO GUI for sigrok (a signal analysis software suite)";
diff --git a/pkgs/applications/science/electronics/sv-lang/default.nix b/pkgs/applications/science/electronics/sv-lang/default.nix
index 58ecf986cf7a2..928cf3059385e 100644
--- a/pkgs/applications/science/electronics/sv-lang/default.nix
+++ b/pkgs/applications/science/electronics/sv-lang/default.nix
@@ -62,7 +62,7 @@ stdenv.mkDerivation rec {
 
   # TODO: a mysterious linker error occurs when building the unittests on darwin.
   # The error occurs when using catch2_3 in nixpkgs, not when fetching catch2_3 using CMake
-  doCheck = !stdenv.isDarwin;
+  doCheck = !stdenv.hostPlatform.isDarwin;
 
   meta = with lib; {
     description = "SystemVerilog compiler and language services";
diff --git a/pkgs/applications/science/electronics/systemc/default.nix b/pkgs/applications/science/electronics/systemc/default.nix
index 8e47ef9606566..089ccd85c0331 100644
--- a/pkgs/applications/science/electronics/systemc/default.nix
+++ b/pkgs/applications/science/electronics/systemc/default.nix
@@ -26,6 +26,6 @@ stdenv.mkDerivation rec {
     homepage    = "https://systemc.org/";
     license     = licenses.asl20;
     platforms   = platforms.unix;
-    maintainers = with maintainers; [ victormignot amiloradovsky ];
+    maintainers = with maintainers; [ amiloradovsky ];
   };
 }
diff --git a/pkgs/applications/science/electronics/tkgate/1.x.nix b/pkgs/applications/science/electronics/tkgate/1.x.nix
index f20ce5e0acd09..03883652e6378 100644
--- a/pkgs/applications/science/electronics/tkgate/1.x.nix
+++ b/pkgs/applications/science/electronics/tkgate/1.x.nix
@@ -1,8 +1,8 @@
 { lib, stdenv, fetchurl, tcl, tk, libX11, glibc, which, bison, flex, imake, xorgproto, gccmakedep }:
 
 let
-  libiconvInc = lib.optionalString stdenv.isLinux "${glibc.dev}/include";
-  libiconvLib = lib.optionalString stdenv.isLinux "${glibc.out}/lib";
+  libiconvInc = lib.optionalString stdenv.hostPlatform.isLinux "${glibc.dev}/include";
+  libiconvLib = lib.optionalString stdenv.hostPlatform.isLinux "${glibc.out}/lib";
 in
 stdenv.mkDerivation rec {
   pname = "tkgate";
diff --git a/pkgs/applications/science/electronics/verilator/default.nix b/pkgs/applications/science/electronics/verilator/default.nix
index 92f8fa52b91f9..b7f2abd37ba75 100644
--- a/pkgs/applications/science/electronics/verilator/default.nix
+++ b/pkgs/applications/science/electronics/verilator/default.nix
@@ -1,33 +1,59 @@
-{ lib, stdenv, fetchFromGitHub, fetchpatch, perl, flex, bison, python3, autoconf,
-  which, cmake, ccache, help2man, makeWrapper, glibcLocales,
-  systemc, git, numactl }:
+{
+  lib,
+  stdenv,
+  fetchFromGitHub,
+  perl,
+  flex,
+  bison,
+  python3,
+  autoconf,
+  which,
+  help2man,
+  makeWrapper,
+  systemc,
+  git,
+  numactl,
+  coreutils,
+}:
 
 stdenv.mkDerivation rec {
   pname = "verilator";
-  version = "5.022";
+  version = "5.026";
+
+  # Verilator gets the version from this environment variable
+  # if it can't do git describe while building.
+  VERILATOR_SRC_VERSION = "v${version}";
 
   src = fetchFromGitHub {
     owner = pname;
     repo = pname;
     rev = "v${version}";
-    hash = "sha256-Ya3lqK8BfvMVLZUrD2Et6OmptteWXp5VmZb2x2G/V/E=";
+    hash = "sha256-Ds6w95tqlKjIFnkq2kKyslprKCwMOtBOoy7LuTon3KM=";
   };
 
-  patches = [
-    (fetchpatch {
-      # Fix try-lock spuriously fail in V3ThreadPool destructor
-      # https://github.com/verilator/verilator/pull/4938
-      url = "https://github.com/verilator/verilator/commit/4b9cce4369c78423779238e585ed693c456d464e.patch";
-      hash = "sha256-sGrk/pxqZqUcmJdzQoPlzXMmYqHCOmd9Y2n6ieVNg1U=";
-    })
-  ];
-
   enableParallelBuilding = true;
-  buildInputs = [ perl python3 systemc ];  # ccache
-  nativeBuildInputs = [ makeWrapper flex bison autoconf help2man git ];
-  nativeCheckInputs = [ which numactl ];  # cmake
+  buildInputs = [
+    perl
+    python3
+    systemc
+    # ccache
+  ];
+  nativeBuildInputs = [
+    makeWrapper
+    flex
+    bison
+    autoconf
+    help2man
+    git
+  ];
+  nativeCheckInputs = [
+    which
+    numactl
+    coreutils
+    # cmake
+  ];
 
-  doCheck = stdenv.isLinux; # darwin tests are broken for now...
+  doCheck = stdenv.hostPlatform.isLinux; # darwin tests are broken for now...
   checkTarget = "test";
 
   preConfigure = "autoconf";
@@ -36,16 +62,12 @@ stdenv.mkDerivation rec {
     patchShebangs bin/* src/* nodist/* docs/bin/* examples/xml_py/* \
     test_regress/{driver.pl,t/*.{pl,pf}} \
     ci/* ci/docker/run/* ci/docker/run/hooks/* ci/docker/buildenv/build.sh
+    # verilator --gdbbt uses /bin/echo to test if gdb works.
+    sed -i 's|/bin/echo|${coreutils}\/bin\/echo|' bin/verilator
   '';
   # grep '^#!/' -R . | grep -v /nix/store | less
   # (in nix-shell after patchPhase)
 
-  postInstall = lib.optionalString stdenv.isLinux ''
-    for x in $(ls $out/bin/verilator*); do
-      wrapProgram "$x" --set LOCALE_ARCHIVE "${glibcLocales}/lib/locale/locale-archive"
-    done
-  '';
-
   env = {
     SYSTEMC_INCLUDE = "${lib.getDev systemc}/include";
     SYSTEMC_LIBDIR = "${lib.getLib systemc}/lib";
@@ -53,9 +75,15 @@ stdenv.mkDerivation rec {
 
   meta = with lib; {
     description = "Fast and robust (System)Verilog simulator/compiler and linter";
-    homepage    = "https://www.veripool.org/verilator";
-    license     = with licenses; [ lgpl3Only artistic2 ];
-    platforms   = platforms.unix;
-    maintainers = with maintainers; [ thoughtpolice amiloradovsky ];
+    homepage = "https://www.veripool.org/verilator";
+    license = with licenses; [
+      lgpl3Only
+      artistic2
+    ];
+    platforms = platforms.unix;
+    maintainers = with maintainers; [
+      thoughtpolice
+      amiloradovsky
+    ];
   };
 }
diff --git a/pkgs/applications/science/electronics/verilog/default.nix b/pkgs/applications/science/electronics/verilog/default.nix
deleted file mode 100644
index 06e8a94a4c537..0000000000000
--- a/pkgs/applications/science/electronics/verilog/default.nix
+++ /dev/null
@@ -1,80 +0,0 @@
-{ lib, stdenv
-, fetchFromGitHub
-, fetchpatch
-, autoconf
-, bison
-, bzip2
-, flex
-, gperf
-, ncurses
-, perl
-, python3
-, readline
-, zlib
-}:
-
-stdenv.mkDerivation rec {
-  pname   = "iverilog";
-  version = "12.0";
-
-  src = fetchFromGitHub {
-    owner  = "steveicarus";
-    repo   = pname;
-    rev    = "v${lib.replaceStrings ["."] ["_"] version}";
-    hash   = "sha256-J9hedSmC6mFVcoDnXBtaTXigxrSCFa2AhhFd77ueo7I=";
-  };
-
-  nativeBuildInputs = [ autoconf bison flex gperf ];
-
-  CC_FOR_BUILD="${stdenv.cc}/bin/cc";
-  CXX_FOR_BUILD="${stdenv.cc}/bin/c++";
-
-  patches = [
-    # NOTE(jleightcap): `-Werror=format-security` warning patched shortly after release, backport the upstream fix
-    (fetchpatch {
-      name = "format-security";
-      url = "https://github.com/steveicarus/iverilog/commit/23e51ef7a8e8e4ba42208936e0a6a25901f58c65.patch";
-      hash = "sha256-fMWfBsCl2fuXe+6AR10ytb8QpC84bXlP5RSdrqsWzEk=";
-    })
-  ];
-
-  buildInputs = [ bzip2 ncurses readline zlib ];
-
-  preConfigure = "sh autoconf.sh";
-
-  enableParallelBuilding = true;
-
-  env = lib.optionalAttrs stdenv.isDarwin {
-    NIX_CFLAGS_COMPILE = "-Wno-error=implicit-function-declaration";
-  };
-
-  # NOTE(jleightcap): the `make check` target only runs a "Hello, World"-esque sanity check.
-  # the tests in the doInstallCheck phase run a full regression test suite.
-  # however, these tests currently fail upstream on aarch64
-  # (see https://github.com/steveicarus/iverilog/issues/917)
-  # so disable the full suite for now.
-  doCheck = true;
-  doInstallCheck = !stdenv.isAarch64;
-
-  nativeInstallCheckInputs = [
-    perl
-    (python3.withPackages (pp: with pp; [
-      docopt
-    ]))
-  ];
-
-  installCheckPhase = ''
-    runHook preInstallCheck
-    export PATH="$PATH:$out/bin"
-    sh .github/test.sh
-    runHook postInstallCheck
-  '';
-
-  meta = with lib; {
-    description = "Icarus Verilog compiler";
-    homepage    = "http://iverilog.icarus.com/";  # https does not work
-    license     = with licenses; [ gpl2Plus lgpl21Plus ];
-    maintainers = with maintainers; [ thoughtpolice ];
-    platforms   = platforms.all;
-  };
-}
diff --git a/pkgs/applications/science/electronics/vhd2vl/default.nix b/pkgs/applications/science/electronics/vhd2vl/default.nix
index 078f5e9514047..28656fe6e1216 100644
--- a/pkgs/applications/science/electronics/vhd2vl/default.nix
+++ b/pkgs/applications/science/electronics/vhd2vl/default.nix
@@ -3,7 +3,7 @@
 , fetchFromGitHub
 , bison
 , flex
-, verilog
+, iverilog
 , which
 }:
 
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
   ];
 
   buildInputs = [
-    verilog
+    iverilog
   ];
 
   # the "translate" target both (a) builds the software and (b) runs
diff --git a/pkgs/applications/science/electronics/xoscope/default.nix b/pkgs/applications/science/electronics/xoscope/default.nix
index 0fa0c1bc79bfc..37b9076c01cc7 100644
--- a/pkgs/applications/science/electronics/xoscope/default.nix
+++ b/pkgs/applications/science/electronics/xoscope/default.nix
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
     mainProgram = "xoscope";
     homepage = "https://xoscope.sourceforge.net";
     license = lib.licenses.gpl2Plus;
-    maintainers = with lib.maintainers; [viric];
+    maintainers = [ ];
     platforms = with lib.platforms; linux;
   };
 }
diff --git a/pkgs/applications/science/electronics/xschem/default.nix b/pkgs/applications/science/electronics/xschem/default.nix
index 826181139c194..72f4687f5c85e 100644
--- a/pkgs/applications/science/electronics/xschem/default.nix
+++ b/pkgs/applications/science/electronics/xschem/default.nix
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
   hardeningDisable = [ "format" ];
 
   meta = with lib; {
-    broken = stdenv.isDarwin;
+    broken = stdenv.hostPlatform.isDarwin;
     description = "Schematic capture and netlisting EDA tool";
     longDescription = ''
       Xschem is a schematic capture program, it allows creation of
diff --git a/pkgs/applications/science/electronics/xyce/default.nix b/pkgs/applications/science/electronics/xyce/default.nix
index 93c155038a22b..56fc59c080994 100644
--- a/pkgs/applications/science/electronics/xyce/default.nix
+++ b/pkgs/applications/science/electronics/xyce/default.nix
@@ -17,14 +17,12 @@
 , withMPI ? false
   # for doc
 , texliveMedium
-, pandoc
 , enableDocs ? true
   # for tests
 , bash
 , bc
 , openssh # required by MPI
 , perl
-, perlPackages
 , python3
 , enableTests ? true
 }:
@@ -175,7 +173,7 @@ stdenv.mkDerivation rec {
   '';
 
   meta = with lib; {
-    broken = (stdenv.isLinux && stdenv.isAarch64) || stdenv.isDarwin;
+    broken = (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) || stdenv.hostPlatform.isDarwin;
     description = "High-performance analog circuit simulator";
     longDescription = ''
       Xyce is a SPICE-compatible, high-performance analog circuit simulator,
diff --git a/pkgs/applications/science/geometry/antiprism/default.nix b/pkgs/applications/science/geometry/antiprism/default.nix
deleted file mode 100644
index 62ffc099dc6cd..0000000000000
--- a/pkgs/applications/science/geometry/antiprism/default.nix
+++ /dev/null
@@ -1,29 +0,0 @@
-{ lib, stdenv
-, fetchFromGitHub
-, autoreconfHook
-, libX11
-, libGL
-, libGLU
-, freeglut }:
-
-stdenv.mkDerivation rec {
-  pname = "antiprism";
-  version = "0.30";
-
-  src = fetchFromGitHub {
-    owner = "antiprism";
-    repo = pname;
-    rev = version;
-    sha256 = "sha256-dD3MH+KectuuKOYF7bqWtGsBo5zz+UMyY/io1tgXbgU=";
-  };
-
-  nativeBuildInputs = [ autoreconfHook ];
-  buildInputs = [ libX11 libGLU libGL.dev freeglut.dev ];
-
-  meta = with lib; {
-    homepage = "https://www.antiprism.com";
-    description = "Collection of programs for generating, manipulating, transforming and viewing polyhedra";
-    license = with licenses; [ mit ];
-    maintainers = with maintainers; [ AndersonTorres ];
-  };
-}
diff --git a/pkgs/applications/science/geometry/tetgen/default.nix b/pkgs/applications/science/geometry/tetgen/default.nix
index dce56dc4e17d2..e64941f4243ad 100644
--- a/pkgs/applications/science/geometry/tetgen/default.nix
+++ b/pkgs/applications/science/geometry/tetgen/default.nix
@@ -27,6 +27,6 @@ stdenv.mkDerivation rec {
     mainProgram = "tetgen";
     homepage = "http://tetgen.org/";
     license = lib.licenses.agpl3Plus;
-    platforms = lib.platforms.linux;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/pkgs/applications/science/logic/alt-ergo/default.nix b/pkgs/applications/science/logic/alt-ergo/default.nix
index 03787a3a084b1..2f58141c3281b 100644
--- a/pkgs/applications/science/logic/alt-ergo/default.nix
+++ b/pkgs/applications/science/logic/alt-ergo/default.nix
@@ -2,11 +2,11 @@
 
 let
   pname = "alt-ergo";
-  version = "2.5.4";
+  version = "2.6.0";
 
   src = fetchurl {
     url = "https://github.com/OCamlPro/alt-ergo/releases/download/v${version}/alt-ergo-${version}.tbz";
-    hash = "sha256-AsHok5i62vqJ5hK8XRiD8hM6JQaFv3dMxZAcVYEim6w=";
+    hash = "sha256-EmkxGvJSeKRmiSuoeMyIi6WfF39T3QPxKixiOwP8834=";
   };
 in
 
@@ -14,7 +14,17 @@ let alt-ergo-lib = ocamlPackages.buildDunePackage rec {
   pname = "alt-ergo-lib";
   inherit version src;
   buildInputs = with ocamlPackages; [ ppx_blob ];
-  propagatedBuildInputs = with ocamlPackages; [ camlzip dolmen_loop dune-build-info fmt ocplib-simplex seq stdlib-shims zarith ];
+  propagatedBuildInputs = with ocamlPackages; [
+    camlzip
+    dolmen_loop
+    dune-build-info
+    fmt
+    ocplib-simplex
+    ppx_deriving
+    seq
+    stdlib-shims
+    zarith
+  ];
 }; in
 
 let alt-ergo-parsers = ocamlPackages.buildDunePackage rec {
@@ -28,8 +38,18 @@ ocamlPackages.buildDunePackage {
 
   inherit pname version src;
 
-  nativeBuildInputs = [ ocamlPackages.menhir ] ++ lib.optionals stdenv.isDarwin [ darwin.sigtool ];
-  buildInputs = [ alt-ergo-parsers ] ++ (with ocamlPackages; [ cmdliner dune-site ]);
+  nativeBuildInputs = [ ocamlPackages.menhir ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.sigtool ];
+  propagatedBuildInputs = [ alt-ergo-parsers ] ++ (with ocamlPackages; [ cmdliner dune-site ppxlib ]);
+
+  outputs = [ "bin" "out" ];
+
+  installPhase = ''
+    runHook preInstall
+    dune install --prefix $bin ${pname}
+    mkdir -p $out/lib/ocaml/${ocamlPackages.ocaml.version}/site-lib
+    mv $bin/lib/alt-ergo $out/lib/ocaml/${ocamlPackages.ocaml.version}/site-lib/
+    runHook postInstall
+  '';
 
   meta = {
     description = "High-performance theorem prover and SMT solver";
diff --git a/pkgs/applications/science/logic/beluga/default.nix b/pkgs/applications/science/logic/beluga/default.nix
index b1497e2b1dcbe..d85f375f9f89d 100644
--- a/pkgs/applications/science/logic/beluga/default.nix
+++ b/pkgs/applications/science/logic/beluga/default.nix
@@ -2,13 +2,13 @@
 
 ocamlPackages.buildDunePackage rec {
   pname = "beluga";
-  version = "1.1.1";
+  version = "1.1.2";
 
   src = fetchFromGitHub {
     owner = "Beluga-lang";
     repo = "Beluga";
     rev = "refs/tags/v${version}";
-    hash = "sha256-l/C77czLtlLnpadVx4d9ve9jv/e11jsOgzrbXt+Zo5s=";
+    hash = "sha256-QUZ3mmd0gBQ+hnAeo/TbvFsETnThAdAoQyfpz2F//4g=";
   };
 
   duneVersion = "3";
diff --git a/pkgs/applications/science/logic/bitwuzla/default.nix b/pkgs/applications/science/logic/bitwuzla/default.nix
index c1eb751fb1a57..f5a5296de9c47 100644
--- a/pkgs/applications/science/logic/bitwuzla/default.nix
+++ b/pkgs/applications/science/logic/bitwuzla/default.nix
@@ -43,7 +43,7 @@ stdenv.mkDerivation (finalAttrs: {
     # but setting it to shared works even in pkgsStatic
     "-Ddefault_library=shared"
 
-    (lib.strings.mesonEnable "testing" finalAttrs.doCheck)
+    (lib.strings.mesonEnable "testing" finalAttrs.finalPackage.doCheck)
   ];
 
   nativeCheckInputs = [ python3 ];
diff --git a/pkgs/applications/science/logic/boolector/default.nix b/pkgs/applications/science/logic/boolector/default.nix
index 1fd6bf7dc5431..30e3cf5002114 100644
--- a/pkgs/applications/science/logic/boolector/default.nix
+++ b/pkgs/applications/science/logic/boolector/default.nix
@@ -34,11 +34,11 @@ stdenv.mkDerivation rec {
   nativeCheckInputs = [ python3 ];
   doCheck = true;
   preCheck =
-    let var = if stdenv.isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH";
+    let var = if stdenv.hostPlatform.isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH";
     in
       # tests modelgen and modelgensmt2 spawn boolector in another processes and
       # macOS strips DYLD_LIBRARY_PATH, hardcode it for testing
-      lib.optionalString stdenv.isDarwin ''
+      lib.optionalString stdenv.hostPlatform.isDarwin ''
         cp -r bin bin.back
         install_name_tool -change libboolector.dylib $(pwd)/lib/libboolector.dylib bin/boolector
       '' + ''
@@ -46,7 +46,7 @@ stdenv.mkDerivation rec {
         patchShebangs ..
       '';
 
-  postCheck = lib.optionalString stdenv.isDarwin ''
+  postCheck = lib.optionalString stdenv.hostPlatform.isDarwin ''
     rm -rf bin
     mv bin.back bin
   '';
diff --git a/pkgs/applications/science/logic/btor2tools/default.nix b/pkgs/applications/science/logic/btor2tools/default.nix
index a66637150bdfd..2b547eeb92218 100644
--- a/pkgs/applications/science/logic/btor2tools/default.nix
+++ b/pkgs/applications/science/logic/btor2tools/default.nix
@@ -2,24 +2,16 @@
 
 stdenv.mkDerivation rec {
   pname = "btor2tools";
-  version = "1.0.0-pre_${src.rev}";
+  version = "unstable-2024-08-07";
 
   src = fetchFromGitHub {
     owner  = "boolector";
     repo   = "btor2tools";
-    rev    = "9831f9909fb283752a3d6d60d43613173bd8af42";
-    sha256 = "0mfqmkgvyw8fa2c09kww107dmk180ch1hp98r5kv41vnc04iqb0s";
+    rev    = "44bcadbfede292ff4c4a4a8962cc18130de522fb";
+    sha256 = "0ncl4xwms8d656x95ga8v8zjybx4cmdl5hlcml7dpcgm3p8qj4ks";
   };
 
-  patches = [
-    (fetchpatch {
-      name = "gcc-13.patch";
-      url = "https://github.com/Boolector/btor2tools/commit/037f1fa88fb439dca6f648ad48a3463256d69d8b.patch";
-      hash = "sha256-FX1yy9XdUs1tAReOxhEzNHu48DrISzNNMSYoIrhHoFY=";
-    })
-  ];
-
-  nativeBuildInputs = [ cmake ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
+  nativeBuildInputs = [ cmake ] ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
 
   installPhase = ''
     mkdir -p $out $dev/include/btor2parser/ $lib/lib
diff --git a/pkgs/applications/science/logic/cadical/default.nix b/pkgs/applications/science/logic/cadical/default.nix
index 12b01dea1a3dd..6d49ef0ab3f63 100644
--- a/pkgs/applications/science/logic/cadical/default.nix
+++ b/pkgs/applications/science/logic/cadical/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "cadical";
-  version = "1.9.5";
+  version = "2.0.0";
 
   src = fetchFromGitHub {
     owner = "arminbiere";
     repo = "cadical";
     rev = "rel-${version}";
-    sha256 = "sha256-mAKuz8WjX+ywQ7Sw5hRMPftsbbilTlmQ9qZVowXxs28=";
+    sha256 = "sha256-qoeEM9SdpuFuBPeQlCzuhPLcJ+bMQkTUTGiT8QdU8rc=";
   };
 
   outputs = [ "out" "dev" "lib" ];
diff --git a/pkgs/applications/science/logic/cbmc/default.nix b/pkgs/applications/science/logic/cbmc/default.nix
index 0a81b2a09ef1d..0bfb512737582 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 = "6.0.0";
+  version = "6.0.1";
 
   src = fetchFromGitHub {
     owner = "diffblue";
     repo = pname;
     rev = "${pname}-${version}";
-    sha256 = "sha256-mPRkkKN7Hz9Qi6a3fEwVFh7a9OaBFcksNw9qwNOarao=";
+    sha256 = "sha256-7syRpCNL7TRZoJaNrmAdahNy7IyovyniYyOwD/lzhuw=";
   };
 
   nativeBuildInputs = [
@@ -83,6 +83,6 @@ stdenv.mkDerivation rec {
     maintainers = with maintainers; [ jiegec ];
     platforms = platforms.unix;
     # error: no member named 'aligned_alloc' in the global namespace
-    broken = stdenv.isDarwin && stdenv.isx86_64;
+    broken = stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64;
   };
 }
diff --git a/pkgs/applications/science/logic/coq/default.nix b/pkgs/applications/science/logic/coq/default.nix
index af672d500fa6a..c45ee7190e77f 100644
--- a/pkgs/applications/science/logic/coq/default.nix
+++ b/pkgs/applications/science/logic/coq/default.nix
@@ -5,20 +5,19 @@
 # - The exact version can be specified through the `version` argument to
 #   the derivation; it defaults to the latest stable version.
 
-{ lib, stdenv, fetchzip, writeText, pkg-config, gnumake42
+{ lib, stdenv, fetchzip, fetchurl, writeText, pkg-config, gnumake42
 , customOCamlPackages ? null
 , ocamlPackages_4_05, ocamlPackages_4_09, ocamlPackages_4_10, ocamlPackages_4_12
 , ocamlPackages_4_14
 , ncurses
 , buildIde ? null # default is true for Coq < 8.14 and false for Coq >= 8.14
-, glib, gnome, wrapGAppsHook3, makeDesktopItem, copyDesktopItems
+, glib, adwaita-icon-theme, wrapGAppsHook3, makeDesktopItem, copyDesktopItems
 , csdp ? null
 , version, coq-version ? null
 }@args:
-let lib' = lib; in
-let lib = import ../../../../build-support/coq/extra-lib.nix {lib = lib';}; in
-with builtins; with lib;
 let
+  lib = import ../../../../build-support/coq/extra-lib.nix { inherit (args) lib; };
+
   release = {
    "8.5pl1".sha256     = "1976ki5xjg2r907xj9p7gs0kpdinywbwcqlgxqw75dgp0hkgi00n";
    "8.5pl2".sha256     = "109rrcrx7mz0fj7725kjjghfg5ydwb24hjsa5hspa27b4caah7rh";
@@ -59,36 +58,37 @@ let
    "8.19.0".sha256   = "sha256-ixsYCvCXpBHqJ71hLQklphlwoOO3i/6w2PJjllKqf9k=";
    "8.19.1".sha256   = "sha256-kmZ8Uk8jpzjOd67aAPp3C+vU2oNaBw9pr7+Uixcgg94=";
    "8.19.2".sha256   = "sha256-q+i07JsMZp83Gqav6v1jxsgPLN7sPvp5/oszVnavmz0=";
+   "8.20.0".sha256   = "sha256-WFpZlA6CzFVAruPhWcHQI7VOBVhrGLdFzWrHW0DTSl0=";
   };
   releaseRev = v: "V${v}";
   fetched = import ../../../../build-support/coq/meta-fetch/default.nix
-    { inherit lib stdenv fetchzip; }
+    { inherit lib stdenv fetchzip fetchurl; }
     { inherit release releaseRev; location = { owner = "coq"; repo = "coq";}; }
     args.version;
   version = fetched.version;
-  coq-version = args.coq-version or (if version != "dev" then versions.majorMinor version else "dev");
-  coqAtLeast = v: coq-version == "dev" || versionAtLeast coq-version v;
+  coq-version = args.coq-version or (if version != "dev" then lib.versions.majorMinor version else "dev");
+  coqAtLeast = v: coq-version == "dev" || lib.versionAtLeast coq-version v;
   buildIde = args.buildIde or (!coqAtLeast "8.14");
-  ideFlags = optionalString (buildIde && !coqAtLeast "8.10")
+  ideFlags = lib.optionalString (buildIde && !coqAtLeast "8.10")
     "-lablgtkdir ${ocamlPackages.lablgtk}/lib/ocaml/*/site-lib/lablgtk2 -coqide opt";
   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"
   '';
   ocamlPackages = if customOCamlPackages != null then customOCamlPackages
-    else with versions; switch coq-version [
-      { case = range "8.16" "8.18"; out = ocamlPackages_4_14; }
-      { case = range "8.14" "8.15"; out = ocamlPackages_4_12; }
-      { case = range "8.11" "8.13"; out = ocamlPackages_4_10; }
-      { case = range "8.7" "8.10";  out = ocamlPackages_4_09; }
-      { case = range "8.5" "8.6";   out = ocamlPackages_4_05; }
+    else lib.switch coq-version [
+      { case = lib.versions.range "8.16" "8.18"; out = ocamlPackages_4_14; }
+      { case = lib.versions.range "8.14" "8.15"; out = ocamlPackages_4_12; }
+      { case = lib.versions.range "8.11" "8.13"; out = ocamlPackages_4_10; }
+      { case = lib.versions.range "8.7" "8.10";  out = ocamlPackages_4_09; }
+      { case = lib.versions.range "8.5" "8.6";   out = ocamlPackages_4_05; }
     ] ocamlPackages_4_14;
-  ocamlNativeBuildInputs = with ocamlPackages; [ ocaml findlib ]
-    ++ optional (coqAtLeast "8.14") dune_3;
+  ocamlNativeBuildInputs = [ ocamlPackages.ocaml ocamlPackages.findlib ]
+    ++ lib.optional (coqAtLeast "8.14") ocamlPackages.dune_3;
   ocamlPropagatedBuildInputs = [ ]
-    ++ optional (!coqAtLeast "8.10") ocamlPackages.camlp5
-    ++ optional (!coqAtLeast "8.13") ocamlPackages.num
-    ++ optional (coqAtLeast "8.13") ocamlPackages.zarith;
+    ++ lib.optional (!coqAtLeast "8.10") ocamlPackages.camlp5
+    ++ lib.optional (!coqAtLeast "8.13") ocamlPackages.num
+    ++ lib.optional (coqAtLeast "8.13") ocamlPackages.zarith;
 self = stdenv.mkDerivation {
   pname = "coq";
   inherit (fetched) version src;
@@ -110,7 +110,7 @@ self = stdenv.mkDerivation {
         (coq-prog-args))
       (mapc (lambda (arg)
         (when (file-directory-p (concat arg "/lib/coq/${coq-version}/user-contrib"))
-          (setenv "COQPATH" (concat (getenv "COQPATH") ":" arg "/lib/coq/${coq-version}/user-contrib")))) '(${concatStringsSep " " (map (pkg: "\"${pkg}\"") pkgs)}))
+          (setenv "COQPATH" (concat (getenv "COQPATH") ":" arg "/lib/coq/${coq-version}/user-contrib")))) '(${lib.concatStringsSep " " (map (pkg: "\"${pkg}\"") pkgs)}))
       ; TODO Abstract this pattern from here and nixBufferBuilders.withPackages!
       (defvar nixpkgs--coq-buffer-count 0)
       (when (eq nixpkgs--coq-buffer-count 0)
@@ -147,13 +147,13 @@ self = stdenv.mkDerivation {
 
   nativeBuildInputs = [ pkg-config ]
     ++ ocamlNativeBuildInputs
-    ++ optional buildIde copyDesktopItems
-    ++ optional (buildIde && coqAtLeast "8.10") wrapGAppsHook3
-    ++ optional (!coqAtLeast "8.6") gnumake42;
+    ++ lib.optional buildIde copyDesktopItems
+    ++ lib.optional (buildIde && coqAtLeast "8.10") wrapGAppsHook3
+    ++ lib.optional (!coqAtLeast "8.6") gnumake42;
   buildInputs = [ ncurses ]
-    ++ optionals buildIde
+    ++ lib.optionals buildIde
       (if coqAtLeast "8.10"
-       then [ ocamlPackages.lablgtk3-sourceview3 glib gnome.adwaita-icon-theme ]
+       then [ ocamlPackages.lablgtk3-sourceview3 glib adwaita-icon-theme ]
        else [ ocamlPackages.lablgtk ])
   ;
 
@@ -187,12 +187,12 @@ self = stdenv.mkDerivation {
 
   prefixKey = "-prefix ";
 
-  buildFlags = [ "revision" "coq" ] ++ optional buildIde "coqide" ++ optional (!coqAtLeast "8.14") "bin/votour";
+  buildFlags = [ "revision" "coq" ] ++ lib.optional buildIde "coqide" ++ lib.optional (!coqAtLeast "8.14") "bin/votour";
   enableParallelBuilding = true;
 
   createFindlibDestdir = true;
 
-  desktopItems = optional buildIde (makeDesktopItem {
+  desktopItems = lib.optional buildIde (makeDesktopItem {
     name = "coqide";
     exec = "coqide";
     icon = "coq";
@@ -201,18 +201,18 @@ self = stdenv.mkDerivation {
     categories = [ "Development" "Science" "Math" "IDE" "GTK" ];
   });
 
-  postInstall = let suffix = optionalString (coqAtLeast "8.14") "-core"; in optionalString (!coqAtLeast "8.17") ''
+  postInstall = let suffix = lib.optionalString (coqAtLeast "8.14") "-core"; in lib.optionalString (!coqAtLeast "8.17") ''
     cp bin/votour $out/bin/
   '' + ''
     ln -s $out/lib/coq${suffix} $OCAMLFIND_DESTDIR/coq${suffix}
-  '' + optionalString (coqAtLeast "8.14") ''
+  '' + lib.optionalString (coqAtLeast "8.14") ''
     ln -s $out/lib/coqide-server $OCAMLFIND_DESTDIR/coqide-server
-  '' + optionalString buildIde ''
+  '' + lib.optionalString buildIde ''
     mkdir -p "$out/share/pixmaps"
     ln -s "$out/share/coq/coq.png" "$out/share/pixmaps/"
   '';
 
-  meta = {
+  meta = with lib; {
     description = "Coq proof assistant";
     longDescription = ''
       Coq is a formal proof management system.  It provides a formal language
diff --git a/pkgs/applications/science/logic/cryptoverif/default.nix b/pkgs/applications/science/logic/cryptoverif/default.nix
index 7c95c21c2ccf3..fb1ba4df55b24 100644
--- a/pkgs/applications/science/logic/cryptoverif/default.nix
+++ b/pkgs/applications/science/logic/cryptoverif/default.nix
@@ -1,12 +1,12 @@
-{ lib, stdenv, fetchurl, ocaml }:
+{ lib, stdenv, fetchurl, ocaml, writeScript }:
 
 stdenv.mkDerivation (finalAttrs: {
   pname = "cryptoverif";
-  version = "2.09";
+  version = "2.10";
 
   src = fetchurl {
     url    = "http://prosecco.gforge.inria.fr/personal/bblanche/cryptoverif/cryptoverif${finalAttrs.version}.tar.gz";
-    hash = "sha256-FJlPZgTUZ+6HzhG/B0dOiVIjDvoCnF6yg2E9UriSojw=";
+    hash = "sha256-Gg7PYMB5cYWk9+xuxxcFY9L9vynHX2xYyMDo/0DauPM=";
   };
 
   /* Fix up the frontend to load the 'default' cryptoverif library
@@ -40,10 +40,22 @@ stdenv.mkDerivation (finalAttrs: {
     runHook postInstall
   '';
 
+  passthru.updateScript = writeScript "update-cryptoverif" ''
+    #!/usr/bin/env nix-shell
+    #!nix-shell -i bash -p common-updater-scripts curl pcre2
+
+    set -eu -o pipefail
+
+    version="$(curl -s https://bblanche.gitlabpages.inria.fr/CryptoVerif/ |
+      pcre2grep -o1 '\bCryptoVerif version ([.[:alnum:]]+),')"
+
+    update-source-version "$UPDATE_NIX_ATTR_PATH" "$version"
+  '';
+
   meta = {
     description = "Cryptographic protocol verifier in the computational model";
     mainProgram = "cryptoverif";
-    homepage    = "https://prosecco.gforge.inria.fr/personal/bblanche/cryptoverif/";
+    homepage    = "https://bblanche.gitlabpages.inria.fr/CryptoVerif/";
     license     = lib.licenses.cecill-b;
     platforms   = lib.platforms.unix;
     maintainers = [ lib.maintainers.thoughtpolice ];
diff --git a/pkgs/applications/science/logic/cvc4/default.nix b/pkgs/applications/science/logic/cvc4/default.nix
index 2dc12b7ab7234..c44b495f2caef 100644
--- a/pkgs/applications/science/logic/cvc4/default.nix
+++ b/pkgs/applications/science/logic/cvc4/default.nix
@@ -15,13 +15,13 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ pkg-config cmake ];
   buildInputs = [ gmp git python3.pkgs.toml readline swig libantlr3c antlr3_4 boost jdk python3 ]
-    ++ lib.optionals (!stdenv.isDarwin) [ cln ];
+    ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ cln ];
   configureFlags = [
     "--enable-language-bindings=c,c++,java"
     "--enable-gpl"
     "--with-readline"
     "--with-boost=${boost.dev}"
-  ] ++ lib.optionals (!stdenv.isDarwin) [ "--with-cln" ];
+  ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ "--with-cln" ];
 
   prePatch = ''
     patch -p1 -i ${./minisat-fenv.patch} -d src/prop/minisat
diff --git a/pkgs/applications/science/logic/cvc5/default.nix b/pkgs/applications/science/logic/cvc5/default.nix
index 93a05e97ff9e1..6fc2b1b7c972a 100644
--- a/pkgs/applications/science/logic/cvc5/default.nix
+++ b/pkgs/applications/science/logic/cvc5/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "cvc5";
-  version = "1.1.2";
+  version = "1.2.0";
 
   src = fetchFromGitHub {
     owner  = "cvc5";
     repo   = "cvc5";
     rev    = "cvc5-${version}";
-    hash  = "sha256-v+3/2IUslQOySxFDYgTBWJIDnyjbU2RPdpfLcIkEtgQ=";
+    hash  = "sha256-d5F4KwPQ1nwYJbEidQsvqyaGwEugo291SpsJE2rr558=";
   };
 
   nativeBuildInputs = [ pkg-config cmake flex ];
@@ -28,6 +28,8 @@ stdenv.mkDerivation rec {
     "-DANTLR3_JAR=${antlr3_4}/lib/antlr/antlr-3.4-complete.jar"
   ];
 
+  doCheck = true;
+
   meta = with lib; {
     description = "High-performance theorem prover and SMT solver";
     mainProgram = "cvc5";
diff --git a/pkgs/applications/science/logic/dafny/default.nix b/pkgs/applications/science/logic/dafny/default.nix
index f85e6cf22879d..3f97765e6c180 100644
--- a/pkgs/applications/science/logic/dafny/default.nix
+++ b/pkgs/applications/science/logic/dafny/default.nix
@@ -8,32 +8,37 @@
 
 buildDotnetModule rec {
   pname = "Dafny";
-  version = "4.6.0";
+  version = "4.8.0";
 
   src = fetchFromGitHub {
     owner = "dafny-lang";
     repo = "dafny";
     rev = "v${version}";
-    hash = "sha256-3t0drxM7PZzrLbxBKYa6Gja2u6GK6Pc+ejoswag3P3k=";
+    hash = "sha256-x/fX4o+R72Pl02u1Zsr80Rh/4Wb/aKw90fhAGmsfFUI=";
   };
 
-  postPatch = ''
-    cp ${
-      writeScript "fake-gradlew-for-dafny" ''
-        mkdir -p build/libs/
-        javac $(find -name "*.java" | grep "^./src/main") -d classes
-        jar cf build/libs/DafnyRuntime-${version}.jar -C classes dafny
-      ''} Source/DafnyRuntime/DafnyRuntimeJava/gradlew
+  postPatch =
+    let
+      # This file wasn't updated between 4.6.0 and 4.7.0.
+      runtimeJarVersion = "4.6.0";
+    in
+    ''
+      cp ${
+        writeScript "fake-gradlew-for-dafny" ''
+          mkdir -p build/libs/
+          javac $(find -name "*.java" | grep "^./src/main") -d classes
+          jar cf build/libs/DafnyRuntime-${runtimeJarVersion}.jar -C classes dafny
+        ''} Source/DafnyRuntime/DafnyRuntimeJava/gradlew
 
-    # Needed to fix
-    # "error NETSDK1129: The 'Publish' target is not supported without
-    # specifying a target framework. The current project targets multiple
-    # frameworks, you must specify the framework for the published
-    # application."
-    substituteInPlace Source/DafnyRuntime/DafnyRuntime.csproj \
-      --replace TargetFrameworks TargetFramework \
-      --replace "netstandard2.0;net452" net6.0
-  '';
+      # Needed to fix
+      # "error NETSDK1129: The 'Publish' target is not supported without
+      # specifying a target framework. The current project targets multiple
+      # frameworks, you must specify the framework for the published
+      # application."
+      substituteInPlace Source/DafnyRuntime/DafnyRuntime.csproj \
+        --replace-warn TargetFrameworks TargetFramework \
+        --replace-warn "netstandard2.0;net452" net6.0
+    '';
 
   buildInputs = [ jdk11 ];
   nugetDeps = ./deps.nix;
diff --git a/pkgs/applications/science/logic/dafny/deps.nix b/pkgs/applications/science/logic/dafny/deps.nix
index 91fe5624ac7f7..95924b788dc9a 100644
--- a/pkgs/applications/science/logic/dafny/deps.nix
+++ b/pkgs/applications/science/logic/dafny/deps.nix
@@ -2,180 +2,174 @@
 # Please dont edit it manually, your changes might get overwritten!
 
 { fetchNuGet }: [
-  (fetchNuGet { pname = "Boogie"; version = "3.1.3"; sha256 = "0xzc7s0rjb8dhdkdf71g6pdsnyhbl534xpwd8gbx6g16a87iqx6i"; })
-  (fetchNuGet { pname = "Boogie.AbstractInterpretation"; version = "3.1.3"; sha256 = "0a7v2jkkbh59pyc5nz4avszm3dbmp4amkmr6lvn0gyc3hxgn8d3k"; })
-  (fetchNuGet { pname = "Boogie.BaseTypes"; version = "3.1.3"; sha256 = "1h94yl4ymhd2g14i5w8lnnh2zw7gx65qydzvv8cm8d5yn64gch63"; })
-  (fetchNuGet { pname = "Boogie.CodeContractsExtender"; version = "3.1.3"; sha256 = "0b1h1lz997lgyq34bx3ngnhgcrw8j4qvsa6iygb6bydxz7rirrf4"; })
-  (fetchNuGet { pname = "Boogie.Concurrency"; version = "3.1.3"; sha256 = "1aq0gdz1xkmp82c67vrmyvkncfbbj5zxrsg78lsmmi22h9qbkzm3"; })
-  (fetchNuGet { pname = "Boogie.Core"; version = "3.1.3"; sha256 = "0yhl272lv9lncjval2z7zl9wavlxx8bivj467zl2zzbrxw2k5wz8"; })
-  (fetchNuGet { pname = "Boogie.ExecutionEngine"; version = "3.1.3"; sha256 = "0p0zp329h6mddbswm3pdcyvy03y69vyznv11ph6bkpya21lsxqy7"; })
-  (fetchNuGet { pname = "Boogie.Graph"; version = "3.1.3"; sha256 = "1p8vb4x4iy7f0ycwb8f71j9a2ci8irwg3rvad2hg3rgbihbwp1qj"; })
-  (fetchNuGet { pname = "Boogie.Houdini"; version = "3.1.3"; sha256 = "06qlgi9f70r2w7w6h9qw3lx9dd4pbddpdplqjxi090rpry6dhrbz"; })
-  (fetchNuGet { pname = "Boogie.Model"; version = "3.1.3"; sha256 = "0fbvnrghaq17fdpjx12axxrrjp1mh99skaznmvxd1ylsqqnn4cbk"; })
-  (fetchNuGet { pname = "Boogie.Provers.SMTLib"; version = "3.1.3"; sha256 = "0x7gpc7m04in2gzdn4jgjphd2xjqrdfmh84wzwnwpvi5wyn869jc"; })
-  (fetchNuGet { pname = "Boogie.VCExpr"; version = "3.1.3"; sha256 = "0dyndhqz1yf9qnq9mw73g53rnz0xfbdbi3yk6pg7fdm1m3363h5p"; })
-  (fetchNuGet { pname = "Boogie.VCGeneration"; version = "3.1.3"; sha256 = "1bl83727zc1rhskx548p5pa27804n3f5i9n233jvcz6n6bfjn74k"; })
-  (fetchNuGet { pname = "CocoR"; version = "2014.12.24"; sha256 = "0ps8h7aawkcc1910qnh13llzb01pvgsjmg862pxp0p4wca2dn7a2"; })
-  (fetchNuGet { pname = "JetBrains.Annotations"; version = "2021.1.0"; sha256 = "07pnhxxlgx8spmwmakz37nmbvgyb6yjrbrhad5rrn6y767z5r1gb"; })
-  (fetchNuGet { pname = "MediatR"; version = "8.1.0"; sha256 = "0cqx7yfh998xhsfk5pr6229lcjcs1jxxyqz7dwskc9jddl6a2akp"; })
-  (fetchNuGet { pname = "Microsoft.Bcl.AsyncInterfaces"; version = "1.1.1"; sha256 = "0a1ahssqds2ympr7s4xcxv5y8jgxs7ahd6ah6fbgglj4rki1f1vw"; })
-  (fetchNuGet { pname = "Microsoft.Bcl.AsyncInterfaces"; version = "6.0.0"; sha256 = "15gqy2m14fdlvy1g59207h5kisznm355kbw010gy19vh47z8gpz3"; })
-  (fetchNuGet { pname = "Microsoft.CodeAnalysis.Analyzers"; version = "3.0.0"; sha256 = "0bbl0jpqywqmzz2gagld1p2gvdfldjfjmm25hil9wj2nq1zc4di8"; })
-  (fetchNuGet { pname = "Microsoft.CodeAnalysis.Common"; version = "3.7.0"; sha256 = "0882492nx6x68b0pkh3q5xaawz0b2l5x35r40722ignyjnvjydph"; })
-  (fetchNuGet { pname = "Microsoft.CodeAnalysis.CSharp"; version = "3.7.0"; sha256 = "0adw6rcag8wxydzyiyhls2mxaqkay5qlz25z1fxrlv5qnchqn0n5"; })
-  (fetchNuGet { pname = "Microsoft.DotNet.PlatformAbstractions"; version = "2.0.4"; sha256 = "1fdzln4im9hb55agzwchbfgm3vmngigmbpci5j89b0gqcxixmv8j"; })
-  (fetchNuGet { pname = "Microsoft.Extensions.Configuration"; version = "2.0.0"; sha256 = "0yssxq9di5h6xw2cayp5hj3l9b2p0jw9wcjz73rwk4586spac9s9"; })
-  (fetchNuGet { pname = "Microsoft.Extensions.Configuration"; version = "5.0.0"; sha256 = "01m9vzlq0vg0lhckj2dimwq42niwny8g3lm13c9a401hlyg90z1p"; })
-  (fetchNuGet { pname = "Microsoft.Extensions.Configuration.Abstractions"; version = "2.0.0"; sha256 = "1ilz2yrgg9rbjyhn6a5zh9pr51nmh11z7sixb4p7vivgydj9gxwf"; })
-  (fetchNuGet { pname = "Microsoft.Extensions.Configuration.Abstractions"; version = "5.0.0"; sha256 = "0fqxkc9pjxkqylsdf26s9q21ciyk56h1w33pz3v1v4wcv8yv1v6k"; })
-  (fetchNuGet { pname = "Microsoft.Extensions.Configuration.Binder"; version = "2.0.0"; sha256 = "1prvdbma6r18n5agbhhabv6g357p1j70gq4m9g0vs859kf44nrgc"; })
-  (fetchNuGet { pname = "Microsoft.Extensions.Configuration.CommandLine"; version = "5.0.0"; sha256 = "084hnz5l0vr15ay23rksqipslqnz3pp30w9hsirpx1iqdm5688mc"; })
-  (fetchNuGet { pname = "Microsoft.Extensions.Configuration.FileExtensions"; version = "5.0.0"; sha256 = "1wq229r3xcmm9wh9sqdpvmfv4qpbp2zms9x6xk7g7sbb8h32hnz3"; })
-  (fetchNuGet { pname = "Microsoft.Extensions.Configuration.Json"; version = "5.0.0"; sha256 = "0hq5i483bjbvprp1la9l3si82x1ydxbvkpfc7r3s7zgxg957fyp9"; })
-  (fetchNuGet { pname = "Microsoft.Extensions.DependencyInjection"; version = "2.0.0"; sha256 = "018izzgykaqcliwarijapgki9kp2c560qv8qsxdjywr7byws5apq"; })
-  (fetchNuGet { pname = "Microsoft.Extensions.DependencyInjection"; version = "5.0.0"; sha256 = "15sdwcyzz0qlybwbdq854bn3jk6kx7awx28gs864c4shhbqkppj4"; })
-  (fetchNuGet { pname = "Microsoft.Extensions.DependencyInjection.Abstractions"; version = "2.0.0"; sha256 = "1pwrfh9b72k9rq6mb2jab5qhhi225d5rjalzkapiayggmygc8nhz"; })
-  (fetchNuGet { pname = "Microsoft.Extensions.DependencyInjection.Abstractions"; version = "5.0.0"; sha256 = "17cz6s80va0ch0a6nqa1wbbbp3p8sqxb96lj4qcw67ivkp2yxiyj"; })
-  (fetchNuGet { pname = "Microsoft.Extensions.DependencyModel"; version = "2.0.4"; sha256 = "041i1vlcibpzgalxxzdk81g5pgmqvmz2g61k0rqa2sky0wpvijx9"; })
-  (fetchNuGet { pname = "Microsoft.Extensions.FileProviders.Abstractions"; version = "5.0.0"; sha256 = "01ahgd0b2z2zycrr2lcsq2cl59fn04bh51hdwdp9dcsdkpvnasj1"; })
-  (fetchNuGet { pname = "Microsoft.Extensions.FileProviders.Physical"; version = "5.0.0"; sha256 = "00vii8148a6pk12l9jl0rhjp7apil5q5qcy7v1smnv17lj4p8szd"; })
-  (fetchNuGet { pname = "Microsoft.Extensions.FileSystemGlobbing"; version = "5.0.0"; sha256 = "0lm6n9vbyjh0l17qcc2y9qwn1cns3dyjmkvbxjp0g9sll32kjpmb"; })
-  (fetchNuGet { pname = "Microsoft.Extensions.Logging"; version = "2.0.0"; sha256 = "1jkwjcq1ld9znz1haazk8ili2g4pzfdp6i7r7rki4hg3jcadn386"; })
-  (fetchNuGet { pname = "Microsoft.Extensions.Logging"; version = "5.0.0"; sha256 = "1qa1l18q2jh9azya8gv1p8anzcdirjzd9dxxisb4911i9m1648i3"; })
-  (fetchNuGet { pname = "Microsoft.Extensions.Logging.Abstractions"; version = "5.0.0"; sha256 = "1yza38675dbv1qqnnhqm23alv2bbaqxp0pb7zinjmw8j2mr5r6wc"; })
-  (fetchNuGet { pname = "Microsoft.Extensions.Options"; version = "2.0.0"; sha256 = "0g4zadlg73f507krilhaaa7h0jdga216syrzjlyf5fdk25gxmjqh"; })
-  (fetchNuGet { pname = "Microsoft.Extensions.Options"; version = "5.0.0"; sha256 = "1rdmgpg770x8qwaaa6ryc27zh93p697fcyvn5vkxp0wimlhqkbay"; })
-  (fetchNuGet { pname = "Microsoft.Extensions.Options.ConfigurationExtensions"; version = "2.0.0"; sha256 = "1isc3rjbzz60f7wbmgcwslx5d10hm5hisnk7v54vfi2bz7132gll"; })
-  (fetchNuGet { pname = "Microsoft.Extensions.Primitives"; version = "2.0.0"; sha256 = "1xppr5jbny04slyjgngxjdm0maxdh47vq481ps944d7jrfs0p3mb"; })
-  (fetchNuGet { pname = "Microsoft.Extensions.Primitives"; version = "5.0.0"; sha256 = "0swqcknyh87ns82w539z1mvy804pfwhgzs97cr3nwqk6g5s42gd6"; })
-  (fetchNuGet { pname = "Microsoft.NETCore.Platforms"; version = "1.0.1"; sha256 = "01al6cfxp68dscl15z7rxfw9zvhm64dncsw09a1vmdkacsa2v6lr"; })
-  (fetchNuGet { pname = "Microsoft.NETCore.Platforms"; version = "1.1.0"; sha256 = "08vh1r12g6ykjygq5d3vq09zylgb84l63k49jc4v8faw9g93iqqm"; })
-  (fetchNuGet { pname = "Microsoft.NETCore.Platforms"; version = "2.1.2"; sha256 = "1507hnpr9my3z4w1r6xk5n0s1j3y6a2c2cnynj76za7cphxi1141"; })
-  (fetchNuGet { pname = "Microsoft.NETCore.Platforms"; version = "3.0.0"; sha256 = "1bk8r4r3ihmi6322jmcag14jmw11mjqys202azqjzglcx59pxh51"; })
-  (fetchNuGet { pname = "Microsoft.NETCore.Targets"; version = "1.0.1"; sha256 = "0ppdkwy6s9p7x9jix3v4402wb171cdiibq7js7i13nxpdky7074p"; })
-  (fetchNuGet { pname = "Microsoft.NETCore.Targets"; version = "1.1.0"; sha256 = "193xwf33fbm0ni3idxzbr5fdq3i2dlfgihsac9jj7whj0gd902nh"; })
-  (fetchNuGet { pname = "Microsoft.TestPlatform.Extensions.TrxLogger"; version = "17.9.0"; sha256 = "0wn38vj9i4gjw5zsl4wcivpqrmp1h5n6m1zxcfwj7yjn9hf45rz9"; })
-  (fetchNuGet { pname = "Microsoft.TestPlatform.ObjectModel"; version = "17.9.0"; sha256 = "1kgsl9w9fganbm9wvlkqgk0ag9hfi58z88rkfybc6kvg78bx89ca"; })
-  (fetchNuGet { pname = "Microsoft.TestPlatform.TestHost"; version = "17.9.0"; sha256 = "19ffh31a1jxzn8j69m1vnk5hyfz3dbxmflq77b8x82zybiilh5nl"; })
-  (fetchNuGet { pname = "Microsoft.VisualStudio.Threading"; version = "16.7.56"; sha256 = "13x0xrsjxd86clf9cjjwmpzlyp8pkrf13riya7igs8zy93zw2qap"; })
-  (fetchNuGet { pname = "Microsoft.VisualStudio.Threading.Analyzers"; version = "16.7.56"; sha256 = "04v9df0k7bsc0rzgkw4mnvi43pdrh42vk6xdcwn9m6im33m0nnz2"; })
-  (fetchNuGet { pname = "Microsoft.VisualStudio.Validation"; version = "15.5.31"; sha256 = "1ah99rn922qa0sd2k3h64m324f2r32pw8cn4cfihgvwx4qdrpmgw"; })
-  (fetchNuGet { pname = "Microsoft.Win32.Primitives"; version = "4.3.0"; sha256 = "0j0c1wj4ndj21zsgivsc24whiya605603kxrbiw6wkfdync464wq"; })
-  (fetchNuGet { pname = "Microsoft.Win32.Registry"; version = "4.6.0"; sha256 = "0i4y782yrqqyx85pg597m20gm0v126w0j9ddk5z7xb3crx4z9f2s"; })
-  (fetchNuGet { pname = "Microsoft.Win32.SystemEvents"; version = "6.0.0"; sha256 = "0c6pcj088g1yd1vs529q3ybgsd2vjlk5y1ic6dkmbhvrp5jibl9p"; })
-  (fetchNuGet { pname = "Nerdbank.Streams"; version = "2.6.81"; sha256 = "06wihcaga8537ibh0mkj28m720m6vzkqk562zkynhca85nd236yi"; })
-  (fetchNuGet { pname = "Newtonsoft.Json"; version = "11.0.2"; sha256 = "1784xi44f4k8v1fr696hsccmwpy94bz7kixxqlri98zhcxn406b2"; })
-  (fetchNuGet { pname = "Newtonsoft.Json"; version = "13.0.1"; sha256 = "0fijg0w6iwap8gvzyjnndds0q4b8anwxxvik7y8vgq97dram4srb"; })
-  (fetchNuGet { pname = "OmniSharp.Extensions.JsonRpc"; version = "0.19.5"; sha256 = "0ilcv3cxcvjkd8ngiydi69pzll07rhqdv5nq9yjnhyj142ynw2cb"; })
-  (fetchNuGet { pname = "OmniSharp.Extensions.JsonRpc.Generators"; version = "0.19.5"; sha256 = "1mac4yx29ld8fyirg7n0vqn81hzdvcrl8w0l9w5xhnnm6bcd42v8"; })
-  (fetchNuGet { pname = "OmniSharp.Extensions.LanguageProtocol"; version = "0.19.5"; sha256 = "1clgrbw6dlh46iiiqhavwh15xqar41az352mb5r4ln8ql3wnmk1i"; })
-  (fetchNuGet { pname = "OmniSharp.Extensions.LanguageServer"; version = "0.19.5"; sha256 = "0cvxmc0r4ajnaah7lsppik61qickq7i0df4jwqaj6c6axiizhqlm"; })
-  (fetchNuGet { pname = "OmniSharp.Extensions.LanguageServer.Shared"; version = "0.19.5"; sha256 = "0cczmmsmn3pj74wpasgfhjay1a817sd0zgzgqvvnckxxzq3n463h"; })
-  (fetchNuGet { pname = "RangeTree"; version = "3.0.1"; sha256 = "19si88v2r0rc7kai1avwhigcvh3x3c916vrvqlyb59sn4f27pbm2"; })
-  (fetchNuGet { pname = "runtime.any.System.Collections"; version = "4.3.0"; sha256 = "0bv5qgm6vr47ynxqbnkc7i797fdi8gbjjxii173syrx14nmrkwg0"; })
-  (fetchNuGet { pname = "runtime.any.System.Diagnostics.Tracing"; version = "4.3.0"; sha256 = "00j6nv2xgmd3bi347k00m7wr542wjlig53rmj28pmw7ddcn97jbn"; })
-  (fetchNuGet { pname = "runtime.any.System.Globalization"; version = "4.3.0"; sha256 = "1daqf33hssad94lamzg01y49xwndy2q97i2lrb7mgn28656qia1x"; })
-  (fetchNuGet { pname = "runtime.any.System.IO"; version = "4.3.0"; sha256 = "0l8xz8zn46w4d10bcn3l4yyn4vhb3lrj2zw8llvz7jk14k4zps5x"; })
-  (fetchNuGet { pname = "runtime.any.System.Reflection"; version = "4.3.0"; sha256 = "02c9h3y35pylc0zfq3wcsvc5nqci95nrkq0mszifc0sjx7xrzkly"; })
-  (fetchNuGet { pname = "runtime.any.System.Reflection.Extensions"; version = "4.3.0"; sha256 = "0zyri97dfc5vyaz9ba65hjj1zbcrzaffhsdlpxc9bh09wy22fq33"; })
-  (fetchNuGet { pname = "runtime.any.System.Reflection.Primitives"; version = "4.3.0"; sha256 = "0x1mm8c6iy8rlxm8w9vqw7gb7s1ljadrn049fmf70cyh42vdfhrf"; })
-  (fetchNuGet { pname = "runtime.any.System.Resources.ResourceManager"; version = "4.3.0"; sha256 = "03kickal0iiby82wa5flar18kyv82s9s6d4xhk5h4bi5kfcyfjzl"; })
-  (fetchNuGet { pname = "runtime.any.System.Runtime"; version = "4.3.0"; sha256 = "1cqh1sv3h5j7ixyb7axxbdkqx6cxy00p4np4j91kpm492rf4s25b"; })
-  (fetchNuGet { pname = "runtime.any.System.Runtime.Handles"; version = "4.3.0"; sha256 = "0bh5bi25nk9w9xi8z23ws45q5yia6k7dg3i4axhfqlnj145l011x"; })
-  (fetchNuGet { pname = "runtime.any.System.Runtime.InteropServices"; version = "4.3.0"; sha256 = "0c3g3g3jmhlhw4klrc86ka9fjbl7i59ds1fadsb2l8nqf8z3kb19"; })
-  (fetchNuGet { pname = "runtime.any.System.Text.Encoding"; version = "4.3.0"; sha256 = "0aqqi1v4wx51h51mk956y783wzags13wa7mgqyclacmsmpv02ps3"; })
-  (fetchNuGet { pname = "runtime.any.System.Text.Encoding.Extensions"; version = "4.3.0"; sha256 = "0lqhgqi0i8194ryqq6v2gqx0fb86db2gqknbm0aq31wb378j7ip8"; })
-  (fetchNuGet { pname = "runtime.any.System.Threading.Tasks"; version = "4.3.0"; sha256 = "03mnvkhskbzxddz4hm113zsch1jyzh2cs450dk3rgfjp8crlw1va"; })
-  (fetchNuGet { pname = "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "16rnxzpk5dpbbl1x354yrlsbvwylrq456xzpsha1n9y3glnhyx9d"; })
-  (fetchNuGet { pname = "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "0hkg03sgm2wyq8nqk6dbm9jh5vcq57ry42lkqdmfklrw89lsmr59"; })
-  (fetchNuGet { pname = "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "0c2p354hjx58xhhz7wv6div8xpi90sc6ibdm40qin21bvi7ymcaa"; })
-  (fetchNuGet { pname = "runtime.native.System"; version = "4.0.0"; sha256 = "1ppk69xk59ggacj9n7g6fyxvzmk1g5p4fkijm0d7xqfkig98qrkf"; })
-  (fetchNuGet { pname = "runtime.native.System"; version = "4.3.0"; sha256 = "15hgf6zaq9b8br2wi1i3x0zvmk410nlmsmva9p0bbg73v6hml5k4"; })
-  (fetchNuGet { pname = "runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "18pzfdlwsg2nb1jjjjzyb5qlgy6xjxzmhnfaijq5s2jw3cm3ab97"; })
-  (fetchNuGet { pname = "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "0qyynf9nz5i7pc26cwhgi8j62ps27sqmf78ijcfgzab50z9g8ay3"; })
-  (fetchNuGet { pname = "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "1klrs545awhayryma6l7g2pvnp9xy4z0r1i40r80zb45q3i9nbyf"; })
-  (fetchNuGet { pname = "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "0zcxjv5pckplvkg0r6mw3asggm7aqzbdjimhvsasb0cgm59x09l3"; })
-  (fetchNuGet { pname = "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "0vhynn79ih7hw7cwjazn87rm9z9fj0rvxgzlab36jybgcpcgphsn"; })
-  (fetchNuGet { pname = "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "160p68l2c7cqmyqjwxydcvgw7lvl1cr0znkw8fp24d1by9mqc8p3"; })
-  (fetchNuGet { pname = "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "15zrc8fgd8zx28hdghcj5f5i34wf3l6bq5177075m2bc2j34jrqy"; })
-  (fetchNuGet { pname = "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; sha256 = "1p4dgxax6p7rlgj4q73k73rslcnz4wdcv8q2flg1s8ygwcm58ld5"; })
-  (fetchNuGet { pname = "runtime.unix.Microsoft.Win32.Primitives"; version = "4.3.0"; sha256 = "0y61k9zbxhdi0glg154v30kkq7f8646nif8lnnxbvkjpakggd5id"; })
-  (fetchNuGet { pname = "runtime.unix.System.Diagnostics.Debug"; version = "4.3.0"; sha256 = "1lps7fbnw34bnh3lm31gs5c0g0dh7548wfmb8zz62v0zqz71msj5"; })
-  (fetchNuGet { pname = "runtime.unix.System.IO.FileSystem"; version = "4.3.0"; sha256 = "14nbkhvs7sji5r1saj2x8daz82rnf9kx28d3v2qss34qbr32dzix"; })
-  (fetchNuGet { pname = "runtime.unix.System.Private.Uri"; version = "4.3.0"; sha256 = "1jx02q6kiwlvfksq1q9qr17fj78y5v6mwsszav4qcz9z25d5g6vk"; })
-  (fetchNuGet { pname = "runtime.unix.System.Runtime.Extensions"; version = "4.3.0"; sha256 = "0pnxxmm8whx38dp6yvwgmh22smknxmqs5n513fc7m4wxvs1bvi4p"; })
-  (fetchNuGet { pname = "Serilog"; version = "2.12.0"; sha256 = "0lqxpc96qcjkv9pr1rln7mi4y7n7jdi4vb36c2fv3845w1vswgr4"; })
-  (fetchNuGet { pname = "Serilog.Extensions.Logging"; version = "3.0.1"; sha256 = "069qy7dm5nxb372ij112ppa6m99b4iaimj3sji74m659fwrcrl9a"; })
-  (fetchNuGet { pname = "Serilog.Settings.Configuration"; version = "3.1.0"; sha256 = "1cj5am4n073331gbfm2ylqb9cadl4q3ppzgwmm5c8m1drxpiwkb5"; })
-  (fetchNuGet { pname = "Serilog.Sinks.Debug"; version = "2.0.0"; sha256 = "1i7j870l47gan3gpnnlzkccn5lbm7518cnkp25a3g5gp9l0dbwpw"; })
-  (fetchNuGet { pname = "Serilog.Sinks.File"; version = "5.0.0"; sha256 = "097rngmgcrdfy7jy8j7dq3xaq2qky8ijwg0ws6bfv5lx0f3vvb0q"; })
-  (fetchNuGet { pname = "System.AppContext"; version = "4.1.0"; sha256 = "0fv3cma1jp4vgj7a8hqc9n7hr1f1kjp541s6z0q1r6nazb4iz9mz"; })
-  (fetchNuGet { pname = "System.Buffers"; version = "4.3.0"; sha256 = "0fgns20ispwrfqll4q1zc1waqcmylb3zc50ys9x8zlwxh9pmd9jy"; })
-  (fetchNuGet { pname = "System.Collections"; version = "4.3.0"; sha256 = "19r4y64dqyrq6k4706dnyhhw7fs24kpp3awak7whzss39dakpxk9"; })
-  (fetchNuGet { pname = "System.Collections.Immutable"; version = "1.7.0"; sha256 = "1gik4sn9jsi1wcy1pyyp0r4sn2g17cwrsh24b2d52vif8p2h24zx"; })
-  (fetchNuGet { pname = "System.Collections.Immutable"; version = "1.7.1"; sha256 = "1nh4nlxfc7lbnbl86wwk1a3jwl6myz5j6hvgh5sp4krim9901hsq"; })
-  (fetchNuGet { pname = "System.CommandLine"; version = "2.0.0-beta4.22272.1"; sha256 = "1iy5hwwgvx911g3yq65p4zsgpy08w4qz9j3h0igcf7yci44vw8yd"; })
-  (fetchNuGet { pname = "System.Configuration.ConfigurationManager"; version = "6.0.0"; sha256 = "0sqapr697jbb4ljkq46msg0xx1qpmc31ivva6llyz2wzq3mpmxbw"; })
-  (fetchNuGet { pname = "System.Diagnostics.Debug"; version = "4.3.0"; sha256 = "00yjlf19wjydyr6cfviaph3vsjzg3d5nvnya26i2fvfg53sknh3y"; })
-  (fetchNuGet { pname = "System.Diagnostics.Tracing"; version = "4.3.0"; sha256 = "1m3bx6c2s958qligl67q7grkwfz3w53hpy7nc97mh6f7j5k168c4"; })
-  (fetchNuGet { pname = "System.Drawing.Common"; version = "6.0.0"; sha256 = "02n8rzm58dac2np8b3xw8ychbvylja4nh6938l5k2fhyn40imlgz"; })
-  (fetchNuGet { pname = "System.Dynamic.Runtime"; version = "4.0.11"; sha256 = "1pla2dx8gkidf7xkciig6nifdsb494axjvzvann8g2lp3dbqasm9"; })
-  (fetchNuGet { pname = "System.Globalization"; version = "4.0.11"; sha256 = "070c5jbas2v7smm660zaf1gh0489xanjqymkvafcs4f8cdrs1d5d"; })
-  (fetchNuGet { pname = "System.Globalization"; version = "4.3.0"; sha256 = "1cp68vv683n6ic2zqh2s1fn4c2sd87g5hpp6l4d4nj4536jz98ki"; })
-  (fetchNuGet { pname = "System.IO"; version = "4.1.0"; sha256 = "1g0yb8p11vfd0kbkyzlfsbsp5z44lwsvyc0h3dpw6vqnbi035ajp"; })
-  (fetchNuGet { pname = "System.IO"; version = "4.3.0"; sha256 = "05l9qdrzhm4s5dixmx68kxwif4l99ll5gqmh7rqgw554fx0agv5f"; })
-  (fetchNuGet { pname = "System.IO.FileSystem"; version = "4.0.1"; sha256 = "0kgfpw6w4djqra3w5crrg8xivbanh1w9dh3qapb28q060wb9flp1"; })
-  (fetchNuGet { pname = "System.IO.FileSystem.Primitives"; version = "4.3.0"; sha256 = "0j6ndgglcf4brg2lz4wzsh1av1gh8xrzdsn9f0yznskhqn1xzj9c"; })
-  (fetchNuGet { pname = "System.IO.Pipelines"; version = "4.7.3"; sha256 = "0djp59x56klidi04xx8p5jc1nchv5zvd1d59diphqxwvgny3aawy"; })
-  (fetchNuGet { pname = "System.Linq"; version = "4.1.0"; sha256 = "1ppg83svb39hj4hpp5k7kcryzrf3sfnm08vxd5sm2drrijsla2k5"; })
-  (fetchNuGet { pname = "System.Linq.Async"; version = "6.0.1"; sha256 = "10ira8hmv0i54yp9ggrrdm1c06j538sijfjpn1kmnh9j2xk5yzmq"; })
-  (fetchNuGet { pname = "System.Linq.Expressions"; version = "4.1.0"; sha256 = "1gpdxl6ip06cnab7n3zlcg6mqp7kknf73s8wjinzi4p0apw82fpg"; })
-  (fetchNuGet { pname = "System.Memory"; version = "4.5.4"; sha256 = "14gbbs22mcxwggn0fcfs1b062521azb9fbb7c113x0mq6dzq9h6y"; })
-  (fetchNuGet { pname = "System.Net.WebSockets"; version = "4.3.0"; sha256 = "1gfj800078kggcgl0xyl00a6y5k4wwh2k2qm69rjy22wbmq7fy4p"; })
-  (fetchNuGet { pname = "System.ObjectModel"; version = "4.0.12"; sha256 = "1sybkfi60a4588xn34nd9a58png36i0xr4y4v4kqpg8wlvy5krrj"; })
-  (fetchNuGet { pname = "System.Private.Uri"; version = "4.3.0"; sha256 = "04r1lkdnsznin0fj4ya1zikxiqr0h6r6a1ww2dsm60gqhdrf0mvx"; })
-  (fetchNuGet { pname = "System.Reactive"; version = "4.4.1"; sha256 = "0gx8jh3hny2y5kijz5k9pxiqw481d013787c04zlhps21ygklw4a"; })
-  (fetchNuGet { pname = "System.Reflection"; version = "4.1.0"; sha256 = "1js89429pfw79mxvbzp8p3q93il6rdff332hddhzi5wqglc4gml9"; })
-  (fetchNuGet { pname = "System.Reflection"; version = "4.3.0"; sha256 = "0xl55k0mw8cd8ra6dxzh974nxif58s3k1rjv1vbd7gjbjr39j11m"; })
-  (fetchNuGet { pname = "System.Reflection.Emit"; version = "4.0.1"; sha256 = "0ydqcsvh6smi41gyaakglnv252625hf29f7kywy2c70nhii2ylqp"; })
-  (fetchNuGet { pname = "System.Reflection.Emit.ILGeneration"; version = "4.0.1"; sha256 = "1pcd2ig6bg144y10w7yxgc9d22r7c7ww7qn1frdfwgxr24j9wvv0"; })
-  (fetchNuGet { pname = "System.Reflection.Emit.Lightweight"; version = "4.0.1"; sha256 = "1s4b043zdbx9k39lfhvsk68msv1nxbidhkq6nbm27q7sf8xcsnxr"; })
-  (fetchNuGet { pname = "System.Reflection.Extensions"; version = "4.0.1"; sha256 = "0m7wqwq0zqq9gbpiqvgk3sr92cbrw7cp3xn53xvw7zj6rz6fdirn"; })
-  (fetchNuGet { pname = "System.Reflection.Metadata"; version = "1.6.0"; sha256 = "1wdbavrrkajy7qbdblpbpbalbdl48q3h34cchz24gvdgyrlf15r4"; })
-  (fetchNuGet { pname = "System.Reflection.Primitives"; version = "4.0.1"; sha256 = "1bangaabhsl4k9fg8khn83wm6yial8ik1sza7401621jc6jrym28"; })
-  (fetchNuGet { pname = "System.Reflection.Primitives"; version = "4.3.0"; sha256 = "04xqa33bld78yv5r93a8n76shvc8wwcdgr1qvvjh959g3rc31276"; })
-  (fetchNuGet { pname = "System.Reflection.TypeExtensions"; version = "4.1.0"; sha256 = "1bjli8a7sc7jlxqgcagl9nh8axzfl11f4ld3rjqsyxc516iijij7"; })
-  (fetchNuGet { pname = "System.Resources.ResourceManager"; version = "4.0.1"; sha256 = "0b4i7mncaf8cnai85jv3wnw6hps140cxz8vylv2bik6wyzgvz7bi"; })
-  (fetchNuGet { pname = "System.Resources.ResourceManager"; version = "4.3.0"; sha256 = "0sjqlzsryb0mg4y4xzf35xi523s4is4hz9q4qgdvlvgivl7qxn49"; })
-  (fetchNuGet { pname = "System.Runtime"; version = "4.1.0"; sha256 = "02hdkgk13rvsd6r9yafbwzss8kr55wnj8d5c7xjnp8gqrwc8sn0m"; })
-  (fetchNuGet { pname = "System.Runtime"; version = "4.3.0"; sha256 = "066ixvgbf2c929kgknshcxqj6539ax7b9m570cp8n179cpfkapz7"; })
-  (fetchNuGet { pname = "System.Runtime.Caching"; version = "6.0.0"; sha256 = "0wh98a77cby4i3h2mar241k01105x661kh03vlyd399shxkfk60a"; })
-  (fetchNuGet { pname = "System.Runtime.CompilerServices.Unsafe"; version = "4.4.0"; sha256 = "0a6ahgi5b148sl5qyfpyw383p3cb4yrkm802k29fsi4mxkiwir29"; })
-  (fetchNuGet { pname = "System.Runtime.CompilerServices.Unsafe"; version = "4.7.0"; sha256 = "16r6sn4czfjk8qhnz7bnqlyiaaszr0ihinb7mq9zzr1wba257r54"; })
-  (fetchNuGet { pname = "System.Runtime.CompilerServices.Unsafe"; version = "4.7.1"; sha256 = "119br3pd85lq8zcgh4f60jzmv1g976q1kdgi3hvqdlhfbw6siz2j"; })
-  (fetchNuGet { pname = "System.Runtime.Extensions"; version = "4.1.0"; sha256 = "0rw4rm4vsm3h3szxp9iijc3ksyviwsv6f63dng3vhqyg4vjdkc2z"; })
-  (fetchNuGet { pname = "System.Runtime.Extensions"; version = "4.3.0"; sha256 = "1ykp3dnhwvm48nap8q23893hagf665k0kn3cbgsqpwzbijdcgc60"; })
-  (fetchNuGet { pname = "System.Runtime.Handles"; version = "4.0.1"; sha256 = "1g0zrdi5508v49pfm3iii2hn6nm00bgvfpjq1zxknfjrxxa20r4g"; })
-  (fetchNuGet { pname = "System.Runtime.Handles"; version = "4.3.0"; sha256 = "0sw2gfj2xr7sw9qjn0j3l9yw07x73lcs97p8xfc9w1x9h5g5m7i8"; })
-  (fetchNuGet { pname = "System.Runtime.InteropServices"; version = "4.1.0"; sha256 = "01kxqppx3dr3b6b286xafqilv4s2n0gqvfgzfd4z943ga9i81is1"; })
-  (fetchNuGet { pname = "System.Runtime.InteropServices"; version = "4.3.0"; sha256 = "00hywrn4g7hva1b2qri2s6rabzwgxnbpw9zfxmz28z09cpwwgh7j"; })
-  (fetchNuGet { pname = "System.Runtime.InteropServices.RuntimeInformation"; version = "4.0.0"; sha256 = "0glmvarf3jz5xh22iy3w9v3wyragcm4hfdr17v90vs7vcrm7fgp6"; })
-  (fetchNuGet { pname = "System.Runtime.Numerics"; version = "4.3.0"; sha256 = "19rav39sr5dky7afygh309qamqqmi9kcwvz3i0c5700v0c5cg61z"; })
-  (fetchNuGet { pname = "System.Security.AccessControl"; version = "4.6.0"; sha256 = "1wl1dyghi0qhpap1vgfhg2ybdyyhy9vc2a7dpm1xb30vfgmlkjmf"; })
-  (fetchNuGet { pname = "System.Security.AccessControl"; version = "6.0.0"; sha256 = "0a678bzj8yxxiffyzy60z2w1nczzpi8v97igr4ip3byd2q89dv58"; })
-  (fetchNuGet { pname = "System.Security.Cryptography.ProtectedData"; version = "6.0.0"; sha256 = "05kd3a8w7658hjxq9vvszxip30a479fjmfq4bq1r95nrsvs4hbss"; })
-  (fetchNuGet { pname = "System.Security.Permissions"; version = "6.0.0"; sha256 = "0jsl4xdrkqi11iwmisi1r2f2qn5pbvl79mzq877gndw6ans2zhzw"; })
-  (fetchNuGet { pname = "System.Security.Principal.Windows"; version = "4.6.0"; sha256 = "1jmfzfz1n8hp63s5lja5xxpzkinbp6g59l3km9h8avjiisdrg5wm"; })
-  (fetchNuGet { pname = "System.Text.Encoding"; version = "4.0.11"; sha256 = "1dyqv0hijg265dwxg6l7aiv74102d6xjiwplh2ar1ly6xfaa4iiw"; })
-  (fetchNuGet { pname = "System.Text.Encoding"; version = "4.3.0"; sha256 = "1f04lkir4iladpp51sdgmis9dj4y8v08cka0mbmsy0frc9a4gjqr"; })
-  (fetchNuGet { pname = "System.Text.Encoding.CodePages"; version = "4.5.1"; sha256 = "1z21qyfs6sg76rp68qdx0c9iy57naan89pg7p6i3qpj8kyzn921w"; })
-  (fetchNuGet { pname = "System.Text.Encoding.Extensions"; version = "4.3.0"; sha256 = "11q1y8hh5hrp5a3kw25cb6l00v5l5dvirkz8jr3sq00h1xgcgrxy"; })
-  (fetchNuGet { pname = "System.Threading"; version = "4.0.11"; sha256 = "19x946h926bzvbsgj28csn46gak2crv2skpwsx80hbgazmkgb1ls"; })
-  (fetchNuGet { pname = "System.Threading"; version = "4.3.0"; sha256 = "0rw9wfamvhayp5zh3j7p1yfmx9b5khbf4q50d8k5rk993rskfd34"; })
-  (fetchNuGet { pname = "System.Threading.Channels"; version = "4.7.1"; sha256 = "038fyrriypwzsj5fwgnkw79hm5ya0x63r724yizgahbxf512chr2"; })
-  (fetchNuGet { pname = "System.Threading.Tasks"; version = "4.0.11"; sha256 = "0nr1r41rak82qfa5m0lhk9mp0k93bvfd7bbd9sdzwx9mb36g28p5"; })
-  (fetchNuGet { pname = "System.Threading.Tasks"; version = "4.3.0"; sha256 = "134z3v9abw3a6jsw17xl3f6hqjpak5l682k2vz39spj4kmydg6k7"; })
-  (fetchNuGet { pname = "System.Threading.Tasks.Extensions"; version = "4.5.3"; sha256 = "0g7r6hm572ax8v28axrdxz1gnsblg6kszq17g51pj14a5rn2af7i"; })
-  (fetchNuGet { pname = "System.Windows.Extensions"; version = "6.0.0"; sha256 = "1wy9pq9vn1bqg5qnv53iqrbx04yzdmjw4x5yyi09y3459vaa1sip"; })
-  (fetchNuGet { pname = "Tomlyn"; version = "0.16.2"; sha256 = "1i928q6a7l65mk7wj2vvfclyvxamdjxg4dbj3g6g95inrfgvidah"; })
+  (fetchNuGet { pname = "Boogie"; version = "3.1.3"; hash = "sha256-0XQcD1ImPNPXQ43fTkahC3qr2zUvHNdmgw0tmYE+7Hc="; })
+  (fetchNuGet { pname = "Boogie.AbstractInterpretation"; version = "3.2.3"; hash = "sha256-SwJ5D3tOU+qcyQdNITIM15ujMEC++aXHOsUSovWbsC4="; })
+  (fetchNuGet { pname = "Boogie.BaseTypes"; version = "3.2.3"; hash = "sha256-cIUdpGGjMKn70Z0nD8rvva8UbFSoLDUrBprC+TMG/EA="; })
+  (fetchNuGet { pname = "Boogie.CodeContractsExtender"; version = "3.2.3"; hash = "sha256-L+phJ66oHNINliPkabU3vO4Vl9Lkv+nug+DWC8VmFlc="; })
+  (fetchNuGet { pname = "Boogie.Concurrency"; version = "3.2.3"; hash = "sha256-w+5B+uyfKCf8j8hP0G/SSPUd2lT2T8A4Lkg0tsxniBg="; })
+  (fetchNuGet { pname = "Boogie.Core"; version = "3.2.3"; hash = "sha256-qqoeLAdpRRaTISdgxyE3iFqhrmezxISaE5bm02rXVyE="; })
+  (fetchNuGet { pname = "Boogie.ExecutionEngine"; version = "3.2.3"; hash = "sha256-8EKwiBnoMFGxeK2+IuG5p6BtnPlR0CCekXi4PBFLEbU="; })
+  (fetchNuGet { pname = "Boogie.Graph"; version = "3.2.3"; hash = "sha256-7XjrCHSnvEL7eMmma2vKA7r8YGJe8Oo4E8U9Wja/al0="; })
+  (fetchNuGet { pname = "Boogie.Houdini"; version = "3.2.3"; hash = "sha256-g7i0yF/89IWXElTi0onOgvPaesqlPGl3qINMCePHGA8="; })
+  (fetchNuGet { pname = "Boogie.Model"; version = "3.2.3"; hash = "sha256-gRMZQQFMjQEQasg3A3iZ9/0KUWCxAoUPiHPZHbWXUs4="; })
+  (fetchNuGet { pname = "Boogie.Provers.LeanAuto"; version = "3.2.3"; hash = "sha256-kMLvTTnvKWjggSby7D4jkaRmdvvOum0ZlfM6yU2760Q="; })
+  (fetchNuGet { pname = "Boogie.Provers.SMTLib"; version = "3.2.3"; hash = "sha256-SCfEJCRueTE66ZZbHX8FHpD50SrBDQne8725uiKjbvM="; })
+  (fetchNuGet { pname = "Boogie.VCExpr"; version = "3.2.3"; hash = "sha256-U6Rc5P0dUtNZ1IGDBU4hggwreVxSZqu6cZSKcWLpq/o="; })
+  (fetchNuGet { pname = "Boogie.VCGeneration"; version = "3.2.3"; hash = "sha256-snbFiueD508B1GLqIC8cQdT9jW2jkRyhmYxPTlfnyrQ="; })
+  (fetchNuGet { pname = "CocoR"; version = "2014.12.25"; hash = "sha256-qxTcnqh7jziriMHwos5/YArRYUG2+3nNoYYmFyPo8E0="; })
+  (fetchNuGet { pname = "JetBrains.Annotations"; version = "2021.1.0"; hash = "sha256-64Vc/jHHG5tzaQrmlaU3y7+9qj3jT1V5vRr1R3uH9h4="; })
+  (fetchNuGet { pname = "MediatR"; version = "8.1.0"; hash = "sha256-dyqhDG1NJjY1b+dj37sMmklGkxAm3zKdhh2lBJ0/HTM="; })
+  (fetchNuGet { pname = "Microsoft.Bcl.AsyncInterfaces"; version = "1.1.1"; hash = "sha256-fAcX4sxE0veWM1CZBtXR/Unky+6sE33yrV7ohrWGKig="; })
+  (fetchNuGet { pname = "Microsoft.Bcl.AsyncInterfaces"; version = "6.0.0"; hash = "sha256-49+H/iFwp+AfCICvWcqo9us4CzxApPKC37Q5Eqrw+JU="; })
+  (fetchNuGet { pname = "Microsoft.DotNet.PlatformAbstractions"; version = "2.0.4"; hash = "sha256-Eu3aY2f4gZWQLJHdVV98tu5Rn1uQ8f9UKQumGomlv7k="; })
+  (fetchNuGet { pname = "Microsoft.Extensions.Configuration"; version = "2.0.0"; hash = "sha256-SSemrjaokMnzOF8ynrgEV6xEh4TlesUE7waW2BLuWns="; })
+  (fetchNuGet { pname = "Microsoft.Extensions.Configuration"; version = "5.0.0"; hash = "sha256-N3yQnqcwAKISG6HS8ZC3PFpBMK+xCTkZpOBtgOnfqQY="; })
+  (fetchNuGet { pname = "Microsoft.Extensions.Configuration.Abstractions"; version = "2.0.0"; hash = "sha256-jveXZPNvx30uWT3q80OA1YaSb4K/KGOhlyun97IXn8Y="; })
+  (fetchNuGet { pname = "Microsoft.Extensions.Configuration.Abstractions"; version = "5.0.0"; hash = "sha256-0+ywPdqMkx32+HcMHqAp00cWBE7aCNc09Xh2eRObHTs="; })
+  (fetchNuGet { pname = "Microsoft.Extensions.Configuration.Binder"; version = "2.0.0"; hash = "sha256-7GVLiJupIL3BS5XgB44M95TxzF4KwvVUsShko+pqO98="; })
+  (fetchNuGet { pname = "Microsoft.Extensions.Configuration.CommandLine"; version = "5.0.0"; hash = "sha256-rCJkSm04hn5z1DBxMO4d32Kqb8R65iG8KiFvQMu3kCA="; })
+  (fetchNuGet { pname = "Microsoft.Extensions.Configuration.FileExtensions"; version = "5.0.0"; hash = "sha256-41soBkRr6fPO7KYnXb+462KyXd23YZ0gT7WyPnISAvM="; })
+  (fetchNuGet { pname = "Microsoft.Extensions.Configuration.Json"; version = "5.0.0"; hash = "sha256-6Xp3Snr9/aNHPszduVdvPnSBoh40KRpuvnvJNRCJBUM="; })
+  (fetchNuGet { pname = "Microsoft.Extensions.DependencyInjection"; version = "2.0.0"; hash = "sha256-+KqiuV8ncy9b1xhtDExh4s4U57tKxqx4pAyr6d//EQU="; })
+  (fetchNuGet { pname = "Microsoft.Extensions.DependencyInjection"; version = "5.0.0"; hash = "sha256-RN478YJQE0YM0g+JztXp00w57CIF4bb48hSD/z3jTZc="; })
+  (fetchNuGet { pname = "Microsoft.Extensions.DependencyInjection.Abstractions"; version = "2.0.0"; hash = "sha256-H1rEnq/veRWvmp8qmUsrQkQIcVlKilUNzmmKsxJ0md8="; })
+  (fetchNuGet { pname = "Microsoft.Extensions.DependencyInjection.Abstractions"; version = "5.0.0"; hash = "sha256-0sfuxZ07HsMZJpKatDrW6I671uJBYWsUgAyoDZA2n50="; })
+  (fetchNuGet { pname = "Microsoft.Extensions.DependencyModel"; version = "2.0.4"; hash = "sha256-qcu4Lwd+aqFwBjOYJ37duL5bXkCz/d6pev+uyOgOMRA="; })
+  (fetchNuGet { pname = "Microsoft.Extensions.FileProviders.Abstractions"; version = "5.0.0"; hash = "sha256-QWpl951Ns5Zu4w2GAhcB1qVCmcCaUZEz8198sUB7UAU="; })
+  (fetchNuGet { pname = "Microsoft.Extensions.FileProviders.Physical"; version = "5.0.0"; hash = "sha256-7Wt0iaQnbFt12MczXHCh8apzJcyAykRFmNcoRAKKcQM="; })
+  (fetchNuGet { pname = "Microsoft.Extensions.FileSystemGlobbing"; version = "5.0.0"; hash = "sha256-q145xaBUpweu7GvPKn0b2rJgOU5eMIZPoABKv3ayplI="; })
+  (fetchNuGet { pname = "Microsoft.Extensions.Logging"; version = "2.0.0"; hash = "sha256-Bg3bFJPjQRJnPvlEc5v7lzwRaUTzKwXDtz81GjCTfMo="; })
+  (fetchNuGet { pname = "Microsoft.Extensions.Logging"; version = "5.0.0"; hash = "sha256-IyJiQk0xhESWjr231L7MsbFvFbphP6T8VwlKgVGgQeE="; })
+  (fetchNuGet { pname = "Microsoft.Extensions.Logging.Abstractions"; version = "5.0.0"; hash = "sha256-jJtcchUS8Spt/GddcDtWa4lN1RAVQ2sxDnu1cgwa6vs="; })
+  (fetchNuGet { pname = "Microsoft.Extensions.Options"; version = "2.0.0"; hash = "sha256-EMvaXxGzueI8lT97bYJQr0kAj1IK0pjnAcWN82hTnzw="; })
+  (fetchNuGet { pname = "Microsoft.Extensions.Options"; version = "5.0.0"; hash = "sha256-Xq2JIa2Rg9vnLnZ75k4ydyT4j2A+G6UUx6iDc959teU="; })
+  (fetchNuGet { pname = "Microsoft.Extensions.Options.ConfigurationExtensions"; version = "2.0.0"; hash = "sha256-lD4xwvlLRLdJ2WdaHWGpEIRWOtWcvbr4ccD8v2QeTMc="; })
+  (fetchNuGet { pname = "Microsoft.Extensions.Primitives"; version = "2.0.0"; hash = "sha256-q44LtMvyNEKSvgERvA+BrasKapP92Sc91QR4u2TJ9/Y="; })
+  (fetchNuGet { pname = "Microsoft.Extensions.Primitives"; version = "5.0.0"; hash = "sha256-pj1BdHlmYm5HZifp/yB3lwDkdw0/jcIF0vYg6O1kmGs="; })
+  (fetchNuGet { pname = "Microsoft.NETCore.Platforms"; version = "1.0.1"; hash = "sha256-mZotlGZqtrqDSoBrZhsxFe6fuOv5/BIo0w2Z2x0zVAU="; })
+  (fetchNuGet { pname = "Microsoft.NETCore.Platforms"; version = "1.1.0"; hash = "sha256-FeM40ktcObQJk4nMYShB61H/E8B7tIKfl9ObJ0IOcCM="; })
+  (fetchNuGet { pname = "Microsoft.NETCore.Platforms"; version = "3.0.0"; hash = "sha256-ocB+U+mMvi/xVwII7bGsIfAqSXiKVSnEMLHCODLJaK4="; })
+  (fetchNuGet { pname = "Microsoft.NETCore.Targets"; version = "1.0.1"; hash = "sha256-lxxw/Gy32xHi0fLgFWNj4YTFBSBkjx5l6ucmbTyf7V4="; })
+  (fetchNuGet { pname = "Microsoft.NETCore.Targets"; version = "1.1.0"; hash = "sha256-0AqQ2gMS8iNlYkrD+BxtIg7cXMnr9xZHtKAuN4bjfaQ="; })
+  (fetchNuGet { pname = "Microsoft.TestPlatform.Extensions.TrxLogger"; version = "17.9.0"; hash = "sha256-6edCHExW+iO5Y/2HamyB4daM746ME6p/4fKRmORGw3I="; })
+  (fetchNuGet { pname = "Microsoft.TestPlatform.ObjectModel"; version = "17.9.0"; hash = "sha256-iiXUFzpvT8OWdzMj9FGJDqanwHx40s1TXVY9l3ii+s0="; })
+  (fetchNuGet { pname = "Microsoft.TestPlatform.TestHost"; version = "17.9.0"; hash = "sha256-1BZIY1z+C9TROgdTV/tq4zsPy7Q71GQksr/LoMKAzqU="; })
+  (fetchNuGet { pname = "Microsoft.VisualStudio.Threading"; version = "16.7.56"; hash = "sha256-V2HB/0j+I/3iUT7mEVyeF11P/61cSpYcZQa1LnXuoI8="; })
+  (fetchNuGet { pname = "Microsoft.VisualStudio.Threading.Analyzers"; version = "16.7.56"; hash = "sha256-4lsL6hg1mposZ62buQWBud1B4raV8Pl+BkyvM4FraRM="; })
+  (fetchNuGet { pname = "Microsoft.VisualStudio.Validation"; version = "15.5.31"; hash = "sha256-/NWbGyad7wejY8QyxK8YWTgiRiUGjimaBgoLkWxOCao="; })
+  (fetchNuGet { pname = "Microsoft.Win32.Primitives"; version = "4.3.0"; hash = "sha256-mBNDmPXNTW54XLnPAUwBRvkIORFM7/j0D0I2SyQPDEg="; })
+  (fetchNuGet { pname = "Microsoft.Win32.Registry"; version = "4.6.0"; hash = "sha256-Wrj0Sc9srH5+ma0lCbgRYYP6gKgnlXcL6h7j7AU6nkQ="; })
+  (fetchNuGet { pname = "Microsoft.Win32.SystemEvents"; version = "6.0.0"; hash = "sha256-N9EVZbl5w1VnMywGXyaVWzT9lh84iaJ3aD48hIBk1zA="; })
+  (fetchNuGet { pname = "Nerdbank.Streams"; version = "2.6.81"; hash = "sha256-0Zshmi1IMWj9/MKUieffpgJxKhJyVgBXPKMg9RSDkRs="; })
+  (fetchNuGet { pname = "Newtonsoft.Json"; version = "11.0.2"; hash = "sha256-YhlAbGfwoxQzxb3Hef4iyV9eGdPQJJNd2GgSR0jsBJ0="; })
+  (fetchNuGet { pname = "Newtonsoft.Json"; version = "13.0.1"; hash = "sha256-K2tSVW4n4beRPzPu3rlVaBEMdGvWSv/3Q1fxaDh4Mjo="; })
+  (fetchNuGet { pname = "OmniSharp.Extensions.JsonRpc"; version = "0.19.5"; hash = "sha256-iwluvSBBemilT9iW3TDMB1D6bzKx+fgsalNu1tnYjEY="; })
+  (fetchNuGet { pname = "OmniSharp.Extensions.JsonRpc.Generators"; version = "0.19.5"; hash = "sha256-aAvS2DLVWtgLTxRwRDPb7cOALN7Anpejd6jRJLonTNU="; })
+  (fetchNuGet { pname = "OmniSharp.Extensions.LanguageProtocol"; version = "0.19.5"; hash = "sha256-Mcxq+aAYWUpyWVWU8VUgWeFeAuRbQRxjNATSZvjKj7I="; })
+  (fetchNuGet { pname = "OmniSharp.Extensions.LanguageServer"; version = "0.19.5"; hash = "sha256-lWL4Y+zKMCMV5pK4BuLBk0UczIz3anqgUlYqkgGrfTM="; })
+  (fetchNuGet { pname = "OmniSharp.Extensions.LanguageServer.Shared"; version = "0.19.5"; hash = "sha256-cBhiB/69T2b3xu+/D5o+AanglYTuaXU5OfIOW3WtnzE="; })
+  (fetchNuGet { pname = "RangeTree"; version = "3.0.1"; hash = "sha256-oq57hCNWp7I8xTtvExIbfcDNXoR8qxDVPCyDLDZCUac="; })
+  (fetchNuGet { pname = "runtime.any.System.Collections"; version = "4.3.0"; hash = "sha256-4PGZqyWhZ6/HCTF2KddDsbmTTjxs2oW79YfkberDZS8="; })
+  (fetchNuGet { pname = "runtime.any.System.Diagnostics.Tracing"; version = "4.3.0"; hash = "sha256-dsmTLGvt8HqRkDWP8iKVXJCS+akAzENGXKPV18W2RgI="; })
+  (fetchNuGet { pname = "runtime.any.System.Globalization"; version = "4.3.0"; hash = "sha256-PaiITTFI2FfPylTEk7DwzfKeiA/g/aooSU1pDcdwWLU="; })
+  (fetchNuGet { pname = "runtime.any.System.IO"; version = "4.3.0"; hash = "sha256-vej7ySRhyvM3pYh/ITMdC25ivSd0WLZAaIQbYj/6HVE="; })
+  (fetchNuGet { pname = "runtime.any.System.Reflection"; version = "4.3.0"; hash = "sha256-ns6f++lSA+bi1xXgmW1JkWFb2NaMD+w+YNTfMvyAiQk="; })
+  (fetchNuGet { pname = "runtime.any.System.Reflection.Extensions"; version = "4.3.0"; hash = "sha256-Y2AnhOcJwJVYv7Rp6Jz6ma0fpITFqJW+8rsw106K2X8="; })
+  (fetchNuGet { pname = "runtime.any.System.Reflection.Primitives"; version = "4.3.0"; hash = "sha256-LkPXtiDQM3BcdYkAm5uSNOiz3uF4J45qpxn5aBiqNXQ="; })
+  (fetchNuGet { pname = "runtime.any.System.Resources.ResourceManager"; version = "4.3.0"; hash = "sha256-9EvnmZslLgLLhJ00o5MWaPuJQlbUFcUF8itGQNVkcQ4="; })
+  (fetchNuGet { pname = "runtime.any.System.Runtime"; version = "4.3.0"; hash = "sha256-qwhNXBaJ1DtDkuRacgHwnZmOZ1u9q7N8j0cWOLYOELM="; })
+  (fetchNuGet { pname = "runtime.any.System.Runtime.Handles"; version = "4.3.0"; hash = "sha256-PQRACwnSUuxgVySO1840KvqCC9F8iI9iTzxNW0RcBS4="; })
+  (fetchNuGet { pname = "runtime.any.System.Runtime.InteropServices"; version = "4.3.0"; hash = "sha256-Kaw5PnLYIiqWbsoF3VKJhy7pkpoGsUwn4ZDCKscbbzA="; })
+  (fetchNuGet { pname = "runtime.any.System.Text.Encoding"; version = "4.3.0"; hash = "sha256-Q18B9q26MkWZx68exUfQT30+0PGmpFlDgaF0TnaIGCs="; })
+  (fetchNuGet { pname = "runtime.any.System.Text.Encoding.Extensions"; version = "4.3.0"; hash = "sha256-6MYj0RmLh4EVqMtO/MRqBi0HOn5iG4x9JimgCCJ+EFM="; })
+  (fetchNuGet { pname = "runtime.any.System.Threading.Tasks"; version = "4.3.0"; hash = "sha256-agdOM0NXupfHbKAQzQT8XgbI9B8hVEh+a/2vqeHctg4="; })
+  (fetchNuGet { pname = "runtime.debian.8-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; hash = "sha256-LXUPLX3DJxsU1Pd3UwjO1PO9NM2elNEDXeu2Mu/vNps="; })
+  (fetchNuGet { pname = "runtime.fedora.23-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; hash = "sha256-qeSqaUI80+lqw5MK4vMpmO0CZaqrmYktwp6L+vQAb0I="; })
+  (fetchNuGet { pname = "runtime.fedora.24-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; hash = "sha256-SrHqT9wrCBsxILWtaJgGKd6Odmxm8/Mh7Kh0CUkZVzA="; })
+  (fetchNuGet { pname = "runtime.native.System"; version = "4.0.0"; hash = "sha256-bmaM0ovT4X4aqDJOR255Yda/u3fmHZskU++lMnsy894="; })
+  (fetchNuGet { pname = "runtime.native.System"; version = "4.3.0"; hash = "sha256-ZBZaodnjvLXATWpXXakFgcy6P+gjhshFXmglrL5xD5Y="; })
+  (fetchNuGet { pname = "runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; hash = "sha256-Jy01KhtcCl2wjMpZWH+X3fhHcVn+SyllWFY8zWlz/6I="; })
+  (fetchNuGet { pname = "runtime.opensuse.13.2-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; hash = "sha256-wyv00gdlqf8ckxEdV7E+Ql9hJIoPcmYEuyeWb5Oz3mM="; })
+  (fetchNuGet { pname = "runtime.opensuse.42.1-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; hash = "sha256-zi+b4sCFrA9QBiSGDD7xPV27r3iHGlV99gpyVUjRmc4="; })
+  (fetchNuGet { pname = "runtime.osx.10.10-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; hash = "sha256-gybQU6mPgaWV3rBG2dbH6tT3tBq8mgze3PROdsuWnX0="; })
+  (fetchNuGet { pname = "runtime.rhel.7-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; hash = "sha256-VsP72GVveWnGUvS/vjOQLv1U80H2K8nZ4fDAmI61Hm4="; })
+  (fetchNuGet { pname = "runtime.ubuntu.14.04-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; hash = "sha256-4yKGa/IrNCKuQ3zaDzILdNPD32bNdy6xr5gdJigyF5g="; })
+  (fetchNuGet { pname = "runtime.ubuntu.16.04-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; hash = "sha256-HmdJhhRsiVoOOCcUvAwdjpMRiyuSwdcgEv2j9hxi+Zc="; })
+  (fetchNuGet { pname = "runtime.ubuntu.16.10-x64.runtime.native.System.Security.Cryptography.OpenSsl"; version = "4.3.0"; hash = "sha256-pVFUKuPPIx0edQKjzRon3zKq8zhzHEzko/lc01V/jdw="; })
+  (fetchNuGet { pname = "runtime.unix.Microsoft.Win32.Primitives"; version = "4.3.0"; hash = "sha256-LZb23lRXzr26tRS5aA0xyB08JxiblPDoA7HBvn6awXg="; })
+  (fetchNuGet { pname = "runtime.unix.System.Diagnostics.Debug"; version = "4.3.0"; hash = "sha256-ReoazscfbGH+R6s6jkg5sIEHWNEvjEoHtIsMbpc7+tI="; })
+  (fetchNuGet { pname = "runtime.unix.System.IO.FileSystem"; version = "4.3.0"; hash = "sha256-Pf4mRl6YDK2x2KMh0WdyNgv0VUNdSKVDLlHqozecy5I="; })
+  (fetchNuGet { pname = "runtime.unix.System.Private.Uri"; version = "4.3.0"; hash = "sha256-c5tXWhE/fYbJVl9rXs0uHh3pTsg44YD1dJvyOA0WoMs="; })
+  (fetchNuGet { pname = "runtime.unix.System.Runtime.Extensions"; version = "4.3.0"; hash = "sha256-l8S9gt6dk3qYG6HYonHtdlYtBKyPb29uQ6NDjmrt3V4="; })
+  (fetchNuGet { pname = "Serilog"; version = "2.12.0"; hash = "sha256-JD+ud+CFoLGdYGasTWKTxx5PYj2W5pBv2lMybBK7HVM="; })
+  (fetchNuGet { pname = "Serilog.Extensions.Logging"; version = "3.0.1"; hash = "sha256-KtHMMnepmEpOlHrIGlUkK6Vq1L0iBBnFGavbUtvxOBk="; })
+  (fetchNuGet { pname = "Serilog.Settings.Configuration"; version = "3.1.0"; hash = "sha256-ZU0eb88tVMRKrfz9ewcmtCmWFqZeVLdeGGMcYElVRbI="; })
+  (fetchNuGet { pname = "Serilog.Sinks.Debug"; version = "2.0.0"; hash = "sha256-/PLVAE33lTdUEXdahkI5ddFiGZufWnvfsOodQsFB8sQ="; })
+  (fetchNuGet { pname = "Serilog.Sinks.File"; version = "5.0.0"; hash = "sha256-GKy9hwOdlu2W0Rw8LiPyEwus+sDtSOTl8a5l9uqz+SQ="; })
+  (fetchNuGet { pname = "System.AppContext"; version = "4.1.0"; hash = "sha256-v6YfyfrKmhww+EYHUq6cwYUMj00MQ6SOfJtcGVRlYzs="; })
+  (fetchNuGet { pname = "System.Buffers"; version = "4.3.0"; hash = "sha256-XqZWb4Kd04960h4U9seivjKseGA/YEIpdplfHYHQ9jk="; })
+  (fetchNuGet { pname = "System.Collections"; version = "4.3.0"; hash = "sha256-afY7VUtD6w/5mYqrce8kQrvDIfS2GXDINDh73IjxJKc="; })
+  (fetchNuGet { pname = "System.Collections.Immutable"; version = "1.7.0"; hash = "sha256-/RMBxUUublGaWERAnTk74QmrSQbX+xs84yFqmawmM74="; })
+  (fetchNuGet { pname = "System.Collections.Immutable"; version = "1.7.1"; hash = "sha256-WMMAUqoxT3J1gW9DI8v31VAuhwqTc4Posose5jq1BNo="; })
+  (fetchNuGet { pname = "System.CommandLine"; version = "2.0.0-beta4.22272.1"; hash = "sha256-zSO+CYnMH8deBHDI9DHhCPj79Ce3GOzHCyH1/TiHxcc="; })
+  (fetchNuGet { pname = "System.Configuration.ConfigurationManager"; version = "6.0.0"; hash = "sha256-fPV668Cfi+8pNWrvGAarF4fewdPVEDwlJWvJk0y+Cms="; })
+  (fetchNuGet { pname = "System.Diagnostics.Debug"; version = "4.3.0"; hash = "sha256-fkA79SjPbSeiEcrbbUsb70u9B7wqbsdM9s1LnoKj0gM="; })
+  (fetchNuGet { pname = "System.Diagnostics.Tracing"; version = "4.3.0"; hash = "sha256-hCETZpHHGVhPYvb4C0fh4zs+8zv4GPoixagkLZjpa9Q="; })
+  (fetchNuGet { pname = "System.Drawing.Common"; version = "6.0.0"; hash = "sha256-/9EaAbEeOjELRSMZaImS1O8FmUe8j4WuFUw1VOrPyAo="; })
+  (fetchNuGet { pname = "System.Dynamic.Runtime"; version = "4.0.11"; hash = "sha256-qWqFVxuXioesVftv2RVJZOnmojUvRjb7cS3Oh3oTit4="; })
+  (fetchNuGet { pname = "System.Globalization"; version = "4.0.11"; hash = "sha256-rbSgc2PIEc2c2rN6LK3qCREAX3DqA2Nq1WcLrZYsDBw="; })
+  (fetchNuGet { pname = "System.Globalization"; version = "4.3.0"; hash = "sha256-caL0pRmFSEsaoeZeWN5BTQtGrAtaQPwFi8YOZPZG5rI="; })
+  (fetchNuGet { pname = "System.IO"; version = "4.1.0"; hash = "sha256-V6oyQFwWb8NvGxAwvzWnhPxy9dKOfj/XBM3tEC5aHrw="; })
+  (fetchNuGet { pname = "System.IO"; version = "4.3.0"; hash = "sha256-ruynQHekFP5wPrDiVyhNiRIXeZ/I9NpjK5pU+HPDiRY="; })
+  (fetchNuGet { pname = "System.IO.FileSystem"; version = "4.0.1"; hash = "sha256-4VKXFgcGYCTWVXjAlniAVq0dO3o5s8KHylg2wg2/7k0="; })
+  (fetchNuGet { pname = "System.IO.FileSystem.Primitives"; version = "4.3.0"; hash = "sha256-LMnfg8Vwavs9cMnq9nNH8IWtAtSfk0/Fy4s4Rt9r1kg="; })
+  (fetchNuGet { pname = "System.IO.Pipelines"; version = "4.7.3"; hash = "sha256-nis1vH2bdwxvbKm00PYvGzIbmCwX9U5AbJFOU3oqVzY="; })
+  (fetchNuGet { pname = "System.Linq"; version = "4.1.0"; hash = "sha256-ZQpFtYw5N1F1aX0jUK3Tw+XvM5tnlnshkTCNtfVA794="; })
+  (fetchNuGet { pname = "System.Linq.Async"; version = "6.0.1"; hash = "sha256-uH5fZhcyQVtnsFc6GTUaRRrAQm05v5euJyWCXSFSOYI="; })
+  (fetchNuGet { pname = "System.Linq.Expressions"; version = "4.1.0"; hash = "sha256-7zqB+FXgkvhtlBzpcZyd81xczWP0D3uWssyAGw3t7b4="; })
+  (fetchNuGet { pname = "System.Net.WebSockets"; version = "4.3.0"; hash = "sha256-l3h3cF1cCC9zMhWLKSDnZBZvFADUd0Afe2+iAwBA0r0="; })
+  (fetchNuGet { pname = "System.ObjectModel"; version = "4.0.12"; hash = "sha256-MudZ/KYcvYsn2cST3EE049mLikrNkmE7QoUoYKKby+s="; })
+  (fetchNuGet { pname = "System.Private.Uri"; version = "4.3.0"; hash = "sha256-fVfgcoP4AVN1E5wHZbKBIOPYZ/xBeSIdsNF+bdukIRM="; })
+  (fetchNuGet { pname = "System.Reactive"; version = "4.4.1"; hash = "sha256-inA6nw9CX0g/AeygMwJoARGOY79pli/jLF54CweUqD8="; })
+  (fetchNuGet { pname = "System.Reflection"; version = "4.1.0"; hash = "sha256-idZHGH2Yl/hha1CM4VzLhsaR8Ljo/rV7TYe7mwRJSMs="; })
+  (fetchNuGet { pname = "System.Reflection"; version = "4.3.0"; hash = "sha256-NQSZRpZLvtPWDlvmMIdGxcVuyUnw92ZURo0hXsEshXY="; })
+  (fetchNuGet { pname = "System.Reflection.Emit"; version = "4.0.1"; hash = "sha256-F1MvYoQWHCY89/O4JBwswogitqVvKuVfILFqA7dmuHk="; })
+  (fetchNuGet { pname = "System.Reflection.Emit.ILGeneration"; version = "4.0.1"; hash = "sha256-YG+eJBG5P+5adsHiw/lhJwvREnvdHw6CJyS8ZV4Ujd0="; })
+  (fetchNuGet { pname = "System.Reflection.Emit.Lightweight"; version = "4.0.1"; hash = "sha256-uVvNOnL64CPqsgZP2OLqNmxdkZl6Q0fTmKmv9gcBi+g="; })
+  (fetchNuGet { pname = "System.Reflection.Extensions"; version = "4.0.1"; hash = "sha256-NsfmzM9G/sN3H8X2cdnheTGRsh7zbRzvegnjDzDH/FQ="; })
+  (fetchNuGet { pname = "System.Reflection.Metadata"; version = "1.6.0"; hash = "sha256-JJfgaPav7UfEh4yRAQdGhLZF1brr0tUWPl6qmfNWq/E="; })
+  (fetchNuGet { pname = "System.Reflection.Primitives"; version = "4.0.1"; hash = "sha256-SFSfpWEyCBMAOerrMCOiKnpT+UAWTvRcmoRquJR6Vq0="; })
+  (fetchNuGet { pname = "System.Reflection.Primitives"; version = "4.3.0"; hash = "sha256-5ogwWB4vlQTl3jjk1xjniG2ozbFIjZTL9ug0usZQuBM="; })
+  (fetchNuGet { pname = "System.Reflection.TypeExtensions"; version = "4.1.0"; hash = "sha256-R0YZowmFda+xzKNR4kKg7neFoE30KfZwp/IwfRSKVK4="; })
+  (fetchNuGet { pname = "System.Resources.ResourceManager"; version = "4.0.1"; hash = "sha256-cZ2/3/fczLjEpn6j3xkgQV9ouOVjy4Kisgw5xWw9kSw="; })
+  (fetchNuGet { pname = "System.Resources.ResourceManager"; version = "4.3.0"; hash = "sha256-idiOD93xbbrbwwSnD4mORA9RYi/D/U48eRUsn/WnWGo="; })
+  (fetchNuGet { pname = "System.Runtime"; version = "4.1.0"; hash = "sha256-FViNGM/4oWtlP6w0JC0vJU+k9efLKZ+yaXrnEeabDQo="; })
+  (fetchNuGet { pname = "System.Runtime"; version = "4.3.0"; hash = "sha256-51813WXpBIsuA6fUtE5XaRQjcWdQ2/lmEokJt97u0Rg="; })
+  (fetchNuGet { pname = "System.Runtime.Caching"; version = "6.0.0"; hash = "sha256-CpjpZoc6pdE83QPAGYzpBYQAZiAiqyrgiMQvdo5CCXI="; })
+  (fetchNuGet { pname = "System.Runtime.CompilerServices.Unsafe"; version = "4.4.0"; hash = "sha256-SeTI4+yVRO2SmAKgOrMni4070OD+Oo8L1YiEVeKDyig="; })
+  (fetchNuGet { pname = "System.Runtime.CompilerServices.Unsafe"; version = "4.7.1"; hash = "sha256-UvyoDV8O0oY3HPG1GbA56YVdvwTGEfjYR5gW1O7IK4U="; })
+  (fetchNuGet { pname = "System.Runtime.Extensions"; version = "4.1.0"; hash = "sha256-X7DZ5CbPY7jHs20YZ7bmcXs9B5Mxptu/HnBUvUnNhGc="; })
+  (fetchNuGet { pname = "System.Runtime.Extensions"; version = "4.3.0"; hash = "sha256-wLDHmozr84v1W2zYCWYxxj0FR0JDYHSVRaRuDm0bd/o="; })
+  (fetchNuGet { pname = "System.Runtime.Handles"; version = "4.0.1"; hash = "sha256-j2QgVO9ZOjv7D1het98CoFpjoYgxjupuIhuBUmLLH7w="; })
+  (fetchNuGet { pname = "System.Runtime.Handles"; version = "4.3.0"; hash = "sha256-KJ5aXoGpB56Y6+iepBkdpx/AfaJDAitx4vrkLqR7gms="; })
+  (fetchNuGet { pname = "System.Runtime.InteropServices"; version = "4.1.0"; hash = "sha256-QceAYlJvkPRJc/+5jR+wQpNNI3aqGySWWSO30e/FfQY="; })
+  (fetchNuGet { pname = "System.Runtime.InteropServices"; version = "4.3.0"; hash = "sha256-8sDH+WUJfCR+7e4nfpftj/+lstEiZixWUBueR2zmHgI="; })
+  (fetchNuGet { pname = "System.Runtime.InteropServices.RuntimeInformation"; version = "4.0.0"; hash = "sha256-5j53amb76A3SPiE3B0llT2XPx058+CgE7OXL4bLalT4="; })
+  (fetchNuGet { pname = "System.Runtime.Numerics"; version = "4.3.0"; hash = "sha256-P5jHCgMbgFMYiONvzmaKFeOqcAIDPu/U8bOVrNPYKqc="; })
+  (fetchNuGet { pname = "System.Security.AccessControl"; version = "4.6.0"; hash = "sha256-rspJ63MbjNVDve0owXby0Pu2vHjQvR2uuhCDCJ9vgfI="; })
+  (fetchNuGet { pname = "System.Security.AccessControl"; version = "6.0.0"; hash = "sha256-qOyWEBbNr3EjyS+etFG8/zMbuPjA+O+di717JP9Cxyg="; })
+  (fetchNuGet { pname = "System.Security.Cryptography.ProtectedData"; version = "6.0.0"; hash = "sha256-Wi9I9NbZlpQDXgS7Kl06RIFxY/9674S7hKiYw5EabRY="; })
+  (fetchNuGet { pname = "System.Security.Permissions"; version = "6.0.0"; hash = "sha256-/MMvtFWGN/vOQfjXdOhet1gsnMgh6lh5DCHimVsnVEs="; })
+  (fetchNuGet { pname = "System.Security.Principal.Windows"; version = "4.6.0"; hash = "sha256-lZeXm45RboVgqnPQVJ65y8b5b+9FSVr0MBciG777rso="; })
+  (fetchNuGet { pname = "System.Text.Encoding"; version = "4.0.11"; hash = "sha256-PEailOvG05CVgPTyKLtpAgRydlSHmtd5K0Y8GSHY2Lc="; })
+  (fetchNuGet { pname = "System.Text.Encoding"; version = "4.3.0"; hash = "sha256-GctHVGLZAa/rqkBNhsBGnsiWdKyv6VDubYpGkuOkBLg="; })
+  (fetchNuGet { pname = "System.Text.Encoding.Extensions"; version = "4.3.0"; hash = "sha256-vufHXg8QAKxHlujPHHcrtGwAqFmsCD6HKjfDAiHyAYc="; })
+  (fetchNuGet { pname = "System.Threading"; version = "4.0.11"; hash = "sha256-mob1Zv3qLQhQ1/xOLXZmYqpniNUMCfn02n8ZkaAhqac="; })
+  (fetchNuGet { pname = "System.Threading"; version = "4.3.0"; hash = "sha256-ZDQ3dR4pzVwmaqBg4hacZaVenQ/3yAF/uV7BXZXjiWc="; })
+  (fetchNuGet { pname = "System.Threading.Channels"; version = "4.7.1"; hash = "sha256-IkMmQnF9QfV+9EScPEwHypcK0+HTPu6K1J9fH3P2Dg0="; })
+  (fetchNuGet { pname = "System.Threading.Tasks"; version = "4.0.11"; hash = "sha256-5SLxzFg1df6bTm2t09xeI01wa5qQglqUwwJNlQPJIVs="; })
+  (fetchNuGet { pname = "System.Threading.Tasks"; version = "4.3.0"; hash = "sha256-Z5rXfJ1EXp3G32IKZGiZ6koMjRu0n8C1NGrwpdIen4w="; })
+  (fetchNuGet { pname = "System.Threading.Tasks.Extensions"; version = "4.5.3"; hash = "sha256-8TglbC6KBHlDeSfgr6d5dGn7wu8td4XERl2JUyo0+Tw="; })
+  (fetchNuGet { pname = "System.Windows.Extensions"; version = "6.0.0"; hash = "sha256-N+qg1E6FDJ9A9L50wmVt3xPQV8ZxlG1xeXgFuxO+yfM="; })
+  (fetchNuGet { pname = "Tomlyn"; version = "0.16.2"; hash = "sha256-ULW4n8s2lvTMG3I18rpsVfXtKXN7C8nPrMXQowxGIsU="; })
 ]
diff --git a/pkgs/applications/science/logic/elan/default.nix b/pkgs/applications/science/logic/elan/default.nix
index 245f8db13ce60..04c5f746f647a 100644
--- a/pkgs/applications/science/logic/elan/default.nix
+++ b/pkgs/applications/science/logic/elan/default.nix
@@ -3,26 +3,27 @@
 
 rustPlatform.buildRustPackage rec {
   pname = "elan";
-  version = "3.1.1";
+  version = "3.1.1-unstable-2024-08-02";
 
   src = fetchFromGitHub {
     owner = "leanprover";
     repo = "elan";
-    rev = "v${version}";
-    hash = "sha256-/g5bO3UQcg0XYm62KdoWcVQqOV3SIedWUYLufEcblmE=";
+    # commit "chore: update to build with rust 1.80 (leanprover/elan#134)"
+    rev = "97ce78e0e6aecdf3e8d35dbf42b0614302efb250";
+    hash = "sha256-7cwpHMyhpTxYXjZM4xbDK+epvA2kBf7jelvMaPGP1kU=";
   };
 
-  cargoHash = "sha256-f8YVUTxHX1FY2p73DlnLDtCJaG/0JImUtJFraV6ErNM=";
+  cargoHash = "sha256-ON5d7ryMKEhkx6dV760msr+y/+4hIwssXUE5Ocaq2W0=";
 
   nativeBuildInputs = [ pkg-config makeWrapper ];
 
   OPENSSL_NO_VENDOR = 1;
   buildInputs = [ curl zlib openssl ]
-    ++ lib.optional stdenv.isDarwin libiconv;
+    ++ lib.optional stdenv.hostPlatform.isDarwin libiconv;
 
   buildFeatures = [ "no-self-update" ];
 
-  patches = lib.optionals stdenv.isLinux [
+  patches = lib.optionals stdenv.hostPlatform.isLinux [
     # Run patchelf on the downloaded binaries.
     # This is necessary because Lean 4 is now dynamically linked.
     (runCommand "0001-dynamically-patchelf-binaries.patch" {
diff --git a/pkgs/applications/science/logic/formula/default.nix b/pkgs/applications/science/logic/formula/default.nix
index 20267e6071c56..bfaf2489bdf77 100644
--- a/pkgs/applications/science/logic/formula/default.nix
+++ b/pkgs/applications/science/logic/formula/default.nix
@@ -14,9 +14,9 @@ buildDotnetModule rec {
   nugetDeps = ./nuget.nix;
   projectFile = "Src/CommandLine/CommandLine.csproj";
 
-  postFixup = if stdenv.isLinux then ''
+  postFixup = if stdenv.hostPlatform.isLinux then ''
     mv $out/bin/CommandLine $out/bin/formula
-  '' else lib.optionalString stdenv.isDarwin ''
+  '' else lib.optionalString stdenv.hostPlatform.isDarwin ''
     makeWrapper ${dotnetCorePackages.runtime_6_0}/bin/dotnet $out/bin/formula \
       --add-flags "$out/lib/formula-dotnet/CommandLine.dll" \
       --prefix DYLD_LIBRARY_PATH : $out/lib/formula-dotnet/runtimes/macos/native
diff --git a/pkgs/applications/science/logic/hol/default.nix b/pkgs/applications/science/logic/hol/default.nix
index de47df098da13..883eb4331c9fa 100644
--- a/pkgs/applications/science/logic/hol/default.nix
+++ b/pkgs/applications/science/logic/hol/default.nix
@@ -4,16 +4,12 @@
 let
   pname = "hol4";
   vnum = "14";
-in
 
-let
   version = "k.${vnum}";
   longVersion = "kananaskis-${vnum}";
   holsubdir = "hol-${longVersion}";
   kernelFlag = if experimentalKernel then "--expk" else "--stdknl";
-in
 
-let
   polymlEnableShared = with pkgs; lib.overrideDerivation polyml (attrs: {
     configureFlags = [ "--enable-shared" ];
   });
@@ -66,7 +62,7 @@ stdenv.mkDerivation {
   '';
 
   meta = with lib; {
-    broken = (stdenv.isLinux && stdenv.isAarch64);
+    broken = (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64);
     description = "Interactive theorem prover based on Higher-Order Logic";
     longDescription = ''
       HOL4 is the latest version of the HOL interactive proof
diff --git a/pkgs/applications/science/logic/hol_light/0004-Fix-compilation-with-camlp5-7.11.patch b/pkgs/applications/science/logic/hol_light/0004-Fix-compilation-with-camlp5-7.11.patch
new file mode 100644
index 0000000000000..2fc2b1544c442
--- /dev/null
+++ b/pkgs/applications/science/logic/hol_light/0004-Fix-compilation-with-camlp5-7.11.patch
@@ -0,0 +1,66 @@
+From: Stephane Glondu <steph@glondu.net>
+Date: Wed, 12 Feb 2020 05:42:32 +0100
+Subject: Fix compilation with camlp5 7.11
+
+---
+ pa_j_4.xx_7.xx.ml | 17 +++++++++++------
+ 1 file changed, 11 insertions(+), 6 deletions(-)
+
+diff --git a/pa_j_4.xx_7.xx.ml b/pa_j_4.xx_7.xx.ml
+index 4f7ed60..e834058 100755
+--- a/pa_j/pa_j_4.xx_7.xx.ml
++++ b/pa_j/pa_j_4.xx_7.xx.ml
+@@ -410,9 +410,10 @@ and reloc_module_type floc sh =
+     | MtApp loc x1 x2 →
+         let loc = floc loc in
+         MtApp loc (self x1) (self x2)
+-    | MtFun loc x1 x2 x3 →
++    | MtFun loc x x3 →
+         let loc = floc loc in
+-        MtFun loc x1 (self x2) (self x3)
++        let x = vala_map (option_map (fun (x1, x2) -> (x1, self x2))) x in
++        MtFun loc x (self x3)
+     | MtLid loc x1 →
+         let loc = floc loc in
+         MtLid loc x1
+@@ -507,9 +508,10 @@ and reloc_module_expr floc sh =
+     | MeApp loc x1 x2 →
+         let loc = floc loc in
+         MeApp loc (self x1) (self x2)
+-    | MeFun loc x1 x2 x3 →
++    | MeFun loc x x3 →
+         let loc = floc loc in
+-        MeFun loc x1 (reloc_module_type floc sh x2) (self x3)
++        let x = vala_map (option_map (fun (x1, x2) -> (x1, reloc_module_type floc sh x2))) x in
++        MeFun loc x (self x3)
+     | MeStr loc x1 →
+         let loc = floc loc in
+         MeStr loc (vala_map (List.map (reloc_str_item floc sh)) x1)
+@@ -2007,7 +2009,7 @@ EXTEND
+       | -> <:vala< [] >> ] ]
+   ;
+   mod_binding:
+-    [ [ i = V UIDENT; me = mod_fun_binding -> (i, me) ] ]
++    [ [ i = V uidopt "uidopt"; me = mod_fun_binding -> (i, me) ] ]
+   ;
+   mod_fun_binding:
+     [ RIGHTA
+@@ -2070,7 +2072,7 @@ EXTEND
+           <:sig_item< value $lid:i$ : $t$ >> ] ]
+   ;
+   mod_decl_binding:
+-    [ [ i = V UIDENT; mt = module_declaration -> (i, mt) ] ]
++    [ [ i = V uidopt "uidopt"; mt = module_declaration -> (i, mt) ] ]
+   ;
+   module_declaration:
+     [ RIGHTA
+@@ -2092,6 +2094,9 @@ EXTEND
+       | "module"; i = V mod_ident ""; ":="; me = module_expr ->
+           <:with_constr< module $_:i$ := $me$ >> ] ]
+   ;
++  uidopt:
++    [ [ m = V UIDENT -> Some m ] ]
++  ;
+   (* Core expressions *)
+   expr:
+     [ "top" RIGHTA
diff --git a/pkgs/applications/science/logic/hol_light/default.nix b/pkgs/applications/science/logic/hol_light/default.nix
index 0e3dee4b0c0ad..59389f11a2828 100644
--- a/pkgs/applications/science/logic/hol_light/default.nix
+++ b/pkgs/applications/science/logic/hol_light/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, runtimeShell, fetchFromGitHub, fetchpatch, ocaml, findlib, num, zarith, camlp5, camlp-streams }:
+{ lib, stdenv, runtimeShell, fetchFromGitHub, ocaml, findlib, num, zarith, camlp5, camlp-streams }:
 
 let
   use_zarith = lib.versionAtLeast ocaml.version "4.14";
@@ -28,21 +28,16 @@ in
 
 stdenv.mkDerivation {
   pname = "hol_light";
-  version = "unstable-2024-05-10";
+  version = "unstable-2024-07-07";
 
   src = fetchFromGitHub {
     owner = "jrh13";
     repo = "hol-light";
-    rev = "d8366986e22555c4e4c8ff49667d646d15c35f14";
-    hash = "sha256-dN9X7yQlFof759I5lxxL4DxDe8V3XAhCRaryO9NabY4=";
+    rev = "16b184e30e7e3fe9add7d1ee93242323ed2e1726";
+    hash = "sha256-V0OtsmX5pa+CH3ZXmNG3juXwXZ5+A0k13eMCAfaRziQ=";
   };
 
-  patches = [
-    (fetchpatch {
-      url = "https://salsa.debian.org/ocaml-team/hol-light/-/raw/master/debian/patches/0004-Fix-compilation-with-camlp5-7.11.patch";
-      sha256 = "180qmxbrk3vb1ix7j77hcs8vsar91rs11s5mm8ir5352rz7ylicr";
-    })
-  ];
+  patches = [ ./0004-Fix-compilation-with-camlp5-7.11.patch ];
 
   strictDeps = true;
 
diff --git a/pkgs/applications/science/logic/isabelle/components/default.nix b/pkgs/applications/science/logic/isabelle/components/default.nix
deleted file mode 100644
index dd7b605f56af0..0000000000000
--- a/pkgs/applications/science/logic/isabelle/components/default.nix
+++ /dev/null
@@ -1,5 +0,0 @@
-{ callPackage }:
-
-{
-  isabelle-linter = callPackage ./isabelle-linter.nix {};
-}
diff --git a/pkgs/applications/science/logic/isabelle/components/isabelle-linter.nix b/pkgs/applications/science/logic/isabelle/components/isabelle-linter.nix
deleted file mode 100644
index 91bf5ba32b68e..0000000000000
--- a/pkgs/applications/science/logic/isabelle/components/isabelle-linter.nix
+++ /dev/null
@@ -1,35 +0,0 @@
-{ stdenv, lib, fetchFromGitHub, isabelle }:
-
-stdenv.mkDerivation rec {
-  pname = "isabelle-linter";
-  version = "2023-1.0.0";
-
-  src = fetchFromGitHub {
-    owner = "isabelle-prover";
-    repo = "isabelle-linter";
-    rev = "Isabelle2023-v1.0.0";
-    sha256 = "sha256-q9+qN94NaTzvhbcNQj7yH/VVfs1QgCH8OU8HW+5+s9U=";
-  };
-
-  nativeBuildInputs = [ isabelle ];
-
-  buildPhase = ''
-    export HOME=$TMP
-    isabelle components -u $(pwd)
-    isabelle scala_build
-  '';
-
-  installPhase = ''
-    dir=$out/Isabelle${isabelle.version}/contrib/${pname}-${version}
-    mkdir -p $dir
-    cp -r * $dir/
-  '';
-
-  meta = with lib; {
-    description = "Linter component for Isabelle";
-    homepage = "https://github.com/isabelle-prover/isabelle-linter";
-    maintainers = with maintainers; [ jvanbruegge ];
-    license = licenses.mit;
-    platforms = platforms.all;
-  };
-}
diff --git a/pkgs/applications/science/logic/isabelle/default.nix b/pkgs/applications/science/logic/isabelle/default.nix
deleted file mode 100644
index edc4483bcfa98..0000000000000
--- a/pkgs/applications/science/logic/isabelle/default.nix
+++ /dev/null
@@ -1,251 +0,0 @@
-{ lib
-, stdenv
-, fetchurl
-, coreutils
-, nettools
-, java
-, scala_3
-, polyml
-, veriT
-, vampire
-, eprover-ho
-, naproche
-, rlwrap
-, perl
-, makeDesktopItem
-, isabelle-components
-, symlinkJoin
-, fetchhg
-}:
-
-let
-  sha1 = stdenv.mkDerivation {
-    pname = "isabelle-sha1";
-    version = "2021-1";
-
-    src = fetchhg {
-      url = "https://isabelle.sketis.net/repos/sha1";
-      rev = "e0239faa6f42";
-      sha256 = "sha256-4sxHzU/ixMAkSo67FiE6/ZqWJq9Nb9OMNhMoXH2bEy4=";
-    };
-
-    buildPhase = (if stdenv.isDarwin then ''
-      LDFLAGS="-dynamic -undefined dynamic_lookup -lSystem"
-    '' else ''
-      LDFLAGS="-fPIC -shared"
-    '') + ''
-      CFLAGS="-fPIC -I."
-      $CC $CFLAGS -c sha1.c -o sha1.o
-      $LD $LDFLAGS sha1.o -o libsha1.so
-    '';
-
-    installPhase = ''
-      mkdir -p $out/lib
-      cp libsha1.so $out/lib/
-    '';
-  };
-in stdenv.mkDerivation (finalAttrs: rec {
-  pname = "isabelle";
-  version = "2023";
-
-  dirname = "Isabelle${version}";
-
-  src =
-    if stdenv.isDarwin
-    then
-      fetchurl
-        {
-          url = "https://isabelle.in.tum.de/website-${dirname}/dist/${dirname}_macos.tar.gz";
-          sha256 = "sha256-0VSW2SrHNI3/k4cCCZ724ruXaq7W1NCPsLrXFZ9l1/Q=";
-        }
-    else if stdenv.hostPlatform.isx86
-    then
-      fetchurl {
-        url = "https://isabelle.in.tum.de/website-${dirname}/dist/${dirname}_linux.tar.gz";
-        sha256 = "sha256-Go4ZCsDz5gJ7uWG5VLrNJOddMPX18G99FAadpX53Rqg=";
-      }
-    else
-      fetchurl {
-        url = "https://isabelle.in.tum.de/website-${dirname}/dist/${dirname}_linux_arm.tar.gz";
-        hash = "sha256-Tzxxs0gKw6vymbaXIzH8tK5VgUrpOIp9vcWQ/zxnRCc=";
-      };
-
-  nativeBuildInputs = [ java ];
-
-  buildInputs = [ polyml veriT vampire eprover-ho nettools ]
-    ++ lib.optionals (!stdenv.isDarwin) [ java ];
-
-  sourceRoot = "${dirname}${lib.optionalString stdenv.isDarwin ".app"}";
-
-  doCheck = stdenv.hostPlatform.system != "aarch64-linux";
-  checkPhase = "bin/isabelle build -v HOL-SMT_Examples";
-
-  postUnpack = lib.optionalString stdenv.isDarwin ''
-    mv $sourceRoot ${dirname}
-    sourceRoot=${dirname}
-  '';
-
-  postPatch = ''
-    patchShebangs lib/Tools/ bin/
-
-    cat >contrib/verit-*/etc/settings <<EOF
-      ISABELLE_VERIT=${veriT}/bin/veriT
-    EOF
-
-    cat >contrib/e-*/etc/settings <<EOF
-      E_HOME=${eprover-ho}/bin
-      E_VERSION=${eprover-ho.version}
-    EOF
-
-    cat >contrib/vampire-*/etc/settings <<EOF
-      VAMPIRE_HOME=${vampire}/bin
-      VAMPIRE_VERSION=${vampire.version}
-      VAMPIRE_EXTRA_OPTIONS="--mode casc"
-    EOF
-
-    cat >contrib/polyml-*/etc/settings <<EOF
-      ML_SYSTEM_64=true
-      ML_SYSTEM=${polyml.name}
-      ML_PLATFORM=${stdenv.system}
-      ML_HOME=${polyml}/bin
-      ML_OPTIONS="--minheap 1000"
-      POLYML_HOME="\$COMPONENT"
-      ML_SOURCES="\$POLYML_HOME/src"
-    EOF
-
-    cat >contrib/jdk*/etc/settings <<EOF
-      ISABELLE_JAVA_PLATFORM=${stdenv.system}
-      ISABELLE_JDK_HOME=${java}
-    EOF
-
-  '' + lib.optionalString stdenv.hostPlatform.isx86 ''
-    rm contrib/naproche-*/x86*/Naproche-SAD
-    ln -s ${naproche}/bin/Naproche-SAD contrib/naproche-*/x86*/
-  '' + ''
-
-    echo ISABELLE_LINE_EDITOR=${rlwrap}/bin/rlwrap >>etc/settings
-
-    for comp in contrib/jdk* contrib/polyml-* contrib/verit-* contrib/vampire-* contrib/e-*; do
-      rm -rf $comp/${if stdenv.hostPlatform.isx86 then "x86" else "arm"}*
-    done
-
-    substituteInPlace lib/Tools/env \
-      --replace /usr/bin/env ${coreutils}/bin/env
-
-    substituteInPlace src/Tools/Setup/src/Environment.java \
-      --replace 'cmd.add("/usr/bin/env");' "" \
-      --replace 'cmd.add("bash");' "cmd.add(\"$SHELL\");"
-
-    substituteInPlace src/Pure/General/sha1.ML \
-      --replace '"$ML_HOME/" ^ (if ML_System.platform_is_windows then "sha1.dll" else "libsha1.so")' '"${sha1}/lib/libsha1.so"'
-
-    rm -r heaps
-  '' + lib.optionalString (stdenv.hostPlatform.system == "x86_64-darwin") ''
-    substituteInPlace lib/scripts/isabelle-platform \
-      --replace 'ISABELLE_APPLE_PLATFORM64=arm64-darwin' ""
-  '' + lib.optionalString stdenv.isLinux ''
-    arch=${if stdenv.hostPlatform.system == "x86_64-linux" then "x86_64-linux"
-           else if stdenv.hostPlatform.isx86 then "x86-linux"
-           else "arm64-linux"}
-    for f in contrib/*/$arch/{z3,epclextract,nunchaku,SPASS,zipperposition}; do
-      patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) "$f"${lib.optionalString stdenv.isAarch64 " || true"}
-    done
-    patchelf --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) contrib/bash_process-*/platform_$arch/bash_process
-    for d in contrib/kodkodi-*/jni/$arch; do
-      patchelf --set-rpath "${lib.concatStringsSep ":" [ "${java}/lib/openjdk/lib/server" "${stdenv.cc.cc.lib}/lib" ]}" $d/*.so
-    done
-    patchelf --set-rpath "${stdenv.cc.cc.lib}/lib" contrib/z3-*/$arch/z3
-  '';
-
-  buildPhase = ''
-    export HOME=$TMP # The build fails if home is not set
-    setup_name=$(basename contrib/isabelle_setup*)
-
-    #The following is adapted from https://isabelle.sketis.net/repos/isabelle/file/Isabelle2021-1/Admin/lib/Tools/build_setup
-    TARGET_DIR="contrib/$setup_name/lib"
-    rm -rf "$TARGET_DIR"
-    mkdir -p "$TARGET_DIR/isabelle/setup"
-    declare -a ARGS=("-Xlint:unchecked")
-
-    SOURCES="$(${perl}/bin/perl -e 'while (<>) { if (m/(\S+\.java)/)  { print "$1 "; } }' "src/Tools/Setup/etc/build.props")"
-    for SRC in $SOURCES
-    do
-      ARGS["''${#ARGS[@]}"]="src/Tools/Setup/$SRC"
-    done
-    echo "Building isabelle setup"
-    javac -d "$TARGET_DIR" -classpath "${scala_3.bare}/lib/scala3-interfaces-${scala_3.version}.jar:${scala_3.bare}/lib/scala3-compiler_3-${scala_3.version}.jar" "''${ARGS[@]}"
-    jar -c -f "$TARGET_DIR/isabelle_setup.jar" -e "isabelle.setup.Setup" -C "$TARGET_DIR" isabelle
-    rm -rf "$TARGET_DIR/isabelle"
-
-    echo "Building HOL heap"
-    bin/isabelle build -v -o system_heaps -b HOL
-  '';
-
-  installPhase = ''
-    mkdir -p $out/bin
-    mv $TMP/$dirname $out
-    cd $out/$dirname
-    bin/isabelle install $out/bin
-
-    # icon
-    mkdir -p "$out/share/icons/hicolor/isabelle/apps"
-    cp "$out/Isabelle${version}/lib/icons/isabelle.xpm" "$out/share/icons/hicolor/isabelle/apps/"
-
-    # desktop item
-    mkdir -p "$out/share"
-    cp -r "${desktopItem}/share/applications" "$out/share/applications"
-  '';
-
-  desktopItem = makeDesktopItem {
-    name = "isabelle";
-    exec = "isabelle jedit";
-    icon = "isabelle";
-    desktopName = "Isabelle";
-    comment = meta.description;
-    categories = [ "Education" "Science" "Math" ];
-  };
-
-  meta = with lib; {
-    description = "A generic proof assistant";
-
-    longDescription = ''
-      Isabelle is a generic proof assistant.  It allows mathematical formulas
-      to be expressed in a formal language and provides tools for proving those
-      formulas in a logical calculus.
-    '';
-    homepage = "https://isabelle.in.tum.de/";
-    sourceProvenance = with sourceTypes; [
-      fromSource
-      binaryNativeCode  # source bundles binary dependencies
-    ];
-    license = licenses.bsd3;
-    maintainers = [ maintainers.jwiegley maintainers.jvanbruegge ];
-    platforms = platforms.unix;
-  };
-
-  passthru.withComponents = f:
-    let
-      isabelle = finalAttrs.finalPackage;
-      base = "$out/${isabelle.dirname}";
-      components = f isabelle-components;
-    in symlinkJoin {
-      name = "isabelle-with-components-${isabelle.version}";
-      paths = [ isabelle ] ++ (builtins.map (c: c.override { inherit isabelle; }) components);
-
-      postBuild = ''
-        rm $out/bin/*
-
-        cd ${base}
-        rm bin/*
-        cp ${isabelle}/${isabelle.dirname}/bin/* bin/
-        rm etc/components
-        cat ${isabelle}/${isabelle.dirname}/etc/components > etc/components
-
-        export HOME=$TMP
-        bin/isabelle install $out/bin
-        patchShebangs $out/bin
-      '' + lib.concatMapStringsSep "\n" (c: ''
-        echo contrib/${c.pname}-${c.version} >> ${base}/etc/components
-      '') components;
-    };
-})
diff --git a/pkgs/applications/science/logic/key/default.nix b/pkgs/applications/science/logic/key/default.nix
index 5a48abfc4aa48..d97eb42b4027f 100644
--- a/pkgs/applications/science/logic/key/default.nix
+++ b/pkgs/applications/science/logic/key/default.nix
@@ -2,7 +2,6 @@
 , fetchurl
 , jdk
 , gradle_7
-, perl
 , jre
 , makeWrapper
 , makeDesktopItem
@@ -12,6 +11,9 @@
 }:
 
 let
+  gradle = gradle_7;
+
+in stdenv.mkDerivation rec {
   pname = "key";
   version = "2.10.0";
   src = fetchurl {
@@ -20,30 +22,6 @@ let
   };
   sourceRoot = "key-${version}/key";
 
-  # fake build to pre-download deps into fixed-output derivation
-  deps = stdenv.mkDerivation {
-    pname = "${pname}-deps";
-    inherit version src sourceRoot;
-    nativeBuildInputs = [ gradle_7 perl ];
-    buildPhase = ''
-      export GRADLE_USER_HOME=$(mktemp -d)
-      # https://github.com/gradle/gradle/issues/4426
-      ${lib.optionalString stdenv.isDarwin "export TERM=dumb"}
-      gradle --no-daemon classes testClasses
-    '';
-    # perl code mavenizes pathes (com.squareup.okio/okio/1.13.0/a9283170b7305c8d92d25aff02a6ab7e45d06cbe/okio-1.13.0.jar -> com/squareup/okio/okio/1.13.0/okio-1.13.0.jar)
-    installPhase = ''
-      find $GRADLE_USER_HOME/caches/modules-2 -type f -regex '.*\.\(jar\|pom\)' \
-        | perl -pe 's#(.*/([^/]+)/([^/]+)/([^/]+)/[0-9a-f]{30,40}/([^/\s]+))$# ($x = $2) =~ tr|\.|/|; "install -Dm444 $1 \$out/$x/$3/$4/$5" #e' \
-        | sh
-    '';
-    outputHashMode = "recursive";
-    outputHashAlgo = "sha256";
-    outputHash = "sha256-GjBUwJxeyJA6vGrPQVtNpcHb4CJlNlY4kHt1PT21xjo=";
-  };
-in stdenv.mkDerivation rec {
-  inherit pname version src sourceRoot;
-
   nativeBuildInputs = [
     jdk
     gradle_7
@@ -65,23 +43,15 @@ in stdenv.mkDerivation rec {
     })
   ];
 
-  # disable tests (broken on darwin)
-  gradleAction = if stdenv.isDarwin then "assemble" else "build";
-
-  buildPhase = ''
-    runHook preBuild
+  mitmCache = gradle.fetchDeps {
+    inherit pname;
+    data = ./deps.json;
+  };
 
-    export GRADLE_USER_HOME=$(mktemp -d)
-    # https://github.com/gradle/gradle/issues/4426
-    ${lib.optionalString stdenv.isDarwin "export TERM=dumb"}
-    # point to offline repo
-    sed -ie "s#repositories {#repositories { maven { url '${deps}' }#g" build.gradle
-    cat <(echo "pluginManagement { repositories { maven { url '${deps}' } } }") settings.gradle > settings_new.gradle
-    mv settings_new.gradle settings.gradle
-    gradle --offline --no-daemon ${gradleAction}
+  __darwinAllowLocalNetworking = true;
 
-    runHook postBuild
-  '';
+  # tests are broken on darwin
+  doCheck = !stdenv.hostPlatform.isDarwin;
 
   installPhase = ''
     runHook preInstall
diff --git a/pkgs/applications/science/logic/key/deps.json b/pkgs/applications/science/logic/key/deps.json
new file mode 100644
index 0000000000000..4d6dee8060f9d
--- /dev/null
+++ b/pkgs/applications/science/logic/key/deps.json
@@ -0,0 +1,387 @@
+{
+ "!comment": "This is a nixpkgs Gradle dependency lockfile. For more details, refer to the Gradle section in the nixpkgs manual.",
+ "!version": 1,
+ "https://plugins.gradle.org/m2": {
+  "ca/coglinc#javacc-gradle-plugin/2.4.0": {
+   "jar": "sha256-RsMHTru+ENUOzWkQpiYxCkE5FlZ5Ct0JF+kBp9afidw=",
+   "pom": "sha256-NTSsuHwtwH2hAqOP1wn1oANHgSkM+gcjPZTLXMOiyrA="
+  },
+  "ca/coglinc/javacc#ca.coglinc.javacc.gradle.plugin/2.4.0": {
+   "pom": "sha256-zmWjvt7VamHG21s6/cHApVuH6mvAewTxamaqn8DP2jw="
+  },
+  "com/github/hierynomus/license-base#com.github.hierynomus.license-base.gradle.plugin/0.15.0": {
+   "pom": "sha256-jWmQF6e7GyViPR4EGOKapRwtUYEHkgNaR8PG+hgMSXU="
+  },
+  "com/github/hierynomus/license-report#com.github.hierynomus.license-report.gradle.plugin/0.15.0": {
+   "pom": "sha256-OIRMJK0goaid41C254nDEz3FeeD51kZSyQi9uCgwAxM="
+  },
+  "com/github/johnrengelman/shadow#com.github.johnrengelman.shadow.gradle.plugin/7.1.0": {
+   "pom": "sha256-mh4hygODDXleq/uKbALOM4QuvCPGd+xqqZ50W1FPKt4="
+  },
+  "com/google/guava#guava-jdk5/17.0": {
+   "jar": "sha256-Wb9FZUe23aPO2WjLVvfy0+FEdOLeKWCjLEfjHB5FbGE=",
+   "pom": "sha256-+MFSYngT1FvE58wXrW7WpkmgIxroGf+44F0ZsgWj22Y="
+  },
+  "com/google/guava#guava-parent-jdk5/17.0": {
+   "pom": "sha256-WpYGvCdjKVazwR34h+mz54WFQGiqpOCAjtVmD2Cx+28="
+  },
+  "com/mycila#license-maven-plugin-parent/3.0": {
+   "pom": "sha256-DR8XPOud8hKSZ2Z8EMiR5eXXJm2C46hQcGaNtW2wy/o="
+  },
+  "com/mycila#license-maven-plugin/3.0": {
+   "jar": "sha256-Ul/o866FI9Be7ac2ZFxB6cMw8CV4K1s95u8Lqs8teMw=",
+   "pom": "sha256-kmJwjckIctcrvmfLFVITU6feJkgJzh6zLflfvqR2/IM="
+  },
+  "com/mycila#mycila-pom/3": {
+   "pom": "sha256-QCd6OyVlPuZDPEaFLacOlzbBmNlLyvbSw0cIqHOjGyY="
+  },
+  "com/mycila#mycila-xmltool/4.4.ga": {
+   "jar": "sha256-ddeyvpOBpl9vrDLzEIIhEvgFVm6fipekXY8Tz1UEnOA=",
+   "pom": "sha256-wMaee7roquvUQOFnjOn1AotD07ToHNQ26Y+BOkvDIrI="
+  },
+  "com/mycila/xmltool#xmltool/3.3": {
+   "jar": "sha256-hw+TlnieL0inuPso38BwwvjnSyAHJ0ziPmm2WBEP0pQ=",
+   "pom": "sha256-64P2FpRcjH37TYDm+QnnKG9SO7EQd4ArzSFr1w6ccXo="
+  },
+  "commons-io#commons-io/2.11.0": {
+   "jar": "sha256-lhsvbYfbrMXVSr9Fq3puJJX4m3VZiWLYxyPOqbwhCQg=",
+   "pom": "sha256-LgFv1+MkS18sIKytg02TqkeQSG7h5FZGQTYaPoMe71k="
+  },
+  "commons-io#commons-io/2.4": {
+   "jar": "sha256-zGpB3D6qzJ5ECmvQ0okLINNrTuQI/i1nEi8yi7bgFYE=",
+   "pom": "sha256-srXdRs+Zj6Ym62+KHBFPYWfI05JpQWTmJTPliY6bMfI="
+  },
+  "commons-logging#commons-logging/1.1.1": {
+   "jar": "sha256-zm+RPK0fDbOq1wGG1lxbx//Mmpnj/o4LE3MSgZ98Ni8=",
+   "pom": "sha256-0PLhbQVOi7l63ZyiZSXrI0b2koCfzSooeH2ozrPDXug="
+  },
+  "gradle/plugin/com/github/johnrengelman#shadow/7.1.0": {
+   "jar": "sha256-Bar4oiGwbGeS7hmZYZPolH7zv3Il6nWOUYsywoNxCJA=",
+   "pom": "sha256-q7tz6sHPSyR/wBbmyohafaFjNk/vyYDICvjTy+jRSQI="
+  },
+  "gradle/plugin/com/hierynomus/gradle/plugins#license-gradle-plugin/0.15.0": {
+   "jar": "sha256-gpLVOVy+k7lGe/p64JgC70z9316oNexy6jxKahfw9ZY=",
+   "pom": "sha256-IAmy13nhNo/tPGzHVwS58EVRv+3tFpk4F0ltrbtDyiw="
+  },
+  "org/apache#apache/10": {
+   "pom": "sha256-gC/uznKFLa/L0KQlpgNnxyxcubbqWq5ZSBEoVpGJ2vk="
+  },
+  "org/apache#apache/13": {
+   "pom": "sha256-/1E9sDYf1BI3vvR4SWi8FarkeNTsCpSW+BEHLMrzhB0="
+  },
+  "org/apache#apache/16": {
+   "pom": "sha256-n4X/L9fWyzCXqkf7QZ7n8OvoaRCfmKup9Oyj9J50pA4="
+  },
+  "org/apache#apache/23": {
+   "pom": "sha256-vBBiTgYj82V3+sVjnKKTbTJA7RUvttjVM6tNJwVDSRw="
+  },
+  "org/apache#apache/4": {
+   "pom": "sha256-npMjomuo6yOU7+8MltMbcN9XCAhjDcFHyrHnNUHMUZQ="
+  },
+  "org/apache#apache/9": {
+   "pom": "sha256-SUbmClR8jtpp87wjxbbw2tz4Rp6kmx0dp940rs/PGN0="
+  },
+  "org/apache/ant#ant-launcher/1.10.11": {
+   "jar": "sha256-2rUw33qYC1rI/X6NIIJDrg0+vW3gmxqiznVjYMwu0lY=",
+   "pom": "sha256-7SoGiCYb624I7FSzgxLx1ILM8aO4Y8R9KNW5CkRtHB4="
+  },
+  "org/apache/ant#ant-parent/1.10.11": {
+   "pom": "sha256-V6BTJoLzD6MHQWoiWSnVcQrNpy17Je4IyvmNyCzTXbY="
+  },
+  "org/apache/ant#ant/1.10.11": {
+   "jar": "sha256-iMC4m7uq4B4Nn8rpO+eS9au+NAkQb47uhY/fNl28B1Q=",
+   "pom": "sha256-wiiU2ctGq/XOv27rK8z+TXjhju6jEaDqat3VnftLH+M="
+  },
+  "org/apache/commons#commons-collections4/4.1": {
+   "jar": "sha256-sf6LWWi1fYRlQlNX7S2dxpVQRRi+0t9bVlxLjmjByKU=",
+   "pom": "sha256-wK1C6RA1N5YNmnTaWOzCTdGjehPR5MSPCWm+k+QBg2k="
+  },
+  "org/apache/commons#commons-lang3/3.4": {
+   "jar": "sha256-c0yDVkIMyOMMeV1k/R/NXUTqnZA0KizDJixRWPvG2Ys=",
+   "pom": "sha256-aG51tWGhPBAx1Dp2R6Nk4u0+RWRnBQ6sRSe5SwbXP9E="
+  },
+  "org/apache/commons#commons-parent/25": {
+   "pom": "sha256-RnrmUEQuh2hnN5CU51GN/dZ9IsU1Lr05gIyEJZ6XkLo="
+  },
+  "org/apache/commons#commons-parent/33": {
+   "pom": "sha256-U9ABE1Li5RBvN52vzNrHdU7G8PeCQ8AwXklp9azd+Ps="
+  },
+  "org/apache/commons#commons-parent/37": {
+   "pom": "sha256-7nBaTdaNjc2cyNEknVeQhh6xRc57DG1sBVW6lEidAUs="
+  },
+  "org/apache/commons#commons-parent/38": {
+   "pom": "sha256-VY2WF0Xrrcxdw5HP3n1HQIbUyq7iTdPm35Me2fa1tJU="
+  },
+  "org/apache/commons#commons-parent/5": {
+   "pom": "sha256-i9YywAvfgKfeNsIrYPEkUsFH2Oyi8A151maZ6+faoCo="
+  },
+  "org/apache/commons#commons-parent/52": {
+   "pom": "sha256-ddvo806Y5MP/QtquSi+etMvNO18QR9VEYKzpBtu0UC4="
+  },
+  "org/apache/commons#commons-pool2/2.2": {
+   "jar": "sha256-h4Czu7Mah5fnTp8wIvBD3a3Crui+Y9lPgIKmoWVGxBs=",
+   "pom": "sha256-SPll6CQtvwF4bQqS0K1j4gogHUpTbgMh0DsQ0uDJgVM="
+  },
+  "org/apache/logging#logging-parent/3": {
+   "pom": "sha256-djouwrgJTUFh3rbCZLEmIIW5vjC/OjHCzhNyQuV3Iqc="
+  },
+  "org/apache/logging/log4j#log4j-api/2.17.1": {
+   "jar": "sha256-sNikyKtPuLGIjQCVgicDsObUeTxBlVAgPanmkZYWHeQ=",
+   "pom": "sha256-HirO8yILKb4QrgmXKLFYsY2UP5Ghk8xFAbtC+SnB6Io="
+  },
+  "org/apache/logging/log4j#log4j-core/2.17.1": {
+   "jar": "sha256-yWfyI0h5gLk2TpSnx/mooB/T7nwZvb8LD5+MuFEfPUE=",
+   "pom": "sha256-C7s79tTSKhv6PDwJJ8KUEK8UoPsm47Ark3JvXH6Yqv0="
+  },
+  "org/apache/logging/log4j#log4j/2.17.1": {
+   "pom": "sha256-lnq8AkRDqcsJaTVVmvXprW8P9hN1+Esn1EDS+nCAawk="
+  },
+  "org/apache/maven#maven-parent/21": {
+   "pom": "sha256-/EWviRHqMH0bV1ZO7x94tpgB6cEaVhnn61jV0Arp244="
+  },
+  "org/apache/maven#maven-settings-builder/3.0.4": {
+   "jar": "sha256-o4pU7B5pow3fwUQ04K7Cdk/CaGaKvMDhMthmkqXc4+Q=",
+   "pom": "sha256-Pgs/YCZ7YHCnQbFdtbQPvYJMYdsSofTxZu1li59i7OA="
+  },
+  "org/apache/maven#maven-settings/3.0.4": {
+   "jar": "sha256-Pj3xf1315M4ee38gEcV9YdMo5lZ4VCreIEjw0PopXwk=",
+   "pom": "sha256-vu3/18fkmtNe+UXDQT8YGfBOQ+opSjGARxTIy7DzcrM="
+  },
+  "org/apache/maven#maven/3.0.4": {
+   "pom": "sha256-TSI+AaZWnWZVwfT86Elp1FFCzbq9sRjqCMXIwz7GMvY="
+  },
+  "org/codehaus/plexus#plexus-component-annotations/1.5.5": {
+   "jar": "sha256-Tfemp75ks1u8z2C1wRVpf56jQh0iZ0rmcTXd43X8yh8=",
+   "pom": "sha256-gV8+wxa4xfpwE4X99ACb+1HgfXgOj2puKv5yDFLX4pI="
+  },
+  "org/codehaus/plexus#plexus-components/1.1.18": {
+   "pom": "sha256-7128f6kYttu6cdJ+Wz16AN9iS8+iVJpyl/Nv4nX2NNc="
+  },
+  "org/codehaus/plexus#plexus-containers/1.5.5": {
+   "pom": "sha256-G8Jkgk7IdrDKb09YOBdcVBxjjLxDMmomi5rufUd4te8="
+  },
+  "org/codehaus/plexus#plexus-interpolation/1.14": {
+   "jar": "sha256-f8YzeNPoRmNhm5vtrOn5/niydsK+PGLKIkVEkpTIQXY=",
+   "pom": "sha256-0IFVxJffN7LD2bWw39sC7AUlsgcLW+Nzn//elC/Kya8="
+  },
+  "org/codehaus/plexus#plexus-utils/2.0.5": {
+   "pom": "sha256-Nbx9EhNhYjZXEHKyxW2hj3pXZY3otKQQBkW3BUorJzs="
+  },
+  "org/codehaus/plexus#plexus-utils/2.0.6": {
+   "jar": "sha256-i5CfTKl4hkeUL4g9TlWbzGQhI/fGvNOEaYOi5GVGnDM=",
+   "pom": "sha256-/drU+mLIIxCuxDUl5RnNWfJ9BMdWn+IbGwPKIQiHgQw="
+  },
+  "org/codehaus/plexus#plexus-utils/3.4.1": {
+   "jar": "sha256-UtheBLORhyKvEdEoVbSoJX35ag52yPTjhS5vqoUfNXs=",
+   "pom": "sha256-sUTP+bHGJZ/sT+5b38DzYNacI6vU6m5URTOpSbaeNYI="
+  },
+  "org/codehaus/plexus#plexus/2.0.6": {
+   "pom": "sha256-vqEudHcI0l5zQQyhxzHr36EC6L227H2BvUUiWDsjS8w="
+  },
+  "org/codehaus/plexus#plexus/2.0.7": {
+   "pom": "sha256-K1kGIDCrChXF0Jd7oiQhcGNokmSIc5pl8leT5xXMinQ="
+  },
+  "org/codehaus/plexus#plexus/8": {
+   "pom": "sha256-/6NJ2wTnq/ZYhb3FogYvQZfA/50/H04qpXILdyM/dCw="
+  },
+  "org/jdom#jdom2/2.0.6": {
+   "jar": "sha256-E0XxG6YG0VYD1nQFUajCGUfAIVZAdw7GcnH+eL6pfPU=",
+   "pom": "sha256-R7I6ef4za3QbgkNMbgSdaBZSVuQF51wQkh/XL6imXY0="
+  },
+  "org/junit#junit-bom/5.7.2": {
+   "module": "sha256-87zrHFndT2mT9DBN/6WAFyuN9lp2zTb6T9ksBXjSitg=",
+   "pom": "sha256-zRSqqGmZH4ICHFhdVw0x/zQry6WLtEIztwGTdxuWSHs="
+  },
+  "org/ow2#ow2/1.5": {
+   "pom": "sha256-D4obEW52C4/mOJxRuE5LB6cPwRCC1Pk25FO1g91QtDs="
+  },
+  "org/ow2/asm#asm-analysis/9.2": {
+   "jar": "sha256-h4++UhcxwHLRTS1luYOxvq5q0G/aAAe2qLroH3P0M8Q=",
+   "pom": "sha256-dzzBor/BTGxKl5xRoHXAI0oL9pT8Or5PrPRU83oUXxs="
+  },
+  "org/ow2/asm#asm-commons/9.2": {
+   "jar": "sha256-vkzlMTiiOLtSLNeBz5Hzulzi9sqT7GLUahYqEnIl4KY=",
+   "pom": "sha256-AoJOg58qLw5ylZ/dMLSJckDwWvxD3kLXugsYQ3YBwHA="
+  },
+  "org/ow2/asm#asm-tree/9.2": {
+   "jar": "sha256-qr+b0jCRpOv8EJwfPufPPkuJ9rotP1HFJD8Ws8/64BE=",
+   "pom": "sha256-9h8+vqVSDd8Z9FKwPEJscjG92KgdesKHZctScSJaw3g="
+  },
+  "org/ow2/asm#asm/9.2": {
+   "jar": "sha256-udT+TXGTjfOIOfDspCqqpkz4sxPWeNoDbwyzyhmbR/U=",
+   "pom": "sha256-37EqGyJL8Bvh/WBAIEZviUJBvLZF3M45Xt2M1vilDfQ="
+  },
+  "org/sonarqube#org.sonarqube.gradle.plugin/3.0": {
+   "pom": "sha256-1Pg7ynlN6ZPv/gtqt/HO572zNJgWc4BVkHgvv6Mj420="
+  },
+  "org/sonarsource/parent#parent/54": {
+   "pom": "sha256-QVl5Y/x9ObDgJArLTYT1dbQCQtbhR9xQsCbUzvwFMV8="
+  },
+  "org/sonarsource/scanner/api#sonar-scanner-api-parent/2.15.0.2182": {
+   "pom": "sha256-JcR02YT0wD5P147u53D0Pqks+5Xrixf3+qyFVpNgFoY="
+  },
+  "org/sonarsource/scanner/api#sonar-scanner-api/2.15.0.2182": {
+   "jar": "sha256-h+foNKu97912pce/pM7ztxUhsfVQ/Iu+qLCphVPjNeg=",
+   "pom": "sha256-H+gEKIHd2qgREtNNv0k30OM+TQFYYIJ7/R/fb0YLH9U="
+  },
+  "org/sonarsource/scanner/gradle#sonarqube-gradle-plugin/3.0": {
+   "jar": "sha256-KLTNnuKtiAHAxeXJhPNtLizGDRkhwC61jujORTpejb8=",
+   "pom": "sha256-2jJNuKvT65d8B0lY/9E4vdVTWwYojfN7WiRv53Uad7Y="
+  },
+  "org/sonatype/forge#forge-parent/4": {
+   "pom": "sha256-GDjRMkeQBbS3RZt5jp2ZFVFQkMKICC/c2G2wsQmDokw="
+  },
+  "org/sonatype/oss#oss-parent/7": {
+   "pom": "sha256-tR+IZ8kranIkmVV/w6H96ne9+e9XRyL+kM5DailVlFQ="
+  },
+  "org/sonatype/plexus#plexus-cipher/1.4": {
+   "jar": "sha256-WhX9uiJmng/dBuENzOYyCHnh9zmPvJEM0Gd7UGcqeMQ=",
+   "pom": "sha256-pjouI5iMyn+sbJOIbW8FBv0m2I1+jMDLibnG4NbJlK0="
+  },
+  "org/sonatype/plexus#plexus-sec-dispatcher/1.3": {
+   "jar": "sha256-OwVZu4Qy8ok37+bKGT71SoUG0Addc/10BrmxFsahEGM=",
+   "pom": "sha256-1eZQxQ72lYwCjtAktZrwTPPTjhRTp31UK2tIS8D0ygs="
+  },
+  "org/sonatype/spice#spice-parent/12": {
+   "pom": "sha256-IaGbJtvlw43bURTPTq2/XMtBG8axKP3VlJscyxLzaD4="
+  },
+  "org/springframework#spring-asm/3.1.3.RELEASE": {
+   "jar": "sha256-za8dBwQOdREzok+Zesp9mOrL/mfhsoddzoynOCUngTA=",
+   "pom": "sha256-f7b7uYdEDEjGc9sVsIdwqcLWySBSBEIZl5z0j0ZvcSM="
+  },
+  "org/springframework#spring-core/3.1.3.RELEASE": {
+   "jar": "sha256-AUp7IdtoD9iGfgJrGMO/idME3sWyEJCotqezy1z8d9I=",
+   "pom": "sha256-8xqLb1m2oBgOOMnBKboGB7rnoNShC5U3V3DIFKtMx1M="
+  },
+  "org/springframework#spring-parent/3.1.3.RELEASE": {
+   "pom": "sha256-ZOkRARj4KhQnWaMW0J09jY1xfV2VB51/aziO5Hn6eC8="
+  },
+  "org/vafer#jdependency/2.7.0": {
+   "jar": "sha256-1j79V0b/QIlDp91++Frp8Jqn+2O7KxaRFCfObEW1n9A=",
+   "pom": "sha256-6yRCKwo+nofVrG6oCHeG+1HEsbvg0iXvdSFSxzaiBNA="
+  }
+ },
+ "https://repo.maven.apache.org/maven2": {
+  "antlr#antlr/2.7.7": {
+   "jar": "sha256-iPvaS5Ellrn1bo4S5YDMlUus+1F3bs/d0+GPwc9W3Ew=",
+   "pom": "sha256-EA95O6J/i05CBO20YXHr825U4PlM/AJSf+oHoLsfzrc="
+  },
+  "com/atlassian/commonmark#commonmark-ext-gfm-tables/0.15.2": {
+   "jar": "sha256-Wn3BAWFAwPHGnFV21kvjcYJcWlStc1sMaZuWLMTgpPo=",
+   "pom": "sha256-rRZxS5MgMZDpRiSFMrWCkDdBQkg7RhdrsD3CrijycN0="
+  },
+  "com/atlassian/commonmark#commonmark-parent/0.15.2": {
+   "pom": "sha256-PhTratCeeq+Uow5I3kexFm+QCz6Ncm+UfMWkD3HkfCU="
+  },
+  "com/atlassian/commonmark#commonmark/0.15.2": {
+   "jar": "sha256-/UmFBUzWYXaB9smSH/yTq2uGQraeV3T48InZc9HGbmo=",
+   "pom": "sha256-3ZVTaHcyCDS90YRnvtbgKE7UhXKdU8LcLfWEE2vmGaI="
+  },
+  "com/atlassian/pom#base-pom/5.0.13": {
+   "pom": "sha256-CN0hBF/fYQSL7zj/7FbiHuslxuLYRPwJ9rlW4JNzdUM="
+  },
+  "com/atlassian/pom#central-pom/5.0.13": {
+   "pom": "sha256-zihFbTZlB8oPkQIpQqBeOI/Zj4YqbY2zEFxcRJenTOU="
+  },
+  "com/google/code/findbugs#jsr305/3.0.2": {
+   "jar": "sha256-dmrSoHg/JoeWLIrXTO7MOKKLn3Ki0IXuQ4t4E+ko0Mc=",
+   "pom": "sha256-GYidvfGyVLJgGl7mRbgUepdGRIgil2hMeYr+XWPXjf4="
+  },
+  "com/ibm/icu#icu4j/58.2": {
+   "jar": "sha256-lT4eg7K+fD6i+I2obBNhT0fp5x01eMhSHX8Yd1a2OWI=",
+   "pom": "sha256-R7Zq1yxypJmlRL57ixEzX2xz/bcyFxfRGBHfs+k0FGo="
+  },
+  "com/miglayout#miglayout-core/5.2": {
+   "jar": "sha256-Zp8NqP12vlPXX1lA9IFibym1RM2ZJbfaJhEYfSaEvHo=",
+   "pom": "sha256-scvva6qqt3IaCLKlAZtpajfV4+wKfQzXmRo4MOJrfGA="
+  },
+  "com/miglayout#miglayout-parent/5.2": {
+   "pom": "sha256-+STS0Cl2vIQu0u/4sx4Hp2Zb/NJUY9TXmtvkEFis6Zs="
+  },
+  "com/miglayout#miglayout-swing/5.2": {
+   "jar": "sha256-g2n2guoVPvtoGj9YKsxIjoKpfub0fSU1LwgOl38TjIY=",
+   "pom": "sha256-52Q1kq9JpxIUc+OUOzdO3Xw/u5zJBdDGq5DOcCvkQqE="
+  },
+  "com/sun/activation#all/1.2.0": {
+   "pom": "sha256-HYUY46x1MqEE5Pe+d97zfJguUwcjxr2z1ncIzOKwwsQ="
+  },
+  "javax/activation#javax.activation-api/1.2.0": {
+   "jar": "sha256-Q/3vC1ts6zGwQksgi5MMdKtY+sLO63s/b9OuuLXKQ5M=",
+   "pom": "sha256-2ikm88i+iYZDzBCs3sbeCwNRpX+yc1dw+gF3sGrecbk="
+  },
+  "javax/xml/bind#jaxb-api-parent/2.4.0-b180830.0359": {
+   "pom": "sha256-ctEy4shY0iMPFdBI8ek6J5xAxOnshLxW+fLz61r0tLg="
+  },
+  "javax/xml/bind#jaxb-api/2.4.0-b180830.0359": {
+   "jar": "sha256-VrnpcCdTdjAHQ1Fi6niAVe/P78hquSDwMsBBHcVHuDY=",
+   "pom": "sha256-sck/wwHX9f5M3hPRlTKZJR2jfv/8kfUjg1UEw/+HNwc="
+  },
+  "junit#junit/4.12": {
+   "jar": "sha256-WXIfCAXiI9hLkGd4h9n/Vn3FNNfFAsqQPAwrF/BcEWo=",
+   "pom": "sha256-kPFj944/+28cetl96efrpO6iWAcUG4XW0SvmfKJUScQ="
+  },
+  "net/java#jvnet-parent/1": {
+   "pom": "sha256-KBRAgRJo5l2eJms8yJgpfiFOBPCXQNA4bO60qJI9Y78="
+  },
+  "net/java#jvnet-parent/3": {
+   "pom": "sha256-MPV4nvo53b+WCVqto/wSYMRWH68vcUaGcXyy3FBJR1o="
+  },
+  "net/java#jvnet-parent/5": {
+   "pom": "sha256-GvaZ+Nndq2f5oNIC+9eRXrA2Klpt/V/8VMr6NGXJywo="
+  },
+  "net/java/dev/javacc#javacc/4.0": {
+   "jar": "sha256-z7qy1qzbN2TivLXAhCpZ9YPLXoui61wTqNuYNoqtzC8=",
+   "pom": "sha256-EBLeGTH+yhXhvQEomKaJBOXTO7TD6IhY+oagD7ePUDg="
+  },
+  "org/abego/treelayout#org.abego.treelayout.core/1.0.3": {
+   "jar": "sha256-+l4xOVw5wufUasoPgfcgYJMWB7L6Qb02A46yy2+5MyY=",
+   "pom": "sha256-o7KyI3lDcDVeeSQzrwEvyZNmfAMxviusrYTbwJrOSgw="
+  },
+  "org/antlr#ST4/4.0.8": {
+   "jar": "sha256-WMqrxAyfdLC1mT/YaOD2SlDAdZCU5qJRqq+tmO38ejs=",
+   "pom": "sha256-PAiQ3scRdOs7o9QEyp40GQH/awQhgIsAcTsNuxMGwXw="
+  },
+  "org/antlr#antlr-master/3.5.2": {
+   "pom": "sha256-QtkaUx6lEA6wm1QaoALDuQjo8oK9c7bi9S83HvEzG9Y="
+  },
+  "org/antlr#antlr-runtime/3.5.2": {
+   "jar": "sha256-zj/I7LEPOemjzdy7LONQ0nLZzT0LHhjm/nPDuTichzQ=",
+   "pom": "sha256-RqnCIAu4sSvXEkqnpQl/9JCZkIMpyFGgTLIFFCCqfyU="
+  },
+  "org/antlr#antlr/3.5.2": {
+   "jar": "sha256-WsNsKs+woPPTfa/iC1tXDyZD4tAAxkjURQPCc4vmQ98=",
+   "pom": "sha256-Bl5egGYv64WHldPAH3cUJHvdMZRZcF7hOxpLGWj6IuQ="
+  },
+  "org/antlr#antlr4-master/4.7.1": {
+   "pom": "sha256-QSb2e/QT9si8wbGdh7mnJWdCz6ccJQxKmVMNrt6ghow="
+  },
+  "org/antlr#antlr4-runtime/4.7.1": {
+   "jar": "sha256-Q1FtGb6uNZCeBNBq9sDFjBe8lOAHDIXo3JkpymQNyR0=",
+   "pom": "sha256-zhOGobkOUSy3oli1Ih1C8RJh/9qaElkBzdhs3ypZ/5E="
+  },
+  "org/antlr#antlr4/4.7.1": {
+   "jar": "sha256-os3C8vjriTcogyVo3FTQgOtaFJXts7ZuUblxIqYKDYc=",
+   "pom": "sha256-k+AkX5wHQx6tBunpyPmO7IJUQb9PbtZr3aboypxoR5Y="
+  },
+  "org/glassfish#javax.json/1.0.4": {
+   "jar": "sha256-Dh3sQKHt6WWUElHtqWiu7gUsxPUDeLwxbMSOgVm9vrQ=",
+   "pom": "sha256-a6+Dg/+pi2bqls1b/B7H8teUY7uYrJgFKWSxIcIhLVQ="
+  },
+  "org/glassfish#json/1.0.4": {
+   "pom": "sha256-bXxoQjEV+SFxjZRPhZkktMaFIX7AOkn3BFWossqpcuY="
+  },
+  "org/hamcrest#hamcrest-core/1.3": {
+   "jar": "sha256-Zv3vkelzk0jfeglqo4SlaF9Oh1WEzOiThqekclHE2Ok=",
+   "pom": "sha256-/eOGp5BRc6GxA95quCBydYS1DQ4yKC4nl3h8IKZP+pM="
+  },
+  "org/hamcrest#hamcrest-parent/1.3": {
+   "pom": "sha256-bVNflO+2Y722gsnyelAzU5RogAlkK6epZ3UEvBvkEps="
+  },
+  "org/sonatype/oss#oss-parent/7": {
+   "pom": "sha256-tR+IZ8kranIkmVV/w6H96ne9+e9XRyL+kM5DailVlFQ="
+  },
+  "org/sonatype/oss#oss-parent/9": {
+   "pom": "sha256-+0AmX5glSCEv+C42LllzKyGH7G8NgBgohcFO8fmCgno="
+  }
+ }
+}
diff --git a/pkgs/applications/science/logic/klee/default.nix b/pkgs/applications/science/logic/klee/default.nix
index b610ce558605d..fb02c6d40b9dc 100644
--- a/pkgs/applications/science/logic/klee/default.nix
+++ b/pkgs/applications/science/logic/klee/default.nix
@@ -1,10 +1,8 @@
 { lib
-, stdenv
+, llvmPackages
 , callPackage
 , fetchFromGitHub
 , cmake
-, clang
-, llvm
 , python3
 , z3
 , stp
@@ -13,6 +11,7 @@
 , sqlite
 , gtest
 , lit
+, nix-update-script
 
 # Build KLEE in debug mode. Defaults to false.
 , debug ? false
@@ -30,19 +29,35 @@
 # Enable runtime asserts. Default false.
 , runtimeAsserts ? false
 
-# Extra klee-uclibc config.
+# Klee uclibc. Defaults to the bundled version.
+, kleeuClibc ? null
+
+# Extra klee-uclibc config for the default klee-uclibc.
 , extraKleeuClibcConfig ? {}
 }:
 
+# Klee supports these LLVM versions.
+let
+  llvmVersion = llvmPackages.llvm.version;
+  inherit (lib.strings) versionAtLeast versionOlder;
+in
+assert versionAtLeast llvmVersion "11" && versionOlder llvmVersion "17";
+
 let
+  # The chosen version of klee-uclibc.
+  chosenKleeuClibc =
+    if kleeuClibc == null then
+      callPackage ./klee-uclibc.nix {
+        llvmPackages = llvmPackages;
+        inherit extraKleeuClibcConfig debugRuntime runtimeAsserts;
+      }
+    else
+      kleeuClibc;
+
   # Python used for KLEE tests.
   kleePython = python3.withPackages (ps: with ps; [ tabulate ]);
-
-  # The klee-uclibc derivation.
-  kleeuClibc = callPackage ./klee-uclibc.nix {
-    inherit stdenv clang llvm extraKleeuClibcConfig debugRuntime runtimeAsserts;
-  };
-in stdenv.mkDerivation rec {
+in
+llvmPackages.stdenv.mkDerivation rec {
   pname = "klee";
   version = "3.1";
 
@@ -54,14 +69,16 @@ in stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [ cmake ];
+
   buildInputs = [
+    llvmPackages.llvm
     cryptominisat
     gperftools
-    llvm
     sqlite
     stp
     z3
   ];
+
   nativeCheckInputs = [
     gtest
 
@@ -77,10 +94,10 @@ in stdenv.mkDerivation rec {
     onOff = val: if val then "ON" else "OFF";
   in [
     "-DKLEE_RUNTIME_BUILD_TYPE=${if debugRuntime then "Debug" else "Release"}"
-    "-DLLVMCC=${clang}/bin/clang"
-    "-DLLVMCXX=${clang}/bin/clang++"
+    "-DLLVMCC=${llvmPackages.clang}/bin/clang"
+    "-DLLVMCXX=${llvmPackages.clang}/bin/clang++"
     "-DKLEE_ENABLE_TIMESTAMP=${onOff false}"
-    "-DKLEE_UCLIBC_PATH=${kleeuClibc}"
+    "-DKLEE_UCLIBC_PATH=${chosenKleeuClibc}"
     "-DENABLE_KLEE_ASSERTS=${onOff asserts}"
     "-DENABLE_POSIX_RUNTIME=${onOff true}"
     "-DENABLE_UNIT_TESTS=${onOff true}"
@@ -94,20 +111,25 @@ in stdenv.mkDerivation rec {
   env.NIX_CFLAGS_COMPILE = toString ["-Wno-macro-redefined"];
 
   prePatch = ''
-    patchShebangs .
+    patchShebangs --build .
   '';
 
   # https://github.com/klee/klee/issues/1690
   hardeningDisable = [ "fortify" ];
 
+  enableParallelBuilding = true;
   doCheck = true;
 
   passthru = {
-    # Let the user depend on `klee.uclibc` for klee-uclibc
-    uclibc = kleeuClibc;
+    updateScript = nix-update-script {
+      extraArgs = [ "--version-regex" "v(\d\.\d)" ];
+    };
+    # Let the user access the chosen uClibc outside the derivation.
+    uclibc = chosenKleeuClibc;
   };
 
   meta = with lib; {
+    mainProgram = "klee";
     description = "Symbolic virtual machine built on top of LLVM";
     longDescription = ''
       KLEE is a symbolic virtual machine built on top of the LLVM compiler
@@ -128,7 +150,7 @@ in stdenv.mkDerivation rec {
       that matches a computed test input, including setting up files, pipes,
       environment variables, and passing command line arguments.
     '';
-    homepage = "https://klee.github.io/";
+    homepage = "https://klee.github.io";
     license = licenses.ncsa;
     platforms = [ "x86_64-linux" ];
     maintainers = with maintainers; [ numinit ];
diff --git a/pkgs/applications/science/logic/klee/klee-uclibc.nix b/pkgs/applications/science/logic/klee/klee-uclibc.nix
index 5bbd8e69a46fa..c87a881e75336 100644
--- a/pkgs/applications/science/logic/klee/klee-uclibc.nix
+++ b/pkgs/applications/science/logic/klee/klee-uclibc.nix
@@ -1,13 +1,12 @@
 { lib
-, stdenv
+, llvmPackages
 , fetchurl
 , fetchFromGitHub
-, which
 , linuxHeaders
-, clang
-, llvm
 , python3
 , curl
+, which
+, nix-update-script
 , debugRuntime ? true
 , runtimeAsserts ? false
 , extraKleeuClibcConfig ? {}
@@ -24,21 +23,22 @@ let
     "RUNTIME_PREFIX" = "/";
     "DEVEL_PREFIX" = "/";
   });
-in stdenv.mkDerivation rec {
+in
+llvmPackages.stdenv.mkDerivation rec {
   pname = "klee-uclibc";
   version = "1.4";
   src = fetchFromGitHub {
     owner = "klee";
     repo = "klee-uclibc";
     rev = "klee_uclibc_v${version}";
-    sha256 = "sha256-sogQK5Ed0k5tf4rrYwCKT4YRKyEovgT25p0BhGvJ1ok=";
+    hash = "sha256-sogQK5Ed0k5tf4rrYwCKT4YRKyEovgT25p0BhGvJ1ok=";
   };
 
   nativeBuildInputs = [
-    clang
-    curl
-    llvm
+    llvmPackages.clang
+    llvmPackages.llvm
     python3
+    curl
     which
   ];
 
@@ -47,11 +47,11 @@ in stdenv.mkDerivation rec {
 
   # HACK: needed for cross-compile.
   # See https://www.mail-archive.com/klee-dev@imperial.ac.uk/msg03141.html
-  KLEE_CFLAGS = "-idirafter ${clang}/resource-root/include";
+  KLEE_CFLAGS = "-idirafter ${llvmPackages.clang}/resource-root/include";
 
   prePatch = ''
-    patchShebangs ./configure
-    patchShebangs ./extra
+    patchShebangs --build ./configure
+    patchShebangs --build ./extra
   '';
 
   # klee-uclibc configure does not support --prefix, so we override configurePhase entirely
@@ -88,13 +88,19 @@ in stdenv.mkDerivation rec {
 
   makeFlags = ["HAVE_DOT_CONFIG=y"];
 
+  enableParallelBuilding = true;
+
+  passthru.updateScript = nix-update-script {
+    extraArgs = [ "--version-regex" "v(\d\.\d)" ];
+  };
+
   meta = with lib; {
     description = "Modified version of uClibc for KLEE";
     longDescription = ''
       klee-uclibc is a bitcode build of uClibc meant for compatibility with the
       KLEE symbolic virtual machine.
     '';
-    homepage = "https://klee.github.io/";
+    homepage = "https://github.com/klee/klee-uclibc";
     license = licenses.lgpl3;
     maintainers = with maintainers; [ numinit ];
   };
diff --git a/pkgs/applications/science/logic/lean/default.nix b/pkgs/applications/science/logic/lean/default.nix
index f0bd2ba777db9..4df1d6eb8aab5 100644
--- a/pkgs/applications/science/logic/lean/default.nix
+++ b/pkgs/applications/science/logic/lean/default.nix
@@ -42,7 +42,7 @@ stdenv.mkDerivation rec {
 
   postPatch = "patchShebangs .";
 
-  postInstall = lib.optionalString stdenv.isDarwin ''
+  postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
     substituteInPlace $out/bin/leanpkg \
       --replace "greadlink" "${coreutils}/bin/readlink"
   '';
diff --git a/pkgs/applications/science/logic/lean2/default.nix b/pkgs/applications/science/logic/lean2/default.nix
index e30b8af047350..83cada9e309ab 100644
--- a/pkgs/applications/science/logic/lean2/default.nix
+++ b/pkgs/applications/science/logic/lean2/default.nix
@@ -40,7 +40,7 @@ stdenv.mkDerivation {
     license     = licenses.asl20;
     platforms   = platforms.unix;
     maintainers = with maintainers; [ thoughtpolice gebner ];
-    broken      = stdenv.isAarch64;
+    broken      = stdenv.hostPlatform.isAarch64;
     mainProgram = "lean";
   };
 }
diff --git a/pkgs/applications/science/logic/lean4/default.nix b/pkgs/applications/science/logic/lean4/default.nix
index 2ec05098f4078..a2c33db40afde 100644
--- a/pkgs/applications/science/logic/lean4/default.nix
+++ b/pkgs/applications/science/logic/lean4/default.nix
@@ -10,13 +10,13 @@
 
 stdenv.mkDerivation (finalAttrs: {
   pname = "lean4";
-  version = "4.8.0";
+  version = "4.9.1";
 
   src = fetchFromGitHub {
     owner = "leanprover";
     repo = "lean4";
     rev = "v${finalAttrs.version}";
-    hash = "sha256-R75RrAQb/tRTtMvy/ddLl1KQaA7V71nocvjIS9geMrg=";
+    hash = "sha256-C3N56f3mT+5f149T1BIYQil2UleAWmnRYLqUq4zcLgs=";
   };
 
   postPatch = ''
@@ -53,6 +53,7 @@ stdenv.mkDerivation (finalAttrs: {
   passthru.tests = {
     version = testers.testVersion {
       package = finalAttrs.finalPackage;
+      version = "v${finalAttrs.version}";
     };
   };
 
@@ -62,7 +63,7 @@ stdenv.mkDerivation (finalAttrs: {
     changelog = "https://github.com/leanprover/lean4/blob/${finalAttrs.src.rev}/RELEASES.md";
     license = licenses.asl20;
     platforms = platforms.all;
-    maintainers = with maintainers; [ ];
+    maintainers = with maintainers; [ danielbritten ];
     mainProgram = "lean";
   };
 })
diff --git a/pkgs/applications/science/logic/logisim-evolution/default.nix b/pkgs/applications/science/logic/logisim-evolution/default.nix
index 3d86c8cafdbc2..465360a202385 100644
--- a/pkgs/applications/science/logic/logisim-evolution/default.nix
+++ b/pkgs/applications/science/logic/logisim-evolution/default.nix
@@ -29,7 +29,7 @@ stdenv.mkDerivation (finalAttrs: {
     makeBinaryWrapper
     copyDesktopItems
     unzip
-  ] ++ lib.optionals stdenv.isDarwin [
+  ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
     desktopToDarwinBundle
   ];
 
diff --git a/pkgs/applications/science/logic/logisim/default.nix b/pkgs/applications/science/logic/logisim/default.nix
index d278f1e784687..951d5b22deef0 100644
--- a/pkgs/applications/science/logic/logisim/default.nix
+++ b/pkgs/applications/science/logic/logisim/default.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation (finalAttrs: {
     makeBinaryWrapper
     copyDesktopItems
     unzip
-  ] ++ lib.optionals stdenv.isDarwin [
+  ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
     desktopToDarwinBundle
   ];
 
diff --git a/pkgs/applications/science/logic/mcrl2/default.nix b/pkgs/applications/science/logic/mcrl2/default.nix
index c26e5f2e761f6..a0cbdabc5a452 100644
--- a/pkgs/applications/science/logic/mcrl2/default.nix
+++ b/pkgs/applications/science/logic/mcrl2/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   dontWrapQtApps = true;
 
   meta = with lib; {
-    broken = stdenv.isDarwin;
+    broken = stdenv.hostPlatform.isDarwin;
     description = "Toolset for model-checking concurrent systems and protocols";
     longDescription = ''
       A formal specification language with an associated toolset,
diff --git a/pkgs/applications/science/logic/mcy/default.nix b/pkgs/applications/science/logic/mcy/default.nix
index 343b50dfd7ef9..65c752f629993 100644
--- a/pkgs/applications/science/logic/mcy/default.nix
+++ b/pkgs/applications/science/logic/mcy/default.nix
@@ -32,7 +32,7 @@ stdenv.mkDerivation {
   '';
 
   # the build needs a bit of work...
-  buildPhase = "true";
+  dontBuild = true;
   installPhase = ''
     mkdir -p $out/bin $out/share/mcy/{dash,scripts}
     install mcy.py      $out/bin/mcy      && chmod +x $out/bin/mcy
diff --git a/pkgs/applications/science/logic/monosat/default.nix b/pkgs/applications/science/logic/monosat/default.nix
index 067ba8ceb1b33..1bd2d29d45059 100644
--- a/pkgs/applications/science/logic/monosat/default.nix
+++ b/pkgs/applications/science/logic/monosat/default.nix
@@ -3,8 +3,6 @@
   # annoying and break the python library, so let's not bother for now
   includeJava ? !stdenv.hostPlatform.isDarwin, includeGplCode ? true }:
 
-with lib;
-
 let
   boolToCmake = x: if x then "ON" else "OFF";
 
@@ -52,14 +50,14 @@ let
       "-DCMAKE_SKIP_BUILD_RPATH=ON"
     ];
 
-    postInstall = optionalString includeJava ''
+    postInstall = lib.optionalString includeJava ''
       mkdir -p $out/share/java
       cp monosat.jar $out/share/java
     '';
 
     passthru = { inherit python; };
 
-    meta = {
+    meta = with lib; {
       description = "SMT solver for Monotonic Theories";
       mainProgram = "monosat";
       platforms   = platforms.unix;
diff --git a/pkgs/applications/science/logic/msat/default.nix b/pkgs/applications/science/logic/msat/default.nix
index 299fe95224eba..3c27493baff87 100644
--- a/pkgs/applications/science/logic/msat/default.nix
+++ b/pkgs/applications/science/logic/msat/default.nix
@@ -1,4 +1,4 @@
-{ lib, ocamlPackages }:
+{ ocamlPackages }:
 
 with ocamlPackages; buildDunePackage {
   pname = "msat-bin";
diff --git a/pkgs/applications/science/logic/naproche/default.nix b/pkgs/applications/science/logic/naproche/default.nix
deleted file mode 100644
index d2070ba8240ff..0000000000000
--- a/pkgs/applications/science/logic/naproche/default.nix
+++ /dev/null
@@ -1,35 +0,0 @@
-{ lib, fetchFromGitHub, haskellPackages, makeWrapper, eprover }:
-
-with haskellPackages; mkDerivation {
-  pname = "Naproche-SAD";
-  version = "unstable-2024-01-18";
-
-  src = fetchFromGitHub {
-    owner = "naproche";
-    repo = "naproche";
-    rev = "bb3dbcbd2173e3334bc5bdcd04c07c6836a11387";
-    hash = "sha256-DWcowUjy8/VBuhqvDYlVINHssF4KhuzT0L+m1YwUxoE=";
-  };
-
-  isExecutable = true;
-
-  buildTools = [ hpack makeWrapper ];
-  executableHaskellDepends = [
-    base array bytestring containers ghc-prim megaparsec mtl network process
-    split temporary text threads time transformers uuid
-  ];
-
-  prePatch = "hpack";
-  doCheck = false; # Tests are broken in upstream
-
-  postInstall = ''
-    wrapProgram $out/bin/Naproche-SAD \
-      --set-default NAPROCHE_EPROVER ${eprover}/bin/eprover
-  '';
-
-  homepage = "https://github.com/naproche/naproche#readme";
-  description = "Write formal proofs in natural language and LaTeX";
-  maintainers = with lib.maintainers; [ jvanbruegge ];
-  license = lib.licenses.gpl3Only;
-  mainProgram = "Naproche-SAD";
-}
diff --git a/pkgs/applications/science/logic/nuXmv/default.nix b/pkgs/applications/science/logic/nuXmv/default.nix
index ad40902e92808..5726796bfa189 100644
--- a/pkgs/applications/science/logic/nuXmv/default.nix
+++ b/pkgs/applications/science/logic/nuXmv/default.nix
@@ -5,21 +5,21 @@ stdenv.mkDerivation rec {
   version = "2.0.0";
 
   src = fetchurl {
-    url = "https://es-static.fbk.eu/tools/nuxmv/downloads/nuXmv-${version}-${if stdenv.isDarwin then "macosx64" else "linux64"}.tar.gz";
-    sha256 = if stdenv.isDarwin
+    url = "https://es-static.fbk.eu/tools/nuxmv/downloads/nuXmv-${version}-${if stdenv.hostPlatform.isDarwin then "macosx64" else "linux64"}.tar.gz";
+    sha256 = if stdenv.hostPlatform.isDarwin
              then "sha256-48I+FhJUUam1nMCMMM47CwGO82BYsNz0eHDHXBfqO2E="
              else "sha256-Gf+QgAjTrysZj7qTtt1wcQPganDtO0YtRY4ykhLPzVo=";
   };
 
   nativeBuildInputs = [ makeWrapper ];
-  buildInputs = lib.optionals stdenv.isDarwin [ gmp ];
+  buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ gmp ];
   installPhase= ''
     runHook preInstall
     install -Dm755 -t $out/bin ./bin/nuXmv
     runHook postInstall
   '';
 
-  postFixup = lib.optionalString stdenv.isDarwin ''
+  postFixup = lib.optionalString stdenv.hostPlatform.isDarwin ''
     wrapProgram $out/bin/nuXmv --prefix DYLD_LIBRARY_PATH : ${gmp}/lib
   '';
 
diff --git a/pkgs/applications/science/logic/nusmv/default.nix b/pkgs/applications/science/logic/nusmv/default.nix
index d7ecbc7cd8874..058949083caf0 100644
--- a/pkgs/applications/science/logic/nusmv/default.nix
+++ b/pkgs/applications/science/logic/nusmv/default.nix
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
 
   meta = with lib; {
     description = "New symbolic model checker for the analysis of synchronous finite-state and infinite-state systems";
-    homepage = "https://nuxmv.fbk.eu/pmwiki.php";
+    homepage = "https://nusmv.fbk.eu/";
     maintainers = with maintainers; [ mgttlinger ];
     sourceProvenance = with sourceTypes; [ binaryNativeCode ];
     platforms = platforms.linux;
diff --git a/pkgs/applications/science/logic/open-wbo/default.nix b/pkgs/applications/science/logic/open-wbo/default.nix
index 2290ff29224b4..798643acc1bba 100644
--- a/pkgs/applications/science/logic/open-wbo/default.nix
+++ b/pkgs/applications/science/logic/open-wbo/default.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation {
   '';
 
   meta = with lib; {
-    broken = (stdenv.isLinux && stdenv.isAarch64);
+    broken = (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64);
     description = "State-of-the-art MaxSAT and Pseudo-Boolean solver";
     mainProgram = "open-wbo";
     maintainers = with maintainers; [ gebner ];
diff --git a/pkgs/applications/science/logic/opensmt/default.nix b/pkgs/applications/science/logic/opensmt/default.nix
index 1a031e8d1e1dd..0ebbbc663caab 100644
--- a/pkgs/applications/science/logic/opensmt/default.nix
+++ b/pkgs/applications/science/logic/opensmt/default.nix
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
   ];
 
   meta = with lib; {
-    broken = (stdenv.isLinux && stdenv.isAarch64);
+    broken = (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64);
     description = "Satisfiability modulo theory (SMT) solver";
     mainProgram = "opensmt";
     maintainers = [ maintainers.raskin ];
diff --git a/pkgs/applications/science/logic/picosat/default.nix b/pkgs/applications/science/logic/picosat/default.nix
index 1fef05069a696..23fc2776ba813 100644
--- a/pkgs/applications/science/logic/picosat/default.nix
+++ b/pkgs/applications/science/logic/picosat/default.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
 
   configurePhase = "./configure.sh --shared --trace";
 
-  makeFlags = lib.optional stdenv.isDarwin
+  makeFlags = lib.optional stdenv.hostPlatform.isDarwin
     "SONAME=-Wl,-install_name,$(out)/lib/libpicosat.so";
 
   installPhase = ''
diff --git a/pkgs/applications/science/logic/prover9/default.nix b/pkgs/applications/science/logic/prover9/default.nix
index 5c476be06e4e7..a82e44c8a5109 100644
--- a/pkgs/applications/science/logic/prover9/default.nix
+++ b/pkgs/applications/science/logic/prover9/default.nix
@@ -41,6 +41,6 @@ stdenv.mkDerivation {
       the Otter Prover. This is the LADR command-line version.
     '';
     platforms = platforms.linux;
-    maintainers = with maintainers; [ ];
+    maintainers = [ ];
   };
 }
diff --git a/pkgs/applications/science/logic/redprl/default.nix b/pkgs/applications/science/logic/redprl/default.nix
index 03117d4e03285..a6354a091665e 100644
--- a/pkgs/applications/science/logic/redprl/default.nix
+++ b/pkgs/applications/science/logic/redprl/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation {
     repo = "sml-redprl";
     rev = "c72190de76f7ed1cfbe1d2046c96e99ac5022b0c";
     fetchSubmodules = true;
-    sha256 = "sha256-xrQT5o0bsIN+mCYUOz9iY4+j3HGROb1I6R2ADcLy8n4=";
+    hash = "sha256-xrQT5o0bsIN+mCYUOz9iY4+j3HGROb1I6R2ADcLy8n4=";
   };
 
   buildInputs = [ mlton ];
diff --git a/pkgs/applications/science/logic/satallax/default.nix b/pkgs/applications/science/logic/satallax/default.nix
index bd3e9d3e8351e..0f7d05a8823ee 100644
--- a/pkgs/applications/science/logic/satallax/default.nix
+++ b/pkgs/applications/science/logic/satallax/default.nix
@@ -49,7 +49,7 @@ stdenv.mkDerivation rec {
   '';
 
   # error: invalid suffix on literal; C++11 requires a space between literal and identifier
-  env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-Wno-reserved-user-defined-literal";
+  env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin "-Wno-reserved-user-defined-literal";
 
   installPhase = ''
     mkdir -p "$out/share/doc/satallax" "$out/bin" "$out/lib" "$out/lib/satallax"
@@ -67,7 +67,7 @@ stdenv.mkDerivation rec {
     cp -r coq* "$out/lib/satallax/"
   '';
 
-  doCheck = stdenv.isLinux;
+  doCheck = stdenv.hostPlatform.isLinux;
 
   checkPhase = ''
     runHook preCheck
diff --git a/pkgs/applications/science/logic/stp/default.nix b/pkgs/applications/science/logic/stp/default.nix
index fb41ea07f5a15..1025663b1bd7c 100644
--- a/pkgs/applications/science/logic/stp/default.nix
+++ b/pkgs/applications/science/logic/stp/default.nix
@@ -1,5 +1,17 @@
-{ lib, stdenv, cmake, boost, bison, flex, fetchFromGitHub, perl
-, python3, python3Packages, zlib, minisat, cryptominisat }:
+{ lib
+, stdenv
+, cmake
+, boost
+, bison
+, flex
+, fetchFromGitHub
+, fetchpatch
+, perl
+, python3
+, zlib
+, minisat
+, cryptominisat
+}:
 
 stdenv.mkDerivation rec {
   pname = "stp";
@@ -8,14 +20,20 @@ stdenv.mkDerivation rec {
   src = fetchFromGitHub {
     owner = "stp";
     repo = "stp";
-    rev    = version;
-    sha256 = "1yg2v4wmswh1sigk47drwsxyayr472mf4i47lqmlcgn9hhbx1q87";
+    rev = version;
+    hash = "sha256-B+HQF4TJPkYrpodE4qo4JHvlu+a5HTJf1AFyXTnZ4vk=";
   };
   patches = [
     # Fix missing type declaration
     # due to undeterminisitic compilation
     # of circularly dependent headers
     ./stdint.patch
+
+    # Python 3.12+ compatibility for build: https://github.com/stp/stp/pull/450
+    (fetchpatch {
+      url = "https://github.com/stp/stp/commit/fb185479e760b6ff163512cb6c30ac9561aadc0e.patch";
+      hash = "sha256-guFgeWOrxRrxkU7kMvd5+nmML0rwLYW196m1usE2qiA=";
+    })
   ];
 
   postPatch = ''
@@ -26,10 +44,16 @@ stdenv.mkDerivation rec {
     sed -e '1i #include <cstdint>' -i include/stp/AST/ASTNode.h
   '';
 
-  buildInputs = [ boost zlib minisat cryptominisat python3 ];
+  buildInputs = [
+    boost
+    zlib
+    minisat
+    cryptominisat
+    python3
+  ];
   nativeBuildInputs = [ cmake bison flex perl ];
   preConfigure = ''
-    python_install_dir=$out/${python3Packages.python.sitePackages}
+    python_install_dir=$out/${python3.sitePackages}
     mkdir -p $python_install_dir
     cmakeFlagsArray=(
       $cmakeFlagsArray
@@ -40,7 +64,7 @@ stdenv.mkDerivation rec {
 
   meta = with lib; {
     description = "Simple Theorem Prover";
-    maintainers = with maintainers; [ McSinyx ];
+    maintainers = with maintainers; [ McSinyx numinit ];
     platforms = platforms.linux;
     license = licenses.mit;
   };
diff --git a/pkgs/applications/science/logic/surelog/default.nix b/pkgs/applications/science/logic/surelog/default.nix
index 7b4c85fe9b215..0d795611b95a8 100644
--- a/pkgs/applications/science/logic/surelog/default.nix
+++ b/pkgs/applications/science/logic/surelog/default.nix
@@ -16,13 +16,13 @@
 
 stdenv.mkDerivation (finalAttrs: {
   pname = "surelog";
-  version = "1.82";
+  version = "1.83";
 
   src = fetchFromGitHub {
     owner = "chipsalliance";
-    repo = finalAttrs.pname;
+    repo = "surelog";
     rev = "v${finalAttrs.version}";
-    hash = "sha256-iW2mQPmKfbAWaiEURyVly5IjJ3YpXjVBkm/UbUuwb6k=";
+    hash = "sha256-V4LmW4ca6KfugOu0XnGwutRqWR/9K6ESokHOB2yAVag=";
     fetchSubmodules = false;  # we use all dependencies from nix
   };
 
diff --git a/pkgs/applications/science/logic/symbiyosys/default.nix b/pkgs/applications/science/logic/symbiyosys/default.nix
deleted file mode 100644
index c3df8340d20c8..0000000000000
--- a/pkgs/applications/science/logic/symbiyosys/default.nix
+++ /dev/null
@@ -1,62 +0,0 @@
-{ lib, stdenv, fetchFromGitHub
-, bash, python3, yosys
-, yices, boolector, z3, aiger
-}:
-
-stdenv.mkDerivation {
-  pname = "symbiyosys";
-  version = "2021.11.30";
-
-  src = fetchFromGitHub {
-    owner = "YosysHQ";
-    repo  = "SymbiYosys";
-    rev   = "b409b1179e36d2a3fff66c85b7d4e271769a2d9e";
-    hash  = "sha256-S7of2upntiMkSdh4kf1RsrjriS31Eh8iEcVvG36isQg=";
-  };
-
-  buildInputs = [ ];
-  patchPhase = ''
-    patchShebangs .
-
-    # Fix up Yosys imports
-    substituteInPlace sbysrc/sby.py \
-      --replace "##yosys-sys-path##" \
-                "sys.path += [p + \"/share/yosys/python3/\" for p in [\"$out\", \"${yosys}\"]]"
-
-    # Fix various executable references
-    substituteInPlace sbysrc/sby_core.py \
-      --replace '"/usr/bin/env", "bash"' '"${bash}/bin/bash"' \
-      --replace ', "btormc"'             ', "${boolector}/bin/btormc"' \
-      --replace ', "aigbmc"'             ', "${aiger}/bin/aigbmc"'
-
-    substituteInPlace sbysrc/sby_core.py \
-      --replace '##yosys-program-prefix##' '"${yosys}/bin/"'
-
-    substituteInPlace sbysrc/sby.py \
-      --replace '/usr/bin/env python3' '${python3}/bin/python'
-  '';
-
-  buildPhase = "true";
-
-  installPhase = ''
-    mkdir -p $out/bin $out/share/yosys/python3
-
-    cp sbysrc/sby_*.py $out/share/yosys/python3/
-    cp sbysrc/sby.py $out/bin/sby
-
-    chmod +x $out/bin/sby
-  '';
-
-  doCheck = false; # not all provers are yet packaged...
-  nativeCheckInputs = [ python3 yosys boolector yices z3 aiger ];
-  checkPhase = "make test";
-
-  meta = {
-    description = "Tooling for Yosys-based verification flows";
-    homepage    = "https://symbiyosys.readthedocs.io/";
-    license     = lib.licenses.isc;
-    maintainers = with lib.maintainers; [ thoughtpolice ];
-    mainProgram = "sby";
-    platforms   = lib.platforms.all;
-  };
-}
diff --git a/pkgs/applications/science/logic/tamarin-prover/default.nix b/pkgs/applications/science/logic/tamarin-prover/default.nix
index 2aa92118b03a7..e621b36a773bb 100644
--- a/pkgs/applications/science/logic/tamarin-prover/default.nix
+++ b/pkgs/applications/science/logic/tamarin-prover/default.nix
@@ -108,7 +108,7 @@ mkDerivation (common "tamarin-prover" src // {
   executableToolDepends = [ makeWrapper which maude graphviz ];
   postInstall = ''
     wrapProgram $out/bin/tamarin-prover \
-  '' + lib.optionalString stdenv.isLinux ''
+  '' + lib.optionalString stdenv.hostPlatform.isLinux ''
       --set LOCALE_ARCHIVE "${glibcLocales}/lib/locale/locale-archive" \
   '' + ''
       --prefix PATH : ${lib.makeBinPath [ which maude graphviz ]}
diff --git a/pkgs/applications/science/logic/tlaplus/default.nix b/pkgs/applications/science/logic/tlaplus/default.nix
index f478bf204d4f3..f53da73e1e632 100644
--- a/pkgs/applications/science/logic/tlaplus/default.nix
+++ b/pkgs/applications/science/logic/tlaplus/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "tlaplus";
-  version = "1.7.3";
+  version = "1.7.4";
 
   src = fetchurl {
     url = "https://github.com/tlaplus/tlaplus/releases/download/v${version}/tla2tools.jar";
-    sha256 = "sha256-5P8V6oH05voSXAgwBDclSxdxdMalrfaNpElkar4IUZ0=";
+    sha256 = "sha256-k2omIGHJFGlN/WaaVDviRXPEXVqg/yCouWsj0B4FDog=";
   };
 
   nativeBuildInputs = [ makeWrapper ];
diff --git a/pkgs/applications/science/logic/uhdm/default.nix b/pkgs/applications/science/logic/uhdm/default.nix
index 182f6eb81eeb2..72b55ffbcd7ab 100644
--- a/pkgs/applications/science/logic/uhdm/default.nix
+++ b/pkgs/applications/science/logic/uhdm/default.nix
@@ -10,13 +10,13 @@
 stdenv.mkDerivation (finalAttrs: {
   pname = "UHDM";
   # When updating this package, also consider updating science/logic/surelog
-  version = "1.82";
+  version = "1.83";
 
   src = fetchFromGitHub {
     owner = "chipsalliance";
-    repo = finalAttrs.pname;
+    repo = "UHDM";
     rev = "v${finalAttrs.version}";
-    hash = "sha256-sl83l6nLN/bluED5bnFShviD1Vv8hmRazxIcLUg/ego=";
+    hash = "sha256-va8qAzsg589C6rLmG1uIMDr4X30qpBgRO1ZVKdEs5ok=";
     fetchSubmodules = false;  # we use all dependencies from nix
   };
 
diff --git a/pkgs/applications/science/logic/verifast/default.nix b/pkgs/applications/science/logic/verifast/default.nix
index a1f5ec65a3be3..9515bda467cfd 100644
--- a/pkgs/applications/science/logic/verifast/default.nix
+++ b/pkgs/applications/science/logic/verifast/default.nix
@@ -20,11 +20,11 @@ let
 in
 stdenv.mkDerivation rec {
   pname = "verifast";
-  version = "21.04";
+  version = "24.08.30";
 
   src = fetchurl {
     url    = "https://github.com/verifast/verifast/releases/download/${version}/${pname}-${version}-linux.tar.gz";
-    sha256 = "sha256-PlRsf4wFXoM+E+60SbeKzs/RZK0HNVirX47AnI6NeYM=";
+    sha256 = "sha256-hIS5e+zVlxSOqr1/ZDy0PangyWjB9uLCvN8Qr688msg=";
   };
 
   dontConfigure = true;
diff --git a/pkgs/applications/science/logic/workcraft/default.nix b/pkgs/applications/science/logic/workcraft/default.nix
index cc512acad7937..f1159f3c06875 100644
--- a/pkgs/applications/science/logic/workcraft/default.nix
+++ b/pkgs/applications/science/logic/workcraft/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "workcraft";
-  version = "3.4.2";
+  version = "3.5.1";
 
   src = fetchurl {
     url = "https://github.com/workcraft/workcraft/releases/download/v${version}/workcraft-v${version}-linux.tar.gz";
-    sha256 = "sha256-+O6fl/+D89L5xrrTaAnBTfw0tFz/CoKLaBa+OHtdnaA=";
+    sha256 = "sha256-326iDxQ1t9iih2JVRO07C41V5DtkUzwkcNHCz5kLHT8=";
   };
 
   nativeBuildInputs = [ makeWrapper ];
diff --git a/pkgs/applications/science/logic/yices/default.nix b/pkgs/applications/science/logic/yices/default.nix
index de80cd725653f..f29a5e1f3f51f 100644
--- a/pkgs/applications/science/logic/yices/default.nix
+++ b/pkgs/applications/science/logic/yices/default.nix
@@ -2,20 +2,15 @@
 
 stdenv.mkDerivation rec {
   pname = "yices";
-  # We never want X.Y.${odd} versions as they are moving development tags.
-  version = "2.6.4";
+  version = "2.6.5";
 
   src = fetchFromGitHub {
     owner  = "SRI-CSL";
     repo   = "yices2";
     rev    = "Yices-${version}";
-    sha256 = "sha256-qdxh86CkKdm65oHcRgaafTG9GUOoIgTDjeWmRofIpNE=";
+    hash = "sha256-/sKyHkFW5I5kojNIRPEKojzTvfRZiyVIN5VlBIbAV7k=";
   };
 
-  patches = [
-    # musl has no ldconfig, create symlinks explicitly
-    ./linux-no-ldconfig.patch
-  ];
   postPatch = "patchShebangs tests/regress/check.sh";
 
   nativeBuildInputs = [ autoreconfHook ];
diff --git a/pkgs/applications/science/logic/yices/linux-no-ldconfig.patch b/pkgs/applications/science/logic/yices/linux-no-ldconfig.patch
deleted file mode 100644
index bad3da6ad4a28..0000000000000
--- a/pkgs/applications/science/logic/yices/linux-no-ldconfig.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- a/Makefile.build
-+++ b/Makefile.build
-@@ -474,8 +474,9 @@ install-darwin: install-default
- install-solaris: install-default
- 	$(LDCONFIG) -n $(DESTDIR)$(libdir) && (cd $(DESTDIR)$(libdir) && $(LN_S) -f libyices.so.$(YICES_VERSION) libyices.so)
- 
-+# avoid ldconfig as it's not present on musl
- install-linux install-unix: install-default
--	$(LDCONFIG) -n $(DESTDIR)$(libdir) && (cd $(DESTDIR)$(libdir) && $(LN_S) -f libyices.so.$(YICES_VERSION) libyices.so)
-+	(cd $(DESTDIR)$(libdir) && $(LN_S) -f libyices.so.$(YICES_VERSION) libyices.so.$(MAJOR).$(MINOR) && $(LN_S) -f libyices.so.$(MAJOR).$(MINOR) libyices.so)
- 
- # on FreeBSD: the library file is libyices.so.X.Y and ldconfig does not take -n
- # TODO: fix this. We must also create a symbolic link: libyices.so.X in libdir
diff --git a/pkgs/applications/science/logic/z3/default.nix b/pkgs/applications/science/logic/z3/default.nix
index 2db1fc95f7974..a17cc5561cf21 100644
--- a/pkgs/applications/science/logic/z3/default.nix
+++ b/pkgs/applications/science/logic/z3/default.nix
@@ -16,8 +16,6 @@
 assert javaBindings -> jdk != null;
 assert ocamlBindings -> ocaml != null && findlib != null && zarith != null;
 
-with lib;
-
 let common = { version, sha256, patches ? [ ], tag ? "z3" }:
   stdenv.mkDerivation rec {
     pname = "z3";
@@ -32,25 +30,25 @@ let common = { version, sha256, patches ? [ ], tag ? "z3" }:
     strictDeps = true;
 
     nativeBuildInputs = [ python ]
-      ++ optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames
-      ++ optional javaBindings jdk
-      ++ optionals ocamlBindings [ ocaml findlib ]
+      ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames
+      ++ lib.optional javaBindings jdk
+      ++ lib.optionals ocamlBindings [ ocaml findlib ]
     ;
     propagatedBuildInputs = [ python.pkgs.setuptools ]
-      ++ optionals ocamlBindings [ zarith ];
+      ++ lib.optionals ocamlBindings [ zarith ];
     enableParallelBuilding = true;
 
-    postPatch = optionalString ocamlBindings ''
+    postPatch = lib.optionalString ocamlBindings ''
       export OCAMLFIND_DESTDIR=$ocaml/lib/ocaml/${ocaml.version}/site-lib
       mkdir -p $OCAMLFIND_DESTDIR/stublibs
     '';
 
-    configurePhase = concatStringsSep " "
+    configurePhase = lib.concatStringsSep " "
       (
         [ "${python.pythonOnBuildForHost.interpreter} scripts/mk_make.py --prefix=$out" ]
-          ++ optional javaBindings "--java"
-          ++ optional ocamlBindings "--ml"
-          ++ optional pythonBindings "--python --pypkgdir=$out/${python.sitePackages}"
+          ++ lib.optional javaBindings "--java"
+          ++ lib.optional ocamlBindings "--ml"
+          ++ lib.optional pythonBindings "--python --pypkgdir=$out/${python.sitePackages}"
       ) + "\n" + "cd build";
 
     doCheck = true;
@@ -63,19 +61,19 @@ let common = { version, sha256, patches ? [ ], tag ? "z3" }:
       mkdir -p $dev $lib
       mv $out/lib $lib/lib
       mv $out/include $dev/include
-    '' + optionalString pythonBindings ''
+    '' + lib.optionalString pythonBindings ''
       mkdir -p $python/lib
       mv $lib/lib/python* $python/lib/
       ln -sf $lib/lib/libz3${stdenv.hostPlatform.extensions.sharedLibrary} $python/${python.sitePackages}/z3/lib/libz3${stdenv.hostPlatform.extensions.sharedLibrary}
-    '' + optionalString javaBindings ''
+    '' + lib.optionalString javaBindings ''
       mkdir -p $java/share/java
       mv com.microsoft.z3.jar $java/share/java
       moveToOutput "lib/libz3java.${stdenv.hostPlatform.extensions.sharedLibrary}" "$java"
     '';
 
     outputs = [ "out" "lib" "dev" "python" ]
-      ++ optional javaBindings "java"
-      ++ optional ocamlBindings "ocaml";
+      ++ lib.optional javaBindings "java"
+      ++ lib.optional ocamlBindings "ocaml";
 
     meta = with lib; {
       description = "High-performance theorem prover and SMT solver";
diff --git a/pkgs/applications/science/machine-learning/finalfrontier/default.nix b/pkgs/applications/science/machine-learning/finalfrontier/default.nix
index 1a6e9351d3a79..ca495dcc280ac 100644
--- a/pkgs/applications/science/machine-learning/finalfrontier/default.nix
+++ b/pkgs/applications/science/machine-learning/finalfrontier/default.nix
@@ -20,14 +20,14 @@ rustPlatform.buildRustPackage rec {
     sha256 = "sha256-bnRzXIYairlBjv2JxU16UXYc5BB3VeKZNiJ4+XDzub4=";
   };
 
-  cargoSha256 = "sha256-C/D9EPfifyajrCyXE8w/qRuzWEoyJJIcj4xii94/9l4=";
+  cargoHash = "sha256-C/D9EPfifyajrCyXE8w/qRuzWEoyJJIcj4xii94/9l4=";
 
   nativeBuildInputs = [
     installShellFiles
     pkg-config
   ];
 
-  buildInputs = [ openssl ] ++ lib.optionals stdenv.isDarwin [
+  buildInputs = [ openssl ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
     libiconv
     Security
   ];
@@ -47,6 +47,6 @@ rustPlatform.buildRustPackage rec {
     mainProgram = "finalfrontier";
     homepage = "https://github.com/finalfusion/finalfrontier/";
     license = licenses.asl20;
-    maintainers = with maintainers; [ ];
+    maintainers = [ ];
   };
 }
diff --git a/pkgs/applications/science/machine-learning/finalfusion-utils/default.nix b/pkgs/applications/science/machine-learning/finalfusion-utils/default.nix
index 0df8a0525be51..2b3bd2776089d 100644
--- a/pkgs/applications/science/machine-learning/finalfusion-utils/default.nix
+++ b/pkgs/applications/science/machine-learning/finalfusion-utils/default.nix
@@ -21,7 +21,7 @@ rustPlatform.buildRustPackage rec {
     sha256 = "sha256-suzivynlgk4VvDOC2dQR40n5IJHoJ736+ObdrM9dIqE=";
   };
 
-  cargoSha256 = "sha256-HekjmctuzOWs5k/ihhsV8vVkm6906jEnFf3yvhkrA5Y=";
+  cargoHash = "sha256-HekjmctuzOWs5k/ihhsV8vVkm6906jEnFf3yvhkrA5Y=";
 
   nativeBuildInputs = [ installShellFiles ];
 
@@ -30,7 +30,7 @@ rustPlatform.buildRustPackage rec {
     gfortran.cc.lib
     lapack
     openssl
-  ] ++ lib.optionals stdenv.isDarwin [
+  ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
     Security
   ];
 
@@ -49,7 +49,7 @@ rustPlatform.buildRustPackage rec {
     description = "Utility for converting, quantizing, and querying word embeddings";
     homepage = "https://github.com/finalfusion/finalfusion-utils/";
     license = licenses.asl20;
-    maintainers = with maintainers; [ ];
+    maintainers = [ ];
     mainProgram = "finalfusion";
   };
 }
diff --git a/pkgs/applications/science/machine-learning/sc2-headless/default.nix b/pkgs/applications/science/machine-learning/sc2-headless/default.nix
index d96d71695e757..37128ce67e39d 100644
--- a/pkgs/applications/science/machine-learning/sc2-headless/default.nix
+++ b/pkgs/applications/science/machine-learning/sc2-headless/default.nix
@@ -57,6 +57,6 @@ in stdenv.mkDerivation rec {
       url = "https://blzdistsc2-a.akamaihd.net/AI_AND_MACHINE_LEARNING_LICENSE.html";
       free = false;
     };
-    maintainers = with lib.maintainers; [ ];
+    maintainers = [ ];
   };
 }
diff --git a/pkgs/applications/science/machine-learning/shogun/default.nix b/pkgs/applications/science/machine-learning/shogun/default.nix
index 1e317fdec03e3..75bd2278d6069 100644
--- a/pkgs/applications/science/machine-learning/shogun/default.nix
+++ b/pkgs/applications/science/machine-learning/shogun/default.nix
@@ -53,7 +53,7 @@ let
       owner = "shogun-toolbox";
       repo = "shogun";
       rev =  "shogun_${version}";
-      sha256 = "sha256-38aULxK50wQ2+/ERosSpRyBmssmYSGv5aaWfWSlrSRc=";
+      hash = "sha256-38aULxK50wQ2+/ERosSpRyBmssmYSGv5aaWfWSlrSRc=";
       fetchSubmodules = true;
     };
 
diff --git a/pkgs/applications/science/machine-learning/starspace/default.nix b/pkgs/applications/science/machine-learning/starspace/default.nix
deleted file mode 100644
index f4ca74ef5bbf1..0000000000000
--- a/pkgs/applications/science/machine-learning/starspace/default.nix
+++ /dev/null
@@ -1,40 +0,0 @@
-{ lib, stdenv, fetchFromGitHub, boost, zlib }:
-
-stdenv.mkDerivation rec {
-  pname = "starspace";
-  version = "unstable-2019-12-13";
-
-  src = fetchFromGitHub {
-    owner = "facebookresearch";
-    repo = pname;
-    rev = "8aee0a950aa607c023e5c91cff518bec335b5df5";
-    sha256 = "0sc7a37z1skb9377a1qs8ggwrkz0nmpybx7sms38xj05b702kbvj";
-  };
-
-  buildInputs = [ boost zlib ];
-
-  makeFlags = [
-    "CXX=${stdenv.cc.targetPrefix}c++"
-    "BOOST_DIR=${boost.dev}/include"
-  ];
-
-  preBuild = ''
-    cp makefile_compress makefile
-  '';
-
-  installPhase = ''
-    mkdir -p $out/bin
-    mv starspace $out/bin
-  '';
-
-  meta = with lib; {
-    # Does not build against gcc-13. No development activity upstream
-    # for past few years.
-    broken = true;
-    description = "General-purpose neural model for efficient learning of entity embeddings";
-    homepage = "https://ai.facebook.com/tools/starspace/";
-    license = licenses.mit;
-    platforms = platforms.unix;
-    maintainers = [ maintainers.mausch ];
-  };
-}
diff --git a/pkgs/applications/science/machine-learning/uarmsolver/default.nix b/pkgs/applications/science/machine-learning/uarmsolver/default.nix
index 12bca5531364a..2f24f782927bc 100644
--- a/pkgs/applications/science/machine-learning/uarmsolver/default.nix
+++ b/pkgs/applications/science/machine-learning/uarmsolver/default.nix
@@ -6,13 +6,13 @@
 
 stdenv.mkDerivation rec {
   pname = "uarmsolver";
-  version = "0.2.6";
+  version = "0.3.0";
 
   src = fetchFromGitHub {
    owner = "firefly-cpp";
    repo = "uARMSolver";
    rev = version;
-   sha256 = "sha256-E8hc7qoIDaNERMUhVlh+iBvQX1odzd/szeMSh8TCNFo=";
+   sha256 = "sha256-IMlh6Y5iVouMZatR1uxw0gUNZBdh2qm56s+GEjcr1+M=";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/pkgs/applications/science/math/4ti2/default.nix b/pkgs/applications/science/math/4ti2/default.nix
deleted file mode 100644
index 940e2e45d5acf..0000000000000
--- a/pkgs/applications/science/math/4ti2/default.nix
+++ /dev/null
@@ -1,38 +0,0 @@
-{ lib
-, stdenv
-, fetchFromGitHub
-, autoreconfHook
-, glpk
-, gmp
-}:
-
-stdenv.mkDerivation rec{
-  pname = "4ti2";
-  version = "1.6.10";
-
-  src = fetchFromGitHub {
-    owner = pname;
-    repo = pname;
-    rev = "Release_${builtins.replaceStrings ["."] ["_"] version}";
-    hash = "sha256-Rz8O1Tf81kzpTGPq7dkZJvv444F1/VqKu7VuRvH59kQ=";
-  };
-
-  nativeBuildInputs = [
-    autoreconfHook
-  ];
-
-  buildInputs = [
-    glpk
-    gmp
-  ];
-
-  installFlags = [ "install-exec" ];
-
-  meta = with lib;{
-    homepage = "https://4ti2.github.io/";
-    description = "Software package for algebraic, geometric and combinatorial problems on linear spaces";
-    license = with licenses; [ gpl2Plus ];
-    maintainers = with maintainers; [ AndersonTorres ];
-    platforms = platforms.all;
-  };
-}
diff --git a/pkgs/applications/science/math/R/default.nix b/pkgs/applications/science/math/R/default.nix
index b6fac3cca9e5a..f2825e13568a8 100644
--- a/pkgs/applications/science/math/R/default.nix
+++ b/pkgs/applications/science/math/R/default.nix
@@ -33,7 +33,7 @@ stdenv.mkDerivation (finalAttrs: {
     bzip2 gfortran libX11 libXmu libXt libXt libjpeg libpng libtiff ncurses
     pango pcre2 perl readline (texliveSmall.withPackages (ps: with ps; [ inconsolata helvetic ps.texinfo fancyvrb cm-super rsfs ])) xz zlib less texinfo graphviz icu
     bison imake which blas lapack curl tcl tk jdk tzdata
-  ] ++ lib.optionals stdenv.isDarwin [ Cocoa Foundation libobjc libcxx ];
+  ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ Cocoa Foundation libobjc libcxx ];
 
   patches = [
     ./no-usr-local-search-paths.patch
@@ -41,7 +41,7 @@ stdenv.mkDerivation (finalAttrs: {
 
   # Test of the examples for package 'tcltk' fails in Darwin sandbox. See:
   # https://github.com/NixOS/nixpkgs/issues/146131
-  postPatch = lib.optionalString stdenv.isDarwin ''
+  postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
     substituteInPlace configure \
       --replace "-install_name libRblas.dylib" "-install_name $out/lib/R/lib/libRblas.dylib" \
       --replace "-install_name libRlapack.dylib" "-install_name $out/lib/R/lib/libRlapack.dylib" \
@@ -77,7 +77,7 @@ stdenv.mkDerivation (finalAttrs: {
       RANLIB=$(type -p ranlib)
       r_cv_have_curl728=yes
       R_SHELL="${stdenv.shell}"
-  '' + lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.hostPlatform.isDarwin ''
       --disable-R-framework
       --without-x
       OBJC="clang"
diff --git a/pkgs/applications/science/math/bcal/default.nix b/pkgs/applications/science/math/bcal/default.nix
index 9ba028d1cb650..6e87136170c64 100644
--- a/pkgs/applications/science/math/bcal/default.nix
+++ b/pkgs/applications/science/math/bcal/default.nix
@@ -33,6 +33,6 @@ stdenv.mkDerivation rec {
     homepage = "https://github.com/jarun/bcal";
     license = licenses.gpl3Only;
     platforms = platforms.unix;
-    maintainers = with maintainers; [ ];
+    maintainers = [ ];
   };
 }
diff --git a/pkgs/applications/science/math/caffe/default.nix b/pkgs/applications/science/math/caffe/default.nix
index 2a84d4b27b141..f82cef9d881cb 100644
--- a/pkgs/applications/science/math/caffe/default.nix
+++ b/pkgs/applications/science/math/caffe/default.nix
@@ -73,14 +73,14 @@ stdenv.mkDerivation rec {
                 ++ lib.optional ncclSupport nccl
                 ++ lib.optionals leveldbSupport [ leveldb snappy ]
                 ++ lib.optionals pythonSupport [ python numpy ]
-                ++ lib.optionals stdenv.isDarwin [ Accelerate CoreGraphics CoreVideo ]
+                ++ lib.optionals stdenv.hostPlatform.isDarwin [ Accelerate CoreGraphics CoreVideo ]
                 ;
 
   propagatedBuildInputs = lib.optionals pythonSupport (
     # requirements.txt
     let pp = python.pkgs; in ([
       pp.numpy pp.scipy pp.scikit-image pp.h5py
-      pp.matplotlib pp.ipython pp.networkx pp.nose
+      pp.matplotlib pp.ipython pp.networkx
       pp.pandas pp.python-dateutil pp.protobuf pp.gflags
       pp.pyyaml pp.pillow pp.six
     ] ++ lib.optional leveldbSupport pp.leveldb)
@@ -147,7 +147,7 @@ stdenv.mkDerivation rec {
       Center (BVLC) and by community contributors.
     '';
     homepage = "http://caffe.berkeleyvision.org/";
-    maintainers = with maintainers; [ ];
+    maintainers = [ ];
     broken =
       (pythonSupport && (python.isPy310))
       || cudaSupport
diff --git a/pkgs/applications/science/math/cbc/default.nix b/pkgs/applications/science/math/cbc/default.nix
index aa979a78cb485..dbe7b6d241ab5 100644
--- a/pkgs/applications/science/math/cbc/default.nix
+++ b/pkgs/applications/science/math/cbc/default.nix
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "https://projects.coin-or.org/Cbc";
     license = lib.licenses.epl10;
-    maintainers = [ lib.maintainers.eelco ];
+    maintainers = [ ];
     platforms = lib.platforms.linux ++ lib.platforms.darwin;
     description = "Mixed integer programming solver";
   };
diff --git a/pkgs/applications/science/math/cemu-ti/default.nix b/pkgs/applications/science/math/cemu-ti/default.nix
index c8d5bea6f602e..547b57b312dbf 100644
--- a/pkgs/applications/science/math/cemu-ti/default.nix
+++ b/pkgs/applications/science/math/cemu-ti/default.nix
@@ -1,39 +1,39 @@
 { stdenv
 , lib
 , fetchFromGitHub
-, qmake
+, cmake
 , pkg-config
-, wrapQtAppsHook
+, qt6
 , libarchive
 , libpng
 }:
 
-stdenv.mkDerivation rec {
+stdenv.mkDerivation (finalAttrs: {
   pname = "CEmu";
-  version = "unstable-2022-06-29";
+  version = "2.0";
   src = fetchFromGitHub {
     owner = "CE-Programming";
     repo = "CEmu";
-    rev = "880d391ba9f8b7b2ec36ab9b45a34e9ecbf744e9";
-    hash = "sha256-aFwGZJceh1jEP8cEajY5wYlSaFuNhYvSoZ/E1QDfJEI=";
+    rev = "v${finalAttrs.version}";
+    hash = "sha256-fohsIJrvPDMmYHoPbmYQlKLMnj/B3XEBaerZYuqxvd8=";
     fetchSubmodules = true;
   };
 
+  sourceRoot = "${finalAttrs.src.name}/gui/qt/";
+
+
   nativeBuildInputs = [
-    qmake
-    wrapQtAppsHook
+    cmake
+    qt6.wrapQtAppsHook
     pkg-config
   ];
 
   buildInputs = [
+    qt6.qtbase
     libarchive
     libpng
   ];
 
-  qmakeFlags = [
-    "gui/qt"
-  ];
-
   meta = with lib; {
     description = "Third-party TI-84 Plus CE / TI-83 Premium CE emulator, focused on developer features";
     mainProgram = "CEmu";
@@ -41,6 +41,6 @@ stdenv.mkDerivation rec {
     license = licenses.gpl3Plus;
     maintainers = with maintainers; [ luc65r ];
     platforms = [ "x86_64-linux" "x86_64-darwin" ];
-    broken = stdenv.isDarwin;
+    broken = stdenv.hostPlatform.isDarwin;
   };
-}
+})
diff --git a/pkgs/applications/science/math/colpack/default.nix b/pkgs/applications/science/math/colpack/default.nix
index 768366cc5d7a5..591ac3281e5e8 100644
--- a/pkgs/applications/science/math/colpack/default.nix
+++ b/pkgs/applications/science/math/colpack/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ autoreconfHook ];
 
   configureFlags = [
-    "--enable-openmp=${if stdenv.isLinux then "yes" else "no"}"
+    "--enable-openmp=${if stdenv.hostPlatform.isLinux then "yes" else "no"}"
     "--enable-examples=no"
   ];
 
diff --git a/pkgs/applications/science/math/cplex/default.nix b/pkgs/applications/science/math/cplex/default.nix
index ddc950b30664b..e80444b70b275 100644
--- a/pkgs/applications/science/math/cplex/default.nix
+++ b/pkgs/applications/science/math/cplex/default.nix
@@ -9,14 +9,14 @@
 
 stdenv.mkDerivation rec {
   pname = "cplex";
-  version = "128";
+  version = "22.11";
 
   src =
     if releasePath == null then
       throw ''
         This nix expression requires that the cplex installer is already
         downloaded to your machine. Get it from IBM:
-        https://developer.ibm.com/docloud/blog/2017/12/20/cplex-optimization-studio-12-8-now-available/
+        https://www.ibm.com/support/pages/downloading-ibm-ilog-cplex-optimization-studio-2211
 
         Set `cplex.releasePath = /path/to/download;` in your
         ~/.config/nixpkgs/config.nix for `nix-*` commands, or
@@ -36,7 +36,8 @@ stdenv.mkDerivation rec {
   '';
 
   buildPhase = ''
-    sh $name -i silent -DLICENSE_ACCEPTED=TRUE -DUSER_INSTALL_DIR=$out
+     export JAVA_TOOL_OPTIONS=-Djdk.util.zip.disableZip64ExtraFieldValidation=true
+     sh $name LAX_VM ${openjdk}/bin/java -i silent -DLICENSE_ACCEPTED=TRUE -DUSER_INSTALL_DIR=$out
   '';
 
   installPhase = ''
diff --git a/pkgs/applications/science/math/dap/default.nix b/pkgs/applications/science/math/dap/default.nix
deleted file mode 100644
index 40ce12f66ebd0..0000000000000
--- a/pkgs/applications/science/math/dap/default.nix
+++ /dev/null
@@ -1,37 +0,0 @@
-{ lib
-, stdenv
-, fetchurl
-}:
-
-stdenv.mkDerivation rec {
-  pname = "dap";
-  version = "3.10";
-
-  src = fetchurl {
-    url = "mirror://gnu/${pname}/${pname}-${version}.tar.gz";
-    sha256 = "Bk5sty/438jLb1PpurMQ5OqMbr6JqUuuQjcg2bejh2Y=";
-  };
-
-  hardeningDisable = [ "format" ];
-
-  meta = with lib; {
-    homepage = "https://www.gnu.org/software/dap";
-    description = "Small statistics and graphics package based on C";
-    longDescription = ''
-      Dap is a small statistics and graphics package based on C. Version 3.0 and
-      later of Dap can read SBS programs (based on the utterly famous, industry
-      standard statistics system with similar initials - you know the one I
-      mean)! The user wishing to perform basic statistical analyses is now freed
-      from learning and using C syntax for straightforward tasks, while
-      retaining access to the C-style graphics and statistics features provided
-      by the original implementation. Dap provides core methods of data
-      management, analysis, and graphics that are commonly used in statistical
-      consulting practice (univariate statistics, correlations and regression,
-      ANOVA, categorical data analysis, logistic regression, and nonparametric
-      analyses).
-    '';
-    license = licenses.gpl3Plus;
-    maintainers = with maintainers; [ AndersonTorres ];
-    platforms = platforms.unix;
-  };
-}
diff --git a/pkgs/applications/science/math/ecm/default.nix b/pkgs/applications/science/math/ecm/default.nix
index 222db0e98e6a5..ed1c07d87ec1a 100644
--- a/pkgs/applications/science/math/ecm/default.nix
+++ b/pkgs/applications/science/math/ecm/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation {
   };
 
   # See https://trac.sagemath.org/ticket/19233
-  configureFlags = lib.optional stdenv.isDarwin "--disable-asm-redc";
+  configureFlags = lib.optional stdenv.hostPlatform.isDarwin "--disable-asm-redc";
 
   buildInputs = [ m4 gmp ];
 
diff --git a/pkgs/applications/science/math/eigenmath/default.nix b/pkgs/applications/science/math/eigenmath/default.nix
index a120de87b9ff1..8a3ff56e1f6b9 100644
--- a/pkgs/applications/science/math/eigenmath/default.nix
+++ b/pkgs/applications/science/math/eigenmath/default.nix
@@ -7,13 +7,13 @@
 
 stdenv.mkDerivation rec {
   pname = "eigenmath";
-  version = "3.27-unstable-2024-06-20";
+  version = "3.27-unstable-2024-09-15";
 
   src = fetchFromGitHub {
     owner = "georgeweigt";
     repo = pname;
-    rev = "c3e3da104dbef888c3e52659134d5e9bdc12764d";
-    hash = "sha256-fqCphnRQw79v7ZTCZU9ucm/R7BKY7yCZYDSnxD7uRS8=";
+    rev = "ba00d77289f1c9ce64108b1bbcee02c71ce48633";
+    hash = "sha256-yFzsMNVjQK64uQSfjQKC8LbdQu7/97hDolRMBc4Womc=";
   };
 
   checkPhase = let emulator = stdenv.hostPlatform.emulator buildPackages; in ''
diff --git a/pkgs/applications/science/math/fricas/default.nix b/pkgs/applications/science/math/fricas/default.nix
index 9f0b87f011a10..43a00a5e1fbac 100644
--- a/pkgs/applications/science/math/fricas/default.nix
+++ b/pkgs/applications/science/math/fricas/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "fricas";
-  version = "1.3.10";
+  version = "1.3.11";
 
   src = fetchFromGitHub {
     owner = "fricas";
     repo = "fricas";
     rev = version;
-    sha256 = "sha256-T1xDndDnHq/hmhTWWO3Eu0733u8+C8sJMCF6pbLU2GI=";
+    sha256 = "sha256-EX/boSs6rK4RrJ5W6Rd0TSHsbQsNiFI1evFuNPBMeu8=";
   };
 
   buildInputs = [ sbcl libX11 libXpm libICE libSM libXt libXau libXdmcp ];
diff --git a/pkgs/applications/science/math/gap/default.nix b/pkgs/applications/science/math/gap/default.nix
index 7a466f8c000c5..697a19d6afa19 100644
--- a/pkgs/applications/science/math/gap/default.nix
+++ b/pkgs/applications/science/math/gap/default.nix
@@ -1,5 +1,6 @@
 { stdenv
 , lib
+, fetchpatch
 , fetchurl
 , makeWrapper
 , readline
@@ -73,6 +74,13 @@ stdenv.mkDerivation rec {
     sha256 = "sha256-ZyMIdF63iiIklO6N1nhu3VvDMUVvzGRWrAZL2yjVh6g=";
   };
 
+  patches = [
+    (fetchpatch {
+      url = "https://github.com/gap-system/gap/commit/c786e229413a44b7462196716b99ae9bb0071f4c.patch";
+      hash = "sha256-g3jrEMSavHAUKlHoPqWmOw49hWHU+29SA788Klnr0Uw=";
+    })
+  ];
+
   # remove all non-essential packages (which take up a lot of space)
   preConfigure = lib.optionalString (!keepAll) (removeNonWhitelistedPkgs packagesToKeep) + ''
     patchShebangs .
diff --git a/pkgs/applications/science/math/geogebra/default.nix b/pkgs/applications/science/math/geogebra/default.nix
index 5fa4862bb9b40..1d5fa4a9ef450 100644
--- a/pkgs/applications/science/math/geogebra/default.nix
+++ b/pkgs/applications/science/math/geogebra/default.nix
@@ -95,6 +95,6 @@ let
     '';
   };
 in
-if stdenv.isDarwin
+if stdenv.hostPlatform.isDarwin
 then darwinPkg
 else linuxPkg
diff --git a/pkgs/applications/science/math/geogebra/geogebra6.nix b/pkgs/applications/science/math/geogebra/geogebra6.nix
index 38b668804ad16..d57175daff93e 100644
--- a/pkgs/applications/science/math/geogebra/geogebra6.nix
+++ b/pkgs/applications/science/math/geogebra/geogebra6.nix
@@ -1,4 +1,12 @@
-{ lib, stdenv, unzip, fetchurl, electron, makeWrapper, geogebra }:
+{
+  lib,
+  stdenv,
+  unzip,
+  fetchurl,
+  electron,
+  makeWrapper,
+  geogebra,
+}:
 let
   pname = "geogebra";
   version = "6-0-794-0";
@@ -14,14 +22,17 @@ let
       calculus in one easy-to-use package.
     '';
     homepage = "https://www.geogebra.org/";
-    maintainers = with maintainers; [ voidless sikmir ];
+    maintainers = with maintainers; [
+      voidless
+      sikmir
+    ];
     license = licenses.geogebra;
     sourceProvenance = with sourceTypes; [
       binaryBytecode
-      binaryNativeCode  # some jars include native binaries
+      binaryNativeCode # some jars include native binaries
     ];
     platforms = with platforms; linux ++ darwin;
-    hydraPlatforms = [];
+    hydraPlatforms = [ ];
   };
 
   linuxPkg = stdenv.mkDerivation {
@@ -50,7 +61,9 @@ let
     installPhase = ''
       mkdir -p $out/libexec/geogebra/ $out/bin
       cp -r GeoGebra-linux-x64/{resources,locales} "$out/"
-      makeWrapper ${lib.getBin electron}/bin/electron $out/bin/geogebra --add-flags "$out/resources/app"
+      makeWrapper ${lib.getBin electron}/bin/electron $out/bin/geogebra \
+        --add-flags "$out/resources/app" \
+        --add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}"
       install -Dm644 "${desktopItem}/share/applications/"* \
         -t $out/share/applications/
 
@@ -84,6 +97,4 @@ let
     };
   };
 in
-if stdenv.isDarwin
-then darwinPkg
-else linuxPkg
+if stdenv.hostPlatform.isDarwin then darwinPkg else linuxPkg
diff --git a/pkgs/applications/science/math/getdp/default.nix b/pkgs/applications/science/math/getdp/default.nix
index 8accf9d76725a..30a5837c3111d 100644
--- a/pkgs/applications/science/math/getdp/default.nix
+++ b/pkgs/applications/science/math/getdp/default.nix
@@ -1,6 +1,8 @@
 { lib, stdenv, fetchurl, cmake, gfortran, blas, lapack, mpi, petsc, python3 }:
 
-stdenv.mkDerivation rec {
+let
+  mpiSupport = petsc.passthru.mpiSupport;
+in stdenv.mkDerivation rec {
   pname = "getdp";
   version = "3.6.0";
   src = fetchurl {
@@ -8,7 +10,6 @@ stdenv.mkDerivation rec {
     hash = "sha256-nzefwCV+Z9BHDofuTfhR+vhqm3cCSiUT+7cbtn601N8=";
   };
 
-  inherit (petsc) mpiSupport;
   nativeBuildInputs = [ cmake python3 ];
   buildInputs = [ gfortran blas lapack petsc ]
     ++ lib.optional mpiSupport mpi
@@ -27,7 +28,7 @@ stdenv.mkDerivation rec {
     '';
     homepage = "http://getdp.info/";
     license = licenses.gpl2Plus;
-    maintainers = with maintainers; [ ];
+    maintainers = [ ];
     platforms = platforms.linux;
   };
 }
diff --git a/pkgs/applications/science/math/gfan/default.nix b/pkgs/applications/science/math/gfan/default.nix
index ee1fce783d265..531a30e3f857f 100644
--- a/pkgs/applications/science/math/gfan/default.nix
+++ b/pkgs/applications/science/math/gfan/default.nix
@@ -1,4 +1,4 @@
-{lib, stdenv, fetchurl, gmp, mpir, cddlib}:
+{lib, stdenv, fetchpatch, fetchurl, gmp, mpir, cddlib}:
 stdenv.mkDerivation rec {
   pname = "gfan";
   version = "0.6.2";
@@ -10,6 +10,12 @@ stdenv.mkDerivation rec {
 
   patches = [
     ./gfan-0.6.2-cddlib-prefix.patch
+  ] ++ lib.optionals (stdenv.cc.isClang) [
+    (fetchpatch {
+      name = "clang-fix-miscompilation.patch";
+      url = "https://raw.githubusercontent.com/sagemath/sage/eea1f59394a5066e9acd8ae39a90302820914ee3/build/pkgs/gfan/patches/nodel.patch";
+      sha256 = "sha256-RrncSgFyrBIk/Bwe3accxiJ2rpOSJKQ84cV/uBvQsDc=";
+    })
   ];
 
   postPatch = lib.optionalString stdenv.cc.isClang ''
diff --git a/pkgs/applications/science/math/giac/default.nix b/pkgs/applications/science/math/giac/default.nix
index 834ae7b3d61f3..ce009975c1ba1 100644
--- a/pkgs/applications/science/math/giac/default.nix
+++ b/pkgs/applications/science/math/giac/default.nix
@@ -9,18 +9,30 @@ assert (!blas.isILP64) && (!lapack.isILP64);
 
 stdenv.mkDerivation rec {
   pname = "giac${lib.optionalString enableGUI "-with-xcas"}";
-  version = "1.9.0-43"; # TODO try to remove preCheck phase on upgrade
+  version = "1.9.0-993"; # TODO try to remove preCheck phase on upgrade
 
   src = fetchurl {
     url = "https://www-fourier.ujf-grenoble.fr/~parisse/debian/dists/stable/main/source/giac_${version}.tar.gz";
-    sha256 = "sha256-466jB8ZRqHkU5XCY+j0Fh7Dq/mMaOu10rHECKbtNGrs=";
+    sha256 = "sha256-pqytFWrSWfEwQqRdRbaigGCq68s8mdgj2j8M+kclslE=";
   };
 
   patches = [
+    ./remove-old-functional-patterns.patch
+    ./fix-fltk-guard.patch
+
+    (fetchpatch {
+      name = "pari_2_15.patch";
+      url = "https://raw.githubusercontent.com/sagemath/sage/07a2afd65fb4b0a1c9cbc43ede7d4a18c921a000/build/pkgs/giac/patches/pari_2_15.patch";
+      sha256 = "sha256-Q3xBFED7XEAyNz6AHjzt63XtospmdGAIdS6iPq1C2UE=";
+    })
+
     (fetchpatch {
-      name = "pari_2_11.patch";
-      url = "https://raw.githubusercontent.com/sagemath/sage/21ba7540d385a9864b44850d6987893dfa16bfc0/build/pkgs/giac/patches/pari_2_11.patch";
-      sha256 = "sha256-vEo/5MNzMdYRPWgLFPsDcMT1W80Qzj4EPBjx/B8j68k=";
+      name = "infinity.patch";
+      url = "https://github.com/geogebra/giac/commit/851c2cd91e879c79d6652f8a5d5bed03b65c6d39.patch";
+      sha256 = "sha256-WJRT2b8I9kgAkRuIugMiXoF4hT7yR7qyad8A6IspNTM=";
+      stripLen = 5;
+      extraPrefix = "/src/";
+      excludes = [ "src/kdisplay.cc" ];
     })
 
     # giac calls scanf/printf with non-constant first arguments, which
@@ -31,8 +43,12 @@ stdenv.mkDerivation rec {
       sha256 = "sha256-r+M+9MRPRqhHcdhYWI6inxyNvWbXUbBcPCeDY7aulvk=";
     })
 
-    # increase pari stack size for test chk_fhan{4,6}
-    ./increase-pari-stack-size.patch
+    # issue with include path precedence
+    (fetchpatch {
+      name = "fix_implicit_declaration.patch";
+      url = "https://salsa.debian.org/science-team/giac/-/raw/c05ae9b9e74d3c6ee6411d391071989426a76201/debian/patches/fix_implicit_declaration.patch";
+      sha256 = "sha256-ompUceYJLiL0ftfjBkIMcYvX1YqG2/XA7e1yDyFY0IY=";
+    })
   ] ++ lib.optionals (!enableGUI) [
     # when enableGui is false, giac is compiled without fltk. That
     # means some outputs differ in the make check. Patch around this:
@@ -86,6 +102,12 @@ stdenv.mkDerivation rec {
     # when fltk is disabled. disable these tests for now.
     echo > check/chk_fhan2
     echo > check/chk_fhan9
+  '' + lib.optionalString (stdenv.hostPlatform.isDarwin) ''
+    # these cover a known regression in giac, likely due to how pari state
+    # is shared between multiple giac instances (see pari.cc.old).
+    # see https://github.com/NixOS/nixpkgs/pull/264126 for more information
+    echo > check/chk_fhan4
+    echo > check/chk_fhan6
   '';
 
   enableParallelBuilding = true;
@@ -96,6 +118,8 @@ stdenv.mkDerivation rec {
     "--enable-ao" "--enable-ecm" "--enable-glpk"
   ] ++ lib.optionals enableGUI [
     "--enable-gui" "--with-x"
+  ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
+    "--disable-nls"
   ] ++ lib.optionals (!enableGUI) [
     "--disable-fltk"
   ] ++ lib.optionals (!enableMicroPy) [
@@ -129,7 +153,6 @@ stdenv.mkDerivation rec {
     homepage = "https://www-fourier.ujf-grenoble.fr/~parisse/giac.html";
     license = licenses.gpl3Plus;
     platforms = platforms.linux ++ (optionals (!enableGUI) platforms.darwin);
-    broken = stdenv.isDarwin && stdenv.isAarch64;
     maintainers = [ maintainers.symphorien ];
   };
 }
diff --git a/pkgs/applications/science/math/giac/fix-fltk-guard.patch b/pkgs/applications/science/math/giac/fix-fltk-guard.patch
new file mode 100644
index 0000000000000..a9c8e5bbaab8d
--- /dev/null
+++ b/pkgs/applications/science/math/giac/fix-fltk-guard.patch
@@ -0,0 +1,28 @@
+From c7eafa2d7bde0d735b125912542acec2d5896c17 Mon Sep 17 00:00:00 2001
+From: George Huebner <george@feyor.sh>
+Date: Sat, 20 Jul 2024 02:31:20 -0500
+Subject: [PATCH 3/4] remove erroneous HAVE_LIBFLTK guard
+
+---
+ src/icas.cc | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/src/icas.cc b/src/icas.cc
+index f91885b..17a0373 100644
+--- a/src/icas.cc
++++ b/src/icas.cc
+@@ -2407,11 +2407,7 @@ int main(int ARGC, char *ARGV[]){
+ #ifdef __APPLE__
+       startc=clock();
+ #endif
+-#ifdef HAVE_LIBFLTK
+       xcas::icas_eval(gq,e,reading_file,filename,contextptr);
+-#else
+-      e=eval(gq,1,contextptr);
+-#endif
+ #ifdef __APPLE__
+       startc=clock()-startc;
+ #endif
+-- 
+2.44.1
+
diff --git a/pkgs/applications/science/math/giac/increase-pari-stack-size.patch b/pkgs/applications/science/math/giac/increase-pari-stack-size.patch
deleted file mode 100644
index b12b4b7fad660..0000000000000
--- a/pkgs/applications/science/math/giac/increase-pari-stack-size.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-diff -ur a/check/chk_fhan4 b/check/chk_fhan4
---- a/check/chk_fhan4	2018-03-13 19:27:11.000000000 +0100
-+++ b/check/chk_fhan4	2023-05-20 16:31:30.349063063 +0200
-@@ -1,4 +1,5 @@
- #! /bin/sh
- unset LANG
-+export PARI_SIZE=2048000
- ../src/icas TP04-sol.cas > TP04.tst
- diff TP04.tst TP04-sol.cas.out1
-diff -ur a/check/chk_fhan6 b/check/chk_fhan6
---- a/check/chk_fhan6	2018-03-13 19:27:21.000000000 +0100
-+++ b/check/chk_fhan6	2023-05-20 16:32:04.199407065 +0200
-@@ -1,4 +1,5 @@
- #! /bin/sh
- unset LANG
-+export PARI_SIZE=2048000
- ../src/icas TP06-sol.cas > TP06.tst
- diff TP06.tst TP06-sol.cas.out1
diff --git a/pkgs/applications/science/math/giac/remove-old-functional-patterns.patch b/pkgs/applications/science/math/giac/remove-old-functional-patterns.patch
new file mode 100644
index 0000000000000..95f6efe119fcb
--- /dev/null
+++ b/pkgs/applications/science/math/giac/remove-old-functional-patterns.patch
@@ -0,0 +1,294 @@
+From f1c5309d5b815acc2616cd9fbb5182b1e64d225f Mon Sep 17 00:00:00 2001
+From: George Huebner <george@feyor.sh>
+Date: Wed, 17 Jul 2024 18:12:36 -0500
+Subject: [PATCH 1/4] remove old <functional> patterns
+
+pointer_to_binary_function and ptr_fun are holdovers from pre c++11,
+and can be replaced or entirely removed. This allows Giac to compile
+with Clang 16>=.
+---
+ src/all_global_var |  2 +-
+ src/gausspol.cc    |  2 +-
+ src/gausspol.h     |  2 +-
+ src/gen.cc         |  2 +-
+ src/gen.h          |  4 ++--
+ src/maple.cc       |  2 +-
+ src/monomial.h     | 16 ++++++++--------
+ src/plot.cc        |  2 +-
+ src/poly.h         | 17 +++++++++--------
+ src/solve.cc       | 18 +++++++++---------
+ src/usual.cc       |  2 +-
+ 11 files changed, 35 insertions(+), 34 deletions(-)
+
+diff --git a/src/all_global_var b/src/all_global_var
+index 7d75d73..55f4782 100644
+--- a/src/all_global_var
++++ b/src/all_global_var
+@@ -16,7 +16,7 @@ Relatif a l'evaluation du tableur
+ // File Eqw.cc
+   vector<string> completion_tab;
+ // File alg_ext.cc
+-  rootmap symbolic_rootof_list(ptr_fun(islesscomplex));
++  rootmap symbolic_rootof_list(islesscomplex);
+ // File derive.cc
+ // File desolve.cc
+   identificateur laplace_var(" s");
+diff --git a/src/gausspol.cc b/src/gausspol.cc
+index 8fbd581..2f2121f 100644
+--- a/src/gausspol.cc
++++ b/src/gausspol.cc
+@@ -855,7 +855,7 @@ namespace giac {
+ 		 std::vector< monomial<gen> >::const_iterator & itb_end,
+ 		 std::vector< monomial<gen> > & new_coord,
+ 		 bool (* is_strictly_greater)( const index_m &, const index_m &),
+-		 const std::pointer_to_binary_function < const monomial<gen> &, const monomial<gen> &, bool> m_is_strictly_greater
++		 const std::function<bool(const monomial<gen> &, const monomial<gen> &)> m_is_strictly_greater
+ 	     ) {
+     if (ita==ita_end || itb==itb_end){
+       new_coord.clear();
+diff --git a/src/gausspol.h b/src/gausspol.h
+index b5d214b..e6c7e0c 100644
+--- a/src/gausspol.h
++++ b/src/gausspol.h
+@@ -93,7 +93,7 @@ namespace giac {
+ 		 std::vector< monomial<gen> >::const_iterator & itb_end,
+ 		 std::vector< monomial<gen> > & new_coord,
+ 		 bool (* is_strictly_greater)( const index_t &, const index_t &),
+-		 const std::pointer_to_binary_function < const monomial<gen> &, const monomial<gen> &, bool> m_is_greater
++         const std::function<bool(const monomial<gen> &, const monomial<gen> &)> m_is_greater
+ 		 ) ;
+   void mulpoly(const polynome & th,const gen & fact,polynome & res);
+   polynome operator * (const polynome & th, const gen & fact) ;
+diff --git a/src/gen.cc b/src/gen.cc
+index 7d4874c..0b64afe 100644
+--- a/src/gen.cc
++++ b/src/gen.cc
+@@ -1126,7 +1126,7 @@ namespace giac {
+ #if 1 // def NSPIRE
+       g.__MAPptr = new ref_gen_map;
+ #else
+-    g.__MAPptr = new ref_gen_map(ptr_fun(islesscomplexthanf));
++    g.__MAPptr = new ref_gen_map(islesscomplexthanf);
+ #endif
+ #endif
+     g.type=_MAP;
+diff --git a/src/gen.h b/src/gen.h
+index 04d70af..496b25d 100644
+--- a/src/gen.h
++++ b/src/gen.h
+@@ -443,7 +443,7 @@ namespace giac {
+   };
+   typedef std::map<gen,gen,comparegen> gen_map;
+ #else
+-  typedef std::map<gen,gen,const std::pointer_to_binary_function < const gen &, const gen &, bool> > gen_map;
++    typedef std::map<gen,gen,const std::function<bool(const gen &, const gen &)> > gen_map;
+ #endif
+   struct ref_gen_map;
+ 
+@@ -902,7 +902,7 @@ namespace giac {
+ #if 1 // def NSPIRE
+     ref_gen_map(): ref_count(1),m() {}
+ #else
+-    ref_gen_map(const std::pointer_to_binary_function < const gen &, const gen &, bool> & p): ref_count(1),m(p) {}
++    ref_gen_map(const std::function<bool(const gen &, const gen &)> & p): ref_count(1),m(p) {}
+ #endif
+     ref_gen_map(const gen_map & M):ref_count(1),m(M) {}
+   };
+diff --git a/src/maple.cc b/src/maple.cc
+index 3b33da8..d57a170 100644
+--- a/src/maple.cc
++++ b/src/maple.cc
+@@ -3626,7 +3626,7 @@ namespace giac {
+ #if 1 // def NSPIRE
+     gen_map m;
+ #else
+-    gen_map m(ptr_fun(islessthanf));
++    gen_map m(islessthanf);
+ #endif
+     int s=int(args.size());
+     vector<int> indexbegin,indexsize;
+diff --git a/src/monomial.h b/src/monomial.h
+index 6e606d0..637a76c 100644
+--- a/src/monomial.h
++++ b/src/monomial.h
+@@ -338,9 +338,9 @@ namespace giac {
+ 
+   template<class T> class sort_helper {
+   public:
+-    std::pointer_to_binary_function < const monomial<T> &, const monomial<T> &, bool> strictly_greater ;
+-    sort_helper(const std::pointer_to_binary_function < const monomial<T> &, const monomial<T> &, bool> is_strictly_greater):strictly_greater(is_strictly_greater) {};
+-    sort_helper():strictly_greater(std::ptr_fun<const monomial<T> &, const monomial<T> &, bool>(m_lex_is_strictly_greater<T>)) {};
++    std::function<bool(const monomial<T> &, const monomial<T> &)> strictly_greater ;
++      sort_helper(const std::function<bool(const monomial<T> &, const monomial<T> &)> is_strictly_greater):strictly_greater(is_strictly_greater) {};
++    sort_helper():strictly_greater(m_lex_is_strictly_greater<T>) {};
+     bool operator () (const monomial<T> & a, const monomial<T> & b){ return strictly_greater(a,b);}
+   };
+ 
+@@ -677,7 +677,7 @@ namespace giac {
+ 	     typename std::vector< monomial<T> >::const_iterator & itb_end,
+ 	     std::vector< monomial<T> > & new_coord,
+ 	     bool (* is_strictly_greater)( const index_m &, const index_m &),
+-	     const std::pointer_to_binary_function < const monomial<T> &, const monomial<T> &, bool> m_is_strictly_greater
++	     const std::function<bool(const monomial<T> &, const monomial<T> &)> m_is_strictly_greater
+ 	     ) {
+     if (ita==ita_end || itb==itb_end){
+       new_coord.clear();
+@@ -726,8 +726,8 @@ namespace giac {
+ #endif
+ #ifndef NSPIRE
+     /* other algorithm using a map to avoid reserving too much space */
+-    typedef std::map< index_t,T,const std::pointer_to_binary_function < const index_m &, const index_m &, bool> > application;
+-    application produit(std::ptr_fun(is_strictly_greater));
++    typedef std::map< index_t,T,const std::function<bool(const index_m &, const index_m &)> > application;
++    application produit(is_strictly_greater);
+     // typedef std::map<index_t,T> application;
+     // application produit;
+     index_t somme(ita->index.size());
+@@ -848,7 +848,7 @@ namespace giac {
+     typename std::vector< monomial<T> >::const_iterator a=v.begin(), a_end=v.end();
+     typename std::vector< monomial<T> >::const_iterator b=w.begin(), b_end=w.end();
+     std::vector< monomial<T> > res;
+-    Mul(a,a_end,b,b_end,res,i_lex_is_strictly_greater,std::ptr_fun< const monomial<T> &, const monomial<T> &, bool >((m_lex_is_strictly_greater<T>)));
++    Mul(a,a_end,b,b_end,res,i_lex_is_strictly_greater,m_lex_is_strictly_greater<T>);
+     return res ;
+   }
+ 
+@@ -856,7 +856,7 @@ namespace giac {
+   std::vector< monomial<T> > & operator *= (std::vector< monomial<T> > & v,const std::vector< monomial<T> > & w){
+     typename std::vector< monomial<T> >::const_iterator a=v.begin(), a_end=v.end();
+     typename std::vector< monomial<T> >::const_iterator b=w.begin(), b_end=w.end();
+-    Mul(a,a_end,b,b_end,v,i_lex_is_strictly_greater,std::ptr_fun< const monomial<T> &, const monomial<T> &, bool >((m_lex_is_strictly_greater<T>)));
++    Mul(a,a_end,b,b_end,v,i_lex_is_strictly_greater,m_lex_is_strictly_greater<T>);
+     return v;
+   }
+ 
+diff --git a/src/plot.cc b/src/plot.cc
+index 288a1b5..ac85c9a 100755
+--- a/src/plot.cc
++++ b/src/plot.cc
+@@ -11886,7 +11886,7 @@ static vecteur densityscale(double xmin,double xmax,double ymin,double ymax,doub
+ #if 1 // def NSPIRE
+     gen_map m;
+ #else
+-    gen_map m(ptr_fun(islesscomplexthanf));
++    gen_map m(islesscomplexthanf);
+ #endif
+     int taille;
+     is >> taille;
+diff --git a/src/poly.h b/src/poly.h
+index 7d64e2c..d9ff991 100644
+--- a/src/poly.h
++++ b/src/poly.h
+@@ -40,23 +40,24 @@ namespace giac {
+     // T zero;
+     // functional object sorting function for monomial ordering
+     bool (* is_strictly_greater)( const index_m &, const index_m &);
+-    std::pointer_to_binary_function < const monomial<T> &, const monomial<T> &, bool> m_is_strictly_greater ;
++    std::function<bool(const monomial<T> &, const monomial<T> &)> m_is_strictly_greater ;
+     // constructors
+     tensor(const tensor<T> & t) : dim(t.dim), coord(t.coord), is_strictly_greater(t.is_strictly_greater), m_is_strictly_greater(t.m_is_strictly_greater) { }
+     tensor(const tensor<T> & t, const std::vector< monomial<T> > & v) : dim(t.dim), coord(v), is_strictly_greater(t.is_strictly_greater), m_is_strictly_greater(t.m_is_strictly_greater) { }
+     // warning: this constructor prohibits construction of tensor from a value
+     // of type T if this value is an int, except by using tensor<T>(T(int))
+-    tensor() : dim(0), is_strictly_greater(i_lex_is_strictly_greater), m_is_strictly_greater(std::ptr_fun<const monomial<T> &, const monomial<T> &, bool>(m_lex_is_strictly_greater<T>)) { }
+-    explicit tensor(int d) : dim(d), is_strictly_greater(i_lex_is_strictly_greater), m_is_strictly_greater(std::ptr_fun<const monomial<T> &, const monomial<T> &, bool>(m_lex_is_strictly_greater<T>)) { }
++    // DANGER
++    tensor() : dim(0), is_strictly_greater(i_lex_is_strictly_greater), m_is_strictly_greater(m_lex_is_strictly_greater<T>) { }
++    explicit tensor(int d) : dim(d), is_strictly_greater(i_lex_is_strictly_greater), m_is_strictly_greater(m_lex_is_strictly_greater<T>) { }
+     explicit tensor(int d,const tensor<T> & t) : dim(d),is_strictly_greater(t.is_strictly_greater), m_is_strictly_greater(t.m_is_strictly_greater)  { }
+-    tensor(const monomial<T> & v) : dim(int(v.index.size())), is_strictly_greater(i_lex_is_strictly_greater), m_is_strictly_greater(std::ptr_fun<const monomial<T> &, const monomial<T> &, bool>(m_lex_is_strictly_greater<T>)) { 
++    tensor(const monomial<T> & v) : dim(int(v.index.size())), is_strictly_greater(i_lex_is_strictly_greater), m_is_strictly_greater(m_lex_is_strictly_greater<T>) { 
+       coord.push_back(v);
+     }
+-    tensor(const T & v, int d) : dim(d), is_strictly_greater(i_lex_is_strictly_greater), m_is_strictly_greater(std::ptr_fun<const monomial<T> &, const monomial<T> &, bool>(m_lex_is_strictly_greater<T>)) {
++    tensor(const T & v, int d) : dim(d), is_strictly_greater(i_lex_is_strictly_greater), m_is_strictly_greater(m_lex_is_strictly_greater<T>) {
+       if (!is_zero(v))
+ 	coord.push_back(monomial<T>(v,0,d));
+     }
+-    tensor(int d,const std::vector< monomial<T> > & c) : dim(d), coord(c), is_strictly_greater(i_lex_is_strictly_greater),m_is_strictly_greater(std::ptr_fun<const monomial<T> &, const monomial<T> &, bool>(m_lex_is_strictly_greater<T>)) { }
++    tensor(int d,const std::vector< monomial<T> > & c) : dim(d), coord(c), is_strictly_greater(i_lex_is_strictly_greater),m_is_strictly_greater(m_lex_is_strictly_greater<T>) { }
+     ~tensor() { coord.clear(); }
+     // member functions
+     // ordering monomials in the tensor
+@@ -519,10 +520,10 @@ namespace giac {
+   template <class T>
+   void lexsort(std::vector < monomial<T> > & v){
+ #if 1 // def NSPIRE
+-    sort_helper<T> M(std::ptr_fun<const monomial<T> &, const monomial<T> &, bool>(m_lex_is_strictly_greater<T>));
++    sort_helper<T> M(m_lex_is_strictly_greater<T>);
+     sort(v.begin(),v.end(),M);
+ #else
+-    sort(v.begin(),v.end(),std::ptr_fun<const monomial<T> &, const monomial<T> &, bool>(m_lex_is_strictly_greater<T>));
++    sort(v.begin(),v.end(),m_lex_is_strictly_greater<T>);
+ #endif
+   }
+ 
+diff --git a/src/solve.cc b/src/solve.cc
+index 889f824..2a51ab8 100755
+--- a/src/solve.cc
++++ b/src/solve.cc
+@@ -8684,39 +8684,39 @@ namespace giac {
+     switch (order.val){
+     case _PLEX_ORDER: 
+       p.is_strictly_greater=i_lex_is_strictly_greater;
+-      p.m_is_strictly_greater=std::ptr_fun(m_lex_is_strictly_greater<gen>);
++      p.m_is_strictly_greater=m_lex_is_strictly_greater<gen>;
+       break;
+     case _REVLEX_ORDER: 
+       p.is_strictly_greater=i_total_revlex_is_strictly_greater;
+-      p.m_is_strictly_greater=std::ptr_fun(m_total_revlex_is_strictly_greater<gen>);
++      p.m_is_strictly_greater=m_total_revlex_is_strictly_greater<gen>;
+       break;
+     case _TDEG_ORDER:
+       p.is_strictly_greater=i_total_lex_is_strictly_greater;
+-      p.m_is_strictly_greater=std::ptr_fun(m_total_lex_is_strictly_greater<gen>);
++      p.m_is_strictly_greater=m_total_lex_is_strictly_greater<gen>;
+       break;
+     case _3VAR_ORDER:
+       p.is_strictly_greater=i_3var_is_strictly_greater;
+-      p.m_is_strictly_greater=std::ptr_fun(m_3var_is_strictly_greater<gen>);
++      p.m_is_strictly_greater=m_3var_is_strictly_greater<gen>;
+       break;      
+     case _7VAR_ORDER:
+       p.is_strictly_greater=i_7var_is_strictly_greater;
+-      p.m_is_strictly_greater=std::ptr_fun(m_7var_is_strictly_greater<gen>);
++      p.m_is_strictly_greater=m_7var_is_strictly_greater<gen>;
+       break;      
+     case _11VAR_ORDER:
+       p.is_strictly_greater=i_11var_is_strictly_greater;
+-      p.m_is_strictly_greater=std::ptr_fun(m_11var_is_strictly_greater<gen>);
++      p.m_is_strictly_greater=m_11var_is_strictly_greater<gen>;
+       break;      
+     case _16VAR_ORDER:
+       p.is_strictly_greater=i_16var_is_strictly_greater;
+-      p.m_is_strictly_greater=std::ptr_fun(m_16var_is_strictly_greater<gen>);
++      p.m_is_strictly_greater=m_16var_is_strictly_greater<gen>;
+       break;      
+     case _32VAR_ORDER:
+       p.is_strictly_greater=i_32var_is_strictly_greater;
+-      p.m_is_strictly_greater=std::ptr_fun(m_32var_is_strictly_greater<gen>);
++      p.m_is_strictly_greater=m_32var_is_strictly_greater<gen>;
+       break;      
+     case _64VAR_ORDER:
+       p.is_strictly_greater=i_64var_is_strictly_greater;
+-      p.m_is_strictly_greater=std::ptr_fun(m_64var_is_strictly_greater<gen>);
++      p.m_is_strictly_greater=m_64var_is_strictly_greater<gen>;
+       break;      
+     }
+     p.tsort();
+diff --git a/src/usual.cc b/src/usual.cc
+index fddede6..eb7ae5e 100755
+--- a/src/usual.cc
++++ b/src/usual.cc
+@@ -5950,7 +5950,7 @@ namespace giac {
+ #if 1 // def NSPIRE
+     gen_map m;
+ #else
+-    gen_map m(ptr_fun(islesscomplexthanf));
++    gen_map m(islesscomplexthanf);
+ #endif
+     for (;it!=itend;++it){
+       if (is_equal(*it) || it->is_symb_of_sommet(at_deuxpoints)){
+-- 
+2.44.1
+
diff --git a/pkgs/applications/science/math/ginac/default.nix b/pkgs/applications/science/math/ginac/default.nix
index d9d12cbf388de..d2713befed382 100644
--- a/pkgs/applications/science/math/ginac/default.nix
+++ b/pkgs/applications/science/math/ginac/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
   propagatedBuildInputs = [ cln ];
 
   buildInputs = [ readline ]
-    ++ lib.optional stdenv.isDarwin gmp;
+    ++ lib.optional stdenv.hostPlatform.isDarwin gmp;
 
   nativeBuildInputs = [ pkg-config python3 ];
 
diff --git a/pkgs/applications/science/math/glsurf/default.nix b/pkgs/applications/science/math/glsurf/default.nix
index 38caee5805b43..0edaa32babd70 100644
--- a/pkgs/applications/science/math/glsurf/default.nix
+++ b/pkgs/applications/science/math/glsurf/default.nix
@@ -5,7 +5,7 @@
 , makeWrapper
 , libGLU
 , libGL
-, freeglut
+, libglut
 , mpfr
 , gmp
 , pkgsHostTarget
@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
   ]);
 
   buildInputs = [
-    freeglut
+    libglut
     libGL
     libGLU
     mpfr
diff --git a/pkgs/applications/science/math/gmsh/default.nix b/pkgs/applications/science/math/gmsh/default.nix
index 3e88e7f94bbe6..2219815824e7c 100644
--- a/pkgs/applications/science/math/gmsh/default.nix
+++ b/pkgs/applications/science/math/gmsh/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [
     blas lapack gmm fltk libjpeg zlib opencascade-occt
-  ] ++ lib.optionals (!stdenv.isDarwin) [
+  ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
     libGL libGLU xorg.libXrender xorg.libXcursor xorg.libXfixes
     xorg.libXext xorg.libXft xorg.libXinerama xorg.libX11 xorg.libSM
     xorg.libICE
diff --git a/pkgs/applications/science/math/gurobi/default.nix b/pkgs/applications/science/math/gurobi/default.nix
index e8f4794d4179d..eff61579a5f99 100644
--- a/pkgs/applications/science/math/gurobi/default.nix
+++ b/pkgs/applications/science/math/gurobi/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "gurobi";
-  version = "11.0.2";
+  version = "11.0.3";
 
   src = fetchurl {
     url = "https://packages.gurobi.com/${lib.versions.majorMinor version}/gurobi${version}_linux64.tar.gz";
-    hash = "sha256-9DrIo+25h7mgphRSrNnY2+nrNzaMbafONuUkfLKho2g=";
+    hash = "sha256-gqLIZxwjS7qp3GTaIrGVGr9BxiBH/fdwBOZfJKkd/RM=";
   };
 
   sourceRoot = "gurobi${builtins.replaceStrings ["."] [""] version}/linux64";
diff --git a/pkgs/applications/science/math/lp_solve/default.nix b/pkgs/applications/science/math/lp_solve/default.nix
index 773f1f3c089e4..67d7bfdba90c2 100644
--- a/pkgs/applications/science/math/lp_solve/default.nix
+++ b/pkgs/applications/science/math/lp_solve/default.nix
@@ -15,16 +15,16 @@ stdenv.mkDerivation rec {
     sha256 = "sha256-bUq/9cxqqpM66ObBeiJt8PwLZxxDj2lxXUHQn+gfkC8=";
   };
 
-  nativeBuildInputs = lib.optionals stdenv.isDarwin [
+  nativeBuildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
     cctools
     fixDarwinDylibNames
-  ] ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [
+  ] ++ lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
     autoSignDarwinBinariesHook
   ];
 
   env = {
     NIX_CFLAGS_COMPILE = "-Wno-error=implicit-int";
-  } // lib.optionalAttrs (stdenv.isDarwin && stdenv.isx86_64) {
+  } // lib.optionalAttrs (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) {
     NIX_LDFLAGS = "-headerpad_max_install_names";
   };
 
@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
 
   buildPhase =
     let
-      ccc = if stdenv.isDarwin then "ccc.osx" else "ccc";
+      ccc = if stdenv.hostPlatform.isDarwin then "ccc.osx" else "ccc";
     in
     ''
       runHook preBuild
diff --git a/pkgs/applications/science/math/mathematica/10.nix b/pkgs/applications/science/math/mathematica/10.nix
deleted file mode 100644
index e5ab259b8f70b..0000000000000
--- a/pkgs/applications/science/math/mathematica/10.nix
+++ /dev/null
@@ -1,132 +0,0 @@
-{ lib
-, patchelf
-, requireFile
-, stdenv
-# arguments from default.nix
-, lang
-, meta
-, name
-, src
-, version
-# dependencies
-, alsa-lib
-, coreutils
-, cudaPackages
-, fontconfig
-, freetype
-, gcc
-, glib
-, libuuid
-, libxml2
-, ncurses
-, opencv2
-, openssl
-, unixODBC
-, xorg
-# options
-, cudaSupport
-}:
-
-let
-  platform =
-    if stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux" then
-      "Linux"
-    else
-      throw "Mathematica requires i686-linux or x86_64 linux";
-in
-stdenv.mkDerivation rec {
-  inherit meta src version;
-
-  pname = "mathematica";
-
-  buildInputs = [
-    coreutils
-    patchelf
-    alsa-lib
-    coreutils
-    fontconfig
-    freetype
-    gcc.cc
-    gcc.libc
-    glib
-    ncurses
-    opencv2
-    openssl
-    unixODBC
-    libxml2
-    libuuid
-  ] ++ (with xorg; [
-    libX11
-    libXext
-    libXtst
-    libXi
-    libXmu
-    libXrender
-    libxcb
-    libXcursor
-    libXfixes
-    libXrandr
-    libICE
-    libSM
-  ]);
-
-  ldpath = lib.makeLibraryPath buildInputs
-    + lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux")
-      (":" + lib.makeSearchPathOutput "lib" "lib64" buildInputs);
-
-  dontConfigure = true;
-  dontBuild = true;
-
-  unpackPhase = ''
-    echo "=== Extracting makeself archive ==="
-    # find offset from file
-    offset=$(${stdenv.shell} -c "$(grep -axm1 -e 'offset=.*' $src); echo \$offset" $src)
-    dd if="$src" ibs=$offset skip=1 | tar -xf -
-    cd Unix
-  '';
-
-  installPhase = ''
-    cd Installer
-    # don't restrict PATH, that has already been done
-    sed -i -e 's/^PATH=/# PATH=/' MathInstaller
-
-    echo "=== Running MathInstaller ==="
-    ./MathInstaller -auto -createdir=y -execdir=$out/bin -targetdir=$out/libexec/Mathematica -platforms=${platform} -silent
-  '';
-
-  preFixup = ''
-    echo "=== PatchElfing away ==="
-    # This code should be a bit forgiving of errors, unfortunately
-    set +e
-    find $out/libexec/Mathematica/SystemFiles -type f -perm -0100 | while read f; do
-      type=$(readelf -h "$f" 2>/dev/null | grep 'Type:' | sed -e 's/ *Type: *\([A-Z]*\) (.*/\1/')
-      if [ -z "$type" ]; then
-        :
-      elif [ "$type" == "EXEC" ]; then
-        echo "patching $f executable <<"
-        patchelf --shrink-rpath "$f"
-        patchelf \
-    --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
-          --set-rpath "$(patchelf --print-rpath "$f"):${ldpath}" \
-          "$f" \
-          && patchelf --shrink-rpath "$f" \
-          || echo unable to patch ... ignoring 1>&2
-      elif [ "$type" == "DYN" ]; then
-        echo "patching $f library <<"
-        patchelf \
-          --set-rpath "$(patchelf --print-rpath "$f"):${ldpath}" \
-          "$f" \
-          && patchelf --shrink-rpath "$f" \
-          || echo unable to patch ... ignoring 1>&2
-      else
-        echo "not patching $f <<: unknown elf type"
-      fi
-    done
-  '';
-
-  # all binaries are already stripped
-  dontStrip = true;
-
-  # we did this in prefixup already
-  dontPatchELF = true;
-}
diff --git a/pkgs/applications/science/math/mathematica/11.nix b/pkgs/applications/science/math/mathematica/11.nix
deleted file mode 100644
index 5b9460f76e06d..0000000000000
--- a/pkgs/applications/science/math/mathematica/11.nix
+++ /dev/null
@@ -1,146 +0,0 @@
-{ lib
-, patchelf
-, requireFile
-, stdenv
-# arguments from default.nix
-, lang
-, meta
-, name
-, src
-, version
-# dependencies
-, alsa-lib
-, coreutils
-, cudaPackages
-, dbus
-, fontconfig
-, freetype
-, gcc
-, glib
-, libGL
-, libGLU
-, libuuid
-, libxml2
-, ncurses
-, opencv2
-, openssl
-, unixODBC
-, xkeyboard_config
-, xorg
-, zlib
-# options
-, cudaSupport
-}:
-
-stdenv.mkDerivation rec {
-  inherit meta name src version;
-
-  buildInputs = [
-    coreutils
-    patchelf
-    alsa-lib
-    coreutils
-    dbus
-    fontconfig
-    freetype
-    gcc.cc
-    gcc.libc
-    glib
-    ncurses
-    opencv2
-    openssl
-    unixODBC
-    xkeyboard_config
-    libxml2
-    libuuid
-    zlib
-    libGL
-    libGLU
-  ] ++ (with xorg; [
-    libX11
-    libXext
-    libXtst
-    libXi
-    libXmu
-    libXrender
-    libxcb
-    libXcursor
-    libXfixes
-    libXrandr
-    libICE
-    libSM
-  ]);
-
-  ldpath = lib.makeLibraryPath buildInputs
-    + lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux")
-      (":" + lib.makeSearchPathOutput "lib" "lib64" buildInputs);
-
-  dontConfigure = true;
-  dontBuild = true;
-
-  unpackPhase = ''
-    echo "=== Extracting makeself archive ==="
-    # find offset from file
-    offset=$(${stdenv.shell} -c "$(grep -axm1 -e 'offset=.*' $src); echo \$offset" $src)
-    dd if="$src" ibs=$offset skip=1 | tar -xf -
-    cd Unix
-  '';
-
-  installPhase = ''
-    cd Installer
-    # don't restrict PATH, that has already been done
-    sed -i -e 's/^PATH=/# PATH=/' MathInstaller
-    sed -i -e 's/\/bin\/bash/\/bin\/sh/' MathInstaller
-
-    echo "=== Running MathInstaller ==="
-    ./MathInstaller -auto -createdir=y -execdir=$out/bin -targetdir=$out/libexec/Mathematica -silent
-
-    # Fix library paths
-    cd $out/libexec/Mathematica/Executables
-    for path in mathematica MathKernel Mathematica WolframKernel wolfram math; do
-      sed -i -e 's#export LD_LIBRARY_PATH$#export LD_LIBRARY_PATH=${zlib}/lib:\''${LD_LIBRARY_PATH}#' $path
-    done
-
-    # Fix xkeyboard config path for Qt
-    for path in mathematica Mathematica; do
-      line=$(grep -n QT_PLUGIN_PATH $path | sed 's/:.*//')
-      sed -i -e "$line iexport QT_XKB_CONFIG_ROOT=\"${xkeyboard_config}/share/X11/xkb\"" $path
-    done
-  '';
-
-  preFixup = ''
-    echo "=== PatchElfing away ==="
-    # This code should be a bit forgiving of errors, unfortunately
-    set +e
-    find $out/libexec/Mathematica/SystemFiles -type f -perm -0100 | while read f; do
-      type=$(readelf -h "$f" 2>/dev/null | grep 'Type:' | sed -e 's/ *Type: *\([A-Z]*\) (.*/\1/')
-      if [ -z "$type" ]; then
-        :
-      elif [ "$type" == "EXEC" ]; then
-        echo "patching $f executable <<"
-        patchelf --shrink-rpath "$f"
-        patchelf \
-    --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
-          --set-rpath "$(patchelf --print-rpath "$f"):${ldpath}" \
-          "$f" \
-          && patchelf --shrink-rpath "$f" \
-          || echo unable to patch ... ignoring 1>&2
-      elif [ "$type" == "DYN" ]; then
-        echo "patching $f library <<"
-        patchelf \
-          --set-rpath "$(patchelf --print-rpath "$f"):${ldpath}" \
-          "$f" \
-          && patchelf --shrink-rpath "$f" \
-          || echo unable to patch ... ignoring 1>&2
-      else
-        echo "not patching $f <<: unknown elf type"
-      fi
-    done
-  '';
-
-  # all binaries are already stripped
-  dontStrip = true;
-
-  # we did this in prefixup already
-  dontPatchELF = true;
-}
diff --git a/pkgs/applications/science/math/mathematica/9.nix b/pkgs/applications/science/math/mathematica/9.nix
deleted file mode 100644
index c2fc07c532fc9..0000000000000
--- a/pkgs/applications/science/math/mathematica/9.nix
+++ /dev/null
@@ -1,118 +0,0 @@
-{ lib
-, patchelf
-, requireFile
-, stdenv
-# arguments from default.nix
-, lang
-, meta
-, name
-, src
-, version
-# dependencies
-, alsa-lib
-, coreutils
-, cudaPackages
-, fontconfig
-, freetype
-, gcc
-, glib
-, ncurses
-, opencv2
-, openssl
-, unixODBC
-, xorg
-# options
-, cudaSupport
-}:
-
-let
-  platform =
-    if stdenv.hostPlatform.system == "i686-linux" || stdenv.hostPlatform.system == "x86_64-linux" then
-      "Linux"
-    else
-      throw "Mathematica requires i686-linux or x86_64 linux";
-in
-stdenv.mkDerivation rec {
-  inherit meta src version;
-  pname = "mathematica";
-
-  buildInputs = [
-    coreutils
-    patchelf
-    alsa-lib
-    coreutils
-    fontconfig
-    freetype
-    gcc.cc
-    gcc.libc
-    glib
-    ncurses
-    opencv2
-    openssl
-    unixODBC
-  ] ++ (with xorg; [
-    libX11
-    libXext
-    libXtst
-    libXi
-    libXmu
-    libXrender
-    libxcb
-  ]);
-
-  ldpath = lib.makeLibraryPath buildInputs
-    + lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux")
-    (":" + lib.makeSearchPathOutput "lib" "lib64" buildInputs);
-
-  dontConfigure = true;
-  dontBuild = true;
-
-  unpackPhase = ''
-    echo "=== Extracting makeself archive ==="
-    # find offset from file
-    offset=$(${stdenv.shell} -c "$(grep -axm1 -e 'offset=.*' $src); echo \$offset" $src)
-    dd if="$src" ibs=$offset skip=1 | tar -xf -
-    cd Unix
-  '';
-
-  installPhase = ''
-    cd Installer
-    # don't restrict PATH, that has already been done
-    sed -i -e 's/^PATH=/# PATH=/' MathInstaller
-
-    echo "=== Running MathInstaller ==="
-    ./MathInstaller -auto -createdir=y -execdir=$out/bin -targetdir=$out/libexec/Mathematica -platforms=${platform} -silent
-  '';
-
-  preFixup = ''
-    echo "=== PatchElfing away ==="
-    find $out/libexec/Mathematica/SystemFiles -type f -perm -0100 | while read f; do
-      type=$(readelf -h "$f" 2>/dev/null | grep 'Type:' | sed -e 's/ *Type: *\([A-Z]*\) (.*/\1/')
-      if [ -z "$type" ]; then
-        :
-      elif [ "$type" == "EXEC" ]; then
-        echo "patching $f executable <<"
-        patchelf \
-            --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
-            --set-rpath "${ldpath}" \
-            "$f"
-        patchelf --shrink-rpath "$f"
-      elif [ "$type" == "DYN" ]; then
-        echo "patching $f library <<"
-        patchelf \
-          --set-rpath "$(patchelf --print-rpath "$f"):${ldpath}" \
-          "$f" \
-          && patchelf --shrink-rpath "$f" \
-          || echo unable to patch ... ignoring 1>&2
-      else
-        echo "not patching $f <<: unknown elf type"
-      fi
-    done
-  '';
-
-  # all binaries are already stripped
-  dontStrip = true;
-
-  # we did this in prefixup already
-  dontPatchELF = true;
-}
diff --git a/pkgs/applications/science/math/mathematica/default.nix b/pkgs/applications/science/math/mathematica/default.nix
index c4cebcd8e29ad..9d0a308f44357 100644
--- a/pkgs/applications/science/math/mathematica/default.nix
+++ b/pkgs/applications/science/math/mathematica/default.nix
@@ -44,12 +44,6 @@ let versions = callPackage ./versions.nix { };
                         else "and with local documentation"}")
       else lib.head matching-versions;
 
-    specific-drv = ./. + "/${lib.versions.major found-version.version}.nix";
-
-    real-drv = if lib.pathExists specific-drv
-               then specific-drv
-               else ./generic.nix;
-
     isMatching = v1: v2:
       let as      = lib.splitVersion v1;
           bs      = lib.splitVersion v2;
@@ -59,12 +53,12 @@ let versions = callPackage ./versions.nix { };
 
     matchesDoc = v:
       builtins.match (if webdoc
-                      then ".*[0-9]_LINUX.sh"
-                      else ".*[0-9]_BNDL_LINUX.sh") v.src.name != null;
+                      then ".*[0-9]_LIN(UX)?.sh"
+                      else ".*_B[Nn][Dd][Ll].sh") v.src.name != null;
 
 in
 
-callPackage real-drv {
+callPackage ./generic.nix {
   inherit cudaSupport cudaPackages;
   inherit (found-version) version lang;
   src = if source == null then found-version.src else source;
@@ -77,7 +71,7 @@ callPackage real-drv {
     homepage = "http://www.wolfram.com/mathematica/";
     license = licenses.unfree;
     sourceProvenance = with sourceTypes; [ binaryNativeCode ];
-    maintainers = with maintainers; [ herberteuler rafaelrc ];
+    maintainers = with maintainers; [ herberteuler rafaelrc chewblacka ];
     platforms = [ "x86_64-linux" ];
   };
 }
diff --git a/pkgs/applications/science/math/mathematica/generic.nix b/pkgs/applications/science/math/mathematica/generic.nix
index 5a96bf1a26252..6bf8992308125 100644
--- a/pkgs/applications/science/math/mathematica/generic.nix
+++ b/pkgs/applications/science/math/mathematica/generic.nix
@@ -1,4 +1,4 @@
-{ addOpenGLRunpath
+{ addDriverRunpath
 , autoPatchelfHook
 , lib
 , makeWrapper
@@ -57,7 +57,7 @@ let cudaEnv = symlinkJoin {
       ];
       postBuild = ''
         if [ ! -e $out/lib/libcuda.so ]; then
-            ln -s ${addOpenGLRunpath.driverLink}/lib/libcuda.so $out/lib
+            ln -s ${addDriverRunpath.driverLink}/lib/libcuda.so $out/lib
         fi
         ln -s lib $out/lib64
       '';
@@ -69,7 +69,7 @@ in stdenv.mkDerivation {
   nativeBuildInputs = [
     autoPatchelfHook
     makeWrapper
-  ] ++ lib.optional cudaSupport addOpenGLRunpath;
+  ] ++ lib.optional cudaSupport addDriverRunpath;
 
   buildInputs = [
     alsa-lib
@@ -136,8 +136,8 @@ in stdenv.mkDerivation {
     "--set QT_QPA_PLATFORM wayland;xcb"
   ] ++ lib.optionals cudaSupport [
     "--set CUDA_PATH ${cudaEnv}"
-    "--set NVIDIA_DRIVER_LIBRARY_PATH ${addOpenGLRunpath.driverLink}/lib/libnvidia-tls.so"
-    "--set CUDA_LIBRARY_PATH ${addOpenGLRunpath.driverLink}/lib/libcuda.so"
+    "--set NVIDIA_DRIVER_LIBRARY_PATH ${addDriverRunpath.driverLink}/lib/libnvidia-tls.so"
+    "--set CUDA_LIBRARY_PATH ${addDriverRunpath.driverLink}/lib/libcuda.so"
   ];
 
   unpackPhase = ''
@@ -157,9 +157,15 @@ in stdenv.mkDerivation {
 
     mkdir -p "$out/lib/udev/rules.d"
 
-    # Patch MathInstaller's shebangs and udev rules dir
-    patchShebangs MathInstaller
-    substituteInPlace MathInstaller \
+    # Set name of installer file
+    if [ -f "MathInstaller" ]; then
+      INSTALLER="MathInstaller"
+    else
+      INSTALLER="WolframInstaller"
+    fi
+    # Patch Installer's shebangs and udev rules dir
+    patchShebangs $INSTALLER
+    substituteInPlace $INSTALLER \
       --replace /etc/udev/rules.d $out/lib/udev/rules.d
 
     # Remove PATH restriction, root and avahi daemon checks, and hostname call
@@ -169,13 +175,13 @@ in stdenv.mkDerivation {
       s/^\s*checkAvahiDaemon$/:/
       s/^\s*installBundledInstall$/:/
       s/`hostname`/""/
-    ' MathInstaller
+    ' $INSTALLER
 
     # NOTE: some files placed under HOME may be useful
     XDG_DATA_HOME="$out/share" HOME="$TMPDIR/home" vernierLink=y \
-      ./MathInstaller -execdir="$out/bin" -targetdir="$out/libexec/Mathematica" -auto -verbose -createdir=y
+      ./$INSTALLER -execdir="$out/bin" -targetdir="$out/libexec/Mathematica" -auto -verbose -createdir=y
 
-    # Check if MathInstaller produced any errors
+    # Check if Installer produced any errors
     errLog="$out/libexec/Mathematica/InstallErrors"
     if [ -f "$errLog" ]; then
       echo "Installation errors:"
diff --git a/pkgs/applications/science/math/mathematica/versions.nix b/pkgs/applications/science/math/mathematica/versions.nix
index 3bbf70433471f..a88aca6f12a8f 100644
--- a/pkgs/applications/science/math/mathematica/versions.nix
+++ b/pkgs/applications/science/math/mathematica/versions.nix
@@ -8,6 +8,20 @@
 
 let versions = [
   {
+    version = "14.1.0";
+    lang = "en";
+    language = "English";
+    sha256 = "sha256-PCpjwqA6NC+iwvYxddYBlmF5+vl76r+MoIYAL91WFns=";
+    installer = "Wolfram_14.1.0_LIN.sh";
+  }
+  {
+    version = "14.1.0";
+    lang = "en";
+    language = "English";
+    sha256 = "sha256-pnu60Pv3xo3+MAkDLiU3yTPVbbQ00diV45vSVL8B310=";
+    installer = "Wolfram_14.1.0_LIN_Bndl.sh";
+  }
+  {
     version = "14.0.0";
     lang = "en";
     language = "English";
@@ -147,34 +161,6 @@ let versions = [
     sha256 = "sha256-uftx4a/MHXLCABlv+kNFEtII+ikg4geHhDP1BOWK6dc=";
     installer = "Mathematica_12.0.0_LINUX.sh";
   }
-  {
-    version = "11.3.0";
-    lang = "en";
-    language = "English";
-    sha256 = "sha256-D8/iCMHqyESOe+OvC9uENwsXvZxdBmwBOSjI7pWu0Q4=";
-    installer = "Mathematica_11.3.0_LINUX.sh";
-  }
-  {
-    version = "11.2.0";
-    lang = "ja";
-    language = "Japanese";
-    sha256 = "sha256-kWOS7dMr7YYiI430Nd2OhkJrsEMDijM28w3xDYGbSbE=";
-    installer = "Mathematica_11.2.0_ja_LINUX.sh";
-  }
-  {
-    version = "9.0.0";
-    lang = "en";
-    language = "English";
-    sha256 = "sha256-mKgxdd7dLWa5EOuR5C37SeU+UC9Cv5YTbY5xSK9y34A=";
-    installer = "Mathematica_9.0.0_LINUX.sh";
-  }
-  {
-    version = "10.0.2";
-    lang = "en";
-    language = "English";
-    sha256 = "sha256-NHUg1jzLos1EsIr8TdYdNaA5+3jEcFqVZIr9GVVUXrQ=";
-    installer = "Mathematica_10.0.2_LINUX.sh";
-  }
 ];
 
 in
diff --git a/pkgs/applications/science/math/maxima/5.47.0-CVE-2024-34490.patch b/pkgs/applications/science/math/maxima/5.47.0-CVE-2024-34490.patch
new file mode 100644
index 0000000000000..008fe725fa895
--- /dev/null
+++ b/pkgs/applications/science/math/maxima/5.47.0-CVE-2024-34490.patch
@@ -0,0 +1,86 @@
+Based on upstream https://sourceforge.net/p/maxima/code/ci/51704ccb090f6f971b641e4e0b7c1c22c4828bf7/
+adjusted to apply to 5.47.0
+
+diff --git a/src/gnuplot_def.lisp b/src/gnuplot_def.lisp
+index 80c174bd5..6fdc8da6d 100644
+--- a/src/gnuplot_def.lisp
++++ b/src/gnuplot_def.lisp
+@@ -286,7 +286,7 @@
+                (format nil "set term postscript eps color solid lw 2 size 16.4 cm, 12.3 cm font \",24\" ~a" gstrings)))
+      (if (getf plot-options :gnuplot_out_file)
+          (setq out-file (getf plot-options :gnuplot_out_file))
+-         (setq out-file "maxplot.ps")))
++         (setq out-file (format nil "~a.ps" (random-name 16)))))
+     ((eq (getf plot-options :gnuplot_term) '$dumb)
+      (if (getf plot-options :gnuplot_dumb_term_command)
+          (setq terminal-command
+@@ -294,7 +294,7 @@
+          (setq terminal-command "set term dumb 79 22"))
+      (if (getf plot-options :gnuplot_out_file)
+          (setq out-file (getf plot-options :gnuplot_out_file))
+-         (setq out-file "maxplot.txt")))
++         (setq out-file (format nil "~a.txt" (random-name 16)))))
+     ((eq (getf plot-options :gnuplot_term) '$default)
+      (if (getf plot-options :gnuplot_default_term_command)
+          (setq terminal-command
+diff --git a/src/plot.lisp b/src/plot.lisp
+index fb2b3136b..8877f7025 100644
+--- a/src/plot.lisp
++++ b/src/plot.lisp
+@@ -1755,16 +1755,24 @@ plot3d([cos(y)*(10.0+6*cos(x)), sin(y)*(10.0+6*cos(x)),-6*sin(x)],
+ 
+ (defvar $xmaxima_plot_command "xmaxima")
+ 
++;; random-file-name
++;; Creates a random word of 'count' alphanumeric characters
++(defun random-name (count)
++  (let ((chars "0123456789abcdefghijklmnopqrstuvwxyz") (name ""))
++    (setf *random-state* (make-random-state t))
++    (dotimes (i count)
++      (setq name (format nil "~a~a" name (aref chars (random 36)))))
++    name))
++
+ (defun plot-set-gnuplot-script-file-name (options)
+   (let ((gnuplot-term (getf options :gnuplot_term))
+ 	(gnuplot-out-file (getf options :gnuplot_out_file)))
+     (if (and (find (getf options :plot_format) '($gnuplot_pipes $gnuplot))
+              (eq gnuplot-term '$default) gnuplot-out-file)
+ 	(plot-file-path gnuplot-out-file t options)
+-      (plot-file-path
+-       (format nil "maxout~d.~(~a~)"
+-	       (getpid)
+-               (ensure-string (getf options :plot_format))) nil options))))
++      (plot-file-path (format nil "~a.~a" (random-name 16)
++                              (ensure-string (getf options :plot_format)))
++                      nil options))))
+ 
+ (defun plot-temp-file0 (file &optional (preserve-file nil))
+   (let ((filename 
+@@ -2577,9 +2585,13 @@ plot2d ( x^2+y^2 = 1, [x, -2, 2], [y, -2 ,2]);
+        (format dest "}~%"))
+   (format dest "}~%"))
+ 
++; TODO: Check whether this function is still being used (villate 20240325)
+ (defun show-open-plot (ans file)
+   (cond ($show_openplot
+-         (with-open-file (st1 (plot-temp-file (format nil "maxout~d.xmaxima" (getpid))) :direction :output :if-exists :supersede)
++         (with-open-file
++          (st1 (plot-temp-file
++                (format nil "~a.xmaxima" (random-name 16)))
++               :direction :output :if-exists :supersede)
+            (princ  ans st1))
+          ($system (concatenate 'string *maxima-prefix* 
+                                (if (string= *autoconf-windows* "true") "\\bin\\" "/bin/") 
+diff --git a/src/xmaxima_def.lisp b/src/xmaxima_def.lisp
+index b6513b564..5a13b6141 100644
+--- a/src/xmaxima_def.lisp
++++ b/src/xmaxima_def.lisp
+@@ -431,7 +431,7 @@
+         (format $pstream "}~%"))))))
+ 
+ (defmethod plot-shipout ((plot xmaxima-plot) options &optional output-file)
+-  (let ((file (plot-file-path (format nil "maxout~d.xmaxima" (getpid)))))
++  (let ((file (plot-file-path (format nil "~a.xmaxima" (random-name 16)))))
+     (cond ($show_openplot
+            (with-open-file (fl
+                             #+sbcl (sb-ext:native-namestring file)
diff --git a/pkgs/applications/science/math/maxima/default.nix b/pkgs/applications/science/math/maxima/default.nix
index e7ac178cd5d13..c1458186b2ae1 100644
--- a/pkgs/applications/science/math/maxima/default.nix
+++ b/pkgs/applications/science/math/maxima/default.nix
@@ -20,11 +20,11 @@ let
 in
 stdenv.mkDerivation (finalAttrs: {
   pname = "maxima";
-  version = "5.46.0";
+  version = "5.47.0";
 
   src = fetchurl {
-    url = "mirror://sourceforge/${finalAttrs.pname}/${finalAttrs.pname}-${finalAttrs.version}.tar.gz";
-    sha256 = "sha256-c5Dwa0jaZckDPosvYpuXi5AFZFSlQCLbfecOIiWqiwc=";
+    url = "mirror://sourceforge/maxima/maxima-${finalAttrs.version}.tar.gz";
+    sha256 = "sha256-kQQCGyT9U+jAOpg1CctC6TepJejAyFwzXXcJoU/UD3o=";
   };
 
   nativeBuildInputs = [
@@ -79,6 +79,8 @@ stdenv.mkDerivation (finalAttrs: {
       url = "https://raw.githubusercontent.com/sagemath/sage/07d6c37d18811e2b377a9689790a7c5e24da16ba/build/pkgs/maxima/patches/undoing_true_false_printing_patch.patch";
       sha256 = "0fvi3rcjv6743sqsbgdzazy9jb6r1p1yq63zyj9fx42wd1hgf7yx";
     })
+
+    ./5.47.0-CVE-2024-34490.patch
   ];
 
   # The test suite is disabled since 5.42.2 because of the following issues:
diff --git a/pkgs/applications/science/math/msieve/default.nix b/pkgs/applications/science/math/msieve/default.nix
index bda3e5b3a040a..a5af9e844eca4 100644
--- a/pkgs/applications/science/math/msieve/default.nix
+++ b/pkgs/applications/science/math/msieve/default.nix
@@ -2,12 +2,12 @@
 
 stdenv.mkDerivation rec {
   pname = "msieve";
-  version = "r1050";
+  version = "1056";
 
   src = fetchsvn {
     url = "svn://svn.code.sf.net/p/msieve/code/trunk";
-    rev = "1050";
-    hash = "sha256-cn6OhE4zhrpB7BFrRdOnucjATbfo5mLkK7O0Usx1quE=";
+    rev = version;
+    hash = "sha256-6ErVn4pYPMG5VFjOQURLsHNpN0pGdp55+rjY8988onU=";
   };
 
   buildInputs = [ zlib gmp ecm ];
diff --git a/pkgs/applications/science/math/mxnet/default.nix b/pkgs/applications/science/math/mxnet/default.nix
index 839537438962b..880caaff5afb6 100644
--- a/pkgs/applications/science/math/mxnet/default.nix
+++ b/pkgs/applications/science/math/mxnet/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     name = "apache-mxnet-src-${version}-incubating.tar.gz";
-    url = "https://dlcdn.apache.org/incubator/mxnet/${version}/apache-mxnet-src-${version}-incubating.tar.gz";
+    url = "mirror://apache/incubator/mxnet/${version}/apache-mxnet-src-${version}-incubating.tar.gz";
     hash = "sha256-EephMoF02MKblvNBl34D3rC/Sww3rOZY+T442euMkyI=";
   };
 
diff --git a/pkgs/applications/science/math/nota/default.nix b/pkgs/applications/science/math/nota/default.nix
index eae11806d7254..3a98eacd47171 100644
--- a/pkgs/applications/science/math/nota/default.nix
+++ b/pkgs/applications/science/math/nota/default.nix
@@ -36,6 +36,6 @@ mkDerivation rec {
   description = "Most beautiful command line calculator";
   homepage = "https://kary.us/nota";
   license = lib.licenses.mpl20;
-  maintainers = with lib.maintainers; [ dtzWill ];
+  maintainers = [ ];
   mainProgram = "nota";
 }
diff --git a/pkgs/applications/science/math/numworks-epsilon/default.nix b/pkgs/applications/science/math/numworks-epsilon/default.nix
index 98d5d0d4560ad..71da675614da9 100644
--- a/pkgs/applications/science/math/numworks-epsilon/default.nix
+++ b/pkgs/applications/science/math/numworks-epsilon/default.nix
@@ -14,13 +14,13 @@
 
 stdenv.mkDerivation rec {
   pname = "numworks-epsilon";
-  version = "22.2.0";
+  version = "23.2.3";
 
   src = fetchFromGitHub {
     owner = "numworks";
     repo = "epsilon";
     rev = version;
-    hash = "sha256-E2WaXTn8+Ky9kdZxvQmEt63Ggo6Ns0fZ0Za+rQGIMSg=";
+    hash = "sha256-w9ddcULE1MrGnYcXA0qOg1elQv/eBhcXqhMSjWT3Bkk=";
   };
 
   nativeBuildInputs = [ pkg-config ];
diff --git a/pkgs/applications/science/math/palp/default.nix b/pkgs/applications/science/math/palp/default.nix
index a3b54b78f99bc..0db35ba89ae61 100644
--- a/pkgs/applications/science/math/palp/default.nix
+++ b/pkgs/applications/science/math/palp/default.nix
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
     "format"
   ];
 
-  patchPhase = lib.optionalString stdenv.isDarwin ''
+  patchPhase = lib.optionalString stdenv.hostPlatform.isDarwin ''
     substituteInPlace GNUmakefile --replace gcc cc
   '';
 
diff --git a/pkgs/applications/science/math/qalculate-gtk/default.nix b/pkgs/applications/science/math/qalculate-gtk/default.nix
index e4fc506516fdd..306d6141ac17a 100644
--- a/pkgs/applications/science/math/qalculate-gtk/default.nix
+++ b/pkgs/applications/science/math/qalculate-gtk/default.nix
@@ -2,19 +2,19 @@
 
 stdenv.mkDerivation (finalAttrs: {
   pname = "qalculate-gtk";
-  version = "5.1.0";
+  version = "5.2.0";
 
   src = fetchFromGitHub {
     owner = "qalculate";
     repo = "qalculate-gtk";
     rev = "v${finalAttrs.version}";
-    hash = "sha256-yI+8TrNZJt4eJnDX5mk6RozBe2ZeP7sTyAjsgiYQPck=";
+    hash = "sha256-vH4GZaeQ6Ji9aWh8R5B6PE2fBBW7KTyCsFkpgHu6yg8=";
   };
 
   hardeningDisable = [ "format" ];
 
   nativeBuildInputs = [ intltool pkg-config autoreconfHook wrapGAppsHook3 ]
-    ++ lib.optionals stdenv.isDarwin [ desktopToDarwinBundle ];
+    ++ lib.optionals stdenv.hostPlatform.isDarwin [ desktopToDarwinBundle ];
   buildInputs = [ libqalculate gtk3 curl ];
   enableParallelBuilding = true;
 
diff --git a/pkgs/applications/science/math/qalculate-qt/default.nix b/pkgs/applications/science/math/qalculate-qt/default.nix
index 3c4e19d56ebd7..2cde634498889 100644
--- a/pkgs/applications/science/math/qalculate-qt/default.nix
+++ b/pkgs/applications/science/math/qalculate-qt/default.nix
@@ -2,25 +2,25 @@
 
 stdenv.mkDerivation (finalAttrs: {
   pname = "qalculate-qt";
-  version = "5.1.0";
+  version = "5.2.0.1";
 
   src = fetchFromGitHub {
     owner = "qalculate";
     repo = "qalculate-qt";
     rev = "v${finalAttrs.version}";
-    hash = "sha256-gJfIC5HdA10gb/Dh/yhJbkCZfhUnN0zihqyfDjPv6ow=";
+    hash = "sha256-kzOxOCZmu4mYYgegRBU8SMAkTiE4p1AugVAeZa8yDDE=";
   };
 
   nativeBuildInputs = [ qmake intltool pkg-config qttools wrapQtAppsHook ];
   buildInputs = [ libqalculate qtbase qtsvg ]
-    ++ lib.optionals stdenv.isLinux [ qtwayland ];
+    ++ lib.optionals stdenv.hostPlatform.isLinux [ qtwayland ];
 
   postPatch = ''
     substituteInPlace qalculate-qt.pro\
       --replace "LRELEASE" "${qttools.dev}/bin/lrelease"
   '';
 
-  postInstall = lib.optionalString stdenv.isDarwin ''
+  postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
     mkdir -p $out/Applications
     mv $out/bin/qalculate-qt.app $out/Applications
     makeWrapper $out/{Applications/qalculate-qt.app/Contents/MacOS,bin}/qalculate-qt
diff --git a/pkgs/applications/science/math/ratpoints/default.nix b/pkgs/applications/science/math/ratpoints/default.nix
index f2aa1aac26079..4aaed4a1b0edc 100644
--- a/pkgs/applications/science/math/ratpoints/default.nix
+++ b/pkgs/applications/science/math/ratpoints/default.nix
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ gmp ];
 
   makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];
-  buildFlags = lib.optionals stdenv.isDarwin ["CCFLAGS2=-lgmp -lc -lm" "CCFLAGS=-UUSE_SSE"];
+  buildFlags = lib.optionals stdenv.hostPlatform.isDarwin ["CCFLAGS2=-lgmp -lc -lm" "CCFLAGS=-UUSE_SSE"];
   installFlags = [ "INSTALL_DIR=$(out)" ];
 
   preInstall = ''mkdir -p "$out"/{bin,share,lib,include}'';
diff --git a/pkgs/applications/science/math/ripser/default.nix b/pkgs/applications/science/math/ripser/default.nix
index 3f536f25aa115..38a00d504406b 100644
--- a/pkgs/applications/science/math/ripser/default.nix
+++ b/pkgs/applications/science/math/ripser/default.nix
@@ -5,14 +5,11 @@
 , fileFormat ? "lowerTriangularCsv"
 }:
 
-with lib;
-
-assert assertOneOf "fileFormat" fileFormat
+assert lib.assertOneOf "fileFormat" fileFormat
   ["lowerTriangularCsv" "upperTriangularCsv" "dipha"];
 assert useGoogleHashmap -> sparsehash != null;
 
 let
-  inherit (lib) optional;
   version = "1.2.1";
 in
 stdenv.mkDerivation {
@@ -26,19 +23,19 @@ stdenv.mkDerivation {
     sha256 = "sha256-BxmkPQ/nl5cF+xwQMTjXnLgkLgdmT/39y7Kzl2wDfpE=";
   };
 
-  buildInputs = optional useGoogleHashmap sparsehash;
+  buildInputs = lib.optional useGoogleHashmap sparsehash;
 
   buildFlags = [
     "-std=c++11"
     "-O3"
     "-D NDEBUG"
   ]
-  ++ optional useCoefficients "-D USE_COEFFICIENTS"
-  ++ optional indicateProgress "-D INDICATE_PROGRESS"
-  ++ optional useGoogleHashmap "-D USE_GOOGLE_HASHMAP"
-  ++ optional (fileFormat == "lowerTriangularCsv") "-D FILE_FORMAT_LOWER_TRIANGULAR_CSV"
-  ++ optional (fileFormat == "upperTriangularCsv") "-D FILE_FORMAT_UPPER_TRIANGULAR_CSV"
-  ++ optional (fileFormat == "dipha") "-D FILE_FORMAT_DIPHA"
+  ++ lib.optional useCoefficients "-D USE_COEFFICIENTS"
+  ++ lib.optional indicateProgress "-D INDICATE_PROGRESS"
+  ++ lib.optional useGoogleHashmap "-D USE_GOOGLE_HASHMAP"
+  ++ lib.optional (fileFormat == "lowerTriangularCsv") "-D FILE_FORMAT_LOWER_TRIANGULAR_CSV"
+  ++ lib.optional (fileFormat == "upperTriangularCsv") "-D FILE_FORMAT_UPPER_TRIANGULAR_CSV"
+  ++ lib.optional (fileFormat == "dipha") "-D FILE_FORMAT_DIPHA"
   ;
 
   buildPhase = "c++ ripser.cpp -o ripser $buildFlags";
diff --git a/pkgs/applications/science/math/sage/README.md b/pkgs/applications/science/math/sage/README.md
index 35e8d0deeffba..94a9b0b6bc29b 100644
--- a/pkgs/applications/science/math/sage/README.md
+++ b/pkgs/applications/science/math/sage/README.md
@@ -12,7 +12,7 @@ If the build broke as a result of a package update, try those solutions in order
 
 - 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).
+- 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.
 
 - fix the problem yourself. First clone the sagemath source and then check out the sage version you want to patch:
 
diff --git a/pkgs/applications/science/math/sage/default.nix b/pkgs/applications/science/math/sage/default.nix
index 6624dcc36528b..95ad7ab120134 100644
--- a/pkgs/applications/science/math/sage/default.nix
+++ b/pkgs/applications/science/math/sage/default.nix
@@ -18,7 +18,7 @@ let
         inherit flint3;
         inherit sage-src env-locations singular;
         inherit (maxima) lisp-compiler;
-        linbox = pkgs.linbox.override { withSage = true; };
+        linbox = pkgs.linbox;
         pkg-config = pkgs.pkg-config; # not to confuse with pythonPackages.pkg-config
       };
 
@@ -97,6 +97,7 @@ let
   # Running the tests should take something in the order of 1h.
   sage-tests = callPackage ./sage-tests.nix {
     inherit sage-with-env;
+    pytest = python3.pkgs.pytest;
   };
 
   sage-src = callPackage ./sage-src.nix {};
diff --git a/pkgs/applications/science/math/sage/dist-tests.nix b/pkgs/applications/science/math/sage/dist-tests.nix
index 24a86a8f37a4b..45376b832b9f5 100644
--- a/pkgs/applications/science/math/sage/dist-tests.nix
+++ b/pkgs/applications/science/math/sage/dist-tests.nix
@@ -7,10 +7,10 @@
 # subset of files responsible for the vast majority of packaging tests, we can
 # think about moving this upstream.
 [
-	"src/sage/env.py" # [1]
-	"src/sage/misc/persist.pyx" # [1]
-	"src/sage/misc/inline_fortran.py" # [1]
-	"src/sage/repl/ipython_extension.py" # [1]
+  "src/sage/env.py" # [1]
+  "src/sage/misc/persist.pyx" # [1]
+  "src/sage/misc/inline_fortran.py" # [1]
+  "src/sage/repl/ipython_extension.py" # [1]
 ]
 
 # Numbered list of past failures to annotate files with
diff --git a/pkgs/applications/science/math/sage/patches/disable-singular-doctest.patch b/pkgs/applications/science/math/sage/patches/disable-singular-doctest.patch
new file mode 100644
index 0000000000000..8501d55e54882
--- /dev/null
+++ b/pkgs/applications/science/math/sage/patches/disable-singular-doctest.patch
@@ -0,0 +1,36 @@
+From d6362714c9acf4cab69f3e2e772ec0bb1dfd39fe Mon Sep 17 00:00:00 2001
+From: George Huebner <george@feyor.sh>
+Date: Mon, 22 Jul 2024 00:37:53 -0500
+Subject: [PATCH] disable singular version doctest to avoid exceeding the stack
+ limit
+
+It works fine interactively, only an issue for Nix builds
+---
+ src/sage/interfaces/singular.py | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/sage/interfaces/singular.py b/src/sage/interfaces/singular.py
+index c0ab80e0a6..c778acdb0c 100644
+--- a/src/sage/interfaces/singular.py
++++ b/src/sage/interfaces/singular.py
+@@ -1262,7 +1262,7 @@ class Singular(ExtraTabCompletion, Expect):
+ 
+         EXAMPLES::
+ 
+-            sage: singular.version()
++            sage: singular.version() # not tested
+             "Singular ... version 4...
+         """
+         return singular_version()
+@@ -2475,7 +2475,7 @@ def singular_version():
+ 
+     EXAMPLES::
+ 
+-        sage: singular.version()
++        sage: singular.version() # not tested
+         "Singular ... version 4...
+     """
+     return singular.eval('system("--version");')
+-- 
+2.44.1
+
diff --git a/pkgs/applications/science/math/sage/patches/gap-element-crash.patch b/pkgs/applications/science/math/sage/patches/gap-element-crash.patch
new file mode 100644
index 0000000000000..b5396e2b78543
--- /dev/null
+++ b/pkgs/applications/science/math/sage/patches/gap-element-crash.patch
@@ -0,0 +1,18 @@
+diff --git a/src/sage/libs/gap/element.pyx b/src/sage/libs/gap/element.pyx
+index b2b0681c052..b2e5807392c 100644
+--- a/src/sage/libs/gap/element.pyx
++++ b/src/sage/libs/gap/element.pyx
+@@ -35,6 +35,13 @@ from sage.structure.coerce cimport coercion_model as cm
+ ### helper functions to construct lists and records ########################
+ ############################################################################
+ 
++
++cdef extern from *:
++    """
++    #pragma GCC optimize("O1")
++    """
++
++
+ cdef Obj make_gap_list(sage_list) except NULL:
+     """
+     Convert Sage lists into Gap lists
diff --git a/pkgs/applications/science/math/sage/patches/silence-linker.patch b/pkgs/applications/science/math/sage/patches/silence-linker.patch
new file mode 100644
index 0000000000000..f11f6cc6d0e33
--- /dev/null
+++ b/pkgs/applications/science/math/sage/patches/silence-linker.patch
@@ -0,0 +1,27 @@
+From 06d3bb5d8ef007bbcd71ee157fd97cd69557383b Mon Sep 17 00:00:00 2001
+From: George Huebner <george@feyor.sh>
+Date: Sat, 20 Jul 2024 18:46:04 -0500
+Subject: [PATCH] sage.cython: silence linker
+
+(Nix+LLVM specific issue) "ld: warning: directory not found" causes
+any cython doctest to fail and is annoying, so I told ld to shut up.
+---
+ src/sage/misc/cython.py | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/sage/misc/cython.py b/src/sage/misc/cython.py
+index 545e1227b0..c5f4b69221 100644
+--- a/src/sage/misc/cython.py
++++ b/src/sage/misc/cython.py
+@@ -339,7 +339,7 @@ def cython(filename, verbose=0, compile_message=False,
+     Cython.Compiler.Options.pre_import = "sage.all" if sage_namespace else None
+ 
+     extra_compile_args = ['-w']  # no warnings
+-    extra_link_args = []
++    extra_link_args = ['-w']
+ 
+     ext = Extension(name,
+                     sources=[pyxfile],
+-- 
+2.44.1
+
diff --git a/pkgs/applications/science/math/sage/patches/sphinx-docbuild-subprocesses.patch b/pkgs/applications/science/math/sage/patches/sphinx-docbuild-subprocesses.patch
index 2bfac780dfca3..fecf2088e5045 100644
--- a/pkgs/applications/science/math/sage/patches/sphinx-docbuild-subprocesses.patch
+++ b/pkgs/applications/science/math/sage/patches/sphinx-docbuild-subprocesses.patch
@@ -1,15 +1,15 @@
 diff --git a/src/sage_docbuild/builders.py b/src/sage_docbuild/builders.py
-index c5be38600a..e1d15f62d3 100644
+index 871cc4705a2..4b718136b91 100644
 --- a/src/sage_docbuild/builders.py
 +++ b/src/sage_docbuild/builders.py
-@@ -105,31 +105,6 @@ def builder_helper(type):
+@@ -106,31 +106,6 @@ def builder_helper(type):
      """
      Return a function which builds the documentation for
      output type ``type``.
 -
 -    TESTS:
 -
--    Check that :trac:`25161` has been resolved::
+-    Check that :issue:`25161` has been resolved::
 -
 -        sage: from sage_docbuild.builders import DocBuilder
 -        sage: from sage_docbuild.__main__ import setup_parser
@@ -48,10 +48,10 @@ index c5be38600a..e1d15f62d3 100644
              if build_options.ABORT_ON_ERROR:
                  raise
 diff --git a/src/sage_docbuild/sphinxbuild.py b/src/sage_docbuild/sphinxbuild.py
-index 07c584de55..b83283a9ee 100644
+index 5621fe9e456..b1b91ce7b2c 100644
 --- a/src/sage_docbuild/sphinxbuild.py
 +++ b/src/sage_docbuild/sphinxbuild.py
-@@ -331,3 +331,8 @@ def runsphinx():
+@@ -323,3 +323,8 @@ def runsphinx():
          sys.stderr = saved_stderr
          sys.stdout.flush()
          sys.stderr.flush()
diff --git a/pkgs/applications/science/math/sage/python-modules/sage-docbuild.nix b/pkgs/applications/science/math/sage/python-modules/sage-docbuild.nix
index b45998bbcb86d..43f67b97a278e 100644
--- a/pkgs/applications/science/math/sage/python-modules/sage-docbuild.nix
+++ b/pkgs/applications/science/math/sage/python-modules/sage-docbuild.nix
@@ -1,6 +1,7 @@
 { lib
 , buildPythonPackage
 , sage-src
+, furo
 , jupyter-sphinx
 , sphinx
 , sphinx-copybutton
@@ -13,6 +14,7 @@ buildPythonPackage rec {
   src = sage-src;
 
   propagatedBuildInputs = [
+    furo
     jupyter-sphinx
     sphinx
     sphinx-copybutton
diff --git a/pkgs/applications/science/math/sage/sage-env.nix b/pkgs/applications/science/math/sage/sage-env.nix
index f95e08c51ff4d..1503d3a89957a 100644
--- a/pkgs/applications/science/math/sage/sage-env.nix
+++ b/pkgs/applications/science/math/sage/sage-env.nix
@@ -5,10 +5,12 @@
 , sage-docbuild
 , env-locations
 , gfortran
+, ninja
 , bash
 , coreutils
 , gnused
 , gnugrep
+, gawk
 , binutils
 , pythonEnv
 , python3
@@ -63,11 +65,13 @@ let
     "@sage-local@/build"
     pythonEnv
     gfortran # for inline fortran
+    ninja # for inline fortran via numpy.f2py
     stdenv.cc # for cython
     bash
     coreutils
     gnused
     gnugrep
+    gawk
     binutils.bintools
     pkg-config
     pari
@@ -184,7 +188,7 @@ writeTextFile rec {
     export SAGE_EXTCODE='${sagelib.src}/src/sage/ext_data'
 
   # for find_library
-    export DYLD_LIBRARY_PATH="${lib.makeLibraryPath [stdenv.cc.libc singular giac]}''${DYLD_LIBRARY_PATH:+:}$DYLD_LIBRARY_PATH"
+    export DYLD_LIBRARY_PATH="${lib.makeLibraryPath [stdenv.cc.libc singular giac gap]}''${DYLD_LIBRARY_PATH:+:}$DYLD_LIBRARY_PATH"
   '';
 } // { # equivalent of `passthru`, which `writeTextFile` doesn't support
   lib = sagelib;
diff --git a/pkgs/applications/science/math/sage/sage-src.nix b/pkgs/applications/science/math/sage/sage-src.nix
index de0c2e3b1e20e..b8d9e3e903a6d 100644
--- a/pkgs/applications/science/math/sage/sage-src.nix
+++ b/pkgs/applications/science/math/sage/sage-src.nix
@@ -1,4 +1,5 @@
 { stdenv
+, lib
 , fetchFromGitHub
 , fetchpatch
 , fetchurl
@@ -10,14 +11,14 @@
 # all get the same sources with the same patches applied.
 
 stdenv.mkDerivation rec {
-  version = "10.3";
+  version = "10.4";
   pname = "sage-src";
 
   src = fetchFromGitHub {
     owner = "sagemath";
     repo = "sage";
     rev = version;
-    hash = "sha256-OHtMv8t0RrP6R8XIREU+C1vpazeQLWa75wx9Mv6BN1U=";
+    hash = "sha256-BDO00ZSm5lnjEuA56VsY/FZyAhoG1hkFxdIlTtBZVBA=";
   };
 
   # contains essential files (e.g., setup.cfg) generated by the bootstrap script.
@@ -25,8 +26,8 @@ stdenv.mkDerivation rec {
   configure-src = fetchurl {
     # the hash below is the tagged commit's _parent_. it can also be found by looking for
     # the "configure" asset at https://github.com/sagemath/sage/releases/tag/${version}
-    url = "mirror://sageupstream/configure/configure-ab1a517b64b02bf15bbcb8d7c2d4d643bd5eff9b.tar.gz";
-    hash = "sha256-pe9AxTM+gFSR4/eVfUzay+4bwjoubbYeDPc+avKjlaw=";
+    url = "mirror://sageupstream/configure/configure-3c279ec5712e0fa35c5733e03e010970727d7189.tar.gz";
+    hash = "sha256-3bRlgIUSIq9tDzvI+ZfEd5LMy1qHXdItEwu1say4cx4=";
   };
 
   # Patches needed because of particularities of nix or the way this is packaged.
@@ -40,6 +41,13 @@ stdenv.mkDerivation rec {
     # we can now set the cache dir to be within the .sage directory. This is
     # not strictly necessary, but keeps us from littering in the user's HOME.
     ./patches/sympow-cache.patch
+  ] ++ lib.optionals (stdenv.cc.isClang) [
+    # https://github.com/NixOS/nixpkgs/pull/264126
+    # Dead links in python sysconfig cause LLVM linker warnings, leading to cython doctest failures.
+    ./patches/silence-linker.patch
+
+    # Stack overflows during doctests; this does not change functionality.
+    ./patches/disable-singular-doctest.patch
   ];
 
   # Since sage unfortunately does not release bugfix releases, packagers must
@@ -54,26 +62,9 @@ stdenv.mkDerivation rec {
     # https://github.com/sagemath/sage/issues/34575
     ./patches/disable-slow-glpk-test.patch
 
-    # https://github.com/sagemath/sage/pull/37489, landed in 10.4.beta1
-    (fetchpatch {
-      name = "quaternionalgebra-random-failure.patch";
-      url = "https://github.com/sagemath/sage/commit/1c3f991b9d3c5778e409e5414c6cfcd456113f19.diff";
-      hash = "sha256-uCXchYx26DdxTjR1k2748KCEHPnekKS2fAM7SpyhNvM=";
-    })
-
-    # https://github.com/sagemath/sage/pull/37763, landed in 10.4.beta2
-    (fetchpatch {
-      name = "scipy-fault-tolerance.patch";
-      url = "https://github.com/sagemath/sage/commit/551139c09f26a5da96b1187c3f0dd17b8d80ef84.diff";
-      hash = "sha256-PR4przrZ3ieHaW2nSY7l7VhNfrUupu9yCIrXpeyoAgg=";
-    })
-
-    # first two commits from https://github.com/sagemath/sage/pull/38100
-    (fetchpatch {
-      name = "sphinx-7.3-update.patch";
-      url = "https://github.com/sagemath/sage/compare/10.4.beta7...d2932e142991b442a3eee5dc4f8949e3f7e6fe5c.patch";
-      hash = "sha256-g6w0ImE0d2ocKnbGMQikcz9eI9r3/gESlA1NrQfGimk=";
-    })
+    # compile libs/gap/element.pyx with -O1
+    # a more conservative version of https://github.com/sagemath/sage/pull/37951
+    ./patches/gap-element-crash.patch
   ];
 
   # Patches needed because of package updates. We could just pin the versions of
@@ -83,11 +74,11 @@ stdenv.mkDerivation rec {
   # should come from or be proposed to upstream. This list will probably never
   # be empty since dependencies update all the time.
   packageUpgradePatches = [
-    # https://github.com/sagemath/sage/pull/37492
+    # https://github.com/sagemath/sage/pull/38500, positively reviewed, to land in 10.5.beta3
     (fetchpatch {
-      name = "singular-4.3.2p14-upgrade.patch";
-      url = "https://github.com/sagemath/sage/commit/a0c56816b051e97da44ac0a4e4d4f6915cf7fa0f.diff";
-      sha256 = "sha256-WGMmPeBoj2LUC+2qxWuaJL89QUuGt6axGvxWkpM9LYg=";
+      name = "cython-3.0.11-upgrade.patch";
+      url = "https://patch-diff.githubusercontent.com/raw/sagemath/sage/pull/38500.diff";
+      hash = "sha256-ePfH3Gy1T0UfpoVd3EZowCfy88CbE+yE2MV2itWthsA=";
     })
   ];
 
@@ -112,7 +103,7 @@ stdenv.mkDerivation rec {
 
   installPhase = ''
     cp -r . "$out"
-    tar xkzf ${configure-src} -C "$out"
+    tar xzf ${configure-src} -C "$out"
     rm "$out/configure"
   '';
 }
diff --git a/pkgs/applications/science/math/sage/sage-tests.nix b/pkgs/applications/science/math/sage/sage-tests.nix
index 1a415ae65e96a..e50754986709c 100644
--- a/pkgs/applications/science/math/sage/sage-tests.nix
+++ b/pkgs/applications/science/math/sage/sage-tests.nix
@@ -1,5 +1,6 @@
 { stdenv
 , lib
+, pytest
 , sage-with-env
 , makeWrapper
 , files ? null # "null" means run all tests
@@ -30,6 +31,7 @@ stdenv.mkDerivation {
 
   nativeBuildInputs = [ makeWrapper ];
   buildInputs = [
+    pytest
     sage-with-env
   ];
 
diff --git a/pkgs/applications/science/math/sage/sage.nix b/pkgs/applications/science/math/sage/sage.nix
index 81b55e841d244..cc39624b7f110 100644
--- a/pkgs/applications/science/math/sage/sage.nix
+++ b/pkgs/applications/science/math/sage/sage.nix
@@ -60,6 +60,6 @@ stdenv.mkDerivation rec {
     homepage = "https://www.sagemath.org";
     license = licenses.gpl2Plus;
     maintainers = teams.sage.members;
-    platforms = platforms.linux;
+    platforms = platforms.linux ++ [ "aarch64-darwin" ];
   };
 }
diff --git a/pkgs/applications/science/math/sage/sagelib.nix b/pkgs/applications/science/math/sage/sagelib.nix
index 1552de773d014..1a138eea81d9e 100644
--- a/pkgs/applications/science/math/sage/sagelib.nix
+++ b/pkgs/applications/science/math/sage/sagelib.nix
@@ -6,7 +6,7 @@
 , perl
 , pkg-config
 , sage-setup
-, pythonRelaxDepsHook
+, setuptools
 , gd
 , iml
 , libpng
@@ -63,6 +63,7 @@
 , lrcalc-python
 , matplotlib
 , memory-allocator
+, meson-python
 , mpmath
 , networkx
 , numpy
@@ -79,7 +80,6 @@
 , sphinx
 , sympy
 , typing-extensions
-, nbclassic
 }:
 
 assert (!blas.isILP64) && (!lapack.isILP64);
@@ -103,7 +103,7 @@ buildPythonPackage rec {
     pip # needed to query installed packages
     pkg-config
     sage-setup
-    pythonRelaxDepsHook
+    setuptools
   ];
 
   pythonRelaxDeps = [
@@ -173,6 +173,7 @@ buildPythonPackage rec {
     lrcalc-python
     matplotlib
     memory-allocator
+    meson-python
     mpmath
     networkx
     numpy
@@ -189,8 +190,6 @@ buildPythonPackage rec {
     sphinx
     sympy
     typing-extensions
-
-    nbclassic
   ];
 
   preBuild = ''
diff --git a/pkgs/applications/science/math/scalp/default.nix b/pkgs/applications/science/math/scalp/default.nix
index fc230a11966fb..a4d3dc52e0a96 100644
--- a/pkgs/applications/science/math/scalp/default.nix
+++ b/pkgs/applications/science/math/scalp/default.nix
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
     url = "https://digidev.digi.e-technik.uni-kassel.de/git/scalp.git";
     # mirrored at https://git.sr.ht/~weijia/scalp
     rev = "185b84e4ff967f42cf2de5db4db4e6fa0cc18fb8";
-    sha256 = "sha256-NyMZdJwdD3FR6uweYCclJjfcf3Y24Bns1ViwsmJ5izg=";
+    hash = "sha256-NyMZdJwdD3FR6uweYCclJjfcf3Y24Bns1ViwsmJ5izg=";
   };
 
   nativeBuildInputs = [
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
     lp_solve
   ];
 
-  postPatch = lib.optionalString stdenv.isDarwin ''
+  postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
     substituteInPlace CMakeLists.txt \
       --replace "\''$ORIGIN" "\''${CMAKE_INSTALL_PREFIX}/lib"
   '';
diff --git a/pkgs/applications/science/math/scilab-bin/default.nix b/pkgs/applications/science/math/scilab-bin/default.nix
index f6da20531385b..e3ca7bef52a4b 100644
--- a/pkgs/applications/science/math/scilab-bin/default.nix
+++ b/pkgs/applications/science/math/scilab-bin/default.nix
@@ -100,4 +100,4 @@ let
     '';
   };
 in
-if stdenv.isDarwin then darwin else linux
+if stdenv.hostPlatform.isDarwin then darwin else linux
diff --git a/pkgs/applications/science/math/singular/default.nix b/pkgs/applications/science/math/singular/default.nix
index d1b17eccee23b..fff9c7dfaf903 100644
--- a/pkgs/applications/science/math/singular/default.nix
+++ b/pkgs/applications/science/math/singular/default.nix
@@ -7,6 +7,7 @@
 , getconf
 , flint3
 , ntl
+, mpfr
 , cddlib
 , gfan
 , lrcalc
@@ -15,8 +16,7 @@
 , latex2html
 , texinfo
 , texliveSmall
-, enableDocs ? !stdenv.isDarwin
-, enableGfanlib ? true
+, enableDocs ? true
 }:
 
 stdenv.mkDerivation rec {
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
     # if a release is tagged (which sometimes does not happen), it will
     # be in the format below.
     rev = "Release-${lib.replaceStrings ["."] ["-"] version}";
-    sha256 = "sha256-5JZgI5lnfX4JlBSEAL7Wv6uao/57GBaMqwgslJt9Bjk=";
+    hash = "sha256-5JZgI5lnfX4JlBSEAL7Wv6uao/57GBaMqwgslJt9Bjk=";
 
     # the repository's .gitattributes file contains the lines "/Tst/
     # export-ignore" and "/doc/ export-ignore" so some directories are
@@ -40,12 +40,11 @@ stdenv.mkDerivation rec {
   };
 
   configureFlags = [
+    "--enable-gfanlib"
     "--with-ntl=${ntl}"
-    "--disable-pyobject-module"
+    "--with-flint=${flint3}"
   ] ++ lib.optionals enableDocs [
     "--enable-doc-build"
-  ] ++ lib.optionals enableGfanlib [
-    "--enable-gfanlib"
   ];
 
   prePatch = ''
@@ -61,14 +60,15 @@ stdenv.mkDerivation rec {
   buildInputs = [
     # necessary
     gmp
+    flint3
     # by upstream recommended but optional
     ncurses
     readline
     ntl
-    flint3
+    mpfr
     lrcalc
+    # for gfanlib
     gfan
-  ] ++ lib.optionals enableGfanlib [
     cddlib
   ];
 
@@ -84,7 +84,7 @@ stdenv.mkDerivation rec {
     latex2html
     texinfo
     texliveSmall
-  ] ++ lib.optionals stdenv.isDarwin [ getconf ];
+  ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ getconf ];
   depsBuildBuild = [ buildPackages.stdenv.cc ];
 
   preAutoreconf = ''
@@ -95,11 +95,13 @@ stdenv.mkDerivation rec {
       -i '{}' ';'
   '';
 
-  hardeningDisable = lib.optional stdenv.isi686 "stackprotector";
+  hardeningDisable = lib.optional stdenv.hostPlatform.isi686 "stackprotector";
 
   doCheck = true; # very basic checks, does not test any libraries
 
   installPhase = ''
+    # clean up any artefacts a previous non-sandboxed docbuild may have left behind
+    rm /tmp/conic.log /tmp/conic.tex /tmp/tropicalcurve*.tex || true
     make install
   '' + lib.optionalString enableDocs ''
     # Sage uses singular.info, which is not installed by default
@@ -118,8 +120,8 @@ stdenv.mkDerivation rec {
     "Buch/buch.lst"
     "Plural/short.lst"
     "Old/factor.tst"
-  ] ++ lib.optionals enableGfanlib [
     # tests that require gfanlib
+    # requires "DivRemIdU", a syzextra (undocumented) command
     "Short/ok_s.lst"
   ];
 
diff --git a/pkgs/applications/science/math/speedcrunch/default.nix b/pkgs/applications/science/math/speedcrunch/default.nix
index 021c1bedc348a..ed7339ab56775 100644
--- a/pkgs/applications/science/math/speedcrunch/default.nix
+++ b/pkgs/applications/science/math/speedcrunch/default.nix
@@ -32,6 +32,6 @@ mkDerivation rec {
     '';
     maintainers = with maintainers; [ gebner j0hax ];
     inherit (qtbase.meta) platforms;
-    broken = stdenv.isDarwin;
+    broken = stdenv.hostPlatform.isDarwin;
   };
 }
diff --git a/pkgs/applications/science/math/symmetrica/default.nix b/pkgs/applications/science/math/symmetrica/default.nix
index d6ec352d32a2f..f215ec0037d49 100644
--- a/pkgs/applications/science/math/symmetrica/default.nix
+++ b/pkgs/applications/science/math/symmetrica/default.nix
@@ -23,6 +23,10 @@ stdenv.mkDerivation rec {
     autoreconfHook
   ];
 
+  # clang warning: passing arguments to '...' without a prototype is deprecated
+  # in all versions of C and is not supported in C23.
+  CFLAGS = "-std=c99 -Wno-deprecated-non-prototype";
+
   enableParallelBuilding = true;
 
   meta = with lib; {
diff --git a/pkgs/applications/science/math/wolfram-engine/default.nix b/pkgs/applications/science/math/wolfram-engine/default.nix
index 685bc1bff3b18..c7a1b585379aa 100644
--- a/pkgs/applications/science/math/wolfram-engine/default.nix
+++ b/pkgs/applications/science/math/wolfram-engine/default.nix
@@ -2,8 +2,6 @@
 , stdenv
 , autoPatchelfHook
 , requireFile
-, callPackage
-, makeWrapper
 , alsa-lib
 , dbus
 , fontconfig
@@ -103,9 +101,9 @@ stdenv.mkDerivation rec {
     # Fix the installation script
     patchShebangs MathInstaller
     substituteInPlace MathInstaller \
-      --replace '`hostname`' "" \
-      --replace "chgrp" "# chgrp" \
-      --replace "chown" ": # chown"
+      --replace-fail '`hostname`' "" \
+      --replace-fail "chgrp" "# chgrp" \
+      --replace-fail "chown" ": # chown"
 
     # Install the desktop items
     export XDG_DATA_HOME="$out/share"
@@ -127,7 +125,7 @@ stdenv.mkDerivation rec {
       --set QT_XKB_CONFIG_ROOT "${xkeyboard_config}/share/X11/xkb"
     if ! isELF "$out/libexec/${dirName}/SystemFiles/FrontEnd/Binaries/Linux-x86-64/WolframPlayer"; then
       substituteInPlace $out/libexec/${dirName}/SystemFiles/FrontEnd/Binaries/Linux-x86-64/WolframPlayer \
-        --replace "TopDirectory=" "TopDirectory=$out/libexec/${dirName} #";
+        --replace-fail "TopDirectory=" "TopDirectory=$out/libexec/${dirName} #";
     fi
 
     for path in WolframPlayer wolframplayer; do
diff --git a/pkgs/applications/science/math/wolfram-engine/l10ns.nix b/pkgs/applications/science/math/wolfram-engine/l10ns.nix
index ae1886bae1543..de9b677ab17a4 100644
--- a/pkgs/applications/science/math/wolfram-engine/l10ns.nix
+++ b/pkgs/applications/science/math/wolfram-engine/l10ns.nix
@@ -4,10 +4,17 @@
 , majorVersion ? null
 }:
 
-let allVersions = with lib; flip map
+let allVersions = lib.flip map
   # N.B. Versions in this list should be ordered from newest to oldest.
   [
     {
+      version = "14.1.0";
+      lang = "en";
+      language = "English";
+      sha256 = "1kxdvm3i7nn3ws784y972h2br1n0y82kkkjvz7c5llssv6d3pgj8";
+      installer = "WolframEngine_14.1.0_LIN.sh";
+    }
+    {
       version = "13.3.0";
       lang = "en";
       language = "English";
@@ -45,7 +52,7 @@ let allVersions = with lib; flip map
   ]
   ({ version, lang, language, sha256, installer }: {
     inherit version lang;
-    name = "wolfram-engine-${version}" + optionalString (lang != "en") "-${lang}";
+    name = "wolfram-engine-${version}" + lib.optionalString (lang != "en") "-${lang}";
     src = requireFile {
       name = installer;
       message = ''
@@ -58,14 +65,12 @@ let allVersions = with lib; flip map
     };
   });
 minVersion =
-  with lib;
   if majorVersion == null
-  then elemAt (builtins.splitVersion (elemAt allVersions 0).version) 0
+  then lib.elemAt (builtins.splitVersion (lib.elemAt allVersions 0).version) 0
   else majorVersion;
 maxVersion = toString (1 + builtins.fromJSON minVersion);
 in
-with lib;
-findFirst (l: (l.lang == lang
+lib.findFirst (l: (l.lang == lang
                && l.version >= minVersion
                && l.version < maxVersion))
           (throw "Version ${minVersion} in language ${lang} not supported")
diff --git a/pkgs/applications/science/math/wolfram-engine/notebook.nix b/pkgs/applications/science/math/wolfram-engine/notebook.nix
index 85570eeca7fbc..07cd0afa3099d 100644
--- a/pkgs/applications/science/math/wolfram-engine/notebook.nix
+++ b/pkgs/applications/science/math/wolfram-engine/notebook.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, writeScriptBin, jupyter, wolfram-for-jupyter-kernel }:
+{ stdenv, writeScriptBin, jupyter, wolfram-for-jupyter-kernel }:
 
 let
   wolfram-jupyter = jupyter.override { definitions = { wolfram = wolfram-for-jupyter-kernel.definition; }; };
diff --git a/pkgs/applications/science/math/wxmaxima/default.nix b/pkgs/applications/science/math/wxmaxima/default.nix
index db2ff0c4a8444..2a6225eab7653 100644
--- a/pkgs/applications/science/math/wxmaxima/default.nix
+++ b/pkgs/applications/science/math/wxmaxima/default.nix
@@ -6,7 +6,7 @@
 , gettext
 , maxima
 , wxGTK
-, gnome
+, adwaita-icon-theme
 , glib
 }:
 
@@ -25,7 +25,7 @@ stdenv.mkDerivation (finalAttrs:{
     wxGTK
     maxima
     # So it won't embed svg files into headers.
-    gnome.adwaita-icon-theme
+    adwaita-icon-theme
     # So it won't crash under Sway.
     glib
   ];
diff --git a/pkgs/applications/science/math/yacas/default.nix b/pkgs/applications/science/math/yacas/default.nix
index 7fa2fe1a6075e..ad4e3f37d07ff 100644
--- a/pkgs/applications/science/math/yacas/default.nix
+++ b/pkgs/applications/science/math/yacas/default.nix
@@ -80,7 +80,7 @@ stdenv.mkDerivation rec {
     description = "Easy to use, general purpose Computer Algebra System${lib.optionalString enableGui ", built with GUI."}";
     homepage = "http://www.yacas.org/";
     license = lib.licenses.gpl2Plus;
-    maintainers = with lib.maintainers; [ viric ];
+    maintainers = [ ];
     platforms = with lib.platforms; linux;
   };
 }
diff --git a/pkgs/applications/science/medicine/dcmtk/default.nix b/pkgs/applications/science/medicine/dcmtk/default.nix
index 0fa41ba08760f..8dc85e2ee1077 100644
--- a/pkgs/applications/science/medicine/dcmtk/default.nix
+++ b/pkgs/applications/science/medicine/dcmtk/default.nix
@@ -1,7 +1,6 @@
 { lib, stdenv, fetchFromGitHub, zlib, libtiff, libxml2, openssl, libiconv
 , libpng, cmake }:
 
-with lib;
 stdenv.mkDerivation rec {
   pname = "dcmtk";
   version = "3.6.8";
@@ -17,7 +16,7 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  meta = {
+  meta = with lib; {
     description =
       "Collection of libraries and applications implementing large parts of the DICOM standard";
     longDescription = ''
diff --git a/pkgs/applications/science/medicine/xmedcon/default.nix b/pkgs/applications/science/medicine/xmedcon/default.nix
index 1f0686cc0dad0..b4170dfa228a7 100644
--- a/pkgs/applications/science/medicine/xmedcon/default.nix
+++ b/pkgs/applications/science/medicine/xmedcon/default.nix
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ pkg-config wrapGAppsHook3 ];
 
   meta = with lib; {
-    description = "Open source toolkit for medical image conversion ";
+    description = "Open source toolkit for medical image conversion";
     homepage = "https://xmedcon.sourceforge.net/";
     license = licenses.lgpl2Plus;
     maintainers = with maintainers; [ arianvp flokli ];
diff --git a/pkgs/applications/science/misc/bada-bib/default.nix b/pkgs/applications/science/misc/bada-bib/default.nix
index 83abd40030ee5..fba3726329094 100644
--- a/pkgs/applications/science/misc/bada-bib/default.nix
+++ b/pkgs/applications/science/misc/bada-bib/default.nix
@@ -7,7 +7,6 @@
 , gdk-pixbuf
 , gettext
 , glib
-, gnome
 , gobject-introspection
 , gtk4
 , gtksourceview5
diff --git a/pkgs/applications/science/misc/boinc/default.nix b/pkgs/applications/science/misc/boinc/default.nix
index 68134a99a2035..b8b57857c02aa 100644
--- a/pkgs/applications/science/misc/boinc/default.nix
+++ b/pkgs/applications/science/misc/boinc/default.nix
@@ -10,7 +10,7 @@
 , libGL
 , libXmu
 , libXi
-, freeglut
+, libglut
 , libjpeg
 , libtool
 , wxGTK32
@@ -27,14 +27,14 @@
 
 stdenv.mkDerivation rec {
   pname = "boinc";
-  version = "8.0.3";
+  version = "8.0.4";
 
   src = fetchFromGitHub {
     name = "${pname}-${version}-src";
     owner = "BOINC";
     repo = "boinc";
     rev = "client_release/${lib.versions.majorMinor version}/${version}";
-    hash = "sha256-kkEEJp7NTpHwbo03BGjjJAraFQIJcoNyV+oDsCZlzPQ=";
+    hash = "sha256-dp0zRMIG0PGXhth+Cc8FDhzl5X/4ud3GFCdE7wqPL/c=";
   };
 
   nativeBuildInputs = [ libtool automake autoconf m4 pkg-config ];
@@ -48,7 +48,7 @@ stdenv.mkDerivation rec {
     libGL
     libXmu
     libXi
-    freeglut
+    libglut
     libjpeg
     wxGTK32
     gtk3
diff --git a/pkgs/applications/science/misc/colmap/default.nix b/pkgs/applications/science/misc/colmap/default.nix
index d071c90562cd4..59e58351c0f6b 100644
--- a/pkgs/applications/science/misc/colmap/default.nix
+++ b/pkgs/applications/science/misc/colmap/default.nix
@@ -1,43 +1,62 @@
-{ mkDerivation, lib, fetchFromGitHub, cmake, boost179, ceres-solver, eigen,
+{ lib, fetchFromGitHub, cmake, boost179, ceres-solver, eigen,
   freeimage, glog, libGLU, glew, qtbase,
+  flann,
+  cgal,
+  gmp,
+  mpfr,
   autoAddDriverRunpath,
   config,
-  cudaSupport ? config.cudaSupport, cudaPackages
+  stdenv,
+  qt5,
+  xorg,
+  cudaSupport ? config.cudaSupport,
+  cudaCapabilities ? cudaPackages.cudaFlags.cudaCapabilities,
+  cudaPackages
 }:
 
 assert cudaSupport -> cudaPackages != { };
 
 let
   boost_static = boost179.override { enableStatic = true; };
+  stdenv' = if cudaSupport then cudaPackages.backendStdenv else stdenv;
 
   # TODO: migrate to redist packages
   inherit (cudaPackages) cudatoolkit;
 in
-mkDerivation rec {
-  version = "3.7";
+stdenv'.mkDerivation rec {
+  version = "3.9.1";
   pname = "colmap";
   src = fetchFromGitHub {
      owner = "colmap";
      repo = "colmap";
      rev = version;
-     hash = "sha256-uVAw6qwhpgIpHkXgxttKupU9zU+vD0Za0maw2Iv4x+I=";
+     hash = "sha256-Xb4JOttCMERwPYs5DyGKHw+f9Wik1/rdJQKbgVuygH8=";
   };
 
-  # TODO: rm once the gcc11 issue is closed, https://github.com/colmap/colmap/issues/1418#issuecomment-1049305256
   cmakeFlags = lib.optionals cudaSupport [
-    "-DCUDA_ENABLED=ON"
-    "-DCUDA_NVCC_FLAGS=--std=c++14"
+    (lib.cmakeBool "CUDA_ENABLED" true)
+    (lib.cmakeFeature "CMAKE_CUDA_ARCHITECTURES"
+      (lib.strings.concatStringsSep ";"
+        (map cudaPackages.cudaFlags.dropDot
+          cudaCapabilities)))
   ];
 
   buildInputs = [
     boost_static ceres-solver eigen
     freeimage glog libGLU glew qtbase
+    flann
+    cgal
+    gmp
+    mpfr
+    xorg.libSM
   ] ++ lib.optionals cudaSupport [
     cudatoolkit
+    cudaPackages.cuda_cudart.static
   ];
 
   nativeBuildInputs = [
     cmake
+    qt5.wrapQtAppsHook
   ] ++ lib.optionals cudaSupport [
     autoAddDriverRunpath
   ];
diff --git a/pkgs/applications/science/misc/cwltool/default.nix b/pkgs/applications/science/misc/cwltool/default.nix
index ab43eac8bffb0..1c616866a173d 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.20240508115724";
+  version = "3.1.20240708091337";
   pyproject = true;
 
   src = fetchFromGitHub {
     owner = "common-workflow-language";
     repo = "cwltool";
     rev = "refs/tags/${version}";
-    hash = "sha256-hBP/8PIqvs820UsxrRuyMVIWgQGFVcMHCUToxhcupTk=";
+    hash = "sha256-Umxh8sRBy7fC6+GrcN1q4iO0KVpmUhGPtnqZZK/6c9M=";
   };
 
   postPatch = ''
@@ -24,7 +24,8 @@ python3.pkgs.buildPythonApplication rec {
       --replace '"schema-salad >= 8.4.20230426093816, < 9",' "" \
       --replace "PYTEST_RUNNER + " ""
     substituteInPlace pyproject.toml \
-      --replace "ruamel.yaml>=0.16.0,<0.18" "ruamel.yaml"
+      --replace "ruamel.yaml>=0.16.0,<0.18" "ruamel.yaml" \
+      --replace "mypy==1.10.0" "mypy==1.10.*"
   '';
 
   nativeBuildInputs = [
diff --git a/pkgs/applications/science/misc/fityk/default.nix b/pkgs/applications/science/misc/fityk/default.nix
index 5ec7973065d2f..ed906e7d4c3df 100644
--- a/pkgs/applications/science/misc/fityk/default.nix
+++ b/pkgs/applications/science/misc/fityk/default.nix
@@ -10,7 +10,7 @@
 , xylib
 , readline
 , gnuplot
-, swig3
+, swig
 }:
 
 stdenv.mkDerivation rec {
@@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
     xylib
     readline
     gnuplot
-    swig3
+    swig
   ];
 
   env.NIX_CFLAGS_COMPILE = toString [
diff --git a/pkgs/applications/science/misc/foldingathome/client.nix b/pkgs/applications/science/misc/foldingathome/client.nix
index 6ff159cc54cbe..15dbdf169e539 100644
--- a/pkgs/applications/science/misc/foldingathome/client.nix
+++ b/pkgs/applications/science/misc/foldingathome/client.nix
@@ -13,13 +13,13 @@
 , extraPkgs ? [ ]
 }:
 let
-  version = "8.3.7";
+  version = "8.3.18";
 
   cbangSrc = fetchFromGitHub {
     owner = "cauldrondevelopmentllc";
     repo = "cbang";
     rev = "bastet-v${version}";
-    sha256 = "sha256-acAImItdkgo6PBFL6Vu/caIdcnvp/3VEW2lgVDgKy9g=";
+    sha256 = "sha256-BQNomjz6Bhod3FOC5iICwt1rPrZgIxGQ08yspSvAnJc=";
   };
 
   fah-client = stdenv.mkDerivation {
@@ -30,7 +30,7 @@ let
       owner = "FoldingAtHome";
       repo = "fah-client-bastet";
       rev = "v${version}";
-      sha256 = "sha256-d+LY/R4TAko+2e2W76KEBQ8fXj0hzzmBOm+c4tksXMA=";
+      sha256 = "sha256-lqpC1fAMFb8iX02daVre/pE0c7DkwswlFigJS3ZGEjM=";
     };
 
     nativeBuildInputs = [ scons re2 libevent git ];
diff --git a/pkgs/applications/science/misc/foldingathome/control.nix b/pkgs/applications/science/misc/foldingathome/control.nix
deleted file mode 100644
index a64c973914c66..0000000000000
--- a/pkgs/applications/science/misc/foldingathome/control.nix
+++ /dev/null
@@ -1,57 +0,0 @@
-{ lib, stdenv
-, dpkg
-, fahviewer
-, fetchurl
-, makeWrapper
-, python2
-}:
-let
-  majMin = lib.versions.majorMinor version;
-  version = "7.6.21";
-
-  python = python2.withPackages
-    (
-      ps: [
-        ps.pycairo
-        ps.pygobject2
-        ps.pygtk
-      ]
-    );
-in
-stdenv.mkDerivation rec {
-  inherit version;
-  pname = "fahcontrol";
-
-  src = fetchurl {
-    url = "https://download.foldingathome.org/releases/public/release/fahcontrol/debian-stable-64bit/v${majMin}/fahcontrol_${version}-1_all.deb";
-    sha256 = "1vfrdqkrvdlyxaw3f6z92w5dllrv6810lmf8yhcmjcwmphipvf71";
-  };
-
-  nativeBuildInputs = [
-    dpkg
-    makeWrapper
-  ];
-
-  buildInputs = [ fahviewer python ];
-
-  unpackPhase = ''
-    dpkg-deb -x ${src} ./
-  '';
-
-  installPhase = "cp -ar usr $out";
-
-  postFixup = ''
-    sed -e "s|/usr/bin|$out/bin|g" -i $out/share/applications/FAHControl.desktop
-    wrapProgram "$out/bin/FAHControl" \
-      --suffix PATH : "${fahviewer.outPath}/bin" \
-      --set PYTHONPATH "$out/lib/python2.7/dist-packages"
-  '';
-
-  meta = {
-    description = "Folding@home control";
-    homepage = "https://foldingathome.org/";
-    license = lib.licenses.unfree;
-    maintainers = [ lib.maintainers.zimbatm ];
-    platforms = [ "x86_64-linux" ];
-  };
-}
diff --git a/pkgs/applications/science/misc/foldingathome/viewer.nix b/pkgs/applications/science/misc/foldingathome/viewer.nix
deleted file mode 100644
index 7f28c8d1b1463..0000000000000
--- a/pkgs/applications/science/misc/foldingathome/viewer.nix
+++ /dev/null
@@ -1,56 +0,0 @@
-{ lib, stdenv
-, autoPatchelfHook
-, dpkg
-, fetchurl
-, freeglut
-, gcc-unwrapped
-, libGL
-, libGLU
-, makeWrapper
-, zlib
-}:
-let
-  majMin = lib.versions.majorMinor version;
-  version = "7.6.21";
-in
-stdenv.mkDerivation rec {
-  inherit version;
-  pname = "fahviewer";
-
-  src = fetchurl {
-    url = "https://download.foldingathome.org/releases/public/release/fahviewer/debian-stable-64bit/v${majMin}/fahviewer_${version}_amd64.deb";
-    sha256 = "00fd00pf6fcpplcaahvy9ir60mk69d9rcmwsyq3jrv9mxqm9aq7p";
-  };
-
-  nativeBuildInputs = [
-    autoPatchelfHook
-    dpkg
-    makeWrapper
-  ];
-
-  buildInputs = [
-    freeglut
-    gcc-unwrapped.lib
-    libGL
-    libGLU
-    zlib
-  ];
-
-  unpackPhase = ''
-    dpkg-deb -x ${src} ./
-    sed -e "s|/usr/bin|$out/bin|g" -i usr/share/applications/FAHViewer.desktop
-  '';
-
-  installPhase = ''
-    cp -ar usr $out
-  '';
-
-  meta = {
-    description = "Folding@home viewer";
-    homepage = "https://foldingathome.org/";
-    sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ];
-    license = lib.licenses.unfree;
-    maintainers = [ lib.maintainers.zimbatm ];
-    platforms = [ "x86_64-linux" ];
-  };
-}
diff --git a/pkgs/applications/science/misc/gephi/default.nix b/pkgs/applications/science/misc/gephi/default.nix
index 77b6584412a5a..fe638bde1ba46 100644
--- a/pkgs/applications/science/misc/gephi/default.nix
+++ b/pkgs/applications/science/misc/gephi/default.nix
@@ -1,11 +1,6 @@
 { lib, fetchFromGitHub, jdk11, maven, jogl }:
 
-let
-  mavenJdk11 = maven.override {
-    jdk = jdk11;
-  };
-in
-mavenJdk11.buildMavenPackage rec {
+maven.buildMavenPackage rec {
   pname = "gephi";
   version = "0.10.1";
 
@@ -16,6 +11,7 @@ mavenJdk11.buildMavenPackage rec {
     hash = "sha256-ZNSEaiD32zFfF2ISKa1CmcT9Nq6r5i2rNHooQAcVbn4=";
   };
 
+  mvnJdk = jdk11;
   mvnHash = "sha256-/2/Yb26Ry0NHQQ3j0LXnjwC0wQqJiztvTgWixyMJqvg=";
 
   nativeBuildInputs = [ jdk11 ];
diff --git a/pkgs/applications/science/misc/golly/default.nix b/pkgs/applications/science/misc/golly/default.nix
index 52b05cbb7e9b2..b509387fe8838 100644
--- a/pkgs/applications/science/misc/golly/default.nix
+++ b/pkgs/applications/science/misc/golly/default.nix
@@ -12,6 +12,10 @@ stdenv.mkDerivation rec {
     wxGTK perl python3 zlib libGLU libGL libX11 SDL2
   ];
 
+  nativeBuildInputs = [
+    (python3.withPackages (ps: [ps.setuptools]))
+  ];
+
   setSourceRoot = ''
     sourceRoot=$(echo */gui-wx)
   '';
diff --git a/pkgs/applications/science/misc/gplates/default.nix b/pkgs/applications/science/misc/gplates/default.nix
index 5c2c4cabc9f12..72504246b6c0a 100644
--- a/pkgs/applications/science/misc/gplates/default.nix
+++ b/pkgs/applications/science/misc/gplates/default.nix
@@ -1,6 +1,7 @@
 { lib
 , stdenv
 , fetchFromGitHub
+, fetchpatch
 , cmake
 , doxygen
 , graphviz
@@ -42,6 +43,14 @@ in stdenv.mkDerivation (finalAttrs: {
     hash = "sha256-3fEwm5EKK9RcRbnyUejgwfjdsXaujjZjoMbq/BbVMeM=";
   };
 
+  patches = [
+    (fetchpatch {
+      name = "qwt-6.3-compile-error-fix.patch";
+      url = "https://github.com/GPlates/GPlates/commit/c4680ebe54f4535909085feacecd66410a91ff98.patch";
+      hash = "sha256-mw5+GLayMrmcSDd1ai+0JTuY3iedHT9u2kx5Dd2wMjg=";
+    })
+  ];
+
   nativeBuildInputs = [
     cmake
     doxygen
@@ -71,6 +80,6 @@ in stdenv.mkDerivation (finalAttrs: {
     homepage = "https://www.gplates.org";
     license = licenses.gpl2Only;
     platforms = platforms.all;
-    broken = stdenv.isDarwin; # FIX: this check: https://github.com/GPlates/GPlates/blob/gplates/cmake/modules/Config_h.cmake#L72
+    broken = stdenv.hostPlatform.isDarwin; # FIX: this check: https://github.com/GPlates/GPlates/blob/gplates/cmake/modules/Config_h.cmake#L72
   };
 })
diff --git a/pkgs/applications/science/misc/graphia/default.nix b/pkgs/applications/science/misc/graphia/default.nix
index a5055220e95fb..88fc3a8c0e570 100644
--- a/pkgs/applications/science/misc/graphia/default.nix
+++ b/pkgs/applications/science/misc/graphia/default.nix
@@ -46,7 +46,7 @@ stdenv.mkDerivation rec {
 
   meta = with lib; {
     # never built on Hydra https://hydra.nixos.org/job/nixpkgs/trunk/graphia.x86_64-darwin
-    broken = (stdenv.isLinux && stdenv.isAarch64) || stdenv.isDarwin;
+    broken = (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) || stdenv.hostPlatform.isDarwin;
     description = "Visualisation tool for the creation and analysis of graphs";
     homepage = "https://graphia.app";
     license = licenses.gpl3Only;
diff --git a/pkgs/applications/science/misc/openmvg/default.nix b/pkgs/applications/science/misc/openmvg/default.nix
index f622f87d2e412..a535f436ddb19 100644
--- a/pkgs/applications/science/misc/openmvg/default.nix
+++ b/pkgs/applications/science/misc/openmvg/default.nix
@@ -73,7 +73,7 @@ stdenv.mkDerivation rec {
   passthru.updateScript = nix-update-script { };
 
   meta = {
-    broken = stdenv.isDarwin && stdenv.isx86_64;
+    broken = stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64;
     description = "Library for computer-vision scientists and targeted for the Multiple View Geometry community";
     homepage = "https://openmvg.readthedocs.io/en/latest/";
     license = lib.licenses.mpl20;
diff --git a/pkgs/applications/science/misc/openmvs/default.nix b/pkgs/applications/science/misc/openmvs/default.nix
index 35f46f7a4552b..689ce1ad554ca 100644
--- a/pkgs/applications/science/misc/openmvs/default.nix
+++ b/pkgs/applications/science/misc/openmvs/default.nix
@@ -33,12 +33,12 @@ stdenv.mkDerivation rec {
     owner = "cdcseacave";
     repo = "openmvs";
     rev = "v${version}";
-    sha256 = "sha256-j/tGkR73skZiU+bP4j6aZ5CxkbIcHtqKcaUTgNvj0C8=";
+    hash = "sha256-j/tGkR73skZiU+bP4j6aZ5CxkbIcHtqKcaUTgNvj0C8=";
     fetchSubmodules = true;
   };
 
   # SSE is enabled by default
-  cmakeFlags = lib.optional (!stdenv.isx86_64) "-DOpenMVS_USE_SSE=OFF";
+  cmakeFlags = lib.optional (!stdenv.hostPlatform.isx86_64) "-DOpenMVS_USE_SSE=OFF";
 
   buildInputs = [
     boostWithZstd
diff --git a/pkgs/applications/science/misc/openrefine/default.nix b/pkgs/applications/science/misc/openrefine/default.nix
index b94f23671024b..60615b6f09260 100644
--- a/pkgs/applications/science/misc/openrefine/default.nix
+++ b/pkgs/applications/science/misc/openrefine/default.nix
@@ -7,20 +7,15 @@
 , jq
 , makeWrapper
 , maven
-, writeText
 }:
 
 let
-  maven' = maven.override {
-    inherit jdk;
-  };
-
-  version = "3.8.1";
+  version = "3.8.2";
   src = fetchFromGitHub {
     owner = "openrefine";
     repo = "openrefine";
     rev = version;
-    hash = "sha256-MnFwFJdKIU7D8GQgnDvCO+P8r8h1Se/wmbt/Z3EX+3Q=";
+    hash = "sha256-3KCO9ooYN8PPVirU2wh7wu4feHqugc3JSXWR2aWIanE=";
   };
 
   npmPkg = buildNpmPackage {
@@ -47,7 +42,7 @@ let
     '';
   };
 
-in maven'.buildMavenPackage {
+in maven.buildMavenPackage {
   inherit src version;
 
   pname = "openrefine";
@@ -55,8 +50,10 @@ in maven'.buildMavenPackage {
   postPatch = ''
     cp -r ${npmPkg} main/webapp/modules/core/3rdparty
   '';
+
+  mvnJdk = jdk;
   mvnParameters = "-pl !packaging";
-  mvnHash = "sha256-0qsKUMV9M0ZaddR5ust8VikSrsutdxVNNezKqR+F/6M=";
+  mvnHash = "sha256-AuZp+uq5bmb4gnzKvqXeTmBrsCT6qmJOrwtJq9iCkRQ=";
 
   nativeBuildInputs = [ makeWrapper ];
 
@@ -123,7 +120,7 @@ in maven'.buildMavenPackage {
       fromSource
       binaryBytecode  # maven dependencies
     ];
-    broken = stdenv.isDarwin;  # builds, doesn't run
+    broken = stdenv.hostPlatform.isDarwin;  # builds, doesn't run
     mainProgram = "refine";
   };
 }
diff --git a/pkgs/applications/science/misc/reason-shell/default.nix b/pkgs/applications/science/misc/reason-shell/default.nix
index 5491593cc7f70..015b5c97ebf31 100644
--- a/pkgs/applications/science/misc/reason-shell/default.nix
+++ b/pkgs/applications/science/misc/reason-shell/default.nix
@@ -26,7 +26,7 @@ rustPlatform.buildRustPackage rec {
 
   buildInputs = [
     openssl
-  ] ++ lib.optionals stdenv.isDarwin [
+  ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
     darwin.apple_sdk.frameworks.CoreServices
   ];
 
diff --git a/pkgs/applications/science/misc/rink/default.nix b/pkgs/applications/science/misc/rink/default.nix
index 6b5917e163287..c0b33b3cbedb2 100644
--- a/pkgs/applications/science/misc/rink/default.nix
+++ b/pkgs/applications/science/misc/rink/default.nix
@@ -1,5 +1,5 @@
 { lib, stdenv, fetchFromGitHub, rustPlatform, openssl, pkg-config, ncurses
-, curl, libiconv, Security }:
+, curl, installShellFiles, asciidoctor, libiconv, Security }:
 
 rustPlatform.buildRustPackage rec {
   version = "0.8.0";
@@ -14,13 +14,21 @@ rustPlatform.buildRustPackage rec {
 
   cargoHash = "sha256-j1pQfMjDNu57otOBTVBQEZIx80p4/beEUQdUkAJhvso=";
 
-  nativeBuildInputs = [ pkg-config ];
+  nativeBuildInputs = [ pkg-config installShellFiles asciidoctor ];
   buildInputs = [ ncurses ]
-    ++ (if stdenv.isDarwin then [ curl libiconv Security ] else [ openssl ]);
+    ++ (if stdenv.hostPlatform.isDarwin then [ curl libiconv Security ] else [ openssl ]);
 
   # Some tests fail and/or attempt to use internet servers.
   doCheck = false;
 
+  postBuild = ''
+    make man
+  '';
+
+  postInstall = ''
+    installManPage build/*
+  '';
+
   meta = with lib; {
     description = "Unit-aware calculator";
     mainProgram = "rink";
diff --git a/pkgs/applications/science/misc/root/5.nix b/pkgs/applications/science/misc/root/5.nix
index 80f2df0688da3..62f80ee48096a 100644
--- a/pkgs/applications/science/misc/root/5.nix
+++ b/pkgs/applications/science/misc/root/5.nix
@@ -35,8 +35,8 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake pkg-config ];
   buildInputs = [ pcre python3 zlib libxml2 lz4 xz gsl xxHash libxcrypt ]
-    ++ lib.optionals (!stdenv.isDarwin) [ libX11 libXpm libXft libXext libGLU libGL ]
-    ++ lib.optionals (stdenv.isDarwin) [ Cocoa OpenGL ]
+    ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ libX11 libXpm libXft libXext libGLU libGL ]
+    ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ Cocoa OpenGL ]
   ;
 
   patches = [
@@ -147,7 +147,7 @@ stdenv.mkDerivation rec {
     "-Dxml=ON"
     "-Dxrootd=OFF"
   ]
-  ++ lib.optional stdenv.isDarwin "-DOPENGL_INCLUDE_DIR=${OpenGL}/Library/Frameworks";
+  ++ lib.optional stdenv.hostPlatform.isDarwin "-DOPENGL_INCLUDE_DIR=${OpenGL}/Library/Frameworks";
 
   setupHook = ./setup-hook.sh;
 
@@ -155,7 +155,7 @@ stdenv.mkDerivation rec {
     homepage = "https://root.cern.ch/";
     description = "Data analysis framework";
     platforms = platforms.unix;
-    broken = !stdenv.isx86_64 || stdenv.cc.isClang or false;
+    broken = !stdenv.hostPlatform.isx86_64 || stdenv.cc.isClang or false;
     maintainers = with maintainers; [ veprbl ];
     license = licenses.lgpl21;
   };
diff --git a/pkgs/applications/science/misc/root/default.nix b/pkgs/applications/science/misc/root/default.nix
index ded47a661a21a..32de529c55449 100644
--- a/pkgs/applications/science/misc/root/default.nix
+++ b/pkgs/applications/science/misc/root/default.nix
@@ -56,7 +56,7 @@
 
 stdenv.mkDerivation rec {
   pname = "root";
-  version = "6.32.00";
+  version = "6.32.06";
 
   passthru = {
     tests = import ./tests { inherit callPackage; };
@@ -64,13 +64,15 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "https://root.cern.ch/download/root_v${version}.source.tar.gz";
-    hash = "sha256-EvIDaBpZBBxHTOlSN2Hm8OiGGzvueN9feZqNtVGJ5dI=";
+    hash = "sha256-P8Ay2T/oSN6lrbG0fY8KhieVIyk/7gqis81Sof+rckc=";
   };
 
   clad_src = fetchgit {
     url = "https://github.com/vgvassilev/clad";
-    rev = "refs/tags/v1.5"; # Make sure that this is the same tag as in the ROOT build files!
-    hash = "sha256-s0DbHfLthv51ZICnTd30O4qG/DyZPk5tADeu3bBRoOw=";
+    # Make sure that this is the same tag as in the ROOT build files!
+    # https://github.com/root-project/root/blob/master/interpreter/cling/tools/plugins/clad/CMakeLists.txt#L76
+    rev = "refs/tags/v1.7";
+    hash = "sha256-iKrZsuUerrlrjXBrxcTsFu/t0Pb0sa4UlfSwd1yhg3g=";
   };
 
   nativeBuildInputs = [ makeWrapper cmake pkg-config git ];
@@ -107,8 +109,8 @@ stdenv.mkDerivation rec {
     tbb
     xrootd
   ]
-  ++ lib.optionals (!stdenv.isDarwin) [ libX11 libXpm libXft libXext libGLU libGL ]
-  ++ lib.optionals (stdenv.isDarwin) [ Cocoa CoreSymbolication OpenGL ]
+  ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ libX11 libXpm libXft libXext libGLU libGL ]
+  ++ lib.optionals (stdenv.hostPlatform.isDarwin) [ Cocoa CoreSymbolication OpenGL ]
   ;
 
   patches = [
@@ -122,22 +124,22 @@ stdenv.mkDerivation rec {
       fi
     done
     substituteInPlace cmake/modules/SearchInstalledSoftware.cmake \
-      --replace 'set(lcgpackages ' '#set(lcgpackages '
+      --replace-fail 'set(lcgpackages ' '#set(lcgpackages '
 
     # We have to bypass the connection check, because it would disable clad.
     # This should probably be fixed upstream with a flag to disable the
     # connectivity check!
     substituteInPlace CMakeLists.txt \
-      --replace 'if(clad AND NO_CONNECTION)' 'if(FALSE)'
+      --replace-fail 'if(clad AND NO_CONNECTION)' 'if(FALSE)'
     # Make sure that clad is not downloaded when building
     substituteInPlace interpreter/cling/tools/plugins/clad/CMakeLists.txt \
-      --replace 'UPDATE_COMMAND ""' 'SOURCE_DIR ${clad_src} DOWNLOAD_COMMAND "" UPDATE_COMMAND ""'
+      --replace-fail 'UPDATE_COMMAND ""' 'SOURCE_DIR ${clad_src} DOWNLOAD_COMMAND "" UPDATE_COMMAND ""'
     # Make sure that clad is finding the right llvm version
     substituteInPlace interpreter/cling/tools/plugins/clad/CMakeLists.txt \
-      --replace '-DLLVM_DIR=''${LLVM_BINARY_DIR}' '-DLLVM_DIR=${llvm_16.dev}/lib/cmake/llvm'
+      --replace-fail '-DLLVM_DIR=''${LLVM_BINARY_DIR}' '-DLLVM_DIR=${llvm_16.dev}/lib/cmake/llvm'
 
     substituteInPlace interpreter/llvm-project/clang/tools/driver/CMakeLists.txt \
-      --replace 'add_clang_symlink(''${link} clang)' ""
+      --replace-fail 'add_clang_symlink(''${link} clang)' ""
 
     # Don't require textutil on macOS
     : > cmake/modules/RootCPack.cmake
@@ -147,11 +149,11 @@ stdenv.mkDerivation rec {
       -e '1iset(nlohmann_json_DIR "${nlohmann_json}/lib/cmake/nlohmann_json/")'
 
     patchShebangs build/unix/
-  '' + lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.hostPlatform.isDarwin ''
     # Eliminate impure reference to /System/Library/PrivateFrameworks
     substituteInPlace core/macosx/CMakeLists.txt \
-      --replace "-F/System/Library/PrivateFrameworks " ""
-  '' + lib.optionalString (stdenv.isDarwin && lib.versionAtLeast stdenv.hostPlatform.darwinMinVersion "11") ''
+      --replace-fail "-F/System/Library/PrivateFrameworks " ""
+  '' + lib.optionalString (stdenv.hostPlatform.isDarwin && lib.versionAtLeast stdenv.hostPlatform.darwinMinVersion "11") ''
     MACOSX_DEPLOYMENT_TARGET=10.16
   '';
 
@@ -163,14 +165,14 @@ stdenv.mkDerivation rec {
     "-Dfail-on-missing=ON"
     "-Dfitsio=OFF"
     "-Dgnuinstall=ON"
+    "-Dmathmore=ON"
     "-Dmysql=OFF"
     "-Dpgsql=OFF"
     "-Dsqlite=OFF"
-    "-Dtmva-pymva=OFF"
     "-Dvdt=OFF"
   ]
   ++ lib.optional (stdenv.cc.libc != null) "-DC_INCLUDE_DIRS=${lib.getDev stdenv.cc.libc}/include"
-  ++ lib.optionals stdenv.isDarwin [
+  ++ lib.optionals stdenv.hostPlatform.isDarwin [
     "-DOPENGL_INCLUDE_DIR=${OpenGL}/Library/Frameworks"
 
     # fatal error: module map file '/nix/store/<hash>-Libsystem-osx-10.12.6/include/module.modulemap' not found
@@ -222,6 +224,9 @@ stdenv.mkDerivation rec {
     ]}"
   '';
 
+  # error: aligned allocation function of type 'void *(std::size_t, std::align_val_t)' is only available on macOS 10.13 or newer
+  CXXFLAGS = lib.optional (stdenv.hostPlatform.system == "x86_64-darwin") "-faligned-allocation";
+
   # To use the debug information on the fly (without installation)
   # add the outPath of root.debug into NIX_DEBUG_INFO_DIRS (in PATH-like format)
   # and make sure that gdb from Nixpkgs can be found in PATH.
diff --git a/pkgs/applications/science/misc/root/tests/test-thisroot.nix b/pkgs/applications/science/misc/root/tests/test-thisroot.nix
index 3540dde8c9138..3610e23acbffb 100644
--- a/pkgs/applications/science/misc/root/tests/test-thisroot.nix
+++ b/pkgs/applications/science/misc/root/tests/test-thisroot.nix
@@ -3,7 +3,6 @@
 , root
 , bash
 , fish
-, ksh
 , tcsh
 , zsh
 }: runCommand "test-thisroot"
diff --git a/pkgs/applications/science/misc/sasview/xhtml2pdf.nix b/pkgs/applications/science/misc/sasview/xhtml2pdf.nix
deleted file mode 100644
index b7ace57d74afc..0000000000000
--- a/pkgs/applications/science/misc/sasview/xhtml2pdf.nix
+++ /dev/null
@@ -1,33 +0,0 @@
-{lib, fetchPypi, buildPythonPackage, html5lib, httplib2, nose, pillow, pypdf2, reportlab}:
-
-let
-  #xhtml2pdf specifically requires version "1.0b10" of html5lib
-  html5 = html5lib.overrideAttrs( oldAttrs: rec {
-    name = "${oldAttrs.pname}-${version}";
-    version = "1.0b10";
-    src = oldAttrs.src.override {
-      inherit version;
-      sha256 = "1yd068a5c00wd0ajq0hqimv7fd82lhrw0w3s01vbhy9bbd6xapqd";
-    };
-  });
-in
-
-buildPythonPackage rec {
-  pname = "xhtml2pdf";
-  version = "0.2.1";
-
-  buildInputs = [html5];
-  propagatedBuildInputs = [httplib2 nose pillow pypdf2 reportlab html5];
-
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "1n9r8zdk9gc2x539fq60bhszmd421ipj8g78zmsn3njvma1az9k1";
-  };
-
-  meta = {
-    description = "Pdf converter for the ReportLab Toolkit";
-    homepage = "https://github.com/xhtml2pdf/xhtml2pdf";
-    license = lib.licenses.asl20;
-    maintainers = with lib.maintainers; [ rprospero ];
-  };
-}
diff --git a/pkgs/applications/science/misc/simgrid/default.nix b/pkgs/applications/science/misc/simgrid/default.nix
index a2b04e1877f89..40202b8dbaccf 100644
--- a/pkgs/applications/science/misc/simgrid/default.nix
+++ b/pkgs/applications/science/misc/simgrid/default.nix
@@ -12,12 +12,6 @@
 , withoutBin ? false
 }:
 
-with lib;
-
-let
-  optionOnOff = option: if option then "on" else "off";
-in
-
 stdenv.mkDerivation rec {
   pname = "simgrid";
   version = "3.35";
@@ -32,44 +26,45 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [ boost ];
   nativeBuildInputs = [ cmake perl python3 ]
-    ++ optionals fortranSupport [ gfortran ]
-    ++ optionals buildJavaBindings [ openjdk ]
-    ++ optionals buildPythonBindings [ python3Packages.pybind11 ]
-    ++ optionals buildDocumentation [ fig2dev ghostscript doxygen ]
-    ++ optionals bmfSupport [ eigen ]
-    ++ optionals modelCheckingSupport [ libunwind libevent elfutils ];
+    ++ lib.optionals fortranSupport [ gfortran ]
+    ++ lib.optionals buildJavaBindings [ openjdk ]
+    ++ lib.optionals buildPythonBindings [ python3Packages.pybind11 ]
+    ++ lib.optionals buildDocumentation [ fig2dev ghostscript doxygen ]
+    ++ lib.optionals bmfSupport [ eigen ]
+    ++ lib.optionals modelCheckingSupport [ libunwind libevent elfutils ];
 
   outputs = [ "out" ]
-    ++ optionals buildPythonBindings [ "python" ];
+    ++ lib.optionals buildPythonBindings [ "python" ];
 
   # "Release" does not work. non-debug mode is Debug compiled with optimization
   cmakeBuildType = "Debug";
-  cmakeFlags = [
-    "-Denable_documentation=${optionOnOff buildDocumentation}"
-    "-Denable_java=${optionOnOff buildJavaBindings}"
-    "-Denable_python=${optionOnOff buildPythonBindings}"
-    "-DSIMGRID_PYTHON_LIBDIR=./" # prevents CMake to install in ${python3} dir
-    "-Denable_msg=${optionOnOff buildJavaBindings}"
-    "-Denable_fortran=${optionOnOff fortranSupport}"
-    "-Denable_model-checking=${optionOnOff modelCheckingSupport}"
-    "-Denable_ns3=off"
-    "-Denable_lua=off"
-    "-Denable_lib_in_jar=off"
-    "-Denable_maintainer_mode=off"
-    "-Denable_mallocators=on"
-    "-Denable_debug=on"
-    "-Denable_smpi=on"
-    "-Dminimal-bindings=${optionOnOff minimalBindings}"
-    "-Denable_smpi_ISP_testsuite=${optionOnOff moreTests}"
-    "-Denable_smpi_MPICH3_testsuite=${optionOnOff moreTests}"
-    "-Denable_compile_warnings=off"
-    "-Denable_compile_optimizations=${optionOnOff optimize}"
-    "-Denable_lto=${optionOnOff optimize}"
 
+  cmakeFlags = [
+    (lib.cmakeBool "enable_documentation" buildDocumentation)
+    (lib.cmakeBool "enable_java" buildJavaBindings)
+    (lib.cmakeBool "enable_python" buildPythonBindings)
+    (lib.cmakeFeature "SIMGRID_PYTHON_LIBDIR" "./") # prevents CMake to install in ${python3} dir
+    (lib.cmakeBool "enable_msg" buildJavaBindings)
+    (lib.cmakeBool "enable_fortran" fortranSupport)
+    (lib.cmakeBool "enable_model-checking" modelCheckingSupport)
+    (lib.cmakeBool "enable_ns3" false)
+    (lib.cmakeBool "enable_lua" false)
+    (lib.cmakeBool "enable_lib_in_jar" false)
+    (lib.cmakeBool "enable_maintainer_mode" false)
+    (lib.cmakeBool "enable_mallocators" true)
+    (lib.cmakeBool "enable_debug" true)
+    (lib.cmakeBool "enable_smpi" true)
+    (lib.cmakeBool "minimal-bindings" minimalBindings)
+    (lib.cmakeBool "enable_smpi_ISP_testsuite" moreTests)
+    (lib.cmakeBool "enable_smpi_MPICH3_testsuite" moreTests)
+    (lib.cmakeBool "enable_compile_warnings" false)
+    (lib.cmakeBool "enable_compile_optimizations" optimize)
+    (lib.cmakeBool "enable_lto" optimize)
     # RPATH of binary /nix/store/.../bin/... contains a forbidden reference to /build/
-    "-DCMAKE_SKIP_BUILD_RPATH=ON"
+    (lib.cmakeBool "CMAKE_SKIP_BUILD_RPATH" optimize)
   ];
-  makeFlags = optional debug "VERBOSE=1";
+
+  makeFlags = lib.optional debug "VERBOSE=1";
 
   # needed to run tests and to ensure correct shabangs in output scripts
   preBuild = ''
@@ -106,7 +101,7 @@ stdenv.mkDerivation rec {
   hardeningDisable = lib.optionals debug [ "fortify" ];
   dontStrip = debug;
 
-  meta = {
+  meta = with lib; {
     description = "Framework for the simulation of distributed applications";
     longDescription = ''
       SimGrid is a toolkit that provides core functionalities for the
@@ -120,6 +115,6 @@ stdenv.mkDerivation rec {
     license = licenses.lgpl2Plus;
     maintainers = with maintainers; [ mickours mpoquet ];
     platforms = platforms.all;
-    broken = stdenv.isDarwin;
+    broken = stdenv.hostPlatform.isDarwin;
   };
 }
diff --git a/pkgs/applications/science/misc/snakemake/default.nix b/pkgs/applications/science/misc/snakemake/default.nix
index 7f0e70c642134..07cc2ceaedcc2 100644
--- a/pkgs/applications/science/misc/snakemake/default.nix
+++ b/pkgs/applications/science/misc/snakemake/default.nix
@@ -1,30 +1,26 @@
 { lib
-, fetchFromGitHub
+, fetchPypi
 , python3
-, runtimeShell
+, stress
 }:
 
 python3.pkgs.buildPythonApplication rec {
   pname = "snakemake";
-  version = "8.14.0";
+  version = "8.20.1";
   format = "setuptools";
 
-  src = fetchFromGitHub {
-    owner = "snakemake";
-    repo = pname;
-    rev = "refs/tags/v${version}";
-    hash = "sha256-6oguN4u4OUDXpDsbueSBNwtWgLCaKmgq3w/d/MsMh7Y=";
-    # https://github.com/python-versioneer/python-versioneer/issues/217
-    postFetch = ''
-      sed -i "$out"/snakemake/_version.py -e 's#git_refnames = ".*"#git_refnames = " (tag: v${version})"#'
-    '';
+  src = fetchPypi {
+    inherit pname version;
+    hash = "sha256-adNwIA1z/TwWsa0gQb4hAsUvHInjd30sm1dYKXvvXy8=";
   };
 
   postPatch = ''
     patchShebangs --build tests/
-    patchShebangs --host snakemake/executors/jobscript.sh
-    substituteInPlace snakemake/shell.py \
-      --replace "/bin/sh" "${runtimeShell}"
+    substituteInPlace tests/common.py \
+      --replace-fail 'os.environ["PYTHONPATH"] = os.getcwd()' "pass" \
+      --replace-fail 'del os.environ["PYTHONPATH"]' "pass"
+    substituteInPlace snakemake/unit_tests/__init__.py \
+      --replace-fail '"unit_tests/templates"' '"'"$PWD"'/snakemake/unit_tests/templates"'
   '';
 
   propagatedBuildInputs = with python3.pkgs; [
@@ -41,6 +37,7 @@ python3.pkgs.buildPythonApplication rec {
     nbformat
     psutil
     pulp
+    pygments
     pyyaml
     requests
     reretry
@@ -66,16 +63,54 @@ python3.pkgs.buildPythonApplication rec {
     numpy
     pandas
     pytestCheckHook
+    pytest-mock
     requests-mock
     snakemake-executor-plugin-cluster-generic
+    snakemake-storage-plugin-fs
+    stress
   ];
 
-  disabledTestPaths = [
-    "tests/test_conda_python_3_7_script/test_script.py"
+  pytestFlagsArray = [
+    "tests/tests.py"
+    "tests/test_expand.py"
+    "tests/test_io.py"
+    "tests/test_schema.py"
+    "tests/test_executor_test_suite.py"
+    "tests/test_api.py"
   ];
 
+  # Some will be disabled via https://github.com/snakemake/snakemake/pull/3074
   disabledTests = [
+    # requires graphviz
+    "test_filegraph"
+    # requires s3
+    "test_storage"
+    "test_default_storage"
+    "test_output_file_cache_storage"
+    # requires peppy and eido
+    "test_pep"
+    "test_modules_peppy"
+    # requires perl
+    "test_shadow"
+    # requires snakemake-storage-plugin-http
+    "test_ancient"
+    "test_modules_prefix"
+    # requires snakemake-storage-plugin-s3
     "test_deploy_sources"
+    # requires modules
+    "test_env_modules"
+    # issue with locating template file
+    "test_generate_unit_tests"
+    # weird
+    "test_strict_mode"
+    "test_issue1256"
+    "test_issue2574"
+    "test_github_issue1384"
+    # future-proofing
+    "conda"
+    "singularity"
+    "apptainer"
+    "container"
   ];
 
   pythonImportsCheck = [
diff --git a/pkgs/applications/science/misc/toil/default.nix b/pkgs/applications/science/misc/toil/default.nix
deleted file mode 100644
index 9142676fff48d..0000000000000
--- a/pkgs/applications/science/misc/toil/default.nix
+++ /dev/null
@@ -1,90 +0,0 @@
-{ lib
-, fetchFromGitHub
-, python3
-, rsync
-}:
-
-python3.pkgs.buildPythonApplication rec {
-  pname = "toil";
-  version = "5.12.0";
-  format = "setuptools";
-
-  src = fetchFromGitHub {
-    owner = "DataBiosphere";
-    repo = pname;
-    rev = "refs/tags/releases/${version}";
-    hash = "sha256-cTpbQo9tPZifUO59vbnIa3XUinFJ2/5Slfe4yszglFM=";
-  };
-
-  propagatedBuildInputs = with python3.pkgs; [
-    addict
-    dill
-    docker
-    enlighten
-    psutil
-    py-tes
-    pypubsub
-    python-dateutil
-    pytz
-    pyyaml
-    requests
-    typing-extensions
-  ];
-
-  nativeCheckInputs = [
-    rsync
-  ] ++ (with python3.pkgs; [
-    boto
-    botocore
-    flask
-    pytestCheckHook
-    stubserver
-  ]);
-
-  pytestFlagsArray = [
-    "src/toil/test"
-  ];
-
-  pythonImportsCheck = [
-    "toil"
-  ];
-
-  disabledTestPaths = [
-    # Tests are reaching their timeout
-    "src/toil/test/docs/scriptsTest.py"
-    "src/toil/test/jobStores/jobStoreTest.py"
-    "src/toil/test/provisioners/aws/awsProvisionerTest.py"
-    "src/toil/test/src"
-    "src/toil/test/wdl"
-    "src/toil/test/utils/utilsTest.py"
-    "src/toil/test/cwl/cwlTest.py"
-    "src/toil/test/lib/test_ec2.py"
-    "src/toil/test/lib/aws/test_iam.py"
-    "src/toil/test/lib/aws/test_s3.py"
-  ];
-
-  disabledTests = [
-    # Tests fail starting with 5.7.1
-    "testServices"
-    "testConcurrencyWithDisk"
-    "testJobConcurrency"
-    "testNestedResourcesDoNotBlock"
-    "test_omp_threads"
-    "testFileSingle"
-    "testFileSingle10000"
-    "testFileSingleCheckpoints"
-    "testFileSingleNonCaching"
-    "testFetchJobStoreFiles"
-    "testFetchJobStoreFilesWSymlinks"
-    "testJobStoreContents"
-    "test_cwl_on_arm"
-    "test_cwl_toil_kill"
-  ];
-
-  meta = with lib; {
-    description = "Workflow engine written in pure Python";
-    homepage = "https://toil.ucsc-cgl.org/";
-    license = with licenses; [ asl20 ];
-    maintainers = with maintainers; [ veprbl ];
-  };
-}
diff --git a/pkgs/applications/science/misc/tulip/default.nix b/pkgs/applications/science/misc/tulip/default.nix
index 9808a572836d8..590b429e73f0e 100644
--- a/pkgs/applications/science/misc/tulip/default.nix
+++ b/pkgs/applications/science/misc/tulip/default.nix
@@ -12,15 +12,15 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [ cmake wrapQtAppsHook ]
-    ++ lib.optionals stdenv.isLinux [ autoPatchelfHook ];
+    ++ lib.optionals stdenv.hostPlatform.isLinux [ autoPatchelfHook ];
 
   buildInputs = [ libxml2 freetype glew libjpeg qtbase python3 ]
-    ++ lib.optionals stdenv.isDarwin [ llvmPackages.openmp ]
-    ++ lib.optionals stdenv.isLinux [ libGLU libGL ];
+    ++ lib.optionals stdenv.hostPlatform.isDarwin [ llvmPackages.openmp ]
+    ++ lib.optionals stdenv.hostPlatform.isLinux [ libGLU libGL ];
 
   qtWrapperArgs = [ ''--prefix PATH : ${lib.makeBinPath [ python3 ]}'' ];
 
-  env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin (toString [
+  env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin (toString [
     # fatal error: 'Python.h' file not found
     "-I${python3}/include/${python3.libPrefix}"
     # error: format string is not a string literal (potentially insecure)
diff --git a/pkgs/applications/science/misc/vite/default.nix b/pkgs/applications/science/misc/vite/default.nix
index f1c9329c94df9..8cf8ceb497a84 100644
--- a/pkgs/applications/science/misc/vite/default.nix
+++ b/pkgs/applications/science/misc/vite/default.nix
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
 
     homepage = "http://vite.gforge.inria.fr/";
     license = lib.licenses.cecill20;
-    maintainers = with lib.maintainers; [ ];
+    maintainers = [ ];
     platforms = lib.platforms.linux;
   };
 }
diff --git a/pkgs/applications/science/molecular-dynamics/gromacs/default.nix b/pkgs/applications/science/molecular-dynamics/gromacs/default.nix
index bf2fd1dbf3504..1eed4ff7c3d60 100644
--- a/pkgs/applications/science/molecular-dynamics/gromacs/default.nix
+++ b/pkgs/applications/science/molecular-dynamics/gromacs/default.nix
@@ -24,7 +24,7 @@
 assert enableCuda -> singlePrec;
 
 let
-  inherit (cudaPackages.cudaFlags) cudaCapabilities dropDot;
+  inherit (cudaPackages.flags) cmakeCudaArchitecturesString;
 
   # Select reasonable defaults for all major platforms
   # The possible values are defined in CMakeLists.txt:
@@ -40,13 +40,13 @@ let
   source =
     if enablePlumed then
       {
-        version = "2023";
-        hash = "sha256-rJLG2nL7vMpBT9io2Xnlbs8XxMHNq+0tpc+05yd7e6g=";
+        version = "2024.2";
+        hash = "sha256-gCp+M18uiVdw9XsVnk7DaOuw/yzm2sz3BsboAlw2hSs=";
       }
     else
       {
-        version = "2024.2";
-        hash = "sha256-gCp+M18uiVdw9XsVnk7DaOuw/yzm2sz3BsboAlw2hSs=";
+        version = "2024.3";
+        hash = "sha256-u9oFbuWTkL59WNhME6nsDU42NWF63y63RwNJIsuh8Ck=";
       };
 
 in stdenv.mkDerivation rec {
@@ -61,7 +61,7 @@ in stdenv.mkDerivation rec {
   patches = [ ./pkgconfig.patch ];
 
   postPatch = lib.optionalString enablePlumed ''
-    plumed patch -p -e gromacs-2023
+    plumed patch -p -e gromacs-${source.version}
   '';
 
   outputs = [ "out" "dev" "man" ];
@@ -83,7 +83,7 @@ in stdenv.mkDerivation rec {
     cudaPackages.cuda_cudart
     cudaPackages.libcufft
     cudaPackages.cuda_profiler_api
-  ] ++ lib.optional stdenv.isDarwin llvmPackages.openmp;
+  ] ++ lib.optional stdenv.hostPlatform.isDarwin llvmPackages.openmp;
 
   propagatedBuildInputs = lib.optional enableMpi mpi;
   propagatedUserEnvPkgs = lib.optional enableMpi mpi;
@@ -111,10 +111,10 @@ in stdenv.mkDerivation rec {
      ]
   ) ++ lib.optionals enableCuda [
     "-DGMX_GPU=CUDA"
-    (lib.cmakeFeature "CMAKE_CUDA_ARCHITECTURES" (builtins.concatStringsSep ";" (map dropDot cudaCapabilities)))
+    (lib.cmakeFeature "CMAKE_CUDA_ARCHITECTURES" cmakeCudaArchitecturesString)
 
     # Gromacs seems to ignore and override the normal variables, so we add this ad hoc:
-    (lib.cmakeFeature "GMX_CUDA_TARGET_COMPUTE" (builtins.concatStringsSep ";" (map dropDot cudaCapabilities)))
+    (lib.cmakeFeature "GMX_CUDA_TARGET_COMPUTE" cmakeCudaArchitecturesString)
   ];
 
   postInstall = ''
diff --git a/pkgs/applications/science/molecular-dynamics/lammps/default.nix b/pkgs/applications/science/molecular-dynamics/lammps/default.nix
deleted file mode 100644
index b881d339300c4..0000000000000
--- a/pkgs/applications/science/molecular-dynamics/lammps/default.nix
+++ /dev/null
@@ -1,121 +0,0 @@
-{ lib
-, stdenv
-, fetchFromGitHub
-, libpng
-, gzip
-, fftw
-, blas
-, lapack
-, cmake
-, autoAddDriverRunpath
-, pkg-config
-# Available list of packages can be found near here:
-#
-# - https://github.com/lammps/lammps/blob/develop/cmake/CMakeLists.txt#L222
-# - https://docs.lammps.org/Build_extras.html
-, packages ? {
-  ASPHERE = true;
-  BODY = true;
-  CLASS2 = true;
-  COLLOID = true;
-  COMPRESS = true;
-  CORESHELL = true;
-  DIPOLE = true;
-  GRANULAR = true;
-  KSPACE = true;
-  MANYBODY = true;
-  MC = true;
-  MISC = true;
-  MOLECULE = true;
-  OPT = true;
-  PERI = true;
-  QEQ = true;
-  REPLICA = true;
-  RIGID = true;
-  SHOCK = true;
-  ML-SNAP = true;
-  SRD = true;
-  REAXFF = true;
-}
-# Extra cmakeFlags to add as "-D${attr}=${value}"
-, extraCmakeFlags ? {}
-# Extra `buildInputs` - meant for packages that require more inputs
-, extraBuildInputs ? []
-}:
-
-stdenv.mkDerivation (finalAttrs: {
-  # LAMMPS has weird versioning convention. Updates should go smoothly with:
-  # nix-update --commit lammps --version-regex 'stable_(.*)'
-  version = "2Aug2023_update3";
-  pname = "lammps";
-
-  src = fetchFromGitHub {
-    owner = "lammps";
-    repo = "lammps";
-    rev = "stable_${finalAttrs.version}";
-    hash = "sha256-jx0hkiYxQlnE2sa4WTvluEgphF//sNbK91VGAQJMwjw=";
-  };
-  preConfigure = ''
-    cd cmake
-  '';
-  nativeBuildInputs = [
-    cmake
-    pkg-config
-    # Although not always needed, it is needed if cmakeFlags include
-    # GPU_API=cuda, and it doesn't users that don't enable the GPU package.
-    autoAddDriverRunpath
-  ];
-
-  passthru = {
-    # Remove these at some point - perhaps after release 23.11. See discussion at:
-    # https://github.com/NixOS/nixpkgs/pull/238771#discussion_r1235459961
-    mpi = throw "`lammps-mpi.passthru.mpi` was removed in favor of `extraBuildInputs`";
-    inherit packages;
-    inherit extraCmakeFlags;
-    inherit extraBuildInputs;
-  };
-  cmakeFlags = [
-  ]
-  ++ (builtins.map (p: "-DPKG_${p}=ON") (builtins.attrNames (lib.filterAttrs (n: v: v) packages)))
-  ++ (lib.mapAttrsToList (n: v: "-D${n}=${v}") extraCmakeFlags)
-  ;
-
-  buildInputs = [
-    fftw
-    libpng
-    blas
-    lapack
-    gzip
-  ] ++ extraBuildInputs
-  ;
-
-  postInstall = ''
-    # For backwards compatibility
-    ln -s $out/bin/lmp $out/bin/lmp_serial
-    # Install vim and neovim plugin
-    install -Dm644 ../../tools/vim/lammps.vim $out/share/vim-plugins/lammps/syntax/lammps.vim
-    install -Dm644 ../../tools/vim/filetype.vim $out/share/vim-plugins/lammps/ftdetect/lammps.vim
-    mkdir -p $out/share/nvim
-    ln -s $out/share/vim-plugins/lammps $out/share/nvim/site
-  '';
-
-  meta = with lib; {
-    description = "Classical Molecular Dynamics simulation code";
-    longDescription = ''
-      LAMMPS is a classical molecular dynamics simulation code designed to
-      run efficiently on parallel computers. It was developed at Sandia
-      National Laboratories, a US Department of Energy facility, with
-      funding from the DOE. It is an open-source code, distributed freely
-      under the terms of the GNU Public License (GPL).
-      '';
-    homepage = "https://www.lammps.org";
-    license = licenses.gpl2Only;
-    platforms = platforms.linux;
-    # compiling lammps with 64 bit support blas and lapack might cause runtime
-    # segfaults. In anycase both blas and lapack should have the same #bits
-    # support.
-    broken = (blas.isILP64 && lapack.isILP64);
-    maintainers = [ maintainers.costrouc maintainers.doronbehar ];
-    mainProgram = "lmp";
-  };
-})
diff --git a/pkgs/applications/science/networking/sumo/default.nix b/pkgs/applications/science/networking/sumo/default.nix
index 6f5be3df816eb..4906b0b80c769 100644
--- a/pkgs/applications/science/networking/sumo/default.nix
+++ b/pkgs/applications/science/networking/sumo/default.nix
@@ -1,4 +1,4 @@
-{ lib, bzip2, cmake, eigen, fetchFromGitHub, ffmpeg_4, fox_1_6, gdal,
+{ lib, bzip2, cmake, eigen, fetchFromGitHub, ffmpeg_7, fox_1_6, gdal,
   git, gl2ps, gpp , gtest, jdk, libGL, libGLU, libX11, libjpeg,
   libpng, libtiff, libxcrypt, openscenegraph , proj, python3,
   python3Packages, stdenv, swig, xercesc, xorg, zlib }:
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     owner = "eclipse";
     repo = "sumo";
     rev = "v${lib.replaceStrings ["."] ["_"] version}";
-    sha256 = "sha256-y/bkdDWrb1KB0EOVSJPfPVYHGp/zQ2+Shb6eLsFQRNQ=";
+    hash = "sha256-y/bkdDWrb1KB0EOVSJPfPVYHGp/zQ2+Shb6eLsFQRNQ=";
     fetchSubmodules = true;
   };
 
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
   buildInputs = [
     bzip2
     eigen
-    ffmpeg_4
+    ffmpeg_7
     fox_1_6
     gdal
     gl2ps
diff --git a/pkgs/applications/science/physics/crystfel/default.nix b/pkgs/applications/science/physics/crystfel/default.nix
index e7eb69fb4e1c1..b6f8a0d6f13c9 100644
--- a/pkgs/applications/science/physics/crystfel/default.nix
+++ b/pkgs/applications/science/physics/crystfel/default.nix
@@ -75,7 +75,7 @@ let
     let
       version = "7.4.0";
       src =
-        if stdenv.isDarwin then
+        if stdenv.hostPlatform.isDarwin then
           fetchurl
             {
               url = "https://www.mrc-lmb.cam.ac.uk/mosflm/mosflm/ver${builtins.replaceStrings [ "." ] [ "" ] version}/pre-built/mosflm-osx-64-noX11.zip";
@@ -86,7 +86,7 @@ let
             url = "https://www.mrc-lmb.cam.ac.uk/mosflm/mosflm/ver${builtins.replaceStrings [ "." ] [ "" ] version}/pre-built/mosflm-linux-64-noX11.zip";
             hash = "sha256:1f2qins5kaz5v6mkaclncqpirx3mlz177ywm13py9p6s9mk99g32";
           };
-      mosflmBinary = if stdenv.isDarwin then "bin/mosflm" else "mosflm-linux-64-noX11";
+      mosflmBinary = if stdenv.hostPlatform.isDarwin then "bin/mosflm" else "mosflm-linux-64-noX11";
     in
     stdenv.mkDerivation {
       pname = "mosflm";
@@ -209,9 +209,9 @@ stdenv.mkDerivation rec {
     xgandalf
     pandoc
   ] ++ lib.optionals withGui [ gtk3 gdk-pixbuf ]
-  ++ lib.optionals stdenv.isDarwin [
+  ++ lib.optionals stdenv.hostPlatform.isDarwin [
     argp-standalone
-  ] ++ lib.optionals (stdenv.isDarwin && !stdenv.isAarch64) [
+  ] ++ lib.optionals (stdenv.hostPlatform.isDarwin && !stdenv.hostPlatform.isAarch64) [
     memorymappingHook
   ]
   ++ lib.optionals withBitshuffle [ hdf5-external-filter-plugins ];
diff --git a/pkgs/applications/science/physics/elmerfem/default.nix b/pkgs/applications/science/physics/elmerfem/default.nix
index 4b19bc4b17b48..309e81fad7463 100644
--- a/pkgs/applications/science/physics/elmerfem/default.nix
+++ b/pkgs/applications/science/physics/elmerfem/default.nix
@@ -2,7 +2,6 @@
 , stdenv
 , fetchFromGitHub
 , cmake
-, git
 , gfortran
 , mpi
 , blas
diff --git a/pkgs/applications/science/physics/fasthenry/default.nix b/pkgs/applications/science/physics/fasthenry/default.nix
index 6b9a73f6dd175..963828e18edc4 100644
--- a/pkgs/applications/science/physics/fasthenry/default.nix
+++ b/pkgs/applications/science/physics/fasthenry/default.nix
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
       SHELL="sh"
       "all"
     )
-    '' + (if stdenv.isx86_64 then ''
+    '' + (if stdenv.hostPlatform.isx86_64 then ''
     makeFlagsArray+=(
       CFLAGS="-fcommon -O -DFOUR -m64"
     );
diff --git a/pkgs/applications/science/physics/nnpdf/default.nix b/pkgs/applications/science/physics/nnpdf/default.nix
index a4762323dcf95..c1de306e6bf05 100644
--- a/pkgs/applications/science/physics/nnpdf/default.nix
+++ b/pkgs/applications/science/physics/nnpdf/default.nix
@@ -60,7 +60,5 @@ stdenv.mkDerivation rec {
     license = licenses.gpl3Only;
     maintainers = [ maintainers.veprbl ];
     platforms = platforms.unix;
-    # never built on aarch64-darwin since first introduction in nixpkgs
-    broken = (stdenv.isDarwin && stdenv.isAarch64) || (stdenv.isLinux && stdenv.isAarch64);
   };
 }
diff --git a/pkgs/applications/science/physics/professor/default.nix b/pkgs/applications/science/physics/professor/default.nix
index 1c6c21c52fef8..60a030f528211 100644
--- a/pkgs/applications/science/physics/professor/default.nix
+++ b/pkgs/applications/science/physics/professor/default.nix
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
   postPatch = ''
     substituteInPlace Makefile \
       --replace-fail 'pip install ' 'pip install --prefix $(out) '
-  '' + lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.hostPlatform.isDarwin ''
     substituteInPlace Makefile \
       --replace-fail '-shared -o' '-shared -install_name "$(out)/$@" -o'
   '';
diff --git a/pkgs/applications/science/physics/sacrifice/default.nix b/pkgs/applications/science/physics/sacrifice/default.nix
index dbe2365371393..b6b53446473fc 100644
--- a/pkgs/applications/science/physics/sacrifice/default.nix
+++ b/pkgs/applications/science/physics/sacrifice/default.nix
@@ -20,7 +20,7 @@ stdenv.mkDerivation {
   preConfigure = ''
     substituteInPlace configure --replace HAVE_LCG=yes HAVE_LCG=no
   ''
-  + lib.optionalString stdenv.isDarwin ''
+  + lib.optionalString stdenv.hostPlatform.isDarwin ''
     substituteInPlace configure --replace LIB_SUFFIX=\"so\" LIB_SUFFIX=\"dylib\"
   '';
 
@@ -29,7 +29,7 @@ stdenv.mkDerivation {
     "--with-pythia=${pythia}"
   ];
 
-  postInstall = if stdenv.isDarwin then ''
+  postInstall = if stdenv.hostPlatform.isDarwin then ''
     install_name_tool -add_rpath ${pythia}/lib "$out"/bin/run-pythia
   '' else ''
     wrapProgram $out/bin/run-pythia \
@@ -46,6 +46,6 @@ stdenv.mkDerivation {
     platforms   = lib.platforms.unix;
     maintainers = with lib.maintainers; [ veprbl ];
     # never built on aarch64-darwin since first introduction in nixpkgs
-    broken = stdenv.isDarwin && stdenv.isAarch64;
+    broken = stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64;
   };
 }
diff --git a/pkgs/applications/science/physics/sherpa/default.nix b/pkgs/applications/science/physics/sherpa/default.nix
index 21a5ee7ec234a..2dfe3f7d7bb2c 100644
--- a/pkgs/applications/science/physics/sherpa/default.nix
+++ b/pkgs/applications/science/physics/sherpa/default.nix
@@ -35,6 +35,6 @@ stdenv.mkDerivation rec {
     platforms = platforms.unix;
     maintainers = with maintainers; [ veprbl ];
     # never built on aarch64-darwin since first introduction in nixpkgs
-    broken = stdenv.isDarwin && stdenv.isAarch64;
+    broken = stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64;
   };
 }
diff --git a/pkgs/applications/science/physics/xfitter/default.nix b/pkgs/applications/science/physics/xfitter/default.nix
index 8a92c85a13830..e509f3a005f7e 100644
--- a/pkgs/applications/science/physics/xfitter/default.nix
+++ b/pkgs/applications/science/physics/xfitter/default.nix
@@ -50,7 +50,7 @@ stdenv.mkDerivation rec {
   hardeningDisable = [ "format" ];
 
   # workaround wrong library IDs
-  postInstall = lib.optionalString stdenv.isDarwin ''
+  postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
     ln -sv "$out/lib/xfitter/"* "$out/lib/"
   '';
 
diff --git a/pkgs/applications/science/physics/xnec2c/default.nix b/pkgs/applications/science/physics/xnec2c/default.nix
index ffdd4b6d0b07f..aaff1ff40d313 100644
--- a/pkgs/applications/science/physics/xnec2c/default.nix
+++ b/pkgs/applications/science/physics/xnec2c/default.nix
@@ -38,6 +38,6 @@ stdenv.mkDerivation rec {
     platforms = platforms.unix;
 
     # Darwin support likely to be fixed upstream in the next release
-    broken = stdenv.isDarwin;
+    broken = stdenv.hostPlatform.isDarwin;
   };
 }
diff --git a/pkgs/applications/science/programming/groove/default.nix b/pkgs/applications/science/programming/groove/default.nix
index fb314cdff30ce..6350d0badee9f 100644
--- a/pkgs/applications/science/programming/groove/default.nix
+++ b/pkgs/applications/science/programming/groove/default.nix
@@ -50,6 +50,6 @@ in stdenv.mkDerivation rec {
     license = licenses.asl20;
     sourceProvenance = with sourceTypes; [ binaryBytecode ];
     platforms = platforms.all;
-    maintainers = with maintainers; [ ];
+    maintainers = [ ];
   };
 }
diff --git a/pkgs/applications/science/robotics/emuflight-configurator/default.nix b/pkgs/applications/science/robotics/emuflight-configurator/default.nix
index 9669d48e744e0..66b9cf0efa8ea 100644
--- a/pkgs/applications/science/robotics/emuflight-configurator/default.nix
+++ b/pkgs/applications/science/robotics/emuflight-configurator/default.nix
@@ -3,11 +3,11 @@
 
 stdenv.mkDerivation rec {
   pname = "emuflight-configurator";
-  version = "0.4.1";
+  version = "0.4.3";
 
   src = fetchurl {
     url = "https://github.com/emuflight/EmuConfigurator/releases/download/${version}/emuflight-configurator_${version}_linux64.zip";
-    sha256 = "sha256-e4HNg5yr9V5LyT0hYP6gzw0tZm4dLidJg5MQtH3L3JI=";
+    sha256 = "sha256-7NcN1wF3BUClJBVm13VnV80N/+a2jAEIRqB/x9+GDEg=";
   };
 
   nativeBuildInputs = [ wrapGAppsHook3 unzip copyDesktopItems ];
diff --git a/pkgs/applications/science/robotics/mavproxy/default.nix b/pkgs/applications/science/robotics/mavproxy/default.nix
index f86ca5f635e48..e36b3d62b696f 100644
--- a/pkgs/applications/science/robotics/mavproxy/default.nix
+++ b/pkgs/applications/science/robotics/mavproxy/default.nix
@@ -25,7 +25,7 @@ buildPythonApplication rec {
     pyserial
     setuptools
     wxpython
-  ] ++ lib.optionals stdenv.isDarwin [ billiard gnureadline ];
+  ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ billiard gnureadline ];
 
   # No tests
   doCheck = false;
diff --git a/pkgs/applications/science/robotics/mujoco/default.nix b/pkgs/applications/science/robotics/mujoco/default.nix
deleted file mode 100644
index d4a7a961d3984..0000000000000
--- a/pkgs/applications/science/robotics/mujoco/default.nix
+++ /dev/null
@@ -1,192 +0,0 @@
-{ cereal_1_3_2
-, cmake
-, fetchFromGitHub
-, fetchFromGitLab
-, glfw
-, glm
-, lib
-, spdlog
-, stdenv
-}:
-
-let
-  pin = {
-    # TODO: Check the following file and ensure the dependencies are up-to-date
-    # See https://github.com/google-deepmind/mujoco/blob/<VERSION>/cmake/MujocoDependencies.cmake#L17-L64
-    abseil-cpp = fetchFromGitHub {
-      owner = "abseil";
-      repo = "abseil-cpp";
-      rev = "d7aaad83b488fd62bd51c81ecf16cd938532cc0a";
-      hash = "sha256-eA2/dZpNOlex1O5PNa3XSZhpMB3AmaIoHzVDI9TD/cg=";
-    };
-    benchmark = fetchFromGitHub {
-      owner = "google";
-      repo = "benchmark";
-      rev = "e45585a4b8e75c28479fa4107182c28172799640";
-      hash = "sha256-pgHvmRpPd99ePUVRsi7WXLVSZngZ5q6r1vWW4mdGvxY=";
-    };
-    ccd = fetchFromGitHub {
-      owner = "danfis";
-      repo = "libccd";
-      rev = "7931e764a19ef6b21b443376c699bbc9c6d4fba8";
-      hash = "sha256-TIZkmqQXa0+bSWpqffIgaBela0/INNsX9LPM026x1Wk=";
-    };
-    eigen3 = fetchFromGitLab {
-      owner = "libeigen";
-      repo = "eigen";
-      rev = "2a9055b50ed22101da7d77e999b90ed50956fe0b";
-      hash = "sha256-tx/XR7xJ7IMh5RMvL8wRo/g+dfD3xcjZkLPSY4D9HaY=";
-    };
-    googletest = fetchFromGitHub {
-      owner = "google";
-      repo = "googletest";
-      rev = "f8d7d77c06936315286eb55f8de22cd23c188571";
-      hash = "sha256-t0RchAHTJbuI5YW4uyBPykTvcjy90JW9AOPNjIhwh6U=";
-    };
-    lodepng = fetchFromGitHub {
-      owner = "lvandeve";
-      repo = "lodepng";
-      rev = "b4ed2cd7ecf61d29076169b49199371456d4f90b";
-      hash = "sha256-5cCkdj/izP4e99BKfs/Mnwu9aatYXjlyxzzYiMD/y1M=";
-    };
-    qhull = fetchFromGitHub {
-      owner = "qhull";
-      repo = "qhull";
-      rev = "0c8fc90d2037588024d9964515c1e684f6007ecc";
-      hash = "sha256-Ptzxad3ewmKJbbcmrBT+os4b4SR976zlCG9F0nq0x94=";
-    };
-    tinyobjloader = fetchFromGitHub {
-      owner = "tinyobjloader";
-      repo = "tinyobjloader";
-      rev = "1421a10d6ed9742f5b2c1766d22faa6cfbc56248";
-      hash = "sha256-9z2Ne/WPCiXkQpT8Cun/pSGUwgClYH+kQ6Dx1JvW6w0=";
-    };
-    tinyxml2 = fetchFromGitHub {
-      owner = "leethomason";
-      repo = "tinyxml2";
-      rev = "9a89766acc42ddfa9e7133c7d81a5bda108a0ade";
-      hash = "sha256-YGAe4+Ttv/xeou+9FoJjmQCKgzupTYdDhd+gzvtz/88=";
-    };
-    marchingcubecpp = fetchFromGitHub {
-      owner = "aparis69";
-      repo = "MarchingCubeCpp";
-      rev = "f03a1b3ec29b1d7d865691ca8aea4f1eb2c2873d";
-      hash = "sha256-90ei0lpJA8XuVGI0rGb3md0Qtq8/bdkU7dUCHpp88Bw=";
-    };
-
-    tmd = stdenv.mkDerivation rec {
-      name = "TriangleMeshDistance";
-
-      src = fetchFromGitHub {
-        owner = "InteractiveComputerGraphics";
-        repo = name;
-        rev = "e55a15c20551f36242fd6368df099a99de71d43a";
-        hash = "sha256-vj6TMMT8mp7ciLa5nzVAhMWPcAHXq+ZwHlWsRA3uCmg=";
-      };
-
-      installPhase = ''
-        mkdir -p $out/include/tmd
-        cp ${name}/include/tmd/${name}.h $out/include/tmd/
-      '';
-    };
-
-    sdflib = stdenv.mkDerivation rec {
-      name = "SdfLib";
-
-      src = fetchFromGitHub {
-        owner = "UPC-ViRVIG";
-        repo = name;
-        rev = "1927bee6bb8225258a39c8cbf14e18a4d50409ae";
-        hash = "sha256-+SFUOdZ6pGZvnQa0mT+yfbTMHWe2CTOlroXcuVBHdOE=";
-      };
-
-      patches = [ ./sdflib-system-deps.patch ];
-
-      cmakeFlags = [
-        "-DSDFLIB_USE_ASSIMP=OFF"
-        "-DSDFLIB_USE_OPENMP=OFF"
-        "-DSDFLIB_USE_ENOKI=OFF"
-        "-DSDFLIB_USE_SYSTEM_GLM=ON"
-        "-DSDFLIB_USE_SYSTEM_SPDLOG=ON"
-        "-DSDFLIB_USE_SYSTEM_CEREAL=ON"
-        "-DSDFLIB_USE_SYSTEM_TRIANGLEMESHDISTANCE=ON"
-      ];
-
-      nativeBuildInputs = [ cmake ];
-      buildInputs = [
-        pin.tmd
-
-        # Mainline. The otherwise pinned glm realease from 2018 does
-        # not build due to test failures and missing files.
-        glm
-
-        spdlog
-        cereal_1_3_2
-      ];
-    };
-
-  };
-
-in stdenv.mkDerivation rec {
-  pname = "mujoco";
-  version = "3.1.6";
-
-  # Bumping version? Make sure to look though the MuJoCo's commit
-  # history for bumped dependency pins!
-  src = fetchFromGitHub {
-    owner = "google-deepmind";
-    repo = "mujoco";
-    rev = "refs/tags/${version}";
-    hash = "sha256-64zUplr1E5WSb5RpTW9La1zKVT67a1VrftiUqc2SHlU=";
-  };
-
-  patches = [ ./mujoco-system-deps-dont-fetch.patch ];
-
-  nativeBuildInputs = [ cmake ];
-
-  buildInputs = [
-    pin.sdflib
-    glm
-
-    # non-numerical
-    spdlog
-    cereal_1_3_2
-    glfw
-  ];
-
-  cmakeFlags = [
-    "-DMUJOCO_USE_SYSTEM_sdflib=ON"
-    "-DMUJOCO_SIMULATE_USE_SYSTEM_GLFW=ON"
-    "-DMUJOCO_SAMPLES_USE_SYSTEM_GLFW=ON"
-  ];
-
-  # Move things into place so that cmake doesn't try downloading dependencies.
-  preConfigure = ''
-    mkdir -p build/_deps
-    ln -s ${pin.abseil-cpp} build/_deps/abseil-cpp-src
-    ln -s ${pin.benchmark} build/_deps/benchmark-src
-    ln -s ${pin.ccd} build/_deps/ccd-src
-    ln -s ${pin.eigen3} build/_deps/eigen3-src
-    ln -s ${pin.googletest} build/_deps/googletest-src
-    ln -s ${pin.lodepng} build/_deps/lodepng-src
-    ln -s ${pin.qhull} build/_deps/qhull-src
-    ln -s ${pin.tinyobjloader} build/_deps/tinyobjloader-src
-    ln -s ${pin.tinyxml2} build/_deps/tinyxml2-src
-    ln -s ${pin.marchingcubecpp} build/_deps/marchingcubecpp-src
-  '';
-
-  passthru.pin = { inherit (pin) lodepng eigen3 abseil-cpp; };
-
-  meta = {
-    description = "Multi-Joint dynamics with Contact. A general purpose physics simulator";
-    homepage = "https://mujoco.org/";
-    changelog = "https://github.com/google-deepmind/mujoco/releases/tag/${version}";
-    license = lib.licenses.asl20;
-    maintainers = with lib.maintainers; [
-      GaetanLepage
-      samuela
-      tmplt
-    ];
-    broken = stdenv.isDarwin;
-  };
-}
diff --git a/pkgs/applications/science/robotics/mujoco/mujoco-system-deps-dont-fetch.patch b/pkgs/applications/science/robotics/mujoco/mujoco-system-deps-dont-fetch.patch
deleted file mode 100644
index c09787ff84c5e..0000000000000
--- a/pkgs/applications/science/robotics/mujoco/mujoco-system-deps-dont-fetch.patch
+++ /dev/null
@@ -1,519 +0,0 @@
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index eea180c0..efb39178 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -93,7 +93,7 @@ add_subdirectory(src/render)
- add_subdirectory(src/thread)
- add_subdirectory(src/ui)
- 
--target_compile_definitions(mujoco PRIVATE _GNU_SOURCE CCD_STATIC_DEFINE MUJOCO_DLL_EXPORTS -DMC_IMPLEM_ENABLE)
-+target_compile_definitions(mujoco PRIVATE _GNU_SOURCE MUJOCO_DLL_EXPORTS -DMC_IMPLEM_ENABLE)
- if(MUJOCO_ENABLE_AVX_INTRINSICS)
-   target_compile_definitions(mujoco PUBLIC mjUSEPLATFORMSIMD)
- endif()
-@@ -118,7 +118,7 @@ target_link_libraries(
-           lodepng
-           qhullstatic_r
-           tinyobjloader
--          tinyxml2
-+          tinyxml2::tinyxml2
- )
- 
- set_target_properties(
-diff --git a/cmake/MujocoDependencies.cmake b/cmake/MujocoDependencies.cmake
-index 44962272..656beeb8 100644
---- a/cmake/MujocoDependencies.cmake
-+++ b/cmake/MujocoDependencies.cmake
-@@ -93,28 +93,36 @@ set(BUILD_SHARED_LIBS
- if(NOT TARGET lodepng)
-   FetchContent_Declare(
-     lodepng
--    GIT_REPOSITORY https://github.com/lvandeve/lodepng.git
--    GIT_TAG ${MUJOCO_DEP_VERSION_lodepng}
-   )
-+endif()
- 
--  FetchContent_GetProperties(lodepng)
--  if(NOT lodepng_POPULATED)
--    FetchContent_Populate(lodepng)
--    # This is not a CMake project.
--    set(LODEPNG_SRCS ${lodepng_SOURCE_DIR}/lodepng.cpp)
--    set(LODEPNG_HEADERS ${lodepng_SOURCE_DIR}/lodepng.h)
--    add_library(lodepng STATIC ${LODEPNG_HEADERS} ${LODEPNG_SRCS})
--    target_compile_options(lodepng PRIVATE ${MUJOCO_MACOS_COMPILE_OPTIONS})
--    target_link_options(lodepng PRIVATE ${MUJOCO_MACOS_LINK_OPTIONS})
--    target_include_directories(lodepng PUBLIC ${lodepng_SOURCE_DIR})
-+if(NOT TARGET lodepng)
-+  if(NOT MUJOCO_USE_SYSTEM_lodepng)
-+    fetchcontent_declare(
-+      lodepng
-+      GIT_REPOSITORY https://github.com/lvandeve/lodepng.git
-+      GIT_TAG ${MUJOCO_DEP_VERSION_lodepng}
-+    )
-+
-+    FetchContent_GetProperties(lodepng)
-+    if(NOT lodepng_POPULATED)
-+      FetchContent_Populate(lodepng)
-+      # This is not a CMake project.
-+      set(LODEPNG_SRCS ${lodepng_SOURCE_DIR}/lodepng.cpp)
-+      set(LODEPNG_HEADERS ${lodepng_SOURCE_DIR}/lodepng.h)
-+      add_library(lodepng STATIC ${LODEPNG_HEADERS} ${LODEPNG_SRCS})
-+      target_compile_options(lodepng PRIVATE ${MUJOCO_MACOS_COMPILE_OPTIONS})
-+      target_link_options(lodepng PRIVATE ${MUJOCO_MACOS_LINK_OPTIONS})
-+      target_include_directories(lodepng PUBLIC ${lodepng_SOURCE_DIR})
-+    endif()
-+  else()
-+    find_package(lodepng REQUIRED)
-   endif()
- endif()
- 
- if(NOT TARGET marchingcubecpp)
-   FetchContent_Declare(
-     marchingcubecpp
--    GIT_REPOSITORY https://github.com/aparis69/MarchingCubeCpp.git
--    GIT_TAG ${MUJOCO_DEP_VERSION_MarchingCubeCpp}
-   )
- 
-   FetchContent_GetProperties(marchingcubecpp)
-@@ -124,119 +132,158 @@ if(NOT TARGET marchingcubecpp)
-   endif()
- endif()
- 
-+option(MUJOCO_USE_SYSTEM_qhull "Use installed qhull version." OFF)
-+mark_as_advanced(MUJOCO_USE_SYSTEM_qhull)
-+
- set(QHULL_ENABLE_TESTING OFF)
- 
- findorfetch(
-   USE_SYSTEM_PACKAGE
--  OFF
-+  ${MUJOCO_USE_SYSTEM_qhull}
-   PACKAGE_NAME
--  qhull
-+  Qhull
-   LIBRARY_NAME
-   qhull
--  GIT_REPO
--  https://github.com/qhull/qhull.git
--  GIT_TAG
--  ${MUJOCO_DEP_VERSION_qhull}
-   TARGETS
-   qhull
-   EXCLUDE_FROM_ALL
- )
--# MuJoCo includes a file from libqhull_r which is not exported by the qhull include directories.
--# Add it to the target.
--target_include_directories(
--  qhullstatic_r INTERFACE $<BUILD_INTERFACE:${qhull_SOURCE_DIR}/src/libqhull_r>
--)
--target_compile_options(qhullstatic_r PRIVATE ${MUJOCO_MACOS_COMPILE_OPTIONS})
--target_link_options(qhullstatic_r PRIVATE ${MUJOCO_MACOS_LINK_OPTIONS})
-+if(NOT MUJOCO_USE_SYSTEM_qhull)
-+  # MuJoCo includes a file from libqhull_r which is not exported by the qhull include directories.
-+  # Add it to the target.
-+  target_include_directories(
-+    qhullstatic_r INTERFACE $<BUILD_INTERFACE:${qhull_SOURCE_DIR}/src/libqhull_r>
-+  )
-+  target_compile_options(qhullstatic_r PRIVATE ${MUJOCO_MACOS_COMPILE_OPTIONS})
-+  target_link_options(qhullstatic_r PRIVATE ${MUJOCO_MACOS_LINK_OPTIONS})
-+else()
-+  if(NOT TARGET qhullstatic_r)
-+    add_library(qhullstatic_r INTERFACE)
-+    set_target_properties(qhullstatic_r PROPERTIES INTERFACE_LINK_LIBRARIES Qhull::qhull_r)
-+
-+    # Workaround as headers are installed in <prefix>/include/libqhull_r/something.h
-+    # but mujoco include them as #include <something.h>
-+    get_property(qhull_include_dirs TARGET Qhull::qhull_r PROPERTY INTERFACE_INCLUDE_DIRECTORIES)
-+    foreach(qhull_include_dir IN LISTS qhull_include_dirs)
-+      target_include_directories(qhullstatic_r INTERFACE ${qhull_include_dirs}/libqhull_r)
-+    endforeach()
-+    target_include_directories(qhullstatic_r INTERFACE )
-+  endif()
-+endif()
-+
-+option(MUJOCO_USE_SYSTEM_tinyxml2 "Use installed tinyxml2 version." OFF)
-+mark_as_advanced(MUJOCO_USE_SYSTEM_tinyxml2)
- 
- set(tinyxml2_BUILD_TESTING OFF)
- findorfetch(
-   USE_SYSTEM_PACKAGE
--  OFF
-+  ${MUJOCO_USE_SYSTEM_tinyxml2}
-   PACKAGE_NAME
-   tinyxml2
-   LIBRARY_NAME
-   tinyxml2
--  GIT_REPO
--  https://github.com/leethomason/tinyxml2.git
--  GIT_TAG
--  ${MUJOCO_DEP_VERSION_tinyxml2}
-   TARGETS
--  tinyxml2
-+  tinyxml2::tinyxml2
-   EXCLUDE_FROM_ALL
- )
--target_compile_options(tinyxml2 PRIVATE ${MUJOCO_MACOS_COMPILE_OPTIONS})
--target_link_options(tinyxml2 PRIVATE ${MUJOCO_MACOS_LINK_OPTIONS})
-+if(NOT MUJOCO_USE_SYSTEM_tinyxml2)
-+  target_compile_options(tinyxml2 PRIVATE ${MUJOCO_MACOS_COMPILE_OPTIONS})
-+  target_link_options(tinyxml2 PRIVATE ${MUJOCO_MACOS_LINK_OPTIONS})
-+endif()
-+
-+option(MUJOCO_USE_SYSTEM_tinyobjloader "Use installed tinyobjloader version." OFF)
-+mark_as_advanced(MUJOCO_USE_SYSTEM_tinyobjloader)
- 
- findorfetch(
-   USE_SYSTEM_PACKAGE
--  OFF
-+  ${MUJOCO_USE_SYSTEM_tinyobjloader}
-   PACKAGE_NAME
-   tinyobjloader
-   LIBRARY_NAME
-   tinyobjloader
--  GIT_REPO
--  https://github.com/tinyobjloader/tinyobjloader.git
--  GIT_TAG
--  ${MUJOCO_DEP_VERSION_tinyobjloader}
-   TARGETS
-   tinyobjloader
-   EXCLUDE_FROM_ALL
- )
- 
-+if(MUJOCO_USE_SYSTEM_tinyobjloader)
-+  # As of tinyobjloader v2.0.0rc10, the tinyobjloader target is named tinyobjloader in the build,
-+  # but tinyobjloader::tinyobjloader when it is installed. To deal with this, if tinyobjloader is
-+  # found in the system, we create an ALIAS
-+  # The following is equivalent to add_library(tinyobjloader ALIAS tinyobjloader::tinyobjloader),
-+  # but compatible with CMake 3.16 . Once the minimum CMake is bumped to CMake 3.18, we can use
-+  # the simpler version
-+  add_library(tinyobjloader INTERFACE IMPORTED)
-+  set_target_properties(tinyobjloader PROPERTIES INTERFACE_LINK_LIBRARIES tinyobjloader::tinyobjloader)
-+endif()
-+
-+option(MUJOCO_USE_SYSTEM_sdflib "Use installed sdflib version." OFF)
-+mark_as_advanced(MUJOCO_USE_SYSTEM_sdflib)
-+
- option(SDFLIB_USE_ASSIMP OFF)
- option(SDFLIB_USE_OPENMP OFF)
- option(SDFLIB_USE_ENOKI OFF)
-+
- findorfetch(
-   USE_SYSTEM_PACKAGE
--  OFF
-+  ${MUJOCO_USE_SYSTEM_sdflib}
-   PACKAGE_NAME
--  sdflib
-+  SdfLib
-   LIBRARY_NAME
-   sdflib
--  GIT_REPO
--  https://github.com/UPC-ViRVIG/SdfLib.git
--  GIT_TAG
--  ${MUJOCO_DEP_VERSION_sdflib}
-   TARGETS
--  SdfLib
-+  SdfLib::SdfLib
-   EXCLUDE_FROM_ALL
- )
--target_compile_options(SdfLib PRIVATE ${MUJOCO_MACOS_COMPILE_OPTIONS})
--target_link_options(SdfLib PRIVATE ${MUJOCO_MACOS_LINK_OPTIONS})
-+
-+if(NOT MUJOCO_USE_SYSTEM_sdflib)
-+  target_compile_options(SdfLib PRIVATE ${MUJOCO_MACOS_COMPILE_OPTIONS})
-+  target_link_options(SdfLib PRIVATE ${MUJOCO_MACOS_LINK_OPTIONS})
-+endif()
-+
-+option(MUJOCO_USE_SYSTEM_ccd "Use installed ccd version." OFF)
-+mark_as_advanced(MUJOCO_USE_SYSTEM_ccd)
- 
- set(ENABLE_DOUBLE_PRECISION ON)
- set(CCD_HIDE_ALL_SYMBOLS ON)
- findorfetch(
-   USE_SYSTEM_PACKAGE
--  OFF
-+  ${MUJOCO_USE_SYSTEM_ccd}
-   PACKAGE_NAME
-   ccd
-   LIBRARY_NAME
-   ccd
--  GIT_REPO
--  https://github.com/danfis/libccd.git
--  GIT_TAG
--  ${MUJOCO_DEP_VERSION_ccd}
-   TARGETS
-   ccd
-   EXCLUDE_FROM_ALL
- )
--target_compile_options(ccd PRIVATE ${MUJOCO_MACOS_COMPILE_OPTIONS})
--target_link_options(ccd PRIVATE ${MUJOCO_MACOS_LINK_OPTIONS})
--
--# libCCD has an unconditional `#define _CRT_SECURE_NO_WARNINGS` on Windows.
--# TODO(stunya): Remove this after https://github.com/danfis/libccd/pull/77 is merged.
--if(WIN32)
--  if(MSVC)
--    # C4005 is the MSVC equivalent of -Wmacro-redefined.
--    target_compile_options(ccd PRIVATE /wd4005)
--  else()
--    target_compile_options(ccd PRIVATE -Wno-macro-redefined)
-+
-+if(NOT MUJOCO_USE_SYSTEM_ccd)
-+  target_compile_options(ccd PRIVATE ${MUJOCO_MACOS_COMPILE_OPTIONS})
-+  target_link_options(ccd PRIVATE ${MUJOCO_MACOS_LINK_OPTIONS})
-+  # This is necessary to ensure that the any library that consumes the ccd
-+  # compiled internally by MuJoCo (as static library) has CCD_EXPORT correctly
-+  # defined as an empty string. For ccd itself, this is ensured by the variable
-+  # CCD_HIDE_ALL_SYMBOLS set to ON before the call to findorfetch
-+  # See https://github.com/danfis/libccd/pull/79
-+  target_compile_definitions(ccd INTERFACE CCD_STATIC_DEFINE)
-+
-+  # libCCD has an unconditional `#define _CRT_SECURE_NO_WARNINGS` on Windows.
-+  # TODO(stunya): Remove this after https://github.com/danfis/libccd/pull/77 is merged.
-+  if(WIN32)
-+    if(MSVC)
-+      # C4005 is the MSVC equivalent of -Wmacro-redefined.
-+      target_compile_options(ccd PRIVATE /wd4005)
-+    else()
-+      target_compile_options(ccd PRIVATE -Wno-macro-redefined)
-+    endif()
-   endif()
- endif()
- 
- if(MUJOCO_BUILD_TESTS)
-+  option(MUJOCO_USE_SYSTEM_abseil "Use installed abseil version." OFF)
-+  mark_as_advanced(MUJOCO_USE_SYSTEM_abseil)
-+
-   set(ABSL_PROPAGATE_CXX_STD ON)
- 
-   # This specific version of Abseil does not have the following variable. We need to work with BUILD_TESTING
-@@ -249,15 +296,11 @@ if(MUJOCO_BUILD_TESTS)
-   set(ABSL_BUILD_TESTING OFF)
-   findorfetch(
-     USE_SYSTEM_PACKAGE
--    OFF
-+    ${MUJOCO_USE_SYSTEM_abseil}
-     PACKAGE_NAME
-     absl
-     LIBRARY_NAME
-     abseil-cpp
--    GIT_REPO
--    https://github.com/abseil/abseil-cpp.git
--    GIT_TAG
--    ${MUJOCO_DEP_VERSION_abseil}
-     TARGETS
-     absl::core_headers
-     EXCLUDE_FROM_ALL
-@@ -268,6 +311,9 @@ if(MUJOCO_BUILD_TESTS)
-       CACHE BOOL "Build tests." FORCE
-   )
- 
-+  option(MUJOCO_USE_SYSTEM_gtest "Use installed gtest version." OFF)
-+  mark_as_advanced(MUJOCO_USE_SYSTEM_gtest)
-+
-   # Avoid linking errors on Windows by dynamically linking to the C runtime.
-   set(gtest_force_shared_crt
-       ON
-@@ -276,22 +322,20 @@ if(MUJOCO_BUILD_TESTS)
- 
-   findorfetch(
-     USE_SYSTEM_PACKAGE
--    OFF
-+    ${MUJOCO_USE_SYSTEM_gtest}
-     PACKAGE_NAME
-     GTest
-     LIBRARY_NAME
-     googletest
--    GIT_REPO
--    https://github.com/google/googletest.git
--    GIT_TAG
--    ${MUJOCO_DEP_VERSION_gtest}
-     TARGETS
--    gtest
--    gmock
--    gtest_main
-+    GTest::gmock
-+    GTest::gtest_main
-     EXCLUDE_FROM_ALL
-   )
- 
-+  option(MUJOCO_USE_SYSTEM_benchmark "Use installed benchmark version." OFF)
-+  mark_as_advanced(MUJOCO_USE_SYSTEM_benchmark)
-+
-   set(BENCHMARK_EXTRA_FETCH_ARGS "")
-   if(WIN32 AND NOT MSVC)
-     set(BENCHMARK_EXTRA_FETCH_ARGS
-@@ -310,15 +354,11 @@ if(MUJOCO_BUILD_TESTS)
- 
-   findorfetch(
-     USE_SYSTEM_PACKAGE
--    OFF
-+    ${MUJOCO_USE_SYSTEM_benchmark}
-     PACKAGE_NAME
-     benchmark
-     LIBRARY_NAME
-     benchmark
--    GIT_REPO
--    https://github.com/google/benchmark.git
--    GIT_TAG
--    ${MUJOCO_DEP_VERSION_benchmark}
-     TARGETS
-     benchmark::benchmark
-     benchmark::benchmark_main
-@@ -328,15 +368,18 @@ if(MUJOCO_BUILD_TESTS)
- endif()
- 
- if(MUJOCO_TEST_PYTHON_UTIL)
-+  option(MUJOCO_USE_SYSTEM_Eigen3 "Use installed Eigen3 version." OFF)
-+  mark_as_advanced(MUJOCO_USE_SYSTEM_Eigen3)
-+
-   add_compile_definitions(EIGEN_MPL2_ONLY)
--  if(NOT TARGET eigen)
--    # Support new IN_LIST if() operator.
--    set(CMAKE_POLICY_DEFAULT_CMP0057 NEW)
-+  if(NOT TARGET Eigen3::Eigen)
-+    if(NOT MUJOCO_USE_SYSTEM_Eigen3)
-+      # Support new IN_LIST if() operator.
-+      set(CMAKE_POLICY_DEFAULT_CMP0057 NEW)
-+    endif()
- 
-     FetchContent_Declare(
-       Eigen3
--      GIT_REPOSITORY https://gitlab.com/libeigen/eigen.git
--      GIT_TAG ${MUJOCO_DEP_VERSION_Eigen3}
-     )
- 
-     FetchContent_GetProperties(Eigen3)
-@@ -348,6 +391,19 @@ if(MUJOCO_TEST_PYTHON_UTIL)
-       set_target_properties(
-         Eigen3::Eigen PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${eigen3_SOURCE_DIR}"
-       )
-+
-+      fetchcontent_getproperties(Eigen3)
-+      # if(NOT Eigen3_POPULATED)
-+      #   fetchcontent_populate(Eigen3)
-+
-+      #   # Mark the library as IMPORTED as a workaround for https://gitlab.kitware.com/cmake/cmake/-/issues/15415
-+      #   add_library(Eigen3::Eigen INTERFACE IMPORTED)
-+      #   set_target_properties(
-+      #     Eigen3::Eigen PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${eigen3_SOURCE_DIR}"
-+      #   )
-+      # endif()
-+    else()
-+      find_package(Eigen3 REQUIRED)
-     endif()
-   endif()
- endif()
-diff --git a/plugin/sdf/CMakeLists.txt b/plugin/sdf/CMakeLists.txt
-index 3e216fc4..e7e3a1eb 100644
---- a/plugin/sdf/CMakeLists.txt
-+++ b/plugin/sdf/CMakeLists.txt
-@@ -37,7 +37,7 @@ set(MUJOCO_SDF_SRCS
- add_library(sdf SHARED)
- target_sources(sdf PRIVATE ${MUJOCO_SDF_SRCS})
- target_include_directories(sdf PRIVATE ${MUJOCO_SDF_INCLUDE})
--target_link_libraries(sdf PRIVATE mujoco SdfLib)
-+target_link_libraries(sdf PRIVATE mujoco SdfLib::SdfLib)
- target_compile_options(
-   sdf
-   PRIVATE ${AVX_COMPILE_OPTIONS}
-diff --git a/python/mujoco/util/CMakeLists.txt b/python/mujoco/util/CMakeLists.txt
-index 666a3725..d89bb499 100644
---- a/python/mujoco/util/CMakeLists.txt
-+++ b/python/mujoco/util/CMakeLists.txt
-@@ -63,8 +63,8 @@ if(BUILD_TESTING)
-   target_link_libraries(
-     array_traits_test
-     array_traits
--    gmock
--    gtest_main
-+    GTest::gmock
-+    GTest::gtest_main
-   )
-   gtest_add_tests(TARGET array_traits_test SOURCES array_traits_test.cc)
- 
-@@ -72,8 +72,8 @@ if(BUILD_TESTING)
-   target_link_libraries(
-     func_traits_test
-     func_traits
--    gmock
--    gtest_main
-+    GTest::gmock
-+    GTest::gtest_main
-   )
-   gtest_add_tests(TARGET func_traits_test SOURCES func_traits_test.cc)
- 
-@@ -81,8 +81,8 @@ if(BUILD_TESTING)
-   target_link_libraries(
-     func_wrap_test
-     func_wrap
--    gmock
--    gtest_main
-+    GTest::gmock
-+    GTest::gtest_main
-   )
-   gtest_add_tests(TARGET func_wrap_test SOURCES func_wrap_test.cc)
- 
-@@ -90,8 +90,8 @@ if(BUILD_TESTING)
-   target_link_libraries(
-     tuple_tools_test
-     func_wrap
--    gmock
--    gtest_main
-+    GTest::gmock
-+    GTest::gtest_main
-   )
-   gtest_add_tests(TARGET tuple_tools_test SOURCES tuple_tools_test.cc)
- endif()
-diff --git a/simulate/cmake/SimulateDependencies.cmake b/simulate/cmake/SimulateDependencies.cmake
-index 5141406c..75ff7884 100644
---- a/simulate/cmake/SimulateDependencies.cmake
-+++ b/simulate/cmake/SimulateDependencies.cmake
-@@ -81,10 +81,6 @@ findorfetch(
-   glfw3
-   LIBRARY_NAME
-   glfw3
--  GIT_REPO
--  https://github.com/glfw/glfw.git
--  GIT_TAG
--  ${MUJOCO_DEP_VERSION_glfw3}
-   TARGETS
-   glfw
-   EXCLUDE_FROM_ALL
-diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt
-index 122760a9..ddd90819 100644
---- a/test/CMakeLists.txt
-+++ b/test/CMakeLists.txt
-@@ -30,7 +30,7 @@ macro(mujoco_test name)
-   )
- 
-   add_executable(${name} ${name}.cc)
--  target_link_libraries(${name} gtest_main mujoco)
-+  target_link_libraries(${name} GTest::gtest_main mujoco)
-   target_include_directories(${name} PRIVATE ${MUJOCO_TEST_INCLUDE})
-   set_target_properties(${name} PROPERTIES BUILD_RPATH ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
-   # gtest_discover_tests is recommended over gtest_add_tests, but has some issues in Windows.
-@@ -60,20 +60,20 @@ target_link_libraries(
-          absl::synchronization
-          absl::flat_hash_map
-          absl::flat_hash_set
--         gtest
--         gmock
-+         GTest::gtest
-+         GTest::gmock
-          mujoco::mujoco
- )
- target_include_directories(fixture PRIVATE ${mujoco_SOURCE_DIR}/include gmock)
- 
- mujoco_test(fixture_test)
--target_link_libraries(fixture_test fixture gmock)
-+target_link_libraries(fixture_test fixture GTest::gmock)
- 
- mujoco_test(header_test)
--target_link_libraries(header_test fixture gmock)
-+target_link_libraries(fixture_test fixture GTest::gmock)
- 
- mujoco_test(pipeline_test)
--target_link_libraries(pipeline_test fixture gmock)
-+target_link_libraries(fixture_test fixture GTest::gmock)
- 
- add_subdirectory(benchmark)
- add_subdirectory(engine)
diff --git a/pkgs/applications/science/robotics/mujoco/sdflib-system-deps.patch b/pkgs/applications/science/robotics/mujoco/sdflib-system-deps.patch
deleted file mode 100644
index ca84c60a63df4..0000000000000
--- a/pkgs/applications/science/robotics/mujoco/sdflib-system-deps.patch
+++ /dev/null
@@ -1,192 +0,0 @@
-diff --git a/CMakeLists.txt b/CMakeLists.txt
-index 251c456..3d30231 100644
---- a/CMakeLists.txt
-+++ b/CMakeLists.txt
-@@ -27,7 +27,7 @@ option(SDFLIB_USE_SYSTEM_GLM "Use glm library via find_package instead of downlo
- option(SDFLIB_USE_SYSTEM_SPDLOG "Use spdlog library via find_package instead of downloading it" OFF)
- option(SDFLIB_USE_SYSTEM_CEREAL "Use cereal library via find_package instead of downloading it" OFF)
- option(SDFLIB_USE_SYSTEM_ASSIMP "Use assimp library via find_package instead of downloading it" OFF)
--
-+option(SDFLIB_USE_SYSTEM_TRIANGLEMESHDISTANCE "Use TriangleMeshDistance library via system includes instead of downloading it" OFF)
- 
- if(SDFLIB_DEBUG_INFO)
-     add_compile_definitions(SDFLIB_PRINT_STATISTICS)
-@@ -55,13 +55,52 @@ file(GLOB UTILS_SOURCE_FILES src/utils/*.cpp)
- file(GLOB UTILS_HEADER_FILES src/utils/*.h)
- 
- # Add libraries
--add_library(${PROJECT_NAME} STATIC  ${SOURCE_FILES} ${HEADER_FILES} ${PUBLIC_HEADER_FILES}
--                                    ${SDF_SOURCE_FILES} ${SDF_HEADER_FILES}
--                                    ${UTILS_SOURCE_FILES} ${UTILS_HEADER_FILES})
--
--target_include_directories(${PROJECT_NAME} PUBLIC include/)
-+add_library(${PROJECT_NAME} ${SOURCE_FILES} ${HEADER_FILES} ${PUBLIC_HEADER_FILES}
-+                            ${SDF_SOURCE_FILES} ${SDF_HEADER_FILES}
-+                            ${UTILS_SOURCE_FILES} ${UTILS_HEADER_FILES})
-+add_library(${PROJECT_NAME}::${PROJECT_NAME} ALIAS ${PROJECT_NAME})
-+if(BUILD_SHARED_LIBS AND WIN32)
-+    set_target_properties(${PROJECT_NAME} PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)
-+endif()
-+include(GNUInstallDirs)
-+target_include_directories(${PROJECT_NAME} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
-+                                                  $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>)
- target_include_directories(${PROJECT_NAME} PRIVATE src/)
- 
-+# Install library and CMake config files
-+install(TARGETS ${PROJECT_NAME} EXPORT ${PROJECT_NAME})
-+install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/SdfLib
-+        DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
-+
-+install(EXPORT ${PROJECT_NAME}
-+        FILE ${PROJECT_NAME}Targets.cmake
-+        DESTINATION lib/cmake/${PROJECT_NAME}
-+        NAMESPACE ${PROJECT_NAME}::
-+)
-+
-+include(CMakePackageConfigHelpers)
-+set(PACKAGE_DEPENDENCIES "")
-+if(SDFLIB_USE_SYSTEM_GLM)
-+    string(APPEND PACKAGE_DEPENDENCIES "find_dependency(glm)\n")
-+endif()
-+if(SDFLIB_USE_SYSTEM_SPDLOG)
-+    string(APPEND PACKAGE_DEPENDENCIES "find_dependency(spdlog)\n")
-+endif()
-+if(SDFLIB_USE_SYSTEM_CEREAL)
-+    string(APPEND PACKAGE_DEPENDENCIES "find_dependency(cereal)\n")
-+endif()
-+if(SDFLIB_USE_ASSIMP AND SDFLIB_USE_SYSTEM_ASSIMP)
-+    string(APPEND PACKAGE_DEPENDENCIES "find_dependency(assimp)\n")
-+endif()
-+
-+configure_package_config_file(${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_NAME}Config.cmake.in
-+                              "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake"
-+                              INSTALL_DESTINATION "lib/cmake/${PROJECT_NAME}"
-+                              NO_SET_AND_CHECK_MACRO
-+                              NO_CHECK_REQUIRED_COMPONENTS_MACRO)
-+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake
-+        DESTINATION lib/cmake/${PROJECT_NAME})
-+
- # Add shaders
- file(GLOB SHADER_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/src/render_engine/shaders 
-                        src/render_engine/shaders/*.frag 
-@@ -69,7 +108,7 @@ file(GLOB SHADER_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/src/render_engine/sh
-                        src/render_engine/shaders/*.comp)
- 
- foreach(SHADER IN LISTS SHADER_FILES)
--    add_custom_command(OUTPUT ${SHADER}
-+add_custom_command(OUTPUT ${SHADER}
-             COMMAND cmake -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/src/render_engine/shaders/${SHADER} $<TARGET_FILE_DIR:${PROJECT_NAME}>/shaders/${SHADER}
-             DEPENDS src/render_engine/shaders/${SHADER}
-         )
-@@ -112,7 +151,10 @@ endif()
- target_link_libraries(${PROJECT_NAME} PUBLIC ${SDFLIB_GLM_TARGET})
- target_link_libraries(${PROJECT_NAME} PUBLIC spdlog::spdlog)
- target_link_libraries(${PROJECT_NAME} PUBLIC cereal::cereal)
--target_link_libraries(${PROJECT_NAME} PUBLIC icg)
-+
-+if(NOT SDFLIB_USE_SYSTEM_TRIANGLEMESHDISTANCE)
-+    target_link_libraries(${PROJECT_NAME} PUBLIC TriangleMeshDistance)
-+endif()
- 
- if(CMAKE_CXX_COMPILER_ID MATCHES GNU)
-     target_link_libraries(${PROJECT_NAME} PUBLIC -lstdc++fs)
-diff --git a/SdfLibConfig.cmake.in b/SdfLibConfig.cmake.in
-new file mode 100644
-index 0000000..9b8265c
---- /dev/null
-+++ b/SdfLibConfig.cmake.in
-@@ -0,0 +1,7 @@
-+@PACKAGE_INIT@

-+

-+include(CMakeFindDependencyMacro)

-+

-+@PACKAGE_DEPENDENCIES@

-+

-+include("${CMAKE_CURRENT_LIST_DIR}/SdfLibTargets.cmake")

-diff --git a/include/SdfLib/TrianglesInfluence.h b/include/SdfLib/TrianglesInfluence.h
-index fc2ca52..b276f23 100644
---- a/include/SdfLib/TrianglesInfluence.h
-+++ b/include/SdfLib/TrianglesInfluence.h
-@@ -11,7 +11,7 @@
- #include "InterpolationMethods.h"
- #include "utils/Timer.h"
- #include "utils/GJK.h"
--#include <InteractiveComputerGraphics/TriangleMeshDistance.h>
-+#include <tmd/TriangleMeshDistance.h>
- 
- #include <vector>
- #include <array>
-diff --git a/libs/CMakeLists.txt b/libs/CMakeLists.txt
-index 79f70c1..e2a4f10 100644
---- a/libs/CMakeLists.txt
-+++ b/libs/CMakeLists.txt
-@@ -137,9 +137,10 @@ if(SDFLIB_BUILD_APPS OR SDFLIB_BUILD_DEBUG_APPS)
- 	target_include_directories(stb_image INTERFACE stb)
-  endif()
- 
--# icg
--add_library(icg INTERFACE)
--target_include_directories(icg INTERFACE InteractiveComputerGraphics)
-+if (NOT SDFLIB_USE_SYSTEM_TRIANGLEMESHDISTANCE)
-+	add_library(TriangleMeshDistance INTERFACE)
-+	target_include_directories(TriangleMeshDistance INTERFACE InteractiveComputerGraphics)
-+endif()
- 
- if(SDFLIB_BUILD_APPS OR SDFLIB_BUILD_DEBUG_APPS)
- 	# glfw
-diff --git a/libs/InteractiveComputerGraphics/InteractiveComputerGraphics/TriangleMeshDistance.h b/libs/InteractiveComputerGraphics/tmd/TriangleMeshDistance.h
-similarity index 100%
-rename from libs/InteractiveComputerGraphics/InteractiveComputerGraphics/TriangleMeshDistance.h
-rename to libs/InteractiveComputerGraphics/tmd/TriangleMeshDistance.h
-diff --git a/src/tools/ImageQueryTime/main.cpp b/src/tools/ImageQueryTime/main.cpp
-index 357a78b..f4fd9e7 100644
---- a/src/tools/ImageQueryTime/main.cpp
-+++ b/src/tools/ImageQueryTime/main.cpp
-@@ -17,7 +17,7 @@
- 
- #define TEST_METHODS 
- #ifdef TEST_METHODS
--#include <InteractiveComputerGraphics/TriangleMeshDistance.h>
-+#include <tmd/TriangleMeshDistance.h>
- // #include <CGAL/Simple_cartesian.h>
- // #include <CGAL/AABB_tree.h>
- // #include <CGAL/AABB_traits.h>
-diff --git a/src/tools/SdfErrorCompare/main.cpp b/src/tools/SdfErrorCompare/main.cpp
-index deef25f..9e402c4 100644
---- a/src/tools/SdfErrorCompare/main.cpp
-+++ b/src/tools/SdfErrorCompare/main.cpp
-@@ -23,7 +23,7 @@ using namespace sdflib;
- // #define TEST_OPENVDB
- 
- #ifdef TEST_ICG
--#include <InteractiveComputerGraphics/TriangleMeshDistance.h>
-+#include <tmd/TriangleMeshDistance.h>
- #endif
- #ifdef TEST_CGAL
- #include <CGAL/Simple_cartesian.h>
-diff --git a/src/tools/SdfLibUnity/SdfExportFunc.cpp b/src/tools/SdfLibUnity/SdfExportFunc.cpp
-index ff4e017..7e06ada 100644
---- a/src/tools/SdfLibUnity/SdfExportFunc.cpp
-+++ b/src/tools/SdfLibUnity/SdfExportFunc.cpp
-@@ -1,7 +1,7 @@
- #include "SdfExportFunc.h"
- #include "spdlog/sinks/rotating_file_sink.h"
- 
--#include <InteractiveComputerGraphics/TriangleMeshDistance.h>
-+#include <tmd/TriangleMeshDistance.h>
- 
- using namespace sdflib;
- 
-diff --git a/src/tools/SdfOffsets/main.cpp b/src/tools/SdfOffsets/main.cpp
-index b6769d7..07f137b 100644
---- a/src/tools/SdfOffsets/main.cpp
-+++ b/src/tools/SdfOffsets/main.cpp
-@@ -9,7 +9,7 @@
- #include <glm/gtc/type_ptr.hpp>
- #include <glm/gtc/matrix_transform.hpp>
- 
--#include <InteractiveComputerGraphics/TriangleMeshDistance.h>
-+#include <tmd/TriangleMeshDistance.h>
- #include <CGAL/Surface_mesh_default_triangulation_3.h>
- #include <CGAL/Complex_2_in_triangulation_3.h>
- #include <CGAL/make_surface_mesh.h>
diff --git a/pkgs/applications/science/robotics/qgroundcontrol/default.nix b/pkgs/applications/science/robotics/qgroundcontrol/default.nix
deleted file mode 100644
index 25b1f4e5d5ce6..0000000000000
--- a/pkgs/applications/science/robotics/qgroundcontrol/default.nix
+++ /dev/null
@@ -1,82 +0,0 @@
-{ lib, stdenv, fetchFromGitHub, SDL2, qtbase, qtcharts, qtlocation, qtserialport
-, qtsvg, qtquickcontrols2, qtgraphicaleffects, qtspeech, qtx11extras, qmake
-, qttools, gst_all_1, wayland, pkg-config, wrapQtAppsHook }:
-
-stdenv.mkDerivation rec {
-  pname = "qgroundcontrol";
-  version = "4.3.0";
-
-  propagatedBuildInputs = [
-    qtbase qtcharts qtlocation qtserialport qtsvg qtquickcontrols2
-    qtgraphicaleffects qtspeech qtx11extras
-  ];
-
-  gstInputs = with gst_all_1; [
-    gstreamer
-    gst-plugins-base
-    (gst-plugins-good.override { qt5Support = true; })
-    gst-plugins-bad
-    gst-libav
-    wayland
-  ];
-
-  buildInputs = [ SDL2 ] ++ gstInputs ++ propagatedBuildInputs;
-  nativeBuildInputs = [ pkg-config qmake qttools wrapQtAppsHook ];
-
-  preConfigure = ''
-    mkdir build
-    cd build
-  '';
-
-  qmakeFlags = [
-    "CONFIG+=StableBuild"
-    # Default install tries to copy Qt files into package
-    "CONFIG+=QGC_DISABLE_BUILD_SETUP"
-    # Tries to download x86_64-only prebuilt binaries
-    "DEFINES+=DISABLE_AIRMAP"
-    "../qgroundcontrol.pro"
-  ];
-
-  installPhase = ''
-    runHook preInstall
-
-    cd ..
-
-    mkdir -p $out/share/applications
-    sed 's/Exec=.*$/Exec=QGroundControl/g' --in-place deploy/qgroundcontrol.desktop
-    cp -v deploy/qgroundcontrol.desktop $out/share/applications
-
-    mkdir -p $out/bin
-    cp -v build/staging/QGroundControl "$out/bin/"
-
-    mkdir -p $out/share/qgroundcontrol
-    cp -rv resources/ $out/share/qgroundcontrol
-
-    mkdir -p $out/share/pixmaps
-    cp -v resources/icons/qgroundcontrol.png $out/share/pixmaps
-
-    runHook postInstall
-  '';
-
-  postInstall = ''
-    qtWrapperArgs+=(--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0")
-  '';
-
-  # TODO: package mavlink so we can build from a normal source tarball
-  src = fetchFromGitHub {
-    owner = "mavlink";
-    repo = pname;
-    rev = "v${version}";
-    sha256 = "sha256-a0+cpT413qi88PvaWQPxKABHfK7vbPE7B42n84n/SAk=";
-    fetchSubmodules = true;
-  };
-
-  meta = with lib; {
-    description = "Provides full ground station support and configuration for the PX4 and APM Flight Stacks";
-    homepage = "http://qgroundcontrol.com/";
-    license = licenses.gpl3Plus;
-    platforms = platforms.linux;
-    maintainers = with maintainers; [ lopsided98 ];
-    mainProgram = "QGroundControl";
-  };
-}
diff --git a/pkgs/applications/science/robotics/sumorobot-manager/default.nix b/pkgs/applications/science/robotics/sumorobot-manager/default.nix
index eb9322f0fb222..a26bd5d5fc288 100644
--- a/pkgs/applications/science/robotics/sumorobot-manager/default.nix
+++ b/pkgs/applications/science/robotics/sumorobot-manager/default.nix
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ wrapPython qt5.wrapQtAppsHook dos2unix ];
 
-  buildPhase = "true";
+  dontBuild = true;
 
   installPhase = ''
     mkdir -p $out/opt/sumorobot-manager
diff --git a/pkgs/applications/science/robotics/yarp/default.nix b/pkgs/applications/science/robotics/yarp/default.nix
index 3b33096dc683f..4f2e45384b76c 100644
--- a/pkgs/applications/science/robotics/yarp/default.nix
+++ b/pkgs/applications/science/robotics/yarp/default.nix
@@ -18,11 +18,9 @@ stdenv.mkDerivation rec {
     "-DYARP_COMPILE_UNMAINTAINED:BOOL=ON"
     "-DCREATE_YARPC:BOOL=ON"
     "-DCREATE_YARPCXX:BOOL=ON"
+    "-DCMAKE_INSTALL_LIBDIR=${placeholder "out"}/lib"
   ];
 
-  # since we cant expand $out in cmakeFlags
-  preConfigure = ''cmakeFlags="$cmakeFlags -DCMAKE_INSTALL_LIBDIR=$out/lib"'';
-
   postInstall = "mv ./$out/lib/*.so $out/lib/";
 
   meta = {