about summary refs log tree commit diff
path: root/nixpkgs/pkgs/applications/science
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/applications/science')
-rw-r--r--nixpkgs/pkgs/applications/science/biology/bedops/default.nix4
-rw-r--r--nixpkgs/pkgs/applications/science/biology/bowtie/default.nix2
-rw-r--r--nixpkgs/pkgs/applications/science/biology/bowtie2/default.nix4
-rw-r--r--nixpkgs/pkgs/applications/science/biology/cd-hit/default.nix2
-rw-r--r--nixpkgs/pkgs/applications/science/biology/fastp/default.nix4
-rw-r--r--nixpkgs/pkgs/applications/science/biology/minimap2/default.nix4
-rw-r--r--nixpkgs/pkgs/applications/science/biology/mosdepth/default.nix4
-rw-r--r--nixpkgs/pkgs/applications/science/biology/mrbayes/builder.sh9
-rw-r--r--nixpkgs/pkgs/applications/science/biology/mrbayes/default.nix23
-rw-r--r--nixpkgs/pkgs/applications/science/biology/neuron/default.nix4
-rw-r--r--nixpkgs/pkgs/applications/science/biology/picard-tools/default.nix6
-rw-r--r--nixpkgs/pkgs/applications/science/biology/stacks/default.nix6
-rw-r--r--nixpkgs/pkgs/applications/science/biology/varscan/default.nix2
-rw-r--r--nixpkgs/pkgs/applications/science/chemistry/avogadro2/default.nix37
-rw-r--r--nixpkgs/pkgs/applications/science/chemistry/cp2k/default.nix117
-rw-r--r--nixpkgs/pkgs/applications/science/chemistry/ergoscf/default.nix40
-rw-r--r--nixpkgs/pkgs/applications/science/chemistry/ergoscf/math-constants.patch19
-rw-r--r--nixpkgs/pkgs/applications/science/chemistry/jmol/default.nix4
-rw-r--r--nixpkgs/pkgs/applications/science/chemistry/openmolcas/default.nix6
-rw-r--r--nixpkgs/pkgs/applications/science/chemistry/pymol/default.nix28
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/eagle/eagle.nix4
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/eagle/eagle7.nix2
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/kicad/base.nix4
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/lepton-eda/default.nix61
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/openhantek6022/default.nix4
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/openroad/default.nix94
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/verilator/default.nix4
-rw-r--r--nixpkgs/pkgs/applications/science/electronics/vhd2vl/default.nix7
-rw-r--r--nixpkgs/pkgs/applications/science/geometry/gama/default.nix4
-rw-r--r--nixpkgs/pkgs/applications/science/logic/bitwuzla/default.nix67
-rw-r--r--nixpkgs/pkgs/applications/science/logic/cadical/default.nix26
-rw-r--r--nixpkgs/pkgs/applications/science/logic/elan/default.nix6
-rw-r--r--nixpkgs/pkgs/applications/science/logic/lean/default.nix6
-rw-r--r--nixpkgs/pkgs/applications/science/logic/logisim-evolution/default.nix46
-rw-r--r--nixpkgs/pkgs/applications/science/logic/logisim/default.nix30
-rw-r--r--nixpkgs/pkgs/applications/science/logic/opensmt/default.nix4
-rw-r--r--nixpkgs/pkgs/applications/science/logic/poly/default.nix4
-rw-r--r--nixpkgs/pkgs/applications/science/logic/saw-tools/default.nix2
-rw-r--r--nixpkgs/pkgs/applications/science/logic/tlaplus/tlaps.nix18
-rw-r--r--nixpkgs/pkgs/applications/science/logic/tlaplus/toolbox.nix17
-rw-r--r--nixpkgs/pkgs/applications/science/logic/verifast/default.nix6
-rw-r--r--nixpkgs/pkgs/applications/science/logic/why3/default.nix4
-rw-r--r--nixpkgs/pkgs/applications/science/logic/why3/with-provers.nix31
-rw-r--r--nixpkgs/pkgs/applications/science/logic/workcraft/default.nix4
-rw-r--r--nixpkgs/pkgs/applications/science/machine-learning/finalfusion-utils/default.nix6
-rw-r--r--nixpkgs/pkgs/applications/science/machine-learning/nengo-gui/default.nix26
-rw-r--r--nixpkgs/pkgs/applications/science/machine-learning/vowpal-wabbit/default.nix4
-rw-r--r--nixpkgs/pkgs/applications/science/math/R/default.nix10
-rw-r--r--nixpkgs/pkgs/applications/science/math/R/fix-failing-test.patch25
-rw-r--r--nixpkgs/pkgs/applications/science/math/R/skip-check-for-aarch64.patch11
-rw-r--r--nixpkgs/pkgs/applications/science/math/colpack/default.nix28
-rw-r--r--nixpkgs/pkgs/applications/science/math/ginac/default.nix18
-rw-r--r--nixpkgs/pkgs/applications/science/math/lp_solve/default.nix63
-rw-r--r--nixpkgs/pkgs/applications/science/math/lp_solve/isnan.patch13
-rw-r--r--nixpkgs/pkgs/applications/science/math/maxima/default.nix25
-rw-r--r--nixpkgs/pkgs/applications/science/math/nasc/default.nix14
-rw-r--r--nixpkgs/pkgs/applications/science/math/nauty/default.nix6
-rw-r--r--nixpkgs/pkgs/applications/science/math/polymake/default.nix31
-rw-r--r--nixpkgs/pkgs/applications/science/math/pynac/default.nix11
-rw-r--r--nixpkgs/pkgs/applications/science/math/qalculate-gtk/default.nix4
-rw-r--r--nixpkgs/pkgs/applications/science/math/sage/default.nix4
-rw-r--r--nixpkgs/pkgs/applications/science/math/sage/patches/do-not-test-find-library.patch18
-rw-r--r--nixpkgs/pkgs/applications/science/math/sage/patches/ignore-cmp-deprecation.patch24
-rw-r--r--nixpkgs/pkgs/applications/science/math/sage/sage-src.nix97
-rw-r--r--nixpkgs/pkgs/applications/science/math/sage/sagelib.nix2
-rw-r--r--nixpkgs/pkgs/applications/science/math/scilab-bin/default.nix2
-rw-r--r--nixpkgs/pkgs/applications/science/math/wxmaxima/default.nix4
-rw-r--r--nixpkgs/pkgs/applications/science/medicine/dcmtk/default.nix2
-rw-r--r--nixpkgs/pkgs/applications/science/misc/cwltool/default.nix41
-rw-r--r--nixpkgs/pkgs/applications/science/misc/openmodelica/combined/default.nix30
-rw-r--r--nixpkgs/pkgs/applications/science/misc/openmodelica/default.nix70
-rw-r--r--nixpkgs/pkgs/applications/science/misc/openmodelica/fakegit.nix81
-rw-r--r--nixpkgs/pkgs/applications/science/misc/openmodelica/mkderivation/default.nix101
-rw-r--r--nixpkgs/pkgs/applications/science/misc/openmodelica/mkderivation/src-main.nix7
-rw-r--r--nixpkgs/pkgs/applications/science/misc/openmodelica/omcompiler/default.nix63
-rw-r--r--nixpkgs/pkgs/applications/science/misc/openmodelica/omedit/default.nix38
-rw-r--r--nixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/default.nix37
-rw-r--r--nixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/fakegit.nix49
-rw-r--r--nixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/src-libs.nix83
-rwxr-xr-xnixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/update-src-libs.sh39
-rw-r--r--nixpkgs/pkgs/applications/science/misc/openmodelica/omparser/Makefile.in.patch22
-rw-r--r--nixpkgs/pkgs/applications/science/misc/openmodelica/omparser/default.nix28
-rw-r--r--nixpkgs/pkgs/applications/science/misc/openmodelica/omplot/default.nix34
-rw-r--r--nixpkgs/pkgs/applications/science/misc/openmodelica/omshell/default.nix40
-rw-r--r--nixpkgs/pkgs/applications/science/misc/openmodelica/omsimulator/default.nix26
-rw-r--r--nixpkgs/pkgs/applications/science/misc/openmodelica/src-libs-git.nix71
-rw-r--r--nixpkgs/pkgs/applications/science/misc/openmodelica/src-libs-svn.nix5
-rw-r--r--nixpkgs/pkgs/applications/science/misc/openmodelica/src-main.nix6
-rwxr-xr-xnixpkgs/pkgs/applications/science/misc/openmodelica/update-src-libs-git.sh64
-rwxr-xr-xnixpkgs/pkgs/applications/science/misc/openmodelica/update-src-libs-svn.sh50
-rw-r--r--nixpkgs/pkgs/applications/science/misc/snakemake/default.nix4
-rw-r--r--nixpkgs/pkgs/applications/science/physics/quantomatic/default.nix2
-rw-r--r--nixpkgs/pkgs/applications/science/physics/sherpa/default.nix2
-rw-r--r--nixpkgs/pkgs/applications/science/physics/xflr5/default.nix2
-rw-r--r--nixpkgs/pkgs/applications/science/programming/plm/default.nix18
-rw-r--r--nixpkgs/pkgs/applications/science/robotics/apmplanner2/default.nix2
-rw-r--r--nixpkgs/pkgs/applications/science/robotics/mavproxy/default.nix4
-rw-r--r--nixpkgs/pkgs/applications/science/robotics/qgroundcontrol/default.nix1
98 files changed, 1544 insertions, 704 deletions
diff --git a/nixpkgs/pkgs/applications/science/biology/bedops/default.nix b/nixpkgs/pkgs/applications/science/biology/bedops/default.nix
index 407ed0c01f76..e7379ee382a4 100644
--- a/nixpkgs/pkgs/applications/science/biology/bedops/default.nix
+++ b/nixpkgs/pkgs/applications/science/biology/bedops/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "bedops";
-  version = "2.4.39";
+  version = "2.4.40";
 
   src = fetchFromGitHub {
     owner = "bedops";
     repo = "bedops";
     rev = "v${version}";
-    sha256 = "sha256-vPrut3uhZK1Eg9vPcyxVNWW4zKeypdsb28oM1xbbpJo=";
+    sha256 = "sha256-rJVl3KbzGblyQZ7FtJXeEv/wjQJmzYGNjzhvkoMoBWY=";
   };
 
   buildInputs = [ zlib bzip2 jansson ];
diff --git a/nixpkgs/pkgs/applications/science/biology/bowtie/default.nix b/nixpkgs/pkgs/applications/science/biology/bowtie/default.nix
index 916bba5c0512..0722ffe09fc9 100644
--- a/nixpkgs/pkgs/applications/science/biology/bowtie/default.nix
+++ b/nixpkgs/pkgs/applications/science/biology/bowtie/default.nix
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
   meta = with lib; {
     description = "An ultrafast memory-efficient short read aligner";
     license = licenses.artistic2;
-    homepage = "http://bowtie-bio.sf.net/bowtie";
+    homepage = "http://bowtie-bio.sourceforge.net";
     maintainers = with maintainers; [ prusnak ];
     platforms = platforms.all;
   };
diff --git a/nixpkgs/pkgs/applications/science/biology/bowtie2/default.nix b/nixpkgs/pkgs/applications/science/biology/bowtie2/default.nix
index 205ff9afdca1..818d0fe14ba2 100644
--- a/nixpkgs/pkgs/applications/science/biology/bowtie2/default.nix
+++ b/nixpkgs/pkgs/applications/science/biology/bowtie2/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchFromGitHub, cmake, tbb, zlib }:
+{ lib, stdenv, fetchFromGitHub, cmake, tbb, zlib, python3, perl }:
 
 stdenv.mkDerivation rec {
   pname = "bowtie2";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  buildInputs = [ tbb zlib ];
+  buildInputs = [ tbb zlib python3 perl ];
 
   meta = with lib; {
     description = "An ultrafast and memory-efficient tool for aligning sequencing reads to long reference sequences";
diff --git a/nixpkgs/pkgs/applications/science/biology/cd-hit/default.nix b/nixpkgs/pkgs/applications/science/biology/cd-hit/default.nix
index ba1d6c27ccb1..474c0f292af4 100644
--- a/nixpkgs/pkgs/applications/science/biology/cd-hit/default.nix
+++ b/nixpkgs/pkgs/applications/science/biology/cd-hit/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "032nva6iiwmw59gjipm1mv0xlcckhxsf45mc2qbnv19lbis0q22i";
   };
 
-  propagatedBuildInputs = [ perl perlPackages.TextNSP perlPackages.PerlMagick ];
+  propagatedBuildInputs = [ perl perlPackages.TextNSP perlPackages.ImageMagick ];
 
   nativeBuildInputs = [ zlib makeWrapper ];
   buildInputs = lib.optional stdenv.cc.isClang openmp;
diff --git a/nixpkgs/pkgs/applications/science/biology/fastp/default.nix b/nixpkgs/pkgs/applications/science/biology/fastp/default.nix
index e396c8597d24..c4cae59d1c4e 100644
--- a/nixpkgs/pkgs/applications/science/biology/fastp/default.nix
+++ b/nixpkgs/pkgs/applications/science/biology/fastp/default.nix
@@ -5,13 +5,13 @@
 
 stdenv.mkDerivation rec {
   pname = "fastp";
-  version = "0.20.1";
+  version = "0.22.0";
 
   src = fetchFromGitHub {
     owner = "OpenGene";
     repo = "fastp";
     rev = "v${version}";
-    sha256 = "sha256-pANwppkO9pfV9vctB7HmNCzYRtf+Xt+5HMKzvFuvyFM=";
+    sha256 = "sha256-XR76hNz7iGXQYSBbBandHZ+oU3wyTf1AKlu9Xeq/GyE=";
   };
 
   buildInputs = [ zlib ];
diff --git a/nixpkgs/pkgs/applications/science/biology/minimap2/default.nix b/nixpkgs/pkgs/applications/science/biology/minimap2/default.nix
index d21ef8b3d7a9..072826c40615 100644
--- a/nixpkgs/pkgs/applications/science/biology/minimap2/default.nix
+++ b/nixpkgs/pkgs/applications/science/biology/minimap2/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "minimap2";
-  version = "2.17";
+  version = "2.22";
 
   src = fetchFromGitHub {
     repo = pname;
     owner = "lh3";
     rev = "v${version}";
-    sha256 = "0qdwlkib3aa6112372hdgvnvk86hsjjkhjar0p53pq4ajrr2cdlb";
+    sha256 = "sha256-jYXJr2T1enZfSABVV5Kmd5OBtWZtQ2D/2eAlW2WHtGU=";
   };
 
   buildInputs = [ zlib ];
diff --git a/nixpkgs/pkgs/applications/science/biology/mosdepth/default.nix b/nixpkgs/pkgs/applications/science/biology/mosdepth/default.nix
index 4815ddf2f75c..715f2ea313b4 100644
--- a/nixpkgs/pkgs/applications/science/biology/mosdepth/default.nix
+++ b/nixpkgs/pkgs/applications/science/biology/mosdepth/default.nix
@@ -17,13 +17,13 @@ let
 
 in stdenv.mkDerivation rec {
   pname = "mosdepth";
-  version = "0.3.1";
+  version = "0.3.2";
 
   src = fetchFromGitHub {
     owner = "brentp";
     repo = "mosdepth";
     rev = "v${version}";
-    sha256 = "1kcrvamrafz1m0s7mlbhaay8jyg97l1w37p6syl36r2m1plmwxjd";
+    sha256 = "sha256-uui4yC7ok+pvbXVKfBVsAarH40fnH4fnP8P4uzOqztQ=";
   };
 
   nativeBuildInputs = [ nim ];
diff --git a/nixpkgs/pkgs/applications/science/biology/mrbayes/builder.sh b/nixpkgs/pkgs/applications/science/biology/mrbayes/builder.sh
deleted file mode 100644
index 5b3a54946fc9..000000000000
--- a/nixpkgs/pkgs/applications/science/biology/mrbayes/builder.sh
+++ /dev/null
@@ -1,9 +0,0 @@
-# builder for mrbayes - note: only builds on Unix
-
-source $stdenv/setup
-
-tar xvfz $src
-cd mrbayes-*
-make
-mkdir -p $out/bin
-cp -v mb $out/bin
diff --git a/nixpkgs/pkgs/applications/science/biology/mrbayes/default.nix b/nixpkgs/pkgs/applications/science/biology/mrbayes/default.nix
index 9acfea1a1463..e4c2bbe65652 100644
--- a/nixpkgs/pkgs/applications/science/biology/mrbayes/default.nix
+++ b/nixpkgs/pkgs/applications/science/biology/mrbayes/default.nix
@@ -1,18 +1,18 @@
-{lib, stdenv, fetchurl, readline}:
+{ lib, stdenv, fetchFromGitHub, readline }:
 
 stdenv.mkDerivation rec {
-  # FIXME: replace Makefile so we can build MPI & MAC support
+  pname = "mrbayes";
+  version = "3.2.7a";
 
-  name = "mrbayes-3.1.2";
-  src = fetchurl {
-    url = "mirror://sourceforge/mrbayes/${name}.tar.gz";
-    sha256 = "1x7j8ca5wjrqrxmcpvd375ydm3s2pbkzykv8xfhg1jc037g560n6";
+  src = fetchFromGitHub {
+    owner = "NBISweden";
+    repo = "MrBayes";
+    rev = "v${version}";
+    sha256 = "sha256-pkkxZ6YHRn/I1SJpT9A+EK4S5hWGmFdcDBJS0zh5mLA=";
   };
-  builder = ./builder.sh;
-  buildInputs = [readline];
 
   meta = with lib; {
-    description     = "Bayesian Inference of Phylogeny";
+    description = "Bayesian Inference of Phylogeny";
     longDescription = ''
       Bayesian inference of phylogeny is based upon a
       quantity called the posterior probability distribution of trees, which is
@@ -22,8 +22,9 @@ stdenv.mkDerivation rec {
       MrBayes uses a simulation technique called Markov chain Monte Carlo (or
       MCMC) to approximate the posterior probabilities of trees.
     '';
-    license     = licenses.gpl2;
-    homepage    = "http://mrbayes.csit.fsu.edu/";
+    maintainers = with maintainers; [ ];
+    license = licenses.gpl2Plus;
+    homepage = "https://nbisweden.github.io/MrBayes/";
     platforms = platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/applications/science/biology/neuron/default.nix b/nixpkgs/pkgs/applications/science/biology/neuron/default.nix
index 7bfef3a82fed..804407968e1c 100644
--- a/nixpkgs/pkgs/applications/science/biology/neuron/default.nix
+++ b/nixpkgs/pkgs/applications/science/biology/neuron/default.nix
@@ -60,13 +60,13 @@ stdenv.mkDerivation rec {
                         else ["--without-mpi"]);
 
 
-  postInstall = lib.optionals (python != null) [ ''
+  postInstall = lib.optionalString (python != null) ''
     ## standardise python neuron install dir if any
     if [[ -d $out/lib/python ]]; then
         mkdir -p ''${out}/${python.sitePackages}
         mv ''${out}/lib/python/*  ''${out}/${python.sitePackages}/
     fi
-  ''];
+  '';
 
   propagatedBuildInputs = [ readline ncurses which libtool ];
 
diff --git a/nixpkgs/pkgs/applications/science/biology/picard-tools/default.nix b/nixpkgs/pkgs/applications/science/biology/picard-tools/default.nix
index ed0d043cd542..345a38ae24a4 100644
--- a/nixpkgs/pkgs/applications/science/biology/picard-tools/default.nix
+++ b/nixpkgs/pkgs/applications/science/biology/picard-tools/default.nix
@@ -2,17 +2,17 @@
 
 stdenv.mkDerivation rec {
   pname = "picard-tools";
-  version = "2.25.1";
+  version = "2.26.0";
 
   src = fetchurl {
     url = "https://github.com/broadinstitute/picard/releases/download/${version}/picard.jar";
-    sha256 = "sha256-bW5iLWtGX5/HBMN7y6VbDaxa0U0HCIu9vfreXNAn7hw=";
+    sha256 = "sha256-sz/7MtcCJlUlrNy16W1YB/zXMhYeLLbQOIOdzNsGW7w=";
   };
 
   nativeBuildInputs = [ makeWrapper ];
   buildInputs = [ jre ];
 
-  phases = [ "installPhase" ];
+  dontUnpack = true;
 
   installPhase = ''
     mkdir -p $out/libexec/picard
diff --git a/nixpkgs/pkgs/applications/science/biology/stacks/default.nix b/nixpkgs/pkgs/applications/science/biology/stacks/default.nix
index 16091514f154..89ac4c49629e 100644
--- a/nixpkgs/pkgs/applications/science/biology/stacks/default.nix
+++ b/nixpkgs/pkgs/applications/science/biology/stacks/default.nix
@@ -2,10 +2,10 @@
 
 stdenv.mkDerivation rec {
   pname = "stacks";
-  version = "2.55";
+  version = "2.59";
   src = fetchurl {
     url = "http://catchenlab.life.illinois.edu/stacks/source/${pname}-${version}.tar.gz";
-    sha256 = "sha256-p8L0F3A+GdNsPgTQNn9Em5EjFCc9f7gUvyLIRCTd05c=";
+    sha256 = "sha256-pVFwb4EPba9wL9kDGN2gi7aeH+sPhDG/XLyHxqG4zd4=";
   };
 
   buildInputs = [ zlib ];
@@ -14,6 +14,6 @@ stdenv.mkDerivation rec {
     description = "Software pipeline for building loci from short-read sequences";
     homepage = "http://catchenlab.life.illinois.edu/stacks/";
     maintainers = [ lib.maintainers.bzizou ];
-    license = lib.licenses.gpl3;
+    license = lib.licenses.gpl3Plus;
   };
 }
diff --git a/nixpkgs/pkgs/applications/science/biology/varscan/default.nix b/nixpkgs/pkgs/applications/science/biology/varscan/default.nix
index 2a232d64693d..7b09f601ad68 100644
--- a/nixpkgs/pkgs/applications/science/biology/varscan/default.nix
+++ b/nixpkgs/pkgs/applications/science/biology/varscan/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ makeWrapper ];
   buildInputs = [ jre ];
 
-  phases = [ "installPhase" ];
+  dontUnpack = true;
 
   installPhase = ''
     mkdir -p $out/libexec/varscan
diff --git a/nixpkgs/pkgs/applications/science/chemistry/avogadro2/default.nix b/nixpkgs/pkgs/applications/science/chemistry/avogadro2/default.nix
new file mode 100644
index 000000000000..437123faafd8
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/chemistry/avogadro2/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchFromGitHub, cmake, eigen, avogadrolibs, molequeue, hdf5
+, openbabel, qttools, wrapQtAppsHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "avogadro2";
+  version = "1.94.0";
+
+  src = fetchFromGitHub {
+    owner = "OpenChemistry";
+    repo = "avogadroapp";
+    rev = version;
+    sha256 = "6RaiX23YUMfTYAuSighcLGGlJtqeydNgi3PWGF77Jp8=";
+  };
+
+  nativeBuildInputs = [ cmake wrapQtAppsHook ];
+
+  buildInputs = [
+    avogadrolibs
+    molequeue
+    eigen
+    hdf5
+    qttools
+  ];
+
+  propagatedBuildInputs = [ openbabel ];
+
+  qtWrapperArgs = [ "--prefix PATH : ${openbabel}/bin" ];
+
+  meta = with lib; {
+    description = "Molecule editor and visualizer";
+    maintainers = with maintainers; [ sheepforce ];
+    homepage = "https://github.com/OpenChemistry/avogadroapp";
+    platforms = platforms.mesaPlatforms;
+    license = licenses.bsd3;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/chemistry/cp2k/default.nix b/nixpkgs/pkgs/applications/science/chemistry/cp2k/default.nix
new file mode 100644
index 000000000000..6bb99ce556dd
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/chemistry/cp2k/default.nix
@@ -0,0 +1,117 @@
+{ lib, stdenv, fetchFromGitHub, python3, gfortran, blas, lapack
+, fftw, libint, libvori, libxc, mpi, gsl, scalapack, openssh, makeWrapper
+, libxsmm, spglib, which
+} :
+
+let
+  cp2kVersion = "psmp";
+  arch = "Linux-x86-64-gfortran";
+
+in stdenv.mkDerivation rec {
+  pname = "cp2k";
+  version = "8.2.0";
+
+  src = fetchFromGitHub {
+    owner = "cp2k";
+    repo = "cp2k";
+    rev = "v${version}";
+    sha256 = "0kykq5p318hxjzd4gzqjwv9gqshbdvbg0gnjbd9bdfjx1r6jkjn3";
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [ python3 which openssh makeWrapper ];
+  buildInputs = [
+    gfortran
+    fftw
+    gsl
+    libint
+    libvori
+    libxc
+    libxsmm
+    spglib
+    scalapack
+    blas
+    lapack
+  ];
+
+  propagatedBuildInputs = [ mpi ];
+  propagatedUserEnvPkgs = [ mpi ];
+
+  makeFlags = [
+    "ARCH=${arch}"
+    "VERSION=${cp2kVersion}"
+  ];
+
+  doCheck = true;
+
+  enableParallelBuilding = true;
+
+  postPatch = ''
+    patchShebangs tools exts/dbcsr/tools/build_utils exts/dbcsr/.cp2k
+    substituteInPlace exts/dbcsr/.cp2k/Makefile --replace '/usr/bin/env python3' '${python3}/bin/python'
+  '';
+
+  configurePhase = ''
+    cat > arch/${arch}.${cp2kVersion} << EOF
+    CC         = mpicc
+    CPP        =
+    FC         = mpif90
+    LD         = mpif90
+    AR         = ar -r
+    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
+    CFLAGS    = -fopenmp
+    FCFLAGS    = \$(DFLAGS) -O2 -ffree-form -ffree-line-length-none \
+                 -ftree-vectorize -funroll-loops -msse2 \
+                 -std=f2008 \
+                 -fopenmp -ftree-vectorize -funroll-loops \
+                 -I${libxc}/include -I${libxsmm}/include \
+                 -I${libint}/include
+    LIBS       = -lfftw3 -lfftw3_threads \
+                 -lscalapack -lblas -llapack \
+                 -lxcf03 -lxc -lxsmmf -lxsmm -lsymspg \
+                 -lint2 -lstdc++ -lvori \
+                 -lgomp -lpthread -lm \
+                 -fopenmp
+    LDFLAGS    = \$(FCFLAGS) \$(LIBS)
+    EOF
+  '';
+
+  checkPhase = ''
+    export OMP_NUM_THREADS=1
+
+    export HYDRA_IFACE=lo  # Fix to make mpich run in a sandbox
+    export OMPI_MCA_rmaps_base_oversubscribe=1
+    export CP2K_DATA_DIR=data
+
+    mpirun -np 2 exe/${arch}/libcp2k_unittest.${cp2kVersion}
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin $out/share/cp2k
+
+    cp exe/${arch}/* $out/bin
+
+    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/nixpkgs/pkgs/applications/science/chemistry/ergoscf/default.nix b/nixpkgs/pkgs/applications/science/chemistry/ergoscf/default.nix
new file mode 100644
index 000000000000..b7d61848134e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/chemistry/ergoscf/default.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv, fetchurl, blas, lapack } :
+
+stdenv.mkDerivation rec {
+  pname = "ergoscf";
+  version = "3.8";
+
+  src = fetchurl {
+    url = "http://www.ergoscf.org/source/tarfiles/ergo-${version}.tar.gz";
+    sha256 = "1s50k2gfs3y6r5kddifn4p0wmj0yk85wm5vf9v3swm1c0h43riix";
+  };
+
+  buildInputs = [ blas lapack ];
+
+  patches = [ ./math-constants.patch ];
+
+  postPatch = ''
+    patchShebangs ./test
+  '';
+
+  configureFlags = [
+    "--enable-linalgebra-templates"
+    "--enable-performance"
+  ] ++ lib.optional stdenv.isx86_64 "--enable-sse-intrinsics";
+
+  LDFLAGS = "-lblas -llapack";
+
+  enableParallelBuilding = true;
+
+  OMP_NUM_THREADS = 2; # required for check phase
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Quantum chemistry program for large-scale self-consistent field calculations";
+    homepage = "http://www.ergoscf.org";
+    license = licenses.gpl3Plus;
+    maintainers = [ maintainers.markuskowa ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/chemistry/ergoscf/math-constants.patch b/nixpkgs/pkgs/applications/science/chemistry/ergoscf/math-constants.patch
new file mode 100644
index 000000000000..62209f1a3d84
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/chemistry/ergoscf/math-constants.patch
@@ -0,0 +1,19 @@
+diff --git a/source/dft/functionals.h b/source/dft/functionals.h
+index fde49ba..f7a61fc 100644
+--- a/source/dft/functionals.h
++++ b/source/dft/functionals.h
+@@ -59,6 +59,14 @@
+ #define EXTERN_C
+ #endif
+ 
++#ifndef M_PI
++#define M_PI 3.14159265358979323846
++#endif
++
++#ifndef M_SQRT2
++#define M_SQRT2        1.41421356237309504880
++#endif
++
+ typedef ergo_real real;
+ 
+ #if defined(FUNC_PRECISION) && FUNC_PRECISION == 1
diff --git a/nixpkgs/pkgs/applications/science/chemistry/jmol/default.nix b/nixpkgs/pkgs/applications/science/chemistry/jmol/default.nix
index 5d2158843ede..a3add93c8f70 100644
--- a/nixpkgs/pkgs/applications/science/chemistry/jmol/default.nix
+++ b/nixpkgs/pkgs/applications/science/chemistry/jmol/default.nix
@@ -17,14 +17,14 @@ let
   };
 in
 stdenv.mkDerivation rec {
-  version = "14.31.44";
+  version = "14.31.49";
   pname = "jmol";
 
   src = let
     baseVersion = "${lib.versions.major version}.${lib.versions.minor version}";
   in fetchurl {
     url = "mirror://sourceforge/jmol/Jmol/Version%20${baseVersion}/Jmol%20${version}/Jmol-${version}-binary.tar.gz";
-    sha256 = "sha256-MHfqoQzUEL7nje7Y/hbaA8iktxfN7464TJXum5B6OCc=";
+    sha256 = "sha256-P+bzimBVammX5LxE6Yd6CmvmBeG8WdyA1T9bHXd+ifI=";
   };
 
   patchPhase = ''
diff --git a/nixpkgs/pkgs/applications/science/chemistry/openmolcas/default.nix b/nixpkgs/pkgs/applications/science/chemistry/openmolcas/default.nix
index af646b514af9..8efe537dcacd 100644
--- a/nixpkgs/pkgs/applications/science/chemistry/openmolcas/default.nix
+++ b/nixpkgs/pkgs/applications/science/chemistry/openmolcas/default.nix
@@ -5,9 +5,9 @@
 } :
 
 let
-  version = "21.02";
+  version = "21.06";
   # The tag keeps moving, fix a hash instead
-  gitLabRev = "41cee871945ac712e86ee971425a49a8fc60a936";
+  gitLabRev = "dd982ad4bc94dec8ac1e3e99cb6a7dd249ff71de";
 
   python = python3.withPackages (ps : with ps; [ six pyparsing ]);
 
@@ -19,7 +19,7 @@ in stdenv.mkDerivation {
     owner = "Molcas";
     repo = "OpenMolcas";
     rev = gitLabRev;
-    sha256 = "0cap53gy1wds2qaxbijw09fqhvfxphfkr93nhp9xdq84yxh4wzv6";
+    sha256 = "07dm73n0s7ckif561yb3s9yqxsv39a73kb9qwny4yp39wdvv52hz";
   };
 
   patches = [
diff --git a/nixpkgs/pkgs/applications/science/chemistry/pymol/default.nix b/nixpkgs/pkgs/applications/science/chemistry/pymol/default.nix
index 2df8b0e6d473..39bbae77a66e 100644
--- a/nixpkgs/pkgs/applications/science/chemistry/pymol/default.nix
+++ b/nixpkgs/pkgs/applications/science/chemistry/pymol/default.nix
@@ -1,8 +1,18 @@
-{ lib, fetchurl, fetchFromGitHub, makeDesktopItem
-, python3, python3Packages
-, glew, glm, freeglut, libpng, libxml2, tk, freetype, msgpack }:
-
-
+{ lib
+, fetchFromGitHub
+, makeDesktopItem
+, python3
+, python3Packages
+, netcdf
+, glew
+, glm
+, freeglut
+, libpng
+, libxml2
+, tk
+, freetype
+, msgpack
+}:
 let
   pname = "pymol";
   description = "A Python-enhanced molecular graphics tool";
@@ -20,15 +30,15 @@ let
 in
 python3Packages.buildPythonApplication rec {
   inherit pname;
-  version = "2.3.0";
+  version = "2.5.0";
   src = fetchFromGitHub {
     owner = "schrodinger";
     repo = "pymol-open-source";
     rev = "v${version}";
-    sha256 = "175cqi6gfmvv49i3ws19254m7ljs53fy6y82fm1ywshq2h2c93jh";
+    sha256 = "sha256-JdsgcVF1w1xFPZxVcyS+GcWg4a1Bd4SvxFOuSdlz9SM=";
   };
 
-  buildInputs = [ python3Packages.numpy glew glm freeglut libpng libxml2 tk freetype msgpack ];
+  buildInputs = [ python3Packages.numpy glew glm freeglut libpng libxml2 tk freetype msgpack netcdf ];
   NIX_CFLAGS_COMPILE = "-I ${libxml2.dev}/include/libxml2";
   hardeningDisable = [ "format" ];
 
@@ -49,7 +59,7 @@ python3Packages.buildPythonApplication rec {
   '';
 
   meta = with lib; {
-    description = description;
+    inherit description;
     homepage = "https://www.pymol.org/";
     license = licenses.mit;
     maintainers = with maintainers; [ samlich ];
diff --git a/nixpkgs/pkgs/applications/science/electronics/eagle/eagle.nix b/nixpkgs/pkgs/applications/science/electronics/eagle/eagle.nix
index 0628134d9df2..1a900e10197e 100644
--- a/nixpkgs/pkgs/applications/science/electronics/eagle/eagle.nix
+++ b/nixpkgs/pkgs/applications/science/electronics/eagle/eagle.nix
@@ -66,8 +66,8 @@ let
       # Make desktop item
       mkdir -p "$out"/share/applications
       cp "$desktopItem"/share/applications/* "$out"/share/applications/
-      mkdir -p "$out"/share/icons
-      ln -s "$out/eagle-${version}/bin/eagle-logo.png" "$out"/share/icons/eagle.png
+      mkdir -p "$out"/share/pixmaps
+      ln -s "$out/eagle-${version}/bin/eagle-logo.png" "$out"/share/pixmaps/eagle.png
     '';
 
     meta = with lib; {
diff --git a/nixpkgs/pkgs/applications/science/electronics/eagle/eagle7.nix b/nixpkgs/pkgs/applications/science/electronics/eagle/eagle7.nix
index 2804fc3c8d7c..8ea75a3ec486 100644
--- a/nixpkgs/pkgs/applications/science/electronics/eagle/eagle7.nix
+++ b/nixpkgs/pkgs/applications/science/electronics/eagle/eagle7.nix
@@ -45,7 +45,7 @@ stdenv.mkDerivation rec {
       libX11 libXext libXi
     ];
 
-  phases = [ "installPhase" ];
+  dontUnpack = true;
 
   # NOTES:
   # Eagle for Linux comes as a self-extracting shell script with embedded
diff --git a/nixpkgs/pkgs/applications/science/electronics/kicad/base.nix b/nixpkgs/pkgs/applications/science/electronics/kicad/base.nix
index 596083c27098..d7398f39ec43 100644
--- a/nixpkgs/pkgs/applications/science/electronics/kicad/base.nix
+++ b/nixpkgs/pkgs/applications/science/electronics/kicad/base.nix
@@ -64,7 +64,7 @@ assert lib.assertMsg (!(sanitizeAddress && sanitizeThreads))
   "'sanitizeAddress' and 'sanitizeThreads' are mutually exclusive, use one.";
 
 let
-  inherit (lib) optional optionals;
+  inherit (lib) optional optionals optionalString;
 in
 stdenv.mkDerivation rec {
   pname = "kicad-base";
@@ -172,7 +172,7 @@ stdenv.mkDerivation rec {
 
   dontStrip = debug;
 
-  postInstall = optional (withI18n) ''
+  postInstall = optionalString (withI18n) ''
     mkdir -p $out/share
     lndir ${i18n}/share $out/share
   '';
diff --git a/nixpkgs/pkgs/applications/science/electronics/lepton-eda/default.nix b/nixpkgs/pkgs/applications/science/electronics/lepton-eda/default.nix
new file mode 100644
index 000000000000..3e701dc93c4f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/lepton-eda/default.nix
@@ -0,0 +1,61 @@
+{ stdenv
+, lib
+, pkg-config
+, makeWrapper
+, texinfo
+, fetchurl
+, autoreconfHook
+, guile
+, flex
+, gtk2
+, glib
+, gtkextra
+, gettext
+, gawk
+, shared-mime-info
+, groff
+, libstroke
+}:
+
+stdenv.mkDerivation rec {
+  pname = "lepton-eda";
+  version = "1.9.16-20210731";
+
+  src = fetchurl {
+    url = "https://github.com/lepton-eda/lepton-eda/releases/download/${version}/lepton-eda-${builtins.head (lib.splitString "-" version)}.tar.gz";
+    sha256 = "sha256-xdJ11M4RXNF6ePZD6Y+/DUdO21AFLbydZcq9nWg0+Yk=";
+  };
+
+  nativeBuildInputs = [ pkg-config makeWrapper texinfo autoreconfHook ];
+
+  propagatedBuildInputs = [ guile flex gtk2 glib gtkextra gettext gawk shared-mime-info groff libstroke ];
+
+  configureFlags = [
+    "--disable-update-xdg-database"
+  ];
+
+  CFLAGS = [
+    "-DSCM_DEBUG_TYPING_STRICTNESS=2"
+  ];
+
+  postInstall = ''
+    libs="${lib.makeLibraryPath propagatedBuildInputs}"
+    for program in $out/bin/*; do
+      wrapProgram "$program" \
+        --prefix LD_LIBRARY_PATH : "$libs" \
+        --prefix LTDL_LIBRARY_PATH : "$out/lib"
+    done
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/lepton-eda";
+    description = "Lepton Electronic Design Automation";
+    longDescription = ''
+      Lepton EDA is a suite of free software tools for designing electronics.
+      It provides schematic capture, netlisting into over 30 netlist formats, and many other features.
+    '';
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ tesq0 ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/openhantek6022/default.nix b/nixpkgs/pkgs/applications/science/electronics/openhantek6022/default.nix
index d2cdf20ab87c..1b9d7773669c 100644
--- a/nixpkgs/pkgs/applications/science/electronics/openhantek6022/default.nix
+++ b/nixpkgs/pkgs/applications/science/electronics/openhantek6022/default.nix
@@ -2,13 +2,13 @@
 
 mkDerivation rec {
   pname = "openhantek6022";
-  version = "3.2.3";
+  version = "3.2.4";
 
   src = fetchFromGitHub {
     owner = "OpenHantek";
     repo = "OpenHantek6022";
     rev = version;
-    sha256 = "0hnd3rdmv76dwwlmkykzwhp5sbxd1fr5ss8zdfdybxw28cxlpq8r";
+    sha256 = "sha256-Rb0bd2fnnNWEm1n2EVRB2Leb0Or9vxi5oj+FKNY4GSc=";
   };
 
   nativeBuildInputs = [ cmake makeWrapper ];
diff --git a/nixpkgs/pkgs/applications/science/electronics/openroad/default.nix b/nixpkgs/pkgs/applications/science/electronics/openroad/default.nix
new file mode 100644
index 000000000000..1b1eb39cffa0
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/electronics/openroad/default.nix
@@ -0,0 +1,94 @@
+{ lib
+, mkDerivation
+, fetchFromGitHub
+, bison
+, cmake
+, doxygen
+, flex
+, git
+, python3
+, swig4
+, boost172
+, cimg
+, eigen
+, lcov
+, lemon-graph
+, libjpeg
+, pcre
+, qtbase
+, readline
+, spdlog
+, tcl
+, tcllib
+, xorg
+, yosys
+, zlib
+}:
+
+mkDerivation rec {
+  pname = "openroad";
+  version = "2.0";
+
+  src = fetchFromGitHub {
+    owner = "The-OpenROAD-Project";
+    repo = "OpenROAD";
+    rev = "v${version}";
+    fetchSubmodules = true;
+    sha256 = "1p677xh16wskfj06jnplhpc3glibhdaqxmk0j09832chqlryzwyx";
+  };
+
+  nativeBuildInputs = [
+    bison
+    cmake
+    doxygen
+    flex
+    git
+    swig4
+  ];
+
+  buildInputs = [
+    boost172
+    cimg
+    eigen
+    lcov
+    lemon-graph
+    libjpeg
+    pcre
+    python3
+    qtbase
+    readline
+    spdlog
+    tcl
+    tcllib
+    yosys
+    xorg.libX11
+    zlib
+  ];
+
+  postPatch = ''
+    patchShebangs --build etc/find_messages.py
+  '';
+
+  # Enable output images from the placer.
+  cmakeFlags = [ "-DUSE_CIMG_LIB=ON" ];
+
+  # Resynthesis needs access to the Yosys binaries.
+  qtWrapperArgs = [ "--prefix PATH : ${lib.makeBinPath [ yosys ]}" ];
+
+  # Upstream uses vendored package versions for some dependencies, so regression testing is prudent
+  # to see if there are any breaking changes in unstable that should be vendored as well.
+  doCheck = false; # Disabled pending upstream release with fix for rcx log file creation.
+  checkPhase = ''
+    # Regression tests must be run from the project root not from within the CMake build directory.
+    cd ..
+    test/regression
+  '';
+
+  meta = with lib; {
+    description = "OpenROAD's unified application implementing an RTL-to-GDS flow";
+    homepage = "https://theopenroadproject.org";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ trepetti ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/electronics/verilator/default.nix b/nixpkgs/pkgs/applications/science/electronics/verilator/default.nix
index 5377a7b3d118..159e15cf247d 100644
--- a/nixpkgs/pkgs/applications/science/electronics/verilator/default.nix
+++ b/nixpkgs/pkgs/applications/science/electronics/verilator/default.nix
@@ -4,11 +4,11 @@
 
 stdenv.mkDerivation rec {
   pname = "verilator";
-  version = "4.202";
+  version = "4.210";
 
   src = fetchurl {
     url = "https://www.veripool.org/ftp/${pname}-${version}.tgz";
-    sha256 = "0ydn4304pminzq8zc1hsrb2fjrfqnb6akr45ky43jd29c4jgznnq";
+    sha256 = "sha256-KoIfJeV2aITnwiB2eQgQo4ZyXfMe6erFiGKXezR+IBg=";
   };
 
   enableParallelBuilding = true;
diff --git a/nixpkgs/pkgs/applications/science/electronics/vhd2vl/default.nix b/nixpkgs/pkgs/applications/science/electronics/vhd2vl/default.nix
index adce30551071..f0dd990a35bc 100644
--- a/nixpkgs/pkgs/applications/science/electronics/vhd2vl/default.nix
+++ b/nixpkgs/pkgs/applications/science/electronics/vhd2vl/default.nix
@@ -4,6 +4,7 @@
 , bison
 , flex
 , verilog
+, which
 }:
 
 stdenv.mkDerivation rec {
@@ -29,6 +30,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [
     bison
     flex
+    which
   ];
 
   buildInputs = [
@@ -36,8 +38,9 @@ stdenv.mkDerivation rec {
   ];
 
   installPhase = ''
-    mkdir -p $out/bin
-    cp src/vhd2vl $out/bin/
+    runHook preInstall
+    install -D -m755 src/vhd2vl $out/bin/vdh2vl
+    runHook postInstall
   '';
 
   meta = with lib; {
diff --git a/nixpkgs/pkgs/applications/science/geometry/gama/default.nix b/nixpkgs/pkgs/applications/science/geometry/gama/default.nix
index c5e95d37b510..899e65a7740a 100644
--- a/nixpkgs/pkgs/applications/science/geometry/gama/default.nix
+++ b/nixpkgs/pkgs/applications/science/geometry/gama/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, lib, expat, octave, libxml2, texinfo, zip }:
 stdenv.mkDerivation rec {
   pname = "gama";
-  version = "2.12";
+  version = "2.14";
 
   src = fetchurl {
     url = "mirror://gnu/${pname}/${pname}-${version}.tar.gz";
-    sha256 = "0zfilasalsy29b7viw0iwgnl9bkvp0l87gpxl1hx7379l8agwqyj";
+    sha256 = "sha256-ltYoJyo4b4Ys70nbZo5gxkjBw/RiEs5Rrdb6he9bsBI=";
   };
 
   buildInputs = [ expat ];
diff --git a/nixpkgs/pkgs/applications/science/logic/bitwuzla/default.nix b/nixpkgs/pkgs/applications/science/logic/bitwuzla/default.nix
new file mode 100644
index 000000000000..a8820b55b746
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/bitwuzla/default.nix
@@ -0,0 +1,67 @@
+{ stdenv
+, fetchFromGitHub
+, lib
+, python3
+, cmake
+, lingeling
+, btor2tools
+, gtest
+, gmp
+, cadical
+, minisat
+, picosat
+, cryptominisat
+, zlib
+, pkg-config
+  # "*** internal error in 'lglib.c': watcher stack overflow" on aarch64-linux
+, withLingeling ? !stdenv.hostPlatform.isAarch64
+}:
+
+stdenv.mkDerivation rec {
+  pname = "bitwuzla";
+  version = "unstable-2021-07-01";
+
+  src = fetchFromGitHub {
+    owner = "bitwuzla";
+    repo = "bitwuzla";
+    rev = "58d720598e359b1fdfec4a469c76f1d1f24db51a";
+    sha256 = "06ymqsdppyixb918161rmbgqvbnarj4nm4az88lkn3ri4gyimw04";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [
+    cadical
+    cryptominisat
+    picosat
+    minisat
+    btor2tools
+    gmp
+    zlib
+  ] ++ lib.optional withLingeling lingeling;
+
+  cmakeFlags = [
+    "-DBUILD_SHARED_LIBS=ON"
+    "-DPicoSAT_INCLUDE_DIR=${lib.getDev picosat}/include/picosat"
+    "-DBtor2Tools_INCLUDE_DIR=${lib.getDev btor2tools}/include/btor2parser"
+    "-DBtor2Tools_LIBRARIES=${lib.getLib btor2tools}/lib/libbtor2parser${stdenv.hostPlatform.extensions.sharedLibrary}"
+  ] ++ lib.optional doCheck "-DTESTING=YES";
+
+  checkInputs = [ python3 gtest ];
+  # two tests fail on darwin and 3 on aarch64-linux
+  doCheck = stdenv.hostPlatform.isLinux && (!stdenv.hostPlatform.isAarch64);
+  preCheck = let
+    var = if stdenv.isDarwin then "DYLD_LIBRARY_PATH" else "LD_LIBRARY_PATH";
+  in
+    ''
+      export ${var}=$(readlink -f lib)
+      patchShebangs ..
+    '';
+
+  meta = with lib; {
+    description = "A SMT solver for fixed-size bit-vectors, floating-point arithmetic, arrays, and uninterpreted functions";
+    homepage = "https://bitwuzla.github.io";
+    license = licenses.mit;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ symphorien ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/cadical/default.nix b/nixpkgs/pkgs/applications/science/logic/cadical/default.nix
index ca5e6b5c4195..f0cb1efb3050 100644
--- a/nixpkgs/pkgs/applications/science/logic/cadical/default.nix
+++ b/nixpkgs/pkgs/applications/science/logic/cadical/default.nix
@@ -2,23 +2,39 @@
 
 stdenv.mkDerivation rec {
   pname = "cadical";
-  version = "1.3.0";
+  version = "1.4.1";
 
   src = fetchFromGitHub {
     owner = "arminbiere";
     repo = "cadical";
     rev = "rel-${version}";
-    sha256 = "05lvnvapjawgkky38xknb9lgaliiwan4kggmb9yggl4ifpjrh8qf";
+    sha256 = "0y44z3np4gssgdh4aj5qila7pshrbphycdxn2083i8ayyyjbxshp";
   };
 
+  outputs = [ "out" "dev" "lib" ];
   doCheck = true;
-  dontAddPrefix = true;
+
+  # the configure script is not generated by autotools and does not accept the
+  # arguments that the default configurePhase passes like --prefix and --libdir
+  configurePhase = ''
+    runHook preConfigure
+
+    ./configure
+
+    runHook postConfigure
+  '';
 
   installPhase = ''
+    runHook preInstall
+
     install -Dm0755 build/cadical "$out/bin/cadical"
     install -Dm0755 build/mobical "$out/bin/mobical"
-    mkdir -p "$out/share/doc/${pname}-${version}/"
-    install -Dm0755 {LICEN?E,README*,VERSION} "$out/share/doc/${pname}-${version}/"
+    install -Dm0644 src/ccadical.h "$dev/include/ccadical.h"
+    install -Dm0644 build/libcadical.a "$lib/lib/libcadical.a"
+    mkdir -p "$out/share/doc/${pname}/"
+    install -Dm0755 {LICEN?E,README*,VERSION} "$out/share/doc/${pname}/"
+
+    runHook postInstall
   '';
 
   meta = with lib; {
diff --git a/nixpkgs/pkgs/applications/science/logic/elan/default.nix b/nixpkgs/pkgs/applications/science/logic/elan/default.nix
index a49262e7cb65..1fb4693d64a2 100644
--- a/nixpkgs/pkgs/applications/science/logic/elan/default.nix
+++ b/nixpkgs/pkgs/applications/science/logic/elan/default.nix
@@ -7,16 +7,16 @@ in
 
 rustPlatform.buildRustPackage rec {
   pname = "elan";
-  version = "1.0.6";
+  version = "1.0.7";
 
   src = fetchFromGitHub {
     owner = "leanprover";
     repo = "elan";
     rev = "v${version}";
-    sha256 = "sha256-Ns8vSS/PDlfopigW4Nz3fdR9PCMG8gDoL36+/s0Qkeo=";
+    sha256 = "sha256-SFY9RbUHoaOXCaK+uIqhnKbzSkbtWiS6os/JvsggagI=";
   };
 
-  cargoSha256 = "sha256-NDtldiVo4SyE88f6ntKn1WJDFdvwN5Ps4DxQH15iNZE=";
+  cargoSha256 = "sha256-6TFionZw76V4htYQrz8eLX7ioW7Fbgd63rtz53s0TLU=";
 
   nativeBuildInputs = [ pkg-config makeWrapper ];
 
diff --git a/nixpkgs/pkgs/applications/science/logic/lean/default.nix b/nixpkgs/pkgs/applications/science/logic/lean/default.nix
index ea2cd356e315..5c6ad241cb76 100644
--- a/nixpkgs/pkgs/applications/science/logic/lean/default.nix
+++ b/nixpkgs/pkgs/applications/science/logic/lean/default.nix
@@ -2,7 +2,7 @@
 
 stdenv.mkDerivation rec {
   pname = "lean";
-  version = "3.31.0";
+  version = "3.32.1";
 
   src = fetchFromGitHub {
     owner  = "leanprover-community";
@@ -11,8 +11,8 @@ stdenv.mkDerivation rec {
     # from. this is then used to check whether an olean file should be
     # rebuilt. don't use a tag as rev because this will get replaced into
     # src/githash.h.in in preConfigure.
-    rev    = "333783350cd3fe38f25fed1da7d6a433d8f85b77";
-    sha256 = "sha256-N8Ju7pSGssvt84/0e1o6G/p7fWM1c0Mzw+ftL1/++J4=";
+    rev    = "35b3a9c4e2d35cccb5ed220ea2f2909a4ed2ca90";
+    sha256 = "0s69smknsvycvydbk2f3vcqj1z3jrbv3k048z2r46391dai5iwhf";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/nixpkgs/pkgs/applications/science/logic/logisim-evolution/default.nix b/nixpkgs/pkgs/applications/science/logic/logisim-evolution/default.nix
new file mode 100644
index 000000000000..10266abffea1
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/logic/logisim-evolution/default.nix
@@ -0,0 +1,46 @@
+{ lib, stdenv, fetchurl, jre, makeWrapper, copyDesktopItems, makeDesktopItem, unzip }:
+
+stdenv.mkDerivation rec {
+  pname = "logisim-evolution";
+  version = "3.5.0";
+
+  src = fetchurl {
+    url = "https://github.com/logisim-evolution/logisim-evolution/releases/download/v${version}/logisim-evolution-${version}-all.jar";
+    sha256 = "1r6im4gmjbnckx8jig6bxi5lxv06lwdnpxkyfalsfmw4nybd5arw";
+  };
+
+  dontUnpack = true;
+
+  nativeBuildInputs = [ makeWrapper copyDesktopItems unzip ];
+
+  desktopItems = [
+    (makeDesktopItem {
+      name = pname;
+      desktopName = "Logisim-evolution";
+      exec = "logisim-evolution";
+      icon = "logisim-evolution";
+      comment = meta.description;
+      categories = "Education;";
+    })
+  ];
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/bin
+    makeWrapper ${jre}/bin/java $out/bin/logisim-evolution --add-flags "-jar $src"
+
+    unzip $src resources/logisim/img/logisim-icon.svg
+    install -D resources/logisim/img/logisim-icon.svg $out/share/pixmaps/logisim-evolution.svg
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/logisim-evolution/logisim-evolution";
+    description = "Digital logic designer and simulator";
+    maintainers = with maintainers; [ angustrau ];
+    license = licenses.gpl2Plus;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/logic/logisim/default.nix b/nixpkgs/pkgs/applications/science/logic/logisim/default.nix
index 9b3f42dd4ba8..f94f08e43ab2 100644
--- a/nixpkgs/pkgs/applications/science/logic/logisim/default.nix
+++ b/nixpkgs/pkgs/applications/science/logic/logisim/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchurl, jre, makeWrapper }:
+{ lib, stdenv, fetchurl, jre, makeWrapper, copyDesktopItems, makeDesktopItem, unzip }:
 
 stdenv.mkDerivation rec {
   pname = "logisim";
@@ -11,17 +11,39 @@ stdenv.mkDerivation rec {
 
   dontUnpack = true;
 
-  nativeBuildInputs = [ makeWrapper ];
+  nativeBuildInputs = [ makeWrapper copyDesktopItems unzip ];
+
+  desktopItems = [
+    (makeDesktopItem {
+      name = pname;
+      desktopName = "Logisim";
+      exec = "logisim";
+      icon = "logisim";
+      comment = meta.description;
+      categories = "Education;";
+    })
+  ];
 
   installPhase = ''
+    runHook preInstall
+
     mkdir -p $out/bin
     makeWrapper ${jre}/bin/java $out/bin/logisim --add-flags "-jar $src"
+
+    # Create icons
+    unzip $src "resources/logisim/img/*"
+    for size in 16 20 24 48 64 128
+    do
+      install -D "./resources/logisim/img/logisim-icon-$size.png" "$out/share/icons/hicolor/''${size}x''${size}/apps/logisim.png"
+    done
+
+    runHook postInstall
   '';
 
   meta = with lib; {
-    homepage = "http://ozark.hendrix.edu/~burch/logisim";
+    homepage = "http://www.cburch.com/logisim/";
     description = "Educational tool for designing and simulating digital logic circuits";
-    maintainers = with maintainers; [ ];
+    maintainers = with maintainers; [ angustrau ];
     license = licenses.gpl2Plus;
     platforms = platforms.unix;
   };
diff --git a/nixpkgs/pkgs/applications/science/logic/opensmt/default.nix b/nixpkgs/pkgs/applications/science/logic/opensmt/default.nix
index 1681d4545904..fd22b7b1add8 100644
--- a/nixpkgs/pkgs/applications/science/logic/opensmt/default.nix
+++ b/nixpkgs/pkgs/applications/science/logic/opensmt/default.nix
@@ -6,13 +6,13 @@
 
 stdenv.mkDerivation rec {
   pname = "opensmt";
-  version = "2.0.1";
+  version = "2.1.0";
 
   src = fetchFromGitHub {
     owner = "usi-verification-and-security";
     repo = "opensmt";
     rev = "v${version}";
-    sha256 = "uoIcXWsxxRsIuFsou3RcN9e48lc7cWMgRPVJLFVslDE=";
+    sha256 = "sha256-m8TpMBY1r0h8GJTHM4FLBuZtX+WK/Q7RTXUnNmUWV+o=";
   };
 
   nativeBuildInputs = [ cmake bison flex ];
diff --git a/nixpkgs/pkgs/applications/science/logic/poly/default.nix b/nixpkgs/pkgs/applications/science/logic/poly/default.nix
index 75ad91bc54de..c80b9bf1f0c4 100644
--- a/nixpkgs/pkgs/applications/science/logic/poly/default.nix
+++ b/nixpkgs/pkgs/applications/science/logic/poly/default.nix
@@ -2,14 +2,14 @@
 
 stdenv.mkDerivation rec {
   pname = "libpoly";
-  version = "0.1.9";
+  version = "0.1.10";
 
   src = fetchFromGitHub {
     owner = "SRI-CSL";
     repo = "libpoly";
     # they've pushed to the release branch, use explicit tag
     rev = "refs/tags/v${version}";
-    sha256 = "sha256-E2lHo8Bt4ujoGQ623fjkQbqRnDYJYilXdRt4lnF4wJk=";
+    sha256 = "sha256-22Y4L5NFnCzKwZt0A/ChMuGPU4Dk1Qyke6mdvfN063w=";
   };
 
   # https://github.com/SRI-CSL/libpoly/pull/52
diff --git a/nixpkgs/pkgs/applications/science/logic/saw-tools/default.nix b/nixpkgs/pkgs/applications/science/logic/saw-tools/default.nix
index 3eabc9422e38..df99d067f08c 100644
--- a/nixpkgs/pkgs/applications/science/logic/saw-tools/default.nix
+++ b/nixpkgs/pkgs/applications/science/logic/saw-tools/default.nix
@@ -48,8 +48,6 @@ stdenv.mkDerivation {
     done
   '';
 
-  phases = "unpackPhase installPhase fixupPhase";
-
   meta = {
     description = "Tools for software verification and analysis";
     homepage    = "https://saw.galois.com";
diff --git a/nixpkgs/pkgs/applications/science/logic/tlaplus/tlaps.nix b/nixpkgs/pkgs/applications/science/logic/tlaplus/tlaps.nix
index 89bdd979fea0..90a4aeb4f8ab 100644
--- a/nixpkgs/pkgs/applications/science/logic/tlaplus/tlaps.nix
+++ b/nixpkgs/pkgs/applications/science/logic/tlaplus/tlaps.nix
@@ -1,6 +1,12 @@
 { fetchurl
-, lib, stdenv
-, ocaml, isabelle, cvc3, perl, wget, which
+, lib
+, stdenv
+, ocaml
+, isabelle
+, cvc3
+, perl
+, wget
+, which
 }:
 
 stdenv.mkDerivation rec {
@@ -13,8 +19,6 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ ocaml isabelle cvc3 perl wget which ];
 
-  phases = [ "unpackPhase" "installPhase" ];
-
   installPhase = ''
     mkdir -pv "$out"
     export HOME="$out"
@@ -45,9 +49,9 @@ stdenv.mkDerivation rec {
       and scalable to large system specifications. It provides a
       consistent abstraction over the various “backend” verifiers.
     '';
-    homepage    = "https://tla.msr-inria.inria.fr/tlaps/content/Home.html";
-    license     = lib.licenses.bsd2;
-    platforms   = lib.platforms.unix;
+    homepage = "https://tla.msr-inria.inria.fr/tlaps/content/Home.html";
+    license = lib.licenses.bsd2;
+    platforms = lib.platforms.unix;
     maintainers = [ ];
   };
 
diff --git a/nixpkgs/pkgs/applications/science/logic/tlaplus/toolbox.nix b/nixpkgs/pkgs/applications/science/logic/tlaplus/toolbox.nix
index ef2d97ef6bfc..21c60d03ac1e 100644
--- a/nixpkgs/pkgs/applications/science/logic/tlaplus/toolbox.nix
+++ b/nixpkgs/pkgs/applications/science/logic/tlaplus/toolbox.nix
@@ -1,5 +1,13 @@
-{ lib, fetchzip, makeWrapper, makeDesktopItem, stdenv
-, gtk3, libXtst, glib, zlib, wrapGAppsHook
+{ lib
+, fetchzip
+, makeWrapper
+, makeDesktopItem
+, stdenv
+, gtk3
+, libXtst
+, glib
+, zlib
+, wrapGAppsHook
 }:
 
 let
@@ -17,7 +25,8 @@ let
   };
 
 
-in stdenv.mkDerivation rec {
+in
+stdenv.mkDerivation rec {
   pname = "tla-toolbox";
   version = "1.7.1";
   src = fetchzip {
@@ -31,8 +40,6 @@ in stdenv.mkDerivation rec {
 
   dontWrapGApps = true;
 
-  phases = [ "installPhase" ];
-
   installPhase = ''
     runHook preInstall
 
diff --git a/nixpkgs/pkgs/applications/science/logic/verifast/default.nix b/nixpkgs/pkgs/applications/science/logic/verifast/default.nix
index e426f7b80989..c610256ccaef 100644
--- a/nixpkgs/pkgs/applications/science/logic/verifast/default.nix
+++ b/nixpkgs/pkgs/applications/science/logic/verifast/default.nix
@@ -20,11 +20,11 @@ let
 in
 stdenv.mkDerivation rec {
   pname = "verifast";
-  version = "19.12";
+  version = "21.04";
 
   src = fetchurl {
     url    = "https://github.com/verifast/verifast/releases/download/${version}/${pname}-${version}-linux.tar.gz";
-    sha256 = "169kshjq4cf4i9v92azv0xaflrnik5686w7fwcgdhd6qkbzflzl6";
+    sha256 = "sha256-PlRsf4wFXoM+E+60SbeKzs/RZK0HNVirX47AnI6NeYM=";
   };
 
   dontConfigure = true;
@@ -42,7 +42,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     description = "Verification for C and Java programs via separation logic";
-    homepage    = "http://people.cs.kuleuven.be/~bart.jacobs/verifast/";
+    homepage    = "https://people.cs.kuleuven.be/~bart.jacobs/verifast/";
     license     = lib.licenses.mit;
     platforms   = [ "x86_64-linux" ];
     maintainers = [ lib.maintainers.thoughtpolice ];
diff --git a/nixpkgs/pkgs/applications/science/logic/why3/default.nix b/nixpkgs/pkgs/applications/science/logic/why3/default.nix
index 924ff3fd9fd2..b9f14332f9d8 100644
--- a/nixpkgs/pkgs/applications/science/logic/why3/default.nix
+++ b/nixpkgs/pkgs/applications/science/logic/why3/default.nix
@@ -1,12 +1,12 @@
 { callPackage, fetchurl, fetchpatch, lib, stdenv
 , ocamlPackages, coqPackages, rubber, hevea, emacs }:
 
-stdenv.mkDerivation {
+stdenv.mkDerivation rec {
   pname = "why3";
   version = "1.4.0";
 
   src = fetchurl {
-    url = "https://gforge.inria.fr/frs/download.php/file/38425/why3-1.4.0.tar.gz";
+    url = "https://gforge.inria.fr/frs/download.php/file/38425/why3-${version}.tar.gz";
     sha256 = "0lw0cpx347zz9vvwqibmbxgs80fsd16scgk3isscvwxnajpc3rv8";
   };
 
diff --git a/nixpkgs/pkgs/applications/science/logic/why3/with-provers.nix b/nixpkgs/pkgs/applications/science/logic/why3/with-provers.nix
index d4fdbfd6937c..fc08f5d7c85e 100644
--- a/nixpkgs/pkgs/applications/science/logic/why3/with-provers.nix
+++ b/nixpkgs/pkgs/applications/science/logic/why3/with-provers.nix
@@ -1,31 +1,30 @@
 { stdenv, makeWrapper, runCommand, symlinkJoin, why3 }:
 provers:
 let configAwkScript = runCommand "why3-conf.awk" { inherit provers; }
-    ''
-      for p in $provers; do
-        for b in $p/bin/*; do
-          BASENAME=$(basename $b)
-          echo "/^command =/{ gsub(\"$BASENAME\", \"$b\") }" >> $out
-        done
+  ''
+    for p in $provers; do
+      for b in $p/bin/*; do
+        BASENAME=$(basename $b)
+        echo "/^command =/{ gsub(\"$BASENAME\", \"$b\") }" >> $out
       done
-      echo '{ print }' >> $out
-    '';
-in stdenv.mkDerivation {
+    done
+    echo '{ print }' >> $out
+  '';
+in
+stdenv.mkDerivation {
   name = "${why3.name}-with-provers";
 
-  phases = [ "buildPhase" "installPhase" ];
-
   nativeBuildInputs = [ makeWrapper ];
   buildInputs = [ why3 ] ++ provers;
 
   buildPhase = ''
-      mkdir -p $out/share/why3/
-      why3 config --detect-provers -C $out/share/why3/why3.conf
-      awk -i inplace -f ${configAwkScript} $out/share/why3/why3.conf
+    mkdir -p $out/share/why3/
+    why3 config --detect-provers -C $out/share/why3/why3.conf
+    awk -i inplace -f ${configAwkScript} $out/share/why3/why3.conf
   '';
 
   installPhase = ''
-      mkdir -p $out/bin
-      makeWrapper ${why3}/bin/why3 $out/bin/why3 --add-flags "--extra-config $out/share/why3/why3.conf"
+    mkdir -p $out/bin
+    makeWrapper ${why3}/bin/why3 $out/bin/why3 --add-flags "--extra-config $out/share/why3/why3.conf"
   '';
 }
diff --git a/nixpkgs/pkgs/applications/science/logic/workcraft/default.nix b/nixpkgs/pkgs/applications/science/logic/workcraft/default.nix
index 63a946365604..2829cb59340b 100644
--- a/nixpkgs/pkgs/applications/science/logic/workcraft/default.nix
+++ b/nixpkgs/pkgs/applications/science/logic/workcraft/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "workcraft";
-  version = "3.3.2";
+  version = "3.3.5";
 
   src = fetchurl {
     url = "https://github.com/workcraft/workcraft/releases/download/v${version}/workcraft-v${version}-linux.tar.gz";
-    sha256 = "0v71x3fph2j3xrnysvkm7zsgnbxisfbdfgxzvzxxfdg59a6l3xid";
+    sha256 = "sha256-KErKYK3mmjp5uNdGQnjzUUIEwXT5fqbAPUunH72Mtig=";
   };
 
   nativeBuildInputs = [ makeWrapper ];
diff --git a/nixpkgs/pkgs/applications/science/machine-learning/finalfusion-utils/default.nix b/nixpkgs/pkgs/applications/science/machine-learning/finalfusion-utils/default.nix
index 6655b415d2ab..4c04b3c07368 100644
--- a/nixpkgs/pkgs/applications/science/machine-learning/finalfusion-utils/default.nix
+++ b/nixpkgs/pkgs/applications/science/machine-learning/finalfusion-utils/default.nix
@@ -11,16 +11,16 @@
 
 rustPlatform.buildRustPackage rec {
   pname = "finalfusion-utils";
-  version = "0.12.0";
+  version = "0.13.0";
 
   src = fetchFromGitHub {
     owner = "finalfusion";
     repo = pname;
     rev = version;
-    sha256 = "0gxcjrhfa86kz5qmdf5h278ydc3nc0nfj61brnykb723mg45jj41";
+    sha256 = "sha256-ME0qDSFD8G492+7ex7VQWh9P76a+tOCo+SJ9n9ZIYUI=";
   };
 
-  cargoSha256 = "0dj3xpinzzdfgy06wkp336sp1nyqk7nnvd3hwhyysripmz9apdgg";
+  cargoSha256 = "sha256-/rLv2/bcVsmWw+ZfyumDcj0ptHPQBCCYR9O/lVlV+G0=";
 
   # Enables build against a generic BLAS.
   cargoBuildFlags = [
diff --git a/nixpkgs/pkgs/applications/science/machine-learning/nengo-gui/default.nix b/nixpkgs/pkgs/applications/science/machine-learning/nengo-gui/default.nix
new file mode 100644
index 000000000000..6380f25177cb
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/machine-learning/nengo-gui/default.nix
@@ -0,0 +1,26 @@
+{ lib, fetchFromGitHub, python3Packages }:
+
+python3Packages.buildPythonPackage rec {
+  pname = "nengo-gui";
+  version = "0.4.8";
+
+  src = fetchFromGitHub {
+    owner = "nengo";
+    repo = "nengo-gui";
+    rev = "v${version}";
+    sha256 = "1awb0h2l6yifb77zah7a4qzxqvkk4ac5fynangalidr10sk9rzk3";
+  };
+
+  propagatedBuildInputs = with python3Packages; [ nengo ];
+
+  # checks req missing:
+  #   pyimgur
+  doCheck = false;
+
+  meta = with lib; {
+    description = "Nengo interactive visualizer";
+    homepage    = "https://nengo.ai/";
+    license     = licenses.unfreeRedistributable;
+    maintainers = with maintainers; [ arjix ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/machine-learning/vowpal-wabbit/default.nix b/nixpkgs/pkgs/applications/science/machine-learning/vowpal-wabbit/default.nix
index d1523b571f4b..7ecbe09f5e18 100644
--- a/nixpkgs/pkgs/applications/science/machine-learning/vowpal-wabbit/default.nix
+++ b/nixpkgs/pkgs/applications/science/machine-learning/vowpal-wabbit/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "vowpal-wabbit";
-  version = "8.10.0";
+  version = "8.11.0";
 
   src = fetchFromGitHub {
     owner = "VowpalWabbit";
     repo = "vowpal_wabbit";
     rev = version;
-    sha256 = "1vxnwanflsx6zf8m9mrxms28ii7rl61xfxp3556y3iawmy11d6pl";
+    sha256 = "sha256-F3la4n1ULMN2nktr+PVWFPl3V2RfCowR0ozL+dnbhgA=";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/nixpkgs/pkgs/applications/science/math/R/default.nix b/nixpkgs/pkgs/applications/science/math/R/default.nix
index 827c817fd1a6..a8fdfe8571a6 100644
--- a/nixpkgs/pkgs/applications/science/math/R/default.nix
+++ b/nixpkgs/pkgs/applications/science/math/R/default.nix
@@ -1,9 +1,10 @@
 { lib, stdenv, fetchurl, bzip2, gfortran, libX11, libXmu, libXt, libjpeg, libpng
 , libtiff, ncurses, pango, pcre2, perl, readline, tcl, texLive, tk, xz, zlib
 , less, texinfo, graphviz, icu, pkg-config, bison, imake, which, jdk, blas, lapack
-, curl, Cocoa, Foundation, libobjc, libcxx, tzdata, fetchpatch
+, curl, Cocoa, Foundation, libobjc, libcxx, tzdata
 , withRecommendedPackages ? true
 , enableStrictBarrier ? false
+, enableMemoryProfiling ? false
 # R as of writing does not support outputting both .so and .a files; it outputs:
 #     --enable-R-static-lib conflicts with --enable-R-shlib and will be ignored
 , static ? false
@@ -13,11 +14,11 @@ assert (!blas.isILP64) && (!lapack.isILP64);
 
 stdenv.mkDerivation rec {
   pname = "R";
-  version = "4.0.4";
+  version = "4.1.1";
 
   src = fetchurl {
     url = "https://cran.r-project.org/src/base/R-${lib.versions.major version}/${pname}-${version}.tar.gz";
-    sha256 = "0bl098xcv8v316kqnf43v6gb4kcsv31ydqfm1f7qr824jzb2fgsj";
+    sha256 = "0r6kpnxjbvb7gdfg4m1z8zc6xd225vw81wrnf05ps9ajawk06pji";
   };
 
   dontUseImakeConfigure = true;
@@ -30,7 +31,7 @@ stdenv.mkDerivation rec {
 
   patches = [
     ./no-usr-local-search-paths.patch
-    ./fix-failing-test.patch
+    ./skip-check-for-aarch64.patch
   ];
 
   prePatch = lib.optionalString stdenv.isDarwin ''
@@ -56,6 +57,7 @@ stdenv.mkDerivation rec {
       --with-libtiff
       --with-ICU
       ${lib.optionalString enableStrictBarrier "--enable-strict-barrier"}
+      ${lib.optionalString enableMemoryProfiling "--enable-memory-profiling"}
       ${if static then "--enable-R-static-lib" else "--enable-R-shlib"}
       AR=$(type -p ar)
       AWK=$(type -p gawk)
diff --git a/nixpkgs/pkgs/applications/science/math/R/fix-failing-test.patch b/nixpkgs/pkgs/applications/science/math/R/fix-failing-test.patch
deleted file mode 100644
index 5fb3b3b9c317..000000000000
--- a/nixpkgs/pkgs/applications/science/math/R/fix-failing-test.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From e8f54bc562eb301d204b5f880614be58a2b39a2b Mon Sep 17 00:00:00 2001
-From: maechler <maechler@00db46b3-68df-0310-9c12-caf00c1e9a41>
-Date: Mon, 30 Mar 2020 19:15:59 +0000
-Subject: [PATCH] no longer fail in norm() check for broken OpenBLAS Lapack
- 3.9.0
-
-git-svn-id: https://svn.r-project.org/R/trunk@78112 00db46b3-68df-0310-9c12-caf00c1e9a41
----
- tests/reg-tests-1d.R | 3 ++-
- 1 file changed, 2 insertions(+), 1 deletion(-)
-
-diff --git a/tests/reg-tests-1d.R b/tests/reg-tests-1d.R
-index 6b7de765a95..fafd6911e7a 100644
---- a/tests/reg-tests-1d.R
-+++ b/tests/reg-tests-1d.R
-@@ -3836,7 +3836,8 @@ stopifnot(is.na( norm(diag(c(1, NA)), "2") ))
- ## norm(<matrix-w-NA>, "F")
- (m <- cbind(0, c(NA, 0), 0:-1))
- nTypes <- eval(formals(base::norm)$type) # "O" "I" "F" "M" "2"
--stopifnot(is.na( print(vapply(nTypes, norm, 0., x = m)) )) # print(): show NA *or* NaN
-+print( # stopifnot( -- for now, as Lapack is still broken in some OpenBLAS -- FIXME
-+    is.na( print(vapply(nTypes, norm, 0., x = m)) )) # print(): show NA *or* NaN
- ## "F" gave non-NA with LAPACK 3.9.0, before our patch in R-devel and R-patched
- 
- 
diff --git a/nixpkgs/pkgs/applications/science/math/R/skip-check-for-aarch64.patch b/nixpkgs/pkgs/applications/science/math/R/skip-check-for-aarch64.patch
new file mode 100644
index 000000000000..8721bf6b422d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/math/R/skip-check-for-aarch64.patch
@@ -0,0 +1,11 @@
+diff -ur a/src/library/stats/man/nls.Rd b/src/library/stats/man/nls.Rd
+--- a/src/library/stats/man/nls.Rd   2021-05-21 19:15:02.000000000 -0300
++++ b/src/library/stats/man/nls.Rd   2021-08-12 12:39:00.094758280 -0300
+@@ -287,7 +287,7 @@
+ options(digits = 10) # more accuracy for 'trace'
+ ## IGNORE_RDIFF_BEGIN
+ try(nlm1 <- update(nlmod, control = list(tol = 1e-7))) # where central diff. work here:
+-   (nlm2 <- update(nlmod, control = list(tol = 8e-8, nDcentral=TRUE), trace=TRUE))
++   (nlm2 <- update(nlmod, control = list(tol = 8e-8, nDcentral=TRUE, warnOnly=TRUE), trace=TRUE))
+ ## --> convergence tolerance  4.997e-8 (in 11 iter.)
+ ## IGNORE_RDIFF_END
diff --git a/nixpkgs/pkgs/applications/science/math/colpack/default.nix b/nixpkgs/pkgs/applications/science/math/colpack/default.nix
index f203852c9657..3cc9290a7626 100644
--- a/nixpkgs/pkgs/applications/science/math/colpack/default.nix
+++ b/nixpkgs/pkgs/applications/science/math/colpack/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchFromGitHub, autoconf, automake, libtool, gettext }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook }:
 
 stdenv.mkDerivation rec {
 
@@ -12,20 +12,32 @@ stdenv.mkDerivation rec {
     sha256 = "1p05vry940mrjp6236c0z83yizmw9pk6ly2lb7d8rpb7j9h03glr";
   };
 
-  buildInputs = [ autoconf automake gettext libtool ];
+  nativeBuildInputs = [ autoreconfHook ];
 
-  configurePhase = ''
-    autoreconf -vif
-    ./configure --prefix=$out --enable-openmp
+  configureFlags = [
+    "--enable-openmp=${if stdenv.isLinux then "yes" else "no"}"
+    "--enable-examples=no"
+  ];
+
+  postInstall = ''
+    # Remove libtool archive
+    rm $out/lib/*.la
+
+    # Remove compiled examples (Basic examples get compiled anyway)
+    rm -r $out/examples
+
+    # Copy the example sources (Basic tree contains scripts and object files)
+    mkdir -p $out/share/ColPack/examples/Basic
+    cp SampleDrivers/Basic/*.cpp $out/share/ColPack/examples/Basic
+    cp -r SampleDrivers/Matrix* $out/share/ColPack/examples
   '';
 
   meta = with lib; {
     description = "A package comprising of implementations of algorithms for
     vertex coloring and derivative computation";
     homepage = "http://cscapes.cs.purdue.edu/coloringpage/software.htm#functionalities";
-    license = licenses.lgpl3;
-    platforms = platforms.linux;
+    license = licenses.lgpl3Plus;
+    platforms = platforms.unix;
     maintainers = with maintainers; [ edwtjo ];
   };
-
 }
diff --git a/nixpkgs/pkgs/applications/science/math/ginac/default.nix b/nixpkgs/pkgs/applications/science/math/ginac/default.nix
index 901b9a340fea..78b64d7f587a 100644
--- a/nixpkgs/pkgs/applications/science/math/ginac/default.nix
+++ b/nixpkgs/pkgs/applications/science/math/ginac/default.nix
@@ -1,30 +1,34 @@
 { lib, stdenv, fetchurl, cln, pkg-config, readline, gmp, python3 }:
 
 stdenv.mkDerivation rec {
-  name = "ginac-1.8.0";
+  pname = "ginac";
+  version = "1.8.1";
 
   src = fetchurl {
-    url    = "${meta.homepage}/${name}.tar.bz2";
-    sha256 = "0l9byzfxq3f9az5pcdldnl95ws8mpirkqky46f973mvxi5541d24";
+    url = "https://www.ginac.de/ginac-${version}.tar.bz2";
+    sha256 = "sha256-8WldvWsYcGHvP7pQdkjJ1tukOPczsFjBb5J4y9z14as=";
   };
 
   propagatedBuildInputs = [ cln ];
 
-  buildInputs = [ readline ] ++ lib.optional stdenv.isDarwin gmp;
+  buildInputs = [ readline ]
+    ++ lib.optional stdenv.isDarwin gmp;
 
   nativeBuildInputs = [ pkg-config python3 ];
 
   strictDeps = true;
 
-  preConfigure = "patchShebangs ginsh";
+  preConfigure = ''
+    patchShebangs ginsh
+  '';
 
   configureFlags = [ "--disable-rpath" ];
 
   meta = with lib; {
     description = "GiNaC is Not a CAS";
-    homepage    = "https://www.ginac.de/";
+    homepage = "https://www.ginac.de/";
     maintainers = with maintainers; [ lovek323 ];
     license = licenses.gpl2;
-    platforms   = platforms.all;
+    platforms = platforms.all;
   };
 }
diff --git a/nixpkgs/pkgs/applications/science/math/lp_solve/default.nix b/nixpkgs/pkgs/applications/science/math/lp_solve/default.nix
index f944499af401..876222772e86 100644
--- a/nixpkgs/pkgs/applications/science/math/lp_solve/default.nix
+++ b/nixpkgs/pkgs/applications/science/math/lp_solve/default.nix
@@ -1,40 +1,45 @@
-{ lib, stdenv, fetchurl }:
+{ lib, stdenv, fetchurl, cctools, fixDarwinDylibNames }:
 
 stdenv.mkDerivation rec {
 
   pname = "lp_solve";
-  version = "5.5.2.5";
+  version = "5.5.2.11";
 
   src = fetchurl {
     url = "mirror://sourceforge/project/lpsolve/lpsolve/${version}/lp_solve_${version}_source.tar.gz";
-    sha256 = "12pj1idjz31r7c2mb5w03vy1cmvycvbkx9z29s40qdmkp1i7q6i0";
+    sha256 = "sha256-bUq/9cxqqpM66ObBeiJt8PwLZxxDj2lxXUHQn+gfkC8=";
   };
 
-  patches = [ ./isnan.patch ];
-
-  buildCommand = ''
-    . $stdenv/setup
-    tar xvfz $src
-    (
-    cd lp_solve*
-    eval patchPhase
-    )
-    (
-    cd lp_solve*/lpsolve55
-    bash ccc
-    mkdir -pv $out/lib
-    find bin -type f -exec cp -v "{}" $out/lib \;
-    )
-    (
-    cd lp_solve*/lp_solve
-    bash ccc
-    mkdir -pv $out/bin
-    find bin -type f -exec cp -v "{}" $out/bin \;
-    )
-    (
-    mkdir -pv $out/include
-    cp -v lp_solve*/*.h $out/include
-    )
+  nativeBuildInputs = lib.optionals stdenv.isDarwin [
+    cctools
+    fixDarwinDylibNames
+  ];
+
+  dontConfigure = true;
+
+  buildPhase = let
+    ccc = if stdenv.isDarwin then "ccc.osx" else "ccc";
+  in ''
+    runHook preBuild
+
+    (cd lpsolve55 && bash -x -e ${ccc})
+    (cd lp_solve  && bash -x -e ${ccc})
+
+    runHook postBuild
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    install -d -m755 $out/bin $out/lib $out/include/lpsolve
+    install -m755 lp_solve/bin/*/lp_solve -t $out/bin
+    install -m644 lpsolve55/bin/*/liblpsolve* -t $out/lib
+    install -m644 lp_*.h -t $out/include/lpsolve
+
+    rm $out/lib/liblpsolve*.a
+    rm $out/include/lpsolve/lp_solveDLL.h  # A Windows header
+
+    runHook postInstall
   '';
 
   meta = with lib; {
@@ -44,6 +49,4 @@ stdenv.mkDerivation rec {
     maintainers = with maintainers; [ smironov ];
     platforms   = platforms.unix;
   };
-
 }
-
diff --git a/nixpkgs/pkgs/applications/science/math/lp_solve/isnan.patch b/nixpkgs/pkgs/applications/science/math/lp_solve/isnan.patch
deleted file mode 100644
index bc1983d4423d..000000000000
--- a/nixpkgs/pkgs/applications/science/math/lp_solve/isnan.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff -u a/lp_lib.h b/lp_lib.h
---- a/lp_lib.h	2016-05-04 19:45:15.753143720 +0900
-+++ b/lp_lib.h	2016-05-04 19:53:59.536920722 +0900
-@@ -59,9 +59,6 @@
- # if defined _WIN32 && !defined __GNUC__
- #  define isnan _isnan
- # endif
--#if defined NOISNAN
--# define isnan(x) FALSE
--#endif
- 
- #define SETMASK(variable, mask)     variable |= mask
- #define CLEARMASK(variable, mask)   variable &= ~(mask)
diff --git a/nixpkgs/pkgs/applications/science/math/maxima/default.nix b/nixpkgs/pkgs/applications/science/math/maxima/default.nix
index 01f086c92c75..2b82a8f81705 100644
--- a/nixpkgs/pkgs/applications/science/math/maxima/default.nix
+++ b/nixpkgs/pkgs/applications/science/math/maxima/default.nix
@@ -1,14 +1,16 @@
-{ lib, stdenv, fetchurl, fetchpatch, sbcl, texinfo, perl, python, makeWrapper, autoreconfHook
+{ lib, stdenv, fetchurl, fetchpatch, sbcl, texinfo, perl, python3, makeWrapper, autoreconfHook
 , rlwrap ? null, tk ? null, gnuplot ? null, ecl ? null, ecl-fasl ? false
 }:
 
 let
   name    = "maxima";
-  version = "5.44.0";
+  version = "5.45.0";
+
+  lisp-compiler = if ecl-fasl then ecl else sbcl;
 
   searchPath =
     lib.makeBinPath
-      (lib.filter (x: x != null) [ sbcl ecl rlwrap tk gnuplot ]);
+      (lib.filter (x: x != null) [ lisp-compiler rlwrap tk gnuplot ]);
 in
 stdenv.mkDerivation ({
   inherit version;
@@ -16,14 +18,21 @@ stdenv.mkDerivation ({
 
   src = fetchurl {
     url = "mirror://sourceforge/${name}/${name}-${version}.tar.gz";
-    sha256 = "1v6jr5s6hhj6r18gfk6hgxk2qd6z1dxkrjq9ss2z1y6sqi45wgyr";
+    sha256 = "sha256-x2MfMmRIBc67e6/vOrUzHEus0sJ+OE/YgyO1A5pg0Ng=";
   };
 
-  nativeBuildInputs = [ autoreconfHook ];
+  nativeBuildInputs = [
+    autoreconfHook
+    lisp-compiler
+    makeWrapper
+    python3
+    texinfo
+  ];
+
+  strictDeps = true;
 
-  buildInputs = lib.filter (x: x != null) [
-    sbcl ecl texinfo perl python makeWrapper
-    gnuplot   # required in the test suite
+  checkInputs = [
+    gnuplot
   ];
 
   postPatch = ''
diff --git a/nixpkgs/pkgs/applications/science/math/nasc/default.nix b/nixpkgs/pkgs/applications/science/math/nasc/default.nix
index b55e4047fe47..431668f0c583 100644
--- a/nixpkgs/pkgs/applications/science/math/nasc/default.nix
+++ b/nixpkgs/pkgs/applications/science/math/nasc/default.nix
@@ -21,26 +21,16 @@
 
 stdenv.mkDerivation rec {
   pname = "nasc";
-  version = "0.7.5";
+  version = "0.8.0";
 
   src = fetchFromGitHub {
     owner = "parnold-x";
     repo = pname;
     rev = version;
-    sha256 = "kSRc5RLkI6SBJirUYw6swZi8IJhaL3y74b2Zw8kh2XA=";
+    sha256 = "02b9a59a9fzsb6nn3ycwwbcbv04qfzm6x7csq2addpzx5wak6dd8";
     fetchSubmodules = true;
   };
 
-  patches = [
-    # fix compilation with gcc10
-    (fetchpatch {
-      url = "https://github.com/parnold-x/libqalculate/commit/4fa8f2cceada128ef19f82407226b2c230b780d5.patch";
-      extraPrefix = "subprojects/libqalculate/";
-      stripLen = "1";
-      sha256 = "0kbff623zl0s6yx5avx068f2apwzxzvihjahja4qhlkqkhhzj9dm";
-    })
-  ];
-
   nativeBuildInputs = [
     glib # post_install.py
     gtk3 # post_install.py
diff --git a/nixpkgs/pkgs/applications/science/math/nauty/default.nix b/nixpkgs/pkgs/applications/science/math/nauty/default.nix
index a941a6334508..c435c63ab2ef 100644
--- a/nixpkgs/pkgs/applications/science/math/nauty/default.nix
+++ b/nixpkgs/pkgs/applications/science/math/nauty/default.nix
@@ -6,7 +6,7 @@ stdenv.mkDerivation rec {
   pname = "nauty";
   version = "27r1";
   src = fetchurl {
-    url = "http://pallini.di.uniroma1.it/nauty${version}.tar.gz";
+    url = "https://pallini.di.uniroma1.it/nauty${version}.tar.gz";
     sha256 = "0xsfqfcknbd6g6wzpa5l7crmmk3bf3zjh37rhylq6b20dqcmvjkn";
   };
   outputs = [ "out" "dev" ];
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
     # I'm not sure if the filename will remain the same for future changelog or
     # if it will track changes to minor releases. Lets see. Better than nothing
     # in any case.
-    changelog = "http://pallini.di.uniroma1.it/changes24-27.txt";
-    homepage = "http://pallini.di.uniroma1.it/";
+    changelog = "https://pallini.di.uniroma1.it/changes24-27.txt";
+    homepage = "https://pallini.di.uniroma1.it/";
   };
 }
diff --git a/nixpkgs/pkgs/applications/science/math/polymake/default.nix b/nixpkgs/pkgs/applications/science/math/polymake/default.nix
index b1abb31c7650..9566801479a3 100644
--- a/nixpkgs/pkgs/applications/science/math/polymake/default.nix
+++ b/nixpkgs/pkgs/applications/science/math/polymake/default.nix
@@ -1,27 +1,32 @@
 { lib, stdenv, fetchurl
-, ninja, libxml2, libxslt, readline, perl, gmp, mpfr, boost
+, perl, gmp, mpfr, flint, boost
 , bliss, ppl, singular, cddlib, lrs, nauty
-, ant, openjdk
+, ninja, ant, openjdk
 , perlPackages
 , makeWrapper
 }:
 
+# polymake compiles its own version of sympol and atint because we
+# don't have those packages. other missing optional dependencies:
+# javaview, libnormaliz, scip, soplex, jreality.
+
 stdenv.mkDerivation rec {
   pname = "polymake";
-  version = "3.2.rc4";
+  version = "4.4";
 
   src = fetchurl {
-    url = "https://polymake.org/lib/exe/fetch.php/download/polymake-3.2r4.tar.bz2";
-    sha256 = "02jpkvy1cc6kc23vkn7nkndzr40fq1gkb3v257bwyi1h5d37fyqy";
+    # "The minimal version is a packager friendly version which omits
+    # the bundled sources of cdd, lrs, libnormaliz, nauty and jReality."
+    url = "https://polymake.org/lib/exe/fetch.php/download/polymake-${version}-minimal.tar.bz2";
+    sha256 = "sha256-2nF5F2xznI77pl2TslrxA8HLpw4fmzVnPOM8N3kOwJE=";
   };
 
   buildInputs = [
-    libxml2 libxslt readline perl gmp mpfr boost
+    perl gmp mpfr flint boost
     bliss ppl singular cddlib lrs nauty
     openjdk
-  ] ++
-  (with perlPackages; [
-    XMLLibXML XMLLibXSLT XMLWriter TermReadLineGnu TermReadKey
+  ] ++ (with perlPackages; [
+    JSON TermReadLineGnu TermReadKey XMLSAX
   ]);
 
   nativeBuildInputs = [
@@ -36,11 +41,11 @@ stdenv.mkDerivation rec {
     done
   '';
 
-  meta = {
+  meta = with lib; {
     description = "Software for research in polyhedral geometry";
-    license = lib.licenses.gpl2 ;
-    maintainers = [lib.maintainers.raskin];
-    platforms = lib.platforms.linux;
+    license = licenses.gpl2Plus;
+    maintainers = teams.sage.members;
+    platforms = platforms.linux;
     homepage = "https://www.polymake.org/doku.php";
   };
 }
diff --git a/nixpkgs/pkgs/applications/science/math/pynac/default.nix b/nixpkgs/pkgs/applications/science/math/pynac/default.nix
index 138c97d73be1..88515b92beaf 100644
--- a/nixpkgs/pkgs/applications/science/math/pynac/default.nix
+++ b/nixpkgs/pkgs/applications/science/math/pynac/default.nix
@@ -1,4 +1,5 @@
 { lib, stdenv
+, fetchpatch
 , fetchFromGitHub
 , autoreconfHook
 , pkg-config
@@ -20,6 +21,16 @@ stdenv.mkDerivation rec {
     sha256 = "sha256-ocR7emXtKs+Xe2f6dh4xEDAacgiolY8mtlLnWnNBS8A=";
   };
 
+  patches = [
+    # the patch below is included in sage 9.4 and should be included
+    # in a future pynac release. see https://trac.sagemath.org/ticket/28357
+    (fetchpatch {
+      name = "realpartloop.patch";
+      url = "https://git.sagemath.org/sage.git/plain/build/pkgs/pynac/patches/realpartloop.patch?h=9.4.beta5";
+      sha256 = "sha256-1nj0xtlFN5fZKEiRLD+tiW/ZtxMQre1ziEGA0OVUGE4=";
+    })
+  ];
+
   buildInputs = [
     flint
     gmp
diff --git a/nixpkgs/pkgs/applications/science/math/qalculate-gtk/default.nix b/nixpkgs/pkgs/applications/science/math/qalculate-gtk/default.nix
index 7807ae613e8c..bc192fe4218b 100644
--- a/nixpkgs/pkgs/applications/science/math/qalculate-gtk/default.nix
+++ b/nixpkgs/pkgs/applications/science/math/qalculate-gtk/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "qalculate-gtk";
-  version = "3.19.0";
+  version = "3.20.1";
 
   src = fetchFromGitHub {
     owner = "qalculate";
     repo = "qalculate-gtk";
     rev = "v${version}";
-    sha256 = "1nrx7gp6f1yalbdda1gb97azhbr4xclq2xf08vvbvsk8jfd6fd2v";
+    sha256 = "sha256-GTOdJ4dxR491WU6WM47xLHO7RGUGXkdHuQIDxJvVvFE=";
   };
 
   hardeningDisable = [ "format" ];
diff --git a/nixpkgs/pkgs/applications/science/math/sage/default.nix b/nixpkgs/pkgs/applications/science/math/sage/default.nix
index e39db4b1ac2d..b7821db1f9a7 100644
--- a/nixpkgs/pkgs/applications/science/math/sage/default.nix
+++ b/nixpkgs/pkgs/applications/science/math/sage/default.nix
@@ -38,8 +38,8 @@ let
     ];
     language = "sagemath";
     # just one 16x16 logo is available
-    logo32 = "${sage-src}/doc/common/themes/sage/static/sageicon.png";
-    logo64 = "${sage-src}/doc/common/themes/sage/static/sageicon.png";
+    logo32 = "${sage-src}/src/doc/common/themes/sage/static/sageicon.png";
+    logo64 = "${sage-src}/src/doc/common/themes/sage/static/sageicon.png";
   };
 
   three = callPackage ./threejs-sage.nix { };
diff --git a/nixpkgs/pkgs/applications/science/math/sage/patches/do-not-test-find-library.patch b/nixpkgs/pkgs/applications/science/math/sage/patches/do-not-test-find-library.patch
index 0dbfba642e82..178cef3e54ea 100644
--- a/nixpkgs/pkgs/applications/science/math/sage/patches/do-not-test-find-library.patch
+++ b/nixpkgs/pkgs/applications/science/math/sage/patches/do-not-test-find-library.patch
@@ -1,8 +1,8 @@
 diff --git a/src/sage/env.py b/src/sage/env.py
-index 2908f5d04f..81dfd75c0d 100644
+index 95980cc2df..37107a30e1 100644
 --- a/src/sage/env.py
 +++ b/src/sage/env.py
-@@ -218,93 +218,12 @@ NTL_LIBDIR = var("NTL_LIBDIR")
+@@ -227,93 +227,12 @@ OPENMP_CXXFLAGS = var("OPENMP_CXXFLAGS", "")
  SAGE_BANNER = var("SAGE_BANNER", "")
  SAGE_IMPORTALL = var("SAGE_IMPORTALL", "yes")
  
@@ -51,10 +51,9 @@ index 2908f5d04f..81dfd75c0d 100644
 -        if sys.platform == 'cygwin':
 -            # Later down we take the first matching DLL found, so search
 -            # SAGE_LOCAL first so that it takes precedence
--            search_directories = [
--                Path(SAGE_LOCAL) / 'bin',
--                Path(sysconfig.get_config_var('BINDIR')),
--            ]
+-            if SAGE_LOCAL:
+-                search_directories.append(Path(SAGE_LOCAL) / 'bin')
+-            search_directories.append(Path(sysconfig.get_config_var('BINDIR')))
 -            # Note: The following is not very robust, since if there are multible
 -            # versions for the same library this just selects one more or less
 -            # at arbitrary. However, practically speaking, on Cygwin, there
@@ -66,14 +65,15 @@ index 2908f5d04f..81dfd75c0d 100644
 -            else:
 -                ext = 'so'
 -
--            search_directories = [Path(SAGE_LOCAL) / 'lib']
+-            if SAGE_LOCAL:
+-                search_directories.append(Path(SAGE_LOCAL) / 'lib')
 -            libdir = sysconfig.get_config_var('LIBDIR')
 -            if libdir is not None:
 -                libdir = Path(libdir)
 -                search_directories.append(libdir)
 -
 -                multiarchlib = sysconfig.get_config_var('MULTIARCH')
--                if multiarchlib is not None: 
+-                if multiarchlib is not None:
 -                    search_directories.append(libdir / multiarchlib),
 -
 -            patterns = [f'lib{libname}.{ext}']
@@ -97,4 +97,4 @@ index 2908f5d04f..81dfd75c0d 100644
 +GAP_SO = var("GAP_SO", '/default')
  
  # post process
- if ' ' in DOT_SAGE:
+ if DOT_SAGE is not None and ' ' in DOT_SAGE:
diff --git a/nixpkgs/pkgs/applications/science/math/sage/patches/ignore-cmp-deprecation.patch b/nixpkgs/pkgs/applications/science/math/sage/patches/ignore-cmp-deprecation.patch
deleted file mode 100644
index a91ee319b8f0..000000000000
--- a/nixpkgs/pkgs/applications/science/math/sage/patches/ignore-cmp-deprecation.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff --git a/src/sage/tests/cmdline.py b/src/sage/tests/cmdline.py
-index 6e034dcb5a..8ec60ec72b 100644
---- a/src/sage/tests/cmdline.py
-+++ b/src/sage/tests/cmdline.py
-@@ -660,8 +660,8 @@ def test_executable(args, input="", timeout=100.0, pydebug_ignore_warnings=False
-         sage: with open(input, 'w') as F:
-         ....:     _ = F.write(s)
-         sage: L = ["sage", "--rst2ipynb", input, output]
--        sage: test_executable(L)                              # optional - rst2ipynb
--        ('', '', 0)
-+        sage: test_executable(L)[2]                           # optional - rst2ipynb
-+        0
-         sage: import json                                     # optional - rst2ipynb
-         sage: d = json.load(open(output,'r'))                 # optional - rst2ipynb
-         sage: type(d)                                         # optional - rst2ipynb
-@@ -757,8 +757,6 @@ def test_executable(args, input="", timeout=100.0, pydebug_ignore_warnings=False
-         ///
-         4
-         }}}
--        sage: err # py2 # optional -- sagenb
--        ''
-         sage: ret # py2 # optional -- sagenb
-         0
- 
diff --git a/nixpkgs/pkgs/applications/science/math/sage/sage-src.nix b/nixpkgs/pkgs/applications/science/math/sage/sage-src.nix
index 218ab920a872..3ba21cf6c8be 100644
--- a/nixpkgs/pkgs/applications/science/math/sage/sage-src.nix
+++ b/nixpkgs/pkgs/applications/science/math/sage/sage-src.nix
@@ -13,30 +13,52 @@ let
   # Fetch a diff between `base` and `rev` on sage's git server.
   # Used to fetch trac tickets by setting the `base` to the last release and the
   # `rev` to the last commit of the ticket.
-  fetchSageDiff = { base, name, rev, sha256, ...}@args: (
+  fetchSageDiff = { base, name, rev, sha256, squashed ? false, ...}@args: (
     fetchpatch ({
       inherit name sha256;
 
-      # We used to use
-      # "https://git.sagemath.org/sage.git/patch?id2=${base}&id=${rev}"
-      # but the former way does not squash multiple patches together.
-      url = "https://github.com/sagemath/sage/compare/${base}...${rev}.diff";
+      # There are three places to get changes from:
+      #
+      # 1) From Sage's Trac. Contains all release tags (like "9.4") and all developer
+      # branches (wip patches from tickets), but exports each commit as a separate
+      # patch, so merge commits can lead to conflicts. Used if squashed == false.
+      #
+      # 2) From GitHub's sagemath/sage repo. This lets us use a GH feature that allows
+      # us to choose between a .patch file, with one patch per commit, or a .diff file,
+      # which squashes all commits into a single diff. This is used if squashed ==
+      # true. This repo has all release tags. However, it has no developer branches, so
+      # this option can't be used if a change wasn't yet shipped in a (possibly beta)
+      # release.
+      #
+      # 3) From GitHub's sagemath/sagetrac-mirror repo. Mirrors all developer branches,
+      # but has no release tags. The only use case not covered by 1 or 2 is when we need
+      # to apply a patch from an open ticket that contains merge commits.
+      #
+      # Item 3 could cover all use cases if the sagemath/sagetrack-mirror repo had
+      # release tags, but it requires a sha instead of a release number in "base", which
+      # is inconvenient.
+      urls = if squashed
+             then [
+               "https://github.com/sagemath/sage/compare/${base}...${rev}.diff"
+               "https://github.com/sagemath/sagetrac-mirror/compare/${base}...${rev}.diff"
+             ]
+             else [ "https://git.sagemath.org/sage.git/patch?id2=${base}&id=${rev}" ];
 
       # We don't care about sage's own build system (which builds all its dependencies).
       # Exclude build system changes to avoid conflicts.
       excludes = [ "build/*" ];
-    } // builtins.removeAttrs args [ "rev" "base" "sha256" ])
+    } // builtins.removeAttrs args [ "rev" "base" "sha256" "squashed" ])
   );
 in
 stdenv.mkDerivation rec {
-  version = "9.3";
+  version = "9.4";
   pname = "sage-src";
 
   src = fetchFromGitHub {
     owner = "sagemath";
     repo = "sage";
     rev = version;
-    sha256 = "sha256-l9DX8jcDdKA7GJ6xU+nBsmlZxrcZ9ZUAJju621ooBEo=";
+    sha256 = "sha256-jqkr4meG02KbTCMsGvyr1UbosS4ZuUJhPXU/InuS+9A=";
   };
 
   # Patches needed because of particularities of nix or the way this is packaged.
@@ -77,63 +99,16 @@ stdenv.mkDerivation rec {
   # be empty since dependencies update all the time.
   packageUpgradePatches = [
     # After updating smypow to (https://trac.sagemath.org/ticket/3360) we can
-    # now set the cache dir to be withing the .sage directory. This is not
+    # 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
 
-    # ignore a deprecation warning for usage of `cmp` in the attrs library in the doctests
-    ./patches/ignore-cmp-deprecation.patch
-
-    # remove use of matplotlib function deprecated in 3.4
-    # https://trac.sagemath.org/ticket/31827
-    (fetchSageDiff {
-      base = "9.3";
-      name = "remove-matplotlib-deprecated-function.patch";
-      rev = "32b2bcaefddc4fa3d2aee6fa690ce1466cbb5948";
-      sha256 = "sha256-SXcUGBMOoE9HpuBzgKC3P6cUmM5MiktXbe/7dVdrfWo=";
-    })
-
-    # pari 2.13 update
-    # https://trac.sagemath.org/ticket/30801
-    #
-    # the last commit in that ticket is
-    # c78b1470fccd915e2fa93f95f2fefba6220fb1f7, but commits after
-    # 10a4531721d2700fd717e2b3a1364508ffd971c3 only deal with 32-bit
-    # and post-26635 breakage, none of which is relevant to us. since
-    # there are post-9.4.beta0 rebases after that, we just skip later
-    # commits.
-    (fetchSageDiff {
-      base = "9.3";
-      name = "pari-2.13.1.patch";
-      rev = "10a4531721d2700fd717e2b3a1364508ffd971c3";
-      sha256 = "sha256-gffWKK9CMREaNOb5zb63iZUgON4FvsPrMQNqe+5ZU9E=";
-    })
-
-    # sympy 1.8 update
-    # https://trac.sagemath.org/ticket/31647
-    (fetchSageDiff {
-      base = "9.4.beta0";
-      name = "sympy-1.8.patch";
-      rev = "fa864b36e15696450c36d54215b1e68183b29d25";
-      sha256 = "sha256-fj/9QEZlVF0fw9NpWflkTuBSKpGjCE6b96ECBgdn77o=";
-    })
-
-    # sphinx 4 update
-    # https://trac.sagemath.org/ticket/31696
-    (fetchSageDiff {
-      base = "9.4.beta3";
-      name = "sphinx-4.patch";
-      rev = "bc84af8c795b7da433d2000afc3626ee65ba28b8";
-      sha256 = "sha256-5Kvs9jarC8xRIU1rdmvIWxQLC25ehiTLJpg5skh8WNM=";
-    })
-
-    # eclib 20210625 update
-    # https://trac.sagemath.org/ticket/31443
+    # https://trac.sagemath.org/ticket/32305
     (fetchSageDiff {
-      base = "9.4.beta3";
-      name = "eclib-20210625.patch";
-      rev = "789550ca04c94acfb1e803251538996a34962038";
-      sha256 = "sha256-VlyEn5hg3joG8t/GwiRfq9TzJ54AoHxLolsNQ3shc2c=";
+      base = "9.4";
+      name = "networkx-2.6-upgrade.patch";
+      rev = "9808325853ba9eb035115e5b056305a1c9d362a0";
+      sha256 = "sha256-gJSqycCtbAVr5qnVEbHFUvIuTOvaxFIeffpzd6nH4DE=";
     })
   ];
 
diff --git a/nixpkgs/pkgs/applications/science/math/sage/sagelib.nix b/nixpkgs/pkgs/applications/science/math/sage/sagelib.nix
index f60cb64d2e8d..b9c98ed64d01 100644
--- a/nixpkgs/pkgs/applications/science/math/sage/sagelib.nix
+++ b/nixpkgs/pkgs/applications/science/math/sage/sagelib.nix
@@ -27,6 +27,7 @@
 , linbox
 , m4ri
 , m4rie
+, memory-allocator
 , libmpc
 , mpfi
 , ntl
@@ -107,6 +108,7 @@ buildPythonPackage rec {
     lrcalc
     m4ri
     m4rie
+    memory-allocator
     mpfi
     ntl
     blas
diff --git a/nixpkgs/pkgs/applications/science/math/scilab-bin/default.nix b/nixpkgs/pkgs/applications/science/math/scilab-bin/default.nix
index f9abdee2d148..5dea2c7653aa 100644
--- a/nixpkgs/pkgs/applications/science/math/scilab-bin/default.nix
+++ b/nixpkgs/pkgs/applications/science/math/scilab-bin/default.nix
@@ -39,8 +39,6 @@ stdenv.mkDerivation {
     xorg.libXxf86vm
   ];
 
-  phases = [ "unpackPhase" "fixupPhase" "installPhase" ];
-
   fixupPhase = ''
     sed -i 's|\$(/bin/|$(|g' bin/scilab
     sed -i 's|/usr/bin/||g' bin/scilab
diff --git a/nixpkgs/pkgs/applications/science/math/wxmaxima/default.nix b/nixpkgs/pkgs/applications/science/math/wxmaxima/default.nix
index 94e675d7dd44..2205e96383a4 100644
--- a/nixpkgs/pkgs/applications/science/math/wxmaxima/default.nix
+++ b/nixpkgs/pkgs/applications/science/math/wxmaxima/default.nix
@@ -4,13 +4,13 @@
 
 stdenv.mkDerivation rec {
   pname = "wxmaxima";
-  version = "21.02.0";
+  version = "21.05.2";
 
   src = fetchFromGitHub {
     owner = "wxMaxima-developers";
     repo = "wxmaxima";
     rev = "Version-${version}";
-    sha256 = "sha256-5nvaaKsvSEs7QxOszjDK1Xkana2er1BCMZ83b1JZSqc=";
+    sha256 = "sha256-HPqdxGrPxe5FZNOimTpAP+c9VpDBkXu3Z1c1Aaf3+UA=";
   };
 
   buildInputs = [ wxGTK maxima gnome.adwaita-icon-theme ];
diff --git a/nixpkgs/pkgs/applications/science/medicine/dcmtk/default.nix b/nixpkgs/pkgs/applications/science/medicine/dcmtk/default.nix
index 8a06260ebc71..b6a9c161638a 100644
--- a/nixpkgs/pkgs/applications/science/medicine/dcmtk/default.nix
+++ b/nixpkgs/pkgs/applications/science/medicine/dcmtk/default.nix
@@ -26,6 +26,6 @@ stdenv.mkDerivation rec {
     homepage = "https://dicom.offis.de/dcmtk";
     license = licenses.bsd3;
     maintainers = with maintainers; [ iimog ];
-    platforms = platforms.linux;
+    platforms = with platforms; linux ++ darwin;
   };
 }
diff --git a/nixpkgs/pkgs/applications/science/misc/cwltool/default.nix b/nixpkgs/pkgs/applications/science/misc/cwltool/default.nix
new file mode 100644
index 000000000000..21e3c47b323d
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/cwltool/default.nix
@@ -0,0 +1,41 @@
+{ lib
+, python3Packages
+}:
+
+python3Packages.buildPythonApplication rec {
+  pname = "cwltool";
+  version = "3.1.20210628163208";
+
+  src = python3Packages.fetchPypi {
+    inherit pname version;
+    sha256 = "21b885f725420413d2f87eadc5e81c08a9c91beceda89b35d1a702ec4df47e52";
+  };
+
+  postPatch = ''
+    substituteInPlace setup.py \
+      --replace 'prov == 1.5.1' 'prov'
+  '';
+
+  propagatedBuildInputs = with python3Packages; [
+    argcomplete
+    bagit
+    coloredlogs
+    mypy-extensions
+    prov
+    psutil
+    pydot
+    schema-salad
+    shellescape
+    typing-extensions
+  ];
+
+  doCheck = false; # hard to setup
+  pythonImportsCheck = [ "cwltool" ];
+
+  meta = with lib; {
+    homepage = "https://www.commonwl.org";
+    license = with licenses; [ asl20 ];
+    description = "Common Workflow Language reference implementation";
+    maintainers = with maintainers; [ veprbl ];
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/combined/default.nix b/nixpkgs/pkgs/applications/science/misc/openmodelica/combined/default.nix
new file mode 100644
index 000000000000..459a325111e2
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/combined/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, lib, openmodelica, symlinkJoin, gnumake, blas, lapack, makeWrapper }:
+symlinkJoin {
+  name = "openmodelica-combined";
+  paths = with openmodelica; [
+    omcompiler
+    omsimulator
+    omplot
+    omparser
+    omedit
+    omlibrary
+    omshell
+  ];
+
+  buildInputs = [ gnumake makeWrapper ];
+
+  postBuild = ''
+    wrapProgram $out/bin/OMEdit \
+      --prefix PATH : ${lib.makeBinPath [ gnumake stdenv.cc ]} \
+      --prefix LIBRARY_PATH : "${lib.makeLibraryPath [ blas lapack ]}" \
+      --set-default OPENMODELICALIBRARY "${openmodelica.omlibrary}/lib/omlibrary"
+  '';
+
+  meta = with lib; {
+    description = "An open-source Modelica-based modeling and simulation environment intended for industrial and academic usage";
+    homepage = "https://openmodelica.org";
+    license = licenses.gpl3Only;
+    maintainers = with maintainers; [ smironov ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/default.nix b/nixpkgs/pkgs/applications/science/misc/openmodelica/default.nix
index cab0fa5ff5c6..10fccfdf6da8 100644
--- a/nixpkgs/pkgs/applications/science/misc/openmodelica/default.nix
+++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/default.nix
@@ -1,53 +1,17 @@
-{lib, stdenv, fetchgit, fetchsvn, autoconf, automake, libtool, gfortran, clang, cmake, gnumake,
-hwloc, jre, lapack, blas, hdf5, expat, ncurses, readline, qt4, webkitgtk, which,
-lp_solve, omniorb, sqlite, libatomic_ops, pkg-config, file, gettext, flex, bison,
-doxygen, boost, openscenegraph, gnome2, xorg, git, bash, gtk2, makeWrapper }:
-
-let
-
-  fakegit = import ./fakegit.nix { inherit lib stdenv fetchgit fetchsvn bash; };
-
-in
-
-stdenv.mkDerivation {
-  name = "openmodelica";
-
-  src = fetchgit (import ./src-main.nix);
-
-  buildInputs = [autoconf cmake automake libtool gfortran clang gnumake
-    hwloc jre lapack blas hdf5 expat ncurses readline qt4 webkitgtk which
-    lp_solve omniorb sqlite libatomic_ops pkg-config file gettext flex bison
-    doxygen boost openscenegraph gnome2.gtkglext xorg.libXmu
-    git gtk2 makeWrapper];
-
-  hardeningDisable = [ "format" ];
-
-  patchPhase = ''
-    cp -fv ${fakegit}/bin/checkout-git.sh libraries/checkout-git.sh
-    cp -fv ${fakegit}/bin/checkout-svn.sh libraries/checkout-svn.sh
-  '';
-
-  configurePhase = ''
-    export NIX_LDFLAGS="$NIX_LDFLAGS -L${gfortran.cc.lib}/lib"
-
-    autoconf
-    ./configure CC=${clang}/bin/clang CXX=${clang}/bin/clang++ --prefix=$out
-  '';
-
-  postFixup = ''
-    for e in $(cd $out/bin && ls); do
-      wrapProgram $out/bin/$e \
-        --prefix PATH : "${gnumake}/bin" \
-        --prefix LIBRARY_PATH : "${lib.makeLibraryPath [ lapack blas ]}"
-    done
-  '';
-
-  meta = with lib; {
-    description = "An open-source Modelica-based modeling and simulation environment";
-    homepage    = "https://openmodelica.org";
-    license     = licenses.gpl3;
-    maintainers = with maintainers; [ smironov ];
-    platforms   = platforms.linux;
-    broken      = true;
-  };
-}
+{ lib, newScope, libsForQt5, clangStdenv }:
+lib.makeScope newScope (self:
+  let
+    callPackage = self.newScope { stdenv = clangStdenv; };
+    callQtPackage = self.newScope (libsForQt5 // { stdenv = clangStdenv; });
+  in
+  {
+    mkOpenModelicaDerivation = callPackage ./mkderivation { };
+    omcompiler = callPackage ./omcompiler { };
+    omplot = callQtPackage ./omplot { };
+    omsimulator = callPackage ./omsimulator { };
+    omparser = callPackage ./omparser { };
+    omedit = callQtPackage ./omedit { };
+    omlibrary = callPackage ./omlibrary { };
+    omshell = callQtPackage ./omshell { };
+    combined = callPackage ./combined { };
+  })
diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/fakegit.nix b/nixpkgs/pkgs/applications/science/misc/openmodelica/fakegit.nix
deleted file mode 100644
index 47cca7c74917..000000000000
--- a/nixpkgs/pkgs/applications/science/misc/openmodelica/fakegit.nix
+++ /dev/null
@@ -1,81 +0,0 @@
-{ lib, stdenv, fetchgit, fetchsvn, bash }:
-
-let
-  mkscript = path : text : ''
-    mkdir -pv `dirname ${path}`
-    cat > ${path} <<"EOF"
-    #!${bash}/bin/bash
-    ME=`basename ${path}`
-    ${text}
-    EOF
-    sed -i "s@%out@$out@g" ${path}
-    chmod +x ${path}
-  '';
-
-  hashname = r: let
-    rpl = lib.replaceChars [":" "/"] ["_" "_"];
-  in
-    (rpl r.url) + "-" + (rpl r.rev);
-
-in
-
-stdenv.mkDerivation {
-  name = "fakegit";
-
-  buildCommand = ''
-    mkdir -pv $out/repos
-    ${lib.concatMapStrings
-       (r : ''
-        cp -r ${fetchgit r} $out/repos/${hashname r}
-       ''
-       ) (import ./src-libs-git.nix)
-    }
-
-    ${mkscript "$out/bin/checkout-git.sh" ''
-      if test "$#" -ne 4; then
-        echo "Usage: $0 DESTINATION URL GITBRANCH HASH"
-        exit 1
-      fi
-      DEST=$1
-      URL=`echo $2 | tr :/ __`
-      GITBRANCH=$3
-      REVISION=$4
-
-      L=`echo $REVISION | wc -c`
-      if expr $L '<' 10 >/dev/null; then
-        REVISION=refs/tags/$REVISION
-      fi
-
-      REVISION=`echo $REVISION | tr :/ __`
-
-      rm -rf $DEST
-      mkdir -pv $DEST
-      echo "FAKEGIT cp -r %out/repos/$URL-$REVISION $DEST" >&2
-      cp -r %out/repos/$URL-$REVISION/* $DEST
-      chmod u+w -R $DEST
-    ''}
-
-    ${lib.concatMapStrings
-       (r : ''
-        cp -r ${fetchsvn r} $out/repos/${hashname r}
-       ''
-       ) (import ./src-libs-svn.nix)
-    }
-
-    ${mkscript "$out/bin/checkout-svn.sh" ''
-      if test "$#" -ne 3; then
-        echo "Usage: $0 DESTINATION URL REVISION"
-        exit 1
-      fi
-      DEST=$1
-      URL=`echo $2 | tr :/ __`
-      REVISION=`echo $4 | tr :/ __`
-
-      rm -rf $DEST
-      mkdir -pv $DEST
-      echo "FAKE COPY %out/repos/$URL-$REVISION $DEST"
-      cp -r %out/repos/$URL-$REVISION/* $DEST
-      chmod u+w -R $DEST
-    ''}
-  '';
-}
diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/mkderivation/default.nix b/nixpkgs/pkgs/applications/science/misc/openmodelica/mkderivation/default.nix
new file mode 100644
index 000000000000..94029fead48e
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/mkderivation/default.nix
@@ -0,0 +1,101 @@
+# mkOpenModelicaDerivation is an mkDerivation function for packages
+# from OpenModelica suite.
+
+{ stdenv, lib, fetchgit, autoconf, automake, libtool, cmake, autoreconfHook, symlinkJoin }:
+pkg:
+let
+  inherit (builtins) hasAttr getAttr length elemAt;
+  inherit (lib) attrByPath concatStringsSep;
+
+
+  # A few helpers functions:
+
+  # getAttrDef is just a getAttr with default fallback
+  getAttrDef = attr: default: x: attrByPath [ attr ] default x;
+
+  # getAttr-like helper for optional append to string:
+  # "Hello" + appendByAttr "a" " " {a = "world";} = "Hello world"
+  # "Hello" + appendByAttr "a" " " {} = "Hello"
+  appendByAttr = attr: sep: x: if hasAttr attr x then sep + (getAttr attr x) else "";
+
+  # Are there any OM dependencies at all?
+  ifDeps = length pkg.omdeps != 0;
+
+  # Dependencies of current OpenModelica-target joined in one file tree.
+  # Return the dep itself in case it is a single one.
+  joinedDeps =
+    if length pkg.omdeps == 1
+    then elemAt pkg.omdeps 0
+    else
+      symlinkJoin {
+        name = pkg.pname + "-omhome";
+        paths = pkg.omdeps;
+      };
+
+  # Should we run ./configure for the target pkg?
+  omautoconf = getAttrDef "omautoconf" false pkg;
+
+  # Name of the make target
+  omtarget = getAttrDef "omtarget" pkg.pname pkg;
+
+  # Directory of target sources
+  omdir = getAttrDef "omdir" pkg.pname pkg;
+
+  # Simple to to m4 configuration scripts
+  postPatch = lib.optionalString ifDeps ''
+    sed -i ''$(find -name omhome.m4) -e 's|if test ! -z "$USINGPRESETBUILDDIR"|if test ! -z "$USINGPRESETBUILDDIR" -a -z "$OMHOME"|'
+  '' +
+  appendByAttr "postPatch" "\n" pkg;
+
+  # Update shebangs in the scripts before running configuration.
+  preAutoreconf = "patchShebangs --build common" +
+    appendByAttr "preAutoreconf" "\n" pkg;
+
+  # Tell OpenModelica where built dependencies are located.
+  configureFlags = lib.optional ifDeps "--with-openmodelicahome=${joinedDeps}" ++
+    getAttrDef "configureFlags" [ ] pkg;
+
+  # Our own configurePhase that accounts for omautoconf
+  configurePhase = ''
+    runHook preConfigure
+    export configureFlags="''${configureFlags} --with-ombuilddir=$PWD/build --prefix=$prefix"
+    ./configure --no-recursion $configureFlags
+    ${lib.optionalString omautoconf "(cd ${omdir}; ./configure $configureFlags)"}
+    runHook postConfigure
+  '';
+
+  # Targets that we want to build ourselves:
+  deptargets = lib.forEach pkg.omdeps (dep: dep.omtarget);
+
+  # ... so we ask openmodelica makefile to skip those targets.
+  preBuild = ''
+    for target in ${concatStringsSep " " deptargets}; do
+      touch ''${target}.skip;
+    done
+  '' +
+  appendByAttr "preBuild" "\n" pkg;
+
+  makeFlags = "${omtarget}" +
+    appendByAttr "makeFlags" " " pkg;
+
+  installFlags = "-i " +
+    appendByAttr "installFlags" " " pkg;
+
+
+in
+stdenv.mkDerivation (pkg // {
+  inherit omtarget postPatch preAutoreconf configureFlags configurePhase preBuild makeFlags installFlags;
+
+  src = fetchgit (import ./src-main.nix);
+  version = "1.17.0";
+
+  nativeBuildInputs = getAttrDef "nativeBuildInputs" [ ] pkg
+    ++ [ autoconf automake libtool cmake autoreconfHook ];
+
+  buildInputs = getAttrDef "buildInputs" [ ] pkg
+    ++ lib.optional ifDeps joinedDeps;
+
+  dontUseCmakeConfigure = true;
+
+  hardeningDisable = [ "format" ];
+})
diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/mkderivation/src-main.nix b/nixpkgs/pkgs/applications/science/misc/openmodelica/mkderivation/src-main.nix
new file mode 100644
index 000000000000..c31b23d2f948
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/mkderivation/src-main.nix
@@ -0,0 +1,7 @@
+{
+  url = "https://github.com/OpenModelica/OpenModelica/";
+  rev = "08fd3f9144235f209a4ed7602bfadb32b1823628";
+  sha256 = "0clgqk9ilnr43iyl5sdzwfzqpnw9amfy1npdgkpgm1wfnsvz6xrw";
+  fetchSubmodules = true;
+}
+# Update with: nix run -f ./nixpkgs/default.nix nix-prefetch-git -c nix-prefetch-git 'https://github.com/OpenModelica/OpenModelica/' 'v1.17.0' --fetch-submodules
diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/omcompiler/default.nix b/nixpkgs/pkgs/applications/science/misc/openmodelica/omcompiler/default.nix
new file mode 100644
index 000000000000..b49c0f0f60ca
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/omcompiler/default.nix
@@ -0,0 +1,63 @@
+{ stdenv
+, lib
+, gfortran
+, flex
+, bison
+, jre8
+, blas
+, lapack
+, curl
+, readline
+, expat
+, pkg-config
+, buildPackages
+, targetPackages
+, libffi
+, binutils
+, mkOpenModelicaDerivation
+}:
+let
+  isCross = stdenv.buildPlatform != stdenv.hostPlatform;
+  nativeOMCompiler = buildPackages.openmodelica.omcompiler;
+in
+mkOpenModelicaDerivation ({
+  pname = "omcompiler";
+  omtarget = "omc";
+  omdir = "OMCompiler";
+  omdeps = [ ];
+  omautoconf = true;
+
+  nativeBuildInputs = [
+    jre8
+    gfortran
+    flex
+    bison
+    pkg-config
+  ] ++ lib.optional isCross nativeOMCompiler;
+
+  buildInputs = [ targetPackages.stdenv.cc.cc blas lapack curl readline expat libffi binutils ];
+
+  postPatch = ''
+    sed -i -e '/^\s*AR=ar$/ s/ar/${stdenv.cc.targetPrefix}ar/
+               /^\s*ar / s/ar /${stdenv.cc.targetPrefix}ar /
+               /^\s*ranlib/ s/ranlib /${stdenv.cc.targetPrefix}ranlib /' \
+        $(find ./OMCompiler -name 'Makefile*')
+  '';
+
+  preFixup = ''
+    for entry in $(find $out -name libipopt.so); do
+      patchelf --shrink-rpath --allowed-rpath-prefixes /nix/store $entry
+      patchelf --set-rpath '$ORIGIN':"$(patchelf --print-rpath $entry)" $entry
+    done
+  '';
+
+  meta = with lib; {
+    description = "Modelica compiler from OpenModelica suite";
+    homepage = "https://openmodelica.org";
+    license = licenses.gpl3Only;
+    maintainers = with maintainers; [ smironov ];
+    platforms = platforms.linux;
+  };
+} // lib.optionalAttrs isCross {
+  configureFlags = [ "--with-omc=${nativeOMCompiler}/bin/omc" ];
+})
diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/omedit/default.nix b/nixpkgs/pkgs/applications/science/misc/openmodelica/omedit/default.nix
new file mode 100644
index 000000000000..b0cc530ba37b
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/omedit/default.nix
@@ -0,0 +1,38 @@
+{ lib
+, jre8
+, qmake
+, qtbase
+, qttools
+, qtwebkit
+, qtxmlpatterns
+, binutils
+, wrapQtAppsHook
+, openmodelica
+, mkOpenModelicaDerivation
+}:
+with openmodelica;
+mkOpenModelicaDerivation rec {
+  pname = "omedit";
+  omdir = "OMEdit";
+  omdeps = [ omcompiler omplot omparser omsimulator ];
+  omautoconf = true;
+
+  nativeBuildInputs = [ jre8 qmake qtbase qttools wrapQtAppsHook ];
+
+  buildInputs = [ qtwebkit qtxmlpatterns binutils ];
+
+  postPatch = ''
+    sed -i ''$(find -name qmake.m4) -e '/^\s*LRELEASE=/ s|LRELEASE=.*$|LRELEASE=${lib.getDev qttools}/bin/lrelease|'
+  '';
+
+  dontUseQmakeConfigure = true;
+  QMAKESPEC = "linux-clang";
+
+  meta = with lib; {
+    description = "A Modelica connection editor for OpenModelica";
+    homepage = "https://openmodelica.org";
+    license = licenses.gpl3Only;
+    maintainers = with maintainers; [ smironov ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/default.nix b/nixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/default.nix
new file mode 100644
index 000000000000..006daf18812f
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/default.nix
@@ -0,0 +1,37 @@
+{ lib
+, stdenv
+, fetchgit
+, bash
+, pkg-config
+, jre8
+, libuuid
+, openmodelica
+, mkOpenModelicaDerivation
+}:
+let
+  fakegit = import ./fakegit.nix { inherit lib stdenv fetchgit bash; };
+in
+mkOpenModelicaDerivation {
+  pname = "omlibrary";
+  omdir = "libraries";
+  omtarget = "omlibrary-all";
+  omdeps = [ openmodelica.omcompiler ];
+
+  postPatch = ''
+    patchShebangs --build libraries
+    cp -fv ${fakegit}/bin/checkout-git.sh libraries/checkout-git.sh
+
+    # The EMOTH library is broken in OpenModelica 1.17.0
+    # Let's remove it from targets.
+    sed -i -e '/^OTHER_LIBS=/ s/EMOTH //' libraries/Makefile.libs
+  '';
+
+  meta = with lib; {
+    description = "A collection of Modelica libraries to use with OpenModelica,
+including Modelica Standard Library";
+    homepage = "https://openmodelica.org";
+    license = licenses.gpl3Only;
+    maintainers = with maintainers; [ smironov ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/fakegit.nix b/nixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/fakegit.nix
new file mode 100644
index 000000000000..fdbc79aae599
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/fakegit.nix
@@ -0,0 +1,49 @@
+{ lib, stdenv, fetchgit, bash }:
+let
+  mkscript = path: text: ''
+    mkdir -pv `dirname ${path}`
+    cat > ${path} <<"EOF"
+    #!${bash}/bin/bash
+    ME=$(basename ${path})
+    ${text}
+    EOF
+    sed -i "s@%out@$out@g" ${path}
+    chmod +x ${path}
+  '';
+
+  hashname = r:
+    let
+      rpl = lib.replaceChars [ ":" "/" ] [ "_" "_" ];
+    in
+    (rpl r.url) + "-" + (rpl r.rev);
+
+in
+stdenv.mkDerivation {
+  name = "fakegit";
+
+  buildCommand = ''
+    mkdir -pv $out/repos
+    ${lib.concatMapStrings
+      (r: "cp -r ${fetchgit r} $out/repos/${hashname r}\n")
+      (import ./src-libs.nix)}
+
+    ${mkscript "$out/bin/checkout-git.sh" ''
+      if test "$#" -ne 4; then
+        echo "Usage: $0 DESTINATION URL GITBRANCH HASH"
+        exit 1
+      fi
+      DEST=$1
+      URL=`echo $2 | tr :/ __`
+      GITBRANCH=$3
+      REVISION=$4
+
+      REVISION=`echo $REVISION | tr :/ __`
+
+      rm -rf $DEST
+      mkdir -pv $DEST
+      echo "FAKEGIT cp -r %out/repos/$URL-$REVISION $DEST" >&2
+      cp -r %out/repos/$URL-$REVISION/* $DEST
+      chmod u+w -R $DEST
+    ''}
+  '';
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/src-libs.nix b/nixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/src-libs.nix
new file mode 100644
index 000000000000..c91addf78040
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/src-libs.nix
@@ -0,0 +1,83 @@
+[
+  { url = "https://github.com/modelica-3rdparty/AdvancedNoise.git"; rev = "5ce57acd279dadd0d25b76a6b02d3f9e9d061246"; sha256 = "07jjbj0y6bak269md3xniqb5lgc33m92ar5qixqxj5yxdjaahfs2"; fetchSubmodules = true; }
+  { url = "https://github.com/RWTH-EBC/AixLib.git"; rev = "b00e01d911e2e54e148f24e36ee387a8b457d89c"; sha256 = "1sljddxkx208nill0975sz9b1xd701n97aia4wxihr140dgs4dgb"; fetchSubmodules = true; }
+  { url = "https://github.com/RWTH-EBC/AixLib.git"; rev = "v0.4.0"; sha256 = "0dw34mjq29n55xh51g1c9a9d0d8gbpn16gj309dfxn4v2hbnfvzx"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica-3rdparty/AlgebraTestSuite.git"; rev = "b937e1a7f447138c59abec9b2092f84f16bf02e8"; sha256 = "0406inasx61dk7vcnziiyhxkna7g61a5hn0znnbxj817hz6q11zn"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica-3rdparty/ApproxSpline.git"; rev = "28420f5c1a88c9cd069defbd8c05e4a78a090675"; sha256 = "07gpyi2brj5zpvrlsnflqjnhbrgxvpqbdshp8lp4lh9mnj5jv95d"; fetchSubmodules = true; }
+  { url = "https://github.com/OpenModelica/BioChem.git"; rev = "v1.0.2"; sha256 = "037bvj2lqrslg8k5r0rjgdzccslj9bj25b55k4g440vabm5p05qm"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica-3rdparty/BondGraph.git"; rev = "20c23e60d12989bd4668ccac47659d82d39d29cc"; sha256 = "0yrkk708v4bvf423xb4zgpmnaj8qhq5primdg758ayddgli23wa9"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica-3rdparty/BrineProp.git"; rev = "c2f564ae284726a2df6252a8561856691681572b"; sha256 = "01c2i2rlry7b4a6f2skkvzphcrfg5a2waxv4i7zgx5q275fg06i1"; fetchSubmodules = true; }
+  { url = "https://github.com/EDF-TREE/BuildSysPro.git"; rev = "v3.3.0"; sha256 = "1cvcany3q9p1xndarxa2d8mmqxdnqk22476q8l61nayz5qy25x61"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica-3rdparty/BuildingControlLib.git"; rev = "v1.0.0"; sha256 = "0ckdxway0m755mbrl94k4458sijzgknlzsrf7xs5bjymxchm8r2m"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica-3rdparty/BuildingSystems.git"; rev = "1e07bb475b921a4eedc6155c5310d1f9f3ef7550"; sha256 = "1xg831vqh6zw88cxxcb3sjgz44l7ygsgxddl05fp6xvz5sjpfcna"; fetchSubmodules = true; }
+  { url = "https://github.com/lbl-srg/modelica-buildings.git"; rev = "v6.0.0"; sha256 = "0rnnk1clji0myzr7adggki6knbl6v8381vwnqgiz8mkxbmzdwm4f"; fetchSubmodules = true; }
+  { url = "https://github.com/lbl-srg/modelica-buildings.git"; rev = "v7.0.0"; sha256 = "04n04pp4zvyg8n8h7h79c3wyk7lmn940mh7qzs0lv76g1ybypnlz"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica-3rdparty/Chemical.git"; rev = "5645573fced862430b7b598b4d7ec1a39c7aa0fa"; sha256 = "1kh7kpmjfz55pb8553srlnrh8l00nw21xf5mjzh7nx9b1rndnmyg"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica-3rdparty/DeployStructLib.git"; rev = "v1.0"; sha256 = "1k4zw9lnd0javw4zigxc15l58yf7xdz36b7808g65qxy89w6ksr2"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica-3rdparty/DisHeatLib.git"; rev = "b11f53379c122870a52f2da9b1705d2c911cd21d"; sha256 = "1vm96a4z0b40r0nisxrrzyvan4yphjdkx4ad655phva2636xb5rr"; fetchSubmodules = true; }
+  { url = "https://github.com/AHaumer/DriveControl.git"; rev = "b7233fd97a92867bb4ec2c3647c7f7e888398644"; sha256 = "0nyp1n8wrkjzfypsmjjzac0g9p4wbc1cxxr040fj20bqdg9l3h1b"; fetchSubmodules = true; }
+  # A broken one. The revision is lost.
+  # { url = "https://github.com/AHaumer/EMOTH.git"; rev = "fa890c8c2781f0c0b2f8efe955ed8a27875dd9ac"; sha256 = ""; fetchSubmodules = true; }
+  { url = "https://github.com/christiankral/ElectroMechanicalDrives.git"; rev = "v2.2.0"; sha256 = "0012phmn1y9fgpph45lwbjk0yhm5czidf2z6khm8lddvk93wf31b"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica-3rdparty/ExternData.git"; rev = "v2.5.0"; sha256 = "19dsyq1mk5vl54fqaffzqafm5w94l011cy7pg16c7i933dbqnkki"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica/ExternalMedia.git"; rev = "159518edd538b64e28cd70983a9cc47730323cc4"; sha256 = "0qjd5fk65bln3s1jhs0cqcv54c22m6x2akbmxj09y4x0lkd1kgqn"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica-3rdparty/ExternalMemoryLib.git"; rev = "6488d5815bda23c665123baa916789e283e16d2c"; sha256 = "06y1i5w690b3b9x23nzls8y67fl7yd7bn4xl5j0dmyi4qx33aqda"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica-3rdparty/FMITest.git"; rev = "a67a276083f4010b249802ad8fc70dc30c09adfd"; sha256 = "0mg8jlvlwql2nsjiy7c3rdibv73bkfk149ac0450d5pc0hfn9mln"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica-3rdparty/FailureModes.git"; rev = "v1.2.1"; sha256 = "1z8bwrld1rkydgssab5gnrd76frrbky8qxi1lvlaf2jidj6bzn1l"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica-3rdparty/FaultTriggering.git"; rev = "v0.6.6"; sha256 = "0a08yyrbg4a49s0bgqgyds6pidx9xr47yspvl9bdak1mq34qibip"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica-3rdparty/FeedDriveLibrary.git"; rev = "1.0.1"; sha256 = "15fi9dj6zgl0fr90cwxqjbpphj0dwrrmk74hf25j6zd85w2ycqdz"; fetchSubmodules = true; }
+  { url = "https://github.com/DLR-SR/FractionalOrder.git"; rev = "99918820e346c362c3ad52d782c8215e5deeac4c"; sha256 = "1pycss6fqh86frfdbdfffjhaz09fz1558f9azgckhf8drx6ry1qs"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica-3rdparty/Greenhouses-Library.git"; rev = "89ae0e8097eb0751abce2013d304fa5f9c09b885"; sha256 = "1q77xj6aysqsn3d7kjmcq7dihbw18iqm35ifzdi75xgf3cgwla4f"; fetchSubmodules = true; }
+  { url = "https://github.com/christiankral/HanserModelica.git"; rev = "v1.1.0"; sha256 = "0zwkrhg2y42m18p4z51izrickiv1vikgz0z7fpjia4dbppckav8i"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica-3rdparty/HelmholtzMedia.git"; rev = "3b4a4bca94d388744b2d045344ea2f9b0b4d405b"; sha256 = "17fzpan89075vb5vbhw5ylgxcdsmj2vjnmmka7cgzh06izb69nvh"; fetchSubmodules = true; }
+  { url = "https://github.com/ibpsa/modelica-ibpsa.git"; rev = "v3.0.0"; sha256 = "0xwgfndlw76zfmiiqadl85l9na9igsqlmfcawx526sdw2lhhgics"; fetchSubmodules = true; }
+  { url = "https://github.com/open-ideas/IDEAS.git"; rev = "v2.1.0"; sha256 = "0xp0zg6ib5536d5vl361lsn5w5faqdf6djhcmfxns629wjima8rn"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica-3rdparty/IndustrialControlSystems.git"; rev = "v1.1.0"; sha256 = "1nvgx94iy1pws0768anrl7ssjlzslb5mbp21j7xvf6wpqfmj0npc"; fetchSubmodules = true; }
+  { url = "https://github.com/christiankral/KeyWordIO.git"; rev = "v0.9.0"; sha256 = "10kvj6zn2r6m3403ja8nkkxbfcchkz0pfk3g70ibr76zivxb5nim"; fetchSubmodules = true; }
+  { url = "https://github.com/FishSim/LibRAS.git"; rev = "fca9de50a484a2213f3ca1b39e275c237c471688"; sha256 = "0w1c87sifq8klq0f2l70qxjrlvahyxy1cx9rln80rni4d427yc1k"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica-3rdparty/LinearMPC.git"; rev = "v1.0"; sha256 = "1crj60i5f33l9pgip0xbv6ankcga7px0644cj7c2wnzn1fjmn2k8"; fetchSubmodules = true; }
+  { url = "https://github.com/looms-polimi/MEV.git"; rev = "v1.0.1"; sha256 = "1a7ih9lc01wzaq8a8aznggpi4aqnczyzq49q5hc4fqvmfwl7l0j3"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica-3rdparty/ModPowerSystems.git"; rev = "df3afce27d5e935c4111f392275744a655abe216"; sha256 = "1b1fikm92lv6gj82imka3hxbjwv04i4h33y69yhcxdpqa6z6hm4z"; fetchSubmodules = true; }
+  { url = "https://github.com/OpenModelica/OpenModelica-ModelicaStandardLibrary.git"; rev = "614a148f61c1ab5d6788d8c11197803132ec7c2f"; sha256 = "0fg0pbahybx3srv5npk8pw49k23kaw2ns6c00f15iy93mvfrmfsk"; fetchSubmodules = true; }
+  { url = "https://github.com/OpenModelica/OpenModelica-ModelicaStandardLibrary.git"; rev = "34fe8cf3c7127ae09ca5f41e26b48fb6044e1e34"; sha256 = "0yz82k9dsp9d1jxqgxcm27fw1jz718km43qfginmgg0m9kfh2336"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica-3rdparty/Modelica-Arduino.git"; rev = "v0.1.0"; sha256 = "1n34dksqhrn1synv2mp2ifk4dxyhp15f5v1jb1b3dbw9n19951qb"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica-3rdparty/Modelica-GNU_ScientificLibrary.git"; rev = "9235ab28bdd7f0fe3e7abba48af53d73332858ec"; sha256 = "168g9gg12lfa863ifs41bnx6yd0yyjnal6986dgpm51dj5arw6id"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica-3rdparty/Modelica-MVEM.git"; rev = "v1.0.1"; sha256 = "1p68691dnl06lgwm4bl9g036brn4vl7m5x3gq4rxc291339frixk"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica-3rdparty/ModelicaADS.git"; rev = "v1.0.1"; sha256 = "0fhxrl07d7v3wa79d30psm1gxydc0p7s2akfirdx6dai0633skp9"; fetchSubmodules = true; }
+  { url = "https://github.com/xogeny/ModelicaBook.git"; rev = "v0.6.0"; sha256 = "0yqbll6p738yvpi1x11cjngpz2glda07mljrkjlm23p7l53x63dc"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica-compliance/compliance.git"; rev = "8a91e75d8a26acc4de30fc0e5d5e9db83c970bd6"; sha256 = "1cym1wlgsvfrryq8zqzzrgs4wam1l7pc20q07hk3d615nhq21lg6"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica-3rdparty/ModelicaDFR.git"; rev = "37a441934d05330cf3d13e9ec551954d27eca84c"; sha256 = "13rpcs8cl9x15vi655150zmhmg1iaxpzvxrl3rqif46zpl5dhlj2"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica/Modelica_DeviceDrivers.git"; rev = "v1.8.2"; sha256 = "16c0p9zn0qrraz59ivinibmikdd251plm1vqngznzhksjwvz6bja"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica/Modelica_LinearSystems2.git"; rev = "v2.3.5"; sha256 = "0rzicynqgayydxqynnairxk7ybg4alv1xnfz8cgkrpicl2g9bacg"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica-3rdparty/Modelica_Requirements.git"; rev = "a427b5cb7997e9036c577d219e6b8a5d0c28389a"; sha256 = "1ihx46kifnfi9kw1g8nmd9sarl766whbzdk6a44alczsya4gg45k"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica/Modelica_Synchronous.git"; rev = "c8350276bfd945086962cf4150ba941b9c57ed13"; sha256 = "12ad7fpjy50ky3lvl65r9d5xvlzvw5yqdnbp4rsgl3qw7s3wrmja"; fetchSubmodules = true; }
+  { url = "https://github.com/jwindahlModelon/MultiPhaseMixtureMedia.git"; rev = "0bda0c58af6384f8e0edf7aa7520afb369af3e38"; sha256 = "11bqm69504bh4h05dxlwdmjfxwls06mr49cz47kl8jmrygkfi4i2"; fetchSubmodules = true; }
+  { url = "https://github.com/OpenIPSL/OpenIPSL.git"; rev = "v1.5.0"; sha256 = "09xrcz0rdxdy220ki5zyl7920y0a4lg24p0aibna4ad15vszhhwj"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica-3rdparty/Optimisers.git"; rev = "e33c69edaad6dad8029167b0ca00533964a6fe37"; sha256 = "0hcxsrr2n4fzaxdjvgvqayz38kpfk86cclvg5pzcfmjc5bznb8bs"; fetchSubmodules = true; }
+  { url = "https://github.com/lochel/PNlib.git"; rev = "ab9b6b8527c0c78140365e7b105ae469d4954a64"; sha256 = "0y7bfbnvzv9bnz4v8wvmy42dji3cqpy5b2fmd2jj0rhlzs1infzh"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica-3rdparty/PVSystems.git"; rev = "v0.6.2"; sha256 = "0vcgvdaqfbn46lpzk0kvsif3d55wf8yzhkbdpf5zv04kv7zw25w9"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica-3rdparty/PhotoVoltaics.git"; rev = "v1.6.0"; sha256 = "0zqx77z217iln3vfxn2v3c2jl0jz5kgcd96ylvimjnwr30mxr09n"; fetchSubmodules = true; }
+  { url = "https://github.com/MarekMatejak/Physiolibrary.git"; rev = "v2.3.1"; sha256 = "0nxfw63m278gaff18zz29n2s1vk4kwdbv2qvbjmcq86fl1i5b3bg"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica-3rdparty/Physiomodel.git"; rev = "v1.0.0"; sha256 = "1sdhv5qgjqv3zdq57pkkrh04ainwv9n5zqd8mb9a3ybjmwdjf6f9"; fetchSubmodules = true; }
+  { url = "https://github.com/dzimmer/PlanarMechanics.git"; rev = "55224a9e76de8aa7f708236bd4d7dee624ecba50"; sha256 = "0hf7vi44adss86x5ahk5if7bdjgw773d8mb3d8ianq12g8azycyd"; fetchSubmodules = true; }
+  { url = "https://github.com/PowerGrids/PowerGrids.git"; rev = "v1.0.0"; sha256 = "06bx8mqvmizhfwg99djdfgh2mblc4wzmg0zq4ilrp586jwfninmz"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica/PowerSystems.git"; rev = "v1.0.0"; sha256 = "1xwhwich7gi6vl33zl2r78xdjklchgkjcnvww6390j20l1wjznkn"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica/PowerSystems.git"; rev = "7369976265a9d7b62097340aba5e463c62cc5061"; sha256 = "1f0h148v2g057l6ixf646d8ymsx1jzqn14xlram8h62la2k6nmvw"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica-3rdparty/RealTimeCoordinationLibrary.git"; rev = "v1.0.2"; sha256 = "0ch4la04hm059ii5wzph9gsbvqhnfqrvvpqi57qn27bm10c4la0m"; fetchSubmodules = true; }
+  { url = "https://github.com/casella/ScalableTestSuite.git"; rev = "v1.11.5"; sha256 = "0bhj1q9b8d29nrbr253zszy1w1yvyizvyr3law1pqjj6mhbqmg4i"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica-3rdparty/Servomechanisms.git"; rev = "3bf82ba5d3f31b4a0ae05f99ae690037358e153e"; sha256 = "1swka7d58wkg5pqv59lqgfi7gv6rg5vra4j6r76pn9czx9ddal8w"; fetchSubmodules = true; }
+  { url = "https://github.com/SolarTherm/SolarTherm.git"; rev = "d80fc335d1fa5d1628c45c2e73204bcb8a614b21"; sha256 = "18d8cqlh0ic2yfcxzkz0ar9z19486z9x4sc7c9mpggxib28p39aa"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica-3rdparty/Soltermica.git"; rev = "9f7224bd89335f95dffe1ccdaa094df5a3279fdf"; sha256 = "1bif3cnwjas6x7b8ahwkm7dbrqrfdqwwa26zmdc6zrpfncl3kqd0"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica-3rdparty/SystemDynamics.git"; rev = "2f6bd9382c5aac2aff9148cd9113a418767734b6"; sha256 = "0ii2mj6ngwjir3gzyad8wsj86pvd6wzal91nz2y7gzwj1djchb3x"; fetchSubmodules = true; }
+  { url = "https://github.com/thom-marx/ThermalSeparation.git"; rev = "ffa0495ba829ecab105be4bfb3b7652625ec9c03"; sha256 = "1czm97bcrpp2jv0a0kd31a929wqlrlzdhdxvyy4w499dn20jzv1l"; fetchSubmodules = true; }
+  { url = "https://github.com/casella/ThermoPower.git"; rev = "82d21eba0d330005899dd50a6a0ceb7d09c4caeb"; sha256 = "0n83b40hjisy7lpnbz692947d2q3hw5hk4rak7fg0w5dbm4i719p"; fetchSubmodules = true; }
+  { url = "https://openmodelica.org/git/ThermoSysPro.git"; rev = "db81ae1b5a6a85f6c6c7693244cafa6087e18ff5"; sha256 = "12fsf0xxxc1ja6vmm9ff85f8j5sg1lb7w4g57s2w3fkf4d3a7d0c"; fetchSubmodules = true; }
+  { url = "https://openmodelica.org/git/ThermoSysPro.git"; rev = "5cef9acb4dedf8af6f4638a4448f08a544ebd30b"; sha256 = "0ihnz1s4rs42yis9zym9nw29ia2lqz2yx2wblc50p6f221w7q78s"; fetchSubmodules = true; }
+  { url = "https://github.com/lenaRB/VVDRlib.git"; rev = "eae4981674642eddffc7f2aa3690320fcaddee0e"; sha256 = "0qxxk2xlas5mqyc1h8ndic208qj1sm5mr5y8664kv3py7i8jdqi4"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica/VehicleInterfaces.git"; rev = "v1.2.5"; sha256 = "044k17cpc88wprrvw03p6crm6dy6x9a6xj5104d5nln71lqz5sdq"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica-3rdparty/WasteWater.git"; rev = "v2.1.0"; sha256 = "1dxr4m9j7b5266daj4klbrhvnkqr73sximdw9bk9v5qf0s28li99"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica-3rdparty/WindPowerPlants.git"; rev = "v1.2.0"; sha256 = "1lyrqwsb6sm1wc7vlj72zk5cpjhhzh27fviiqayddqy2b903xish"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica-3rdparty/ipsl.git"; rev = "v1.1.1"; sha256 = "1w2iah8c5d8n01wmxydjk0rrcxh88g8yjy2zmv403azcccq7byzp"; fetchSubmodules = true; }
+  { url = "https://github.com/modelica-3rdparty/netCDF-DataReader.git"; rev = "v2.5.0"; sha256 = "1pd5xf5bgz010lryv8bj6lvlfqn9p184csiffwj8icx7rycnlcqb"; fetchSubmodules = true; }
+  { url = "https://github.com/joewa/open-bldc-modelica.git"; rev = "58a83b5b36f267613de4676c95163489b1ddc2e7"; sha256 = "0wf6dn64d2psv9b3xg5227vzpk109r3dqzi4m2wwhrilaxs3v004"; fetchSubmodules = true; }
+]
diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/update-src-libs.sh b/nixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/update-src-libs.sh
new file mode 100755
index 000000000000..b8f2e95923b5
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/omlibrary/update-src-libs.sh
@@ -0,0 +1,39 @@
+#!/usr/bin/env nix-shell
+#! nix-shell -i bash -p bash
+
+CWD=$PWD
+
+chko() {
+  (
+    T=`mktemp -d`
+    trap "rm -rf $T" EXIT INT PIPE
+    cd $T
+    cat >check.nix <<EOF
+with import <nixpkgs> {};
+fetchgit `cat $CWD/../mkderivation/src-main.nix`
+EOF
+    nix-build check.nix
+    cat result/libraries/Makefile.libs
+  )
+}
+
+getsha256() {
+  URL=$(echo "$1" | sed 's/^"\(.*\)"$/\1/')
+  REV=$(echo "$2" | sed 's/^"\(.*\)"$/\1/')
+  SHA=$(nix run nixpkgs.nix-prefetch-git -c nix-prefetch-git --fetch-submodules "$URL" "$REV" 2>/dev/null | sed -n 's/.*"sha256": "\(.*\)",/\1/g p')
+  echo "{ url = $1; rev = $2; sha256 = \"$SHA\"; fetchSubmodules = true; }"
+}
+
+OUT=src-libs.nix
+
+echo '[' > $OUT
+
+chko |
+grep checkout-git.sh |
+tr \' \" |
+while read NM TGT URL BR REV ; do
+  echo Trying $TGT $URL $REV >&2
+  getsha256 $URL $REV >> $OUT || exit 1
+done
+
+echo ']' >> $OUT
diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/omparser/Makefile.in.patch b/nixpkgs/pkgs/applications/science/misc/openmodelica/omparser/Makefile.in.patch
new file mode 100644
index 000000000000..a8f04203a8c9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/omparser/Makefile.in.patch
@@ -0,0 +1,22 @@
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -23,7 +23,7 @@
+ omedit-testsuite: omedit-testsuite.skip
+ omedit-testsuite.skip: omedit.skip testsuite-depends
+ 	$(MAKE) -f $(defaultMakefileTarget) -C OMEdit/Testsuite
+-omparser: omparser.skip
++omparser: build-dirs omparser.skip
+ omparser.skip:
+ 	test -f $@ || $(MAKE) -C OMParser OMBUILDDIR=@OMBUILDDIR@ "host_short=@host_short@" CC="@CC@" CXX="@CXX@" CFLAGS="@CFLAGS@" CPPFLAGS="@CPPFLAGS@" CXXFLAGS="@CXXFLAGS@"
+ omsimulator: omsimulator.skip
+@@ -134,6 +134,10 @@
+ INSTALL_JAVADIR    = ${DESTDIR}${datadir}/omc/java
+ INSTALL_LOCALEDIR  = ${DESTDIR}${datadir}/locale
+ 
++build-dirs:
++	mkdir -p "@OMBUILDDIR@"/lib/@host_short@/omc
++	mkdir -p "@OMBUILDDIR@"/include/omc
++
+ install-dirs:
+ 	@test ! "${DESTDIR}/@prefix@" -ef "@OMBUILDDIR@" || (echo Error: Install and build dirs are the same && false)
+ 	if [ "@APP@" = ".app" ]; then mkdir -p ${INSTALL_APPDIR}; fi
diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/omparser/default.nix b/nixpkgs/pkgs/applications/science/misc/openmodelica/omparser/default.nix
new file mode 100644
index 000000000000..fcf5acd29ee9
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/omparser/default.nix
@@ -0,0 +1,28 @@
+{ lib
+, pkg-config
+, jre8
+, libuuid
+, openmodelica
+, mkOpenModelicaDerivation
+}:
+
+mkOpenModelicaDerivation rec {
+  pname = "omparser";
+  omdir = "OMParser";
+  omdeps = [ openmodelica.omcompiler ];
+
+  nativeBuildInputs = [ pkg-config ];
+
+  buildInputs = [ jre8 libuuid ];
+
+  patches = [ ./Makefile.in.patch ];
+
+  meta = with lib; {
+    description = "An antlr4-based parser of Modelica files from OpenModelica
+suite";
+    homepage = "https://openmodelica.org";
+    license = licenses.gpl3Only;
+    maintainers = with maintainers; [ smironov ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/omplot/default.nix b/nixpkgs/pkgs/applications/science/misc/openmodelica/omplot/default.nix
new file mode 100644
index 000000000000..7edc4b6efb22
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/omplot/default.nix
@@ -0,0 +1,34 @@
+{ lib
+, qtbase
+, qttools
+, qmake
+, wrapQtAppsHook
+, openmodelica
+, mkOpenModelicaDerivation
+}:
+
+mkOpenModelicaDerivation rec {
+  pname = "omplot";
+  omdir = "OMPlot";
+  omdeps = [ openmodelica.omcompiler ];
+  omautoconf = true;
+
+  nativeBuildInputs = [ qtbase qttools qmake wrapQtAppsHook ];
+
+  postPatch = ''
+    sed -i OMPlot/Makefile.in -e 's|bindir = @includedir@|includedir = @includedir@|'
+    sed -i OMPlot/OMPlot/OMPlotGUI/*.pro -e '/INCLUDEPATH +=/s|$| ../../qwt/src|'
+    sed -i ''$(find -name qmake.m4) -e '/^\s*LRELEASE=/ s|LRELEASE=.*$|LRELEASE=${lib.getDev qttools}/bin/lrelease|'
+  '';
+
+  dontUseQmakeConfigure = true;
+  QMAKESPEC = "linux-clang";
+
+  meta = with lib; {
+    description = "Plotting tool for OpenModelica-generated results files";
+    homepage = "https://openmodelica.org";
+    license = licenses.gpl3Only;
+    maintainers = with maintainers; [ smironov ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/omshell/default.nix b/nixpkgs/pkgs/applications/science/misc/openmodelica/omshell/default.nix
new file mode 100644
index 000000000000..2f8c5203c07a
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/omshell/default.nix
@@ -0,0 +1,40 @@
+{ lib, qttools, qmake, qtwebkit, wrapQtAppsHook, readline, openmodelica, mkOpenModelicaDerivation }:
+
+mkOpenModelicaDerivation rec {
+  pname = "omshell";
+  omdir = "OMShell";
+  omdeps = [ openmodelica.omcompiler ];
+  omautoconf = true;
+
+  nativeBuildInputs = [ qmake wrapQtAppsHook ];
+
+  buildInputs = [ readline qtwebkit ];
+
+  postPatch = with openmodelica; ''
+    sed -i ''$(find -name qmake.m4) -e '/^\s*LRELEASE=/ s|LRELEASE=.*$|LRELEASE=${lib.getDev qttools}/bin/lrelease|'
+    sed -i OMShell/OMShell/OMShellGUI/*.pro -e '
+      s|\$\$\[QT_INSTALL_BINS\]/lrelease|${lib.getDev qttools}/bin/lrelease|
+      /^\s*OMCLIBS =/ s|\$\$(OMBUILDDIR)|${omcompiler}|
+      /^\s*OMCINC =/ s|\$\$(OMBUILDDIR)|${omcompiler}|
+    '
+    sed -i OMShell/OMShell/OMShellGUI/OMShell.config.in -e '
+      s|@OMBUILDDIR@|${omcompiler}|
+      s|@OPENMODELICAHOME@|${omcompiler}|
+    '
+    sed -i OMShell/mosh/src/Makefile.in -e '
+      /^CFLAGS =/ s|-I../../../build|-I${omcompiler}|
+      /^LIBS =/ s|-L@OMBUILDDIR@|-L${omcompiler}|
+      '
+  '';
+
+  dontUseQmakeConfigure = true;
+  QMAKESPEC = "linux-clang";
+
+  meta = with lib; {
+    description = "Interactive OpenModelica session shell";
+    homepage = "https://openmodelica.org";
+    license = licenses.gpl3Only;
+    maintainers = with maintainers; [ smironov ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/omsimulator/default.nix b/nixpkgs/pkgs/applications/science/misc/openmodelica/omsimulator/default.nix
new file mode 100644
index 000000000000..448cdee6c263
--- /dev/null
+++ b/nixpkgs/pkgs/applications/science/misc/openmodelica/omsimulator/default.nix
@@ -0,0 +1,26 @@
+{ lib
+, pkg-config
+, boost
+, readline
+, libxml2
+, openmodelica
+, mkOpenModelicaDerivation
+}:
+
+mkOpenModelicaDerivation rec {
+  pname = "omsimulator";
+  omdir = "OMSimulator";
+  omdeps = [ openmodelica.omcompiler ];
+
+  nativeBuildInputs = [ pkg-config ];
+
+  buildInputs = [ readline libxml2 boost ];
+
+  meta = with lib; {
+    description = "The OpenModelica FMI & SSP-based co-simulation environment";
+    homepage = "https://openmodelica.org";
+    license = licenses.gpl3Only;
+    maintainers = with maintainers; [ smironov ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/src-libs-git.nix b/nixpkgs/pkgs/applications/science/misc/openmodelica/src-libs-git.nix
deleted file mode 100644
index aae5ab321fbe..000000000000
--- a/nixpkgs/pkgs/applications/science/misc/openmodelica/src-libs-git.nix
+++ /dev/null
@@ -1,71 +0,0 @@
-[
-{ url = "https://github.com/modelica-3rdparty/ADGenKinetics.git"; rev = "42428db6e84bcde28543a3bba9bccee581309bb1"; sha256="14l005jwj1wz35gq8xlbzfz0bpsx99rs4q3dxkfh76yhnv1jh9h3"; }
-{ url = "https://github.com/modelica-3rdparty/ADMSL.git"; rev = "ed0305603f86b46d9af03e7d37dcb8b6704915b4"; sha256="15b0nqxyh8444az56ydjn594jikdl1ina5wamabk3nzm1yx218cl"; }
-{ url = "https://github.com/iea-annex60/modelica-annex60.git"; rev = "8015a01591bb24d219f57e7b69cdfcde66e39b47"; sha256="05k4pa007a6p628fq1xac0cfv8g8dnpy2bgy8h99rqpmlaa072z7"; }
-{ url = "https://github.com/OpenModelica/BioChem.git"; rev = "b5f3cb999f3cfad2bbb6fb429b496f61ecf2f628"; sha256="1l52dg888vwx4668spn59hqvfkpl9g06g8n2cdxiap7lvsyh6w9x"; }
-{ url = "https://github.com/modelica-3rdparty/BondGraph.git"; rev = "20c23e60d12989bd4668ccac47659d82d39d29cc"; sha256="1i9cmiy1ya04h2ld0gy0x2gvdrfksl66fmcrgdm1vpsnbb6pviv9"; }
-{ url = "https://github.com/modelica-3rdparty/BondLib.git"; rev = "df7a40fe612617da22e27d39edfa4b27d65f23d0"; sha256="005djwxd568zyk3ndss9hv165dci9x0dgjmcdjhnqmsap3w83hlz"; }
-{ url = "https://github.com/modelica-3rdparty/BrineProp.git"; rev = "fed013cdeec0fb9552964376b575a8e3635539ab"; sha256="020hm2q65d5iv3h8b3lhgl6j930vi2pbh4lvxv3b3k7i9z02q43a"; }
-{ url = "https://github.com/lbl-srg/modelica-buildings.git"; rev = "ef89361cc8673b077b9221efbf78aa63b4d7babd"; sha256="04gclknhl2f5z7w9fsbhwawisd0ibmvwpplx0siqwzvjx7nsmdg4"; }
-{ url = "https://github.com/lbl-srg/modelica-buildings.git"; rev = "444aa231f423b8d04225bf8672e3212d089fbfe4"; sha256="0q754mlkwqj0jcqsmxksvcz4ak2i86f9s41fhffh5jvra27cvq01"; }
-{ url = "https://github.com/modelica-3rdparty/Chemical.git"; rev = "aa2642608e587ddb6897e8c3ffabb3aa099510bd"; sha256="0y46spcb6rw0jpj4v20nlw8xlvi5kypij46f1msvwgr7dfgy4gl4"; }
-{ url = "https://github.com/modelica-3rdparty/ComplexLib.git"; rev = "0b78942ee4fa95ae71347a0d552dd869fdf4c708"; sha256="18llf5ccrq3b0f4cjznfycskwf78pik8370xv45w9gb51gamszrn"; }
-{ url = "https://github.com/lochel/ConPNlib.git"; rev = "bbf6e9711665d55e5a8cf2f7235fa013c2315104"; sha256="0g3ll44sn2ff14qxwdyakw9h5b8b7vzabxp8cb8km16wcdqzgcxx"; }
-{ url = "https://github.com/modelica-3rdparty/DESLib.git"; rev = "7a473d8d16b118c3ea05761c6f43b17fd9838e4e"; sha256="19f2121n8rdc9svcjk8irivsd9wqcb9ai9jx72s2r85fkbvm8jc3"; }
-{ url = "https://github.com/modelica-3rdparty/ExtendedPetriNets.git"; rev = "2f4eac0651c1ab0ed56b75ec61424e0ef15181d3"; sha256="0wwj756pg33qwb90ycbfkrk5xsiwsbrqvq3i16i4pisi21vl6jk9"; }
-{ url = "https://github.com/modelica-3rdparty/ExternData.git"; rev = "396164fa708cc7c7e64da55ac0b3cba23939f790"; sha256="09052qmv91a9wawsl93b5b3q47awrxhnsbb9mrv39kpnwygfh7dq"; }
-{ url = "https://github.com/modelica/ExternalMedia.git"; rev = "1b77869b31dc3509defeccb1236db4b05d2f6f5b"; sha256="05sszn4bn8r78syydyjq8csn9xv4az56mm9lrarqykqdh78pvlqp"; }
-{ url = "https://github.com/kdavies4/FCSys.git"; rev = "cb4b17f34313b9d8f2d4223d5365684b4dc1ab65"; sha256="114p7ja6b3fwlkvkkjhbx78fxc7v4af2sbs783hkdga86m1v4ib6"; }
-{ url = "https://github.com/modelica-3rdparty/FastBuildings.git"; rev = "1f5cfebc2f42c13e272bff639ffa3449d5740bf7"; sha256="0sry1n2pliddz0pjv8dp899fx98f16n1arc8zvq36k5grvi52fby"; }
-{ url = "https://github.com/modelica-3rdparty/FaultTriggering.git"; rev = "10c226b7e5b2af901b356ac437c90d6616a6e9a4"; sha256="0a9j18qjwigq11nghl97syxa9bscs1aj6vwpkldh50csnj5h6g2s"; }
-{ url = "https://github.com/modelica-3rdparty/FuzzyControl.git"; rev = "19ff67ff129a440482cc85f216f287b05ea6ec0d"; sha256="0ijcqns7pijsavijn4wlrdsz64k5ks626sly7r28wvrk9af2m2cx"; }
-{ url = "https://github.com/modelica-3rdparty/HelmholtzMedia.git"; rev = "e54fcd0e436d65c85de6c6b935983e363cdc9f6c"; sha256="05afh0379fx4mjjn7jb8j5p4am6qi62hjxvasb38b6fcp9rnysn4"; }
-{ url = "https://github.com/modelica-3rdparty/IdealizedContact.git"; rev = "8ebac550d913f6d2b3af4d1aea5044e72c7eb6b0"; sha256="03gh2a7hf44clshwkiyz786w847hmyr3bicdqd9969fbirgcqn6m"; }
-{ url = "https://github.com/modelica-3rdparty/IndustrialControlSystems.git"; rev = "6a2414307d5998c6d081efe803c2b575a532b3ba"; sha256="09la9h07x8bkh7zhrwykgj1467qdryjvxhvnnm8qvsim0dl9inc4"; }
-{ url = "https://github.com/modelica-3rdparty/LinearMPC.git"; rev = "1e91a5dcaa662cd30c5b09a9d0267289703f933b"; sha256="12094fqmwi65h0mc65b96krbj6b8dgn6jiww3fnv6khglb21kwvd"; }
-{ url = "https://github.com/modelica/Modelica.git"; rev = "refs/tags/v1.6"; sha256="106w83ylgbxf63wr7p9z5q8vqz2qcsaw0zwaad7d3saq6rdbj30c"; }
-{ url = "https://github.com/modelica/Modelica.git"; rev = "d442bcd461b8db9873e33b6141bdbd37bcff9de8"; sha256="1icnd0fxix5khnsvdhy7kmzn6lnqkggbvfrbln98a2h5zqd6s32w"; }
-{ url = "https://github.com/modelica/Modelica.git"; rev = "af2a3e1597d648d6826665c89cf9eaf5c2a632bc"; sha256="0ryk0iwakdazhsjqvan41w6f9bvgl329zkqchcdg6nkidiigziwh"; }
-{ url = "https://github.com/modelica/Modelica.git"; rev = "48943d87db45a6c312b5a5789d384acde44a934b"; sha256="1hi2vkpmx734baa9m1lqzallcykhh3snd68r387gndiv96f6zx3n"; }
-{ url = "https://github.com/modelica/Modelica.git"; rev = "164af873cc5955c50f9592a7d2f3c155f703849c"; sha256="071svqwd72sy85sngbg5r22ab693c0gw2xx29gk1sqrk2nchmvia"; }
-{ url = "https://github.com/OpenModelica/modelica3d.git"; rev = "daf5669b03ad33fc6999671d1c0e7521134a282b"; sha256="1scs6v2cp2r4jz4diszwbqf9kvzf49pid50dmpsz0gfhx06j9y2v"; }
-{ url = "https://github.com/modelica-deprecated/ModelicaAdditions.git"; rev = "568db43766186826b880f9d4bfafeff25cc2c4ab"; sha256="1py5i3afxdvz1dmxxwb2mqj8kyzdhg4jnnqwl8h50akizg4i49pl"; }
-{ url = "https://github.com/xogeny/ModelicaBook.git"; rev = "0e670cfae4db653bd34ea777d6b56423e9be2c9f"; sha256="0lxh08w6nii4p5yk7c0xmfi5y4xkjkzz4hirr3kqdhdfybcwq824"; }
-{ url = "https://github.com/modelica-compliance/compliance.git"; rev = "ca5092c14bb7af4507a10700ee49181a3a3ee199"; sha256="12ja6dhwlbq412kxjdviypgchipxpsg8l0sf6r17g6lbsi19i2b6"; }
-{ url = "https://github.com/modelica-3rdparty/ModelicaDEVS.git"; rev = "a987aa9552fbbe71b2ee2e8c28958f9d213087ae"; sha256="0qcw7vw28xadim0h8kr2km09d8vdj05ibdpzcnpny9n43pm9s5hx"; }
-{ url = "https://github.com/modelica/Modelica_DeviceDrivers.git"; rev = "db912ba7e1317b8f6a776ccf9a19f69c77a9c477"; sha256="052h2lr7xgfag5fks19wbldqmb985kxlc5fzysl7c9w3fnijp0ml"; }
-{ url = "https://github.com/modelica/Modelica_EnergyStorages.git"; rev = "9f057365232364e31a31a8e525f96284b98c7de3"; sha256="195m5b3z8qgg9kih9zsdx1h8zgrm37q63890r59akka05a97j48h"; }
-{ url = "https://github.com/modelica/Modelica_LinearSystems2.git"; rev = "18916fdc485285baab12481701b53d4eb606a3f1"; sha256="0fhvdwcgk8q3z1a98l2bxv8a6dysrs4ll6xfyzpni7yq8gp4mg4q"; }
-{ url = "https://github.com/modelica/Modelica_Synchronous.git"; rev = "d0f5ee57bc7b639738e88026674a87343b33dbe1"; sha256="0l75v4d0fgf07ify0h3skh4y9pfw9gxh9hbj1lbsdgglmzlrcvbg"; }
-{ url = "https://github.com/modelica-3rdparty/MotorcycleDynamics.git"; rev = "2be2667f9936d88ffb9b8a8246c5af9ccb0b307f"; sha256="0jazwmpqpyhhgs9qdn9drmplgp2yjs0ky7wll5x9929dkgy80m6x"; }
-{ url = "https://github.com/modelica-3rdparty/NCLib.git"; rev = "ed3d72f176ac6b7031ce73be9d80101141e74a69"; sha256="1pbpv8w1lsa9vdwp7qbih8iim91ms22b01wz376b548d0x2r95la"; }
-{ url = "https://github.com/modelica-3rdparty/NeuralNetwork.git"; rev = "c44e4d1fe97fd4f86dafcd05ad3713692e3f1806"; sha256="0s1v8k71zq1s9gjlvi3zr23nwfknp4x17cxm64a0y3vsi3kahj2s"; }
-{ url = "https://github.com/DLR-SR/Noise.git"; rev = "9b57476845539e56769cf76ea0fe7bf3c7eb5d11"; sha256="0icrb63f6dm4gww2nyby9i7s7qxvhvialp36xzcgmi7nlq7crjr2"; }
-{ url = "https://github.com/modelica-3rdparty/ObjectStab.git"; rev = "2a723e0b223af50f4ffdd62f8ac901e0f87b9323"; sha256="1b6zi27slzzfbkmbcqxygsn5i5w0zkq0hfrfb72vf7mbgz07j19j"; }
-{ url = "https://github.com/cparedis/OpenHydraulics.git"; rev = "d3173d1f06f7d14c9d7c41769f143617ff03a3ad"; sha256="1hn5rcnmzcbiaqdnxfn02wddmrpj9bcdi9p680f31hbh3vb0i3r6"; }
-{ url = "https://github.com/lochel/PNlib.git"; rev = "44c7d277980b7a88b449b72edec0a56416b40fa9"; sha256="026wdhbxnzarmj8gw0as70vj8f1gwc51z38hjqpswxkl0xd6mfvp"; }
-{ url = "https://github.com/MarekMatejak/Physiolibrary.git"; rev = "49d59060f6e5b4cb68560c6d7467e84ea4318056"; sha256="0klqs2axjm3s780sq4plq4wmbf9mszz2jmq9fprgxy9pw7iszbhc"; }
-{ url = "https://github.com/dzimmer/PlanarMechanics.git"; rev = "d998a1b27355e83d2ff4849d71281a919a3234aa"; sha256="0vyq6mninn38wy2d60rk753xbkfqim2y6y31py7kq2mm170jfqf4"; }
-{ url = "https://github.com/modelica/PowerSystems.git"; rev = "7b551888089277a0dd979db636d47aba0279e8f0"; sha256="0y13f1nllc7riksnly25wmmp6mc30c1b48dbq2lr1nag6yg3blwm"; }
-{ url = "https://github.com/modelica/PowerSystems.git"; rev = "3abd48aa53bbcd3f3e2ddfa2371680febf8baf48"; sha256="1nr2nbpaxywk8cpwnk9rr2zr87mm2gb9b4plqipjdlrrkjlk9fka"; }
-{ url = "https://github.com/modelica-3rdparty/PraxisSimulationstechnik.git"; rev = "f7db177786f84033f3a50b7474988b190a1dfb46"; sha256="08bdm7k7w35kg9gkrvcn382zkwf5h3iwkkx60d5fj64j5d5klray"; }
-{ url = "https://github.com/modelica-3rdparty/QCalc.git"; rev = "af6c34dda691a9bdf7ca1de10650974b2d5cecf5"; sha256="0p0zhl27cnr492byrzib0dyn7zp5yb7wcr0spv10ngm6j90cij6y"; }
-{ url = "https://github.com/modelica-3rdparty/QSSFluidFlow.git"; rev = "d84a2c107132f2cd47ea3c3751238d69e4b1f64b"; sha256="02cdvv33pi0qlmg8n401s4cxf59l9b4ff4ixf7gwn4w4n1y9bw0g"; }
-{ url = "https://github.com/modelica-3rdparty/RealTimeCoordinationLibrary.git"; rev = "655ac1a22aa6deb04ea8e3869dd0aa9fb9540754"; sha256="19crf8pl9vpqq3pq1rhcbl49kkmnm4jrzpwrpqp8qc6dj8096za4"; }
-{ url = "https://github.com/modelica-3rdparty/ScalableTestSuite.git"; rev = "c6319908d45ac97ffb10e96cd42654bce36ffb97"; sha256="1g79d88bfmzcqvaghyyj86ajs38v0qnmjxbj8d53yp6nmgnaasx5"; }
-{ url = "https://github.com/modelica-3rdparty/Servomechanisms.git"; rev = "22e1874ef9ad46156617817c67a4fb1238621bf5"; sha256="0nwb7apayk7ba9iv27yv67wi4b934dy57kkvn0acxy393jhd8jqd"; }
-{ url = "https://openmodelica.org/git/SiemensPower.git"; rev = "73a3bfc6d2ddd72165bb0f3e7e9df48b643a5ed0"; sha256="0mvrkpkmr0bx2cvsb23syg7cs8k6a15vjf4n1hivdcigq4x8g2nc"; }
-{ url = "https://openmodelica.org/git/SiemensPower.git"; rev = "5ef2e38b64ff481801c0db19d52f0bef21f85f77"; sha256="1llnpl2x1g28gari1rk34hdnnwf7a4fwwxlf7i18d8bl1vsrfaja"; }
-{ url = "https://openmodelica.org/git/SiemensPower.git"; rev = "2bd9e367baaa8d44946897c3c3a32a4050ad2a2a"; sha256="1shm9blpn9m87ci6wwkinpmihr1fik9j0a0pj2nxy0cjrr2jzbn4"; }
-{ url = "https://github.com/modelica-3rdparty/Spot.git"; rev = "2f74417f1681570900a1ed373dcbe4b42634ec7b"; sha256="0k5h2k6x98zvvsafpw7y16xs9d6lxz0csa0mlm4wwggaywadn255"; }
-{ url = "https://github.com/modelica-3rdparty/SystemDynamics.git"; rev = "c58a26dc3e62a50e64fd336dc4aa499b2d5ad314"; sha256="0ra3a2vgqmry92kmm060gfa41mrpkgbs4swzl78ih3icawfzjz8q"; }
-{ url = "https://github.com/modelica-3rdparty/ThermoPower.git"; rev = "e012268625dd1645fe5570cf31d64129d83a8192"; sha256="1rlkli48kc9hnkplgb0bjkb6ajn7agiw4yh9l5sfvlv7k7k2gc8l"; }
-{ url = "https://openmodelica.org/git/ThermoSysPro.git"; rev = "d4f9c3ed35f7520f82439eb6e9f4057ae0f82b73"; sha256="0hxbn26g479qkr6rrglx9ljdxnpzd5ll1sf2v08skghrdjjb8jcx"; }
-{ url = "https://openmodelica.org/git/ThermoSysPro.git"; rev = "51e7ea2d2e121ee640e7897335c294923f8eaeb0"; sha256="0l11mzjkaxndsqrnnr0z7qvk08svv229119qkm81yb53ich9wnyw"; }
-{ url = "https://github.com/modelica/VehicleInterfaces.git"; rev = "ad956a35643d53e207ee126d67ea1f3f38337a39"; sha256="0g90cqwjpi06gn7vca5kqnz56im76s2hrdqjhsj2bl43rza8mhr0"; }
-{ url = "https://github.com/modelica-3rdparty/WasteWater.git"; rev = "90ff44ac791ba5ed98444c8597efbd2a2af01cad"; sha256="1icrn0y389rhxmf6i0mnsfgw9v9j5innpkz3q069rfm2ji268b12"; }
-{ url = "https://github.com/xogeny/XogenyTest.git"; rev = "9b98981e8ff0f440dd319d1a806e1fd2f0ab3436"; sha256="18glaxrlxfml26w7ljlf0yj3ah1fnhpbg01py28nplsgnrfwfwqj"; }
-{ url = "https://github.com/modelica-3rdparty/msgpack-modelica.git"; rev = "6ce2ca600c4902038c0f20b43ed442f1ee204310"; sha256="01x5a9y11yf62sc0j2y49yxwm24imj2lfl3z5mwvi9038gwn0lkx"; }
-{ url = "https://github.com/modelica-3rdparty/netCDF-DataReader.git"; rev = "3d2cc8272abfbc4b667d8868f851bf3e11c6f00e"; sha256="194810a4rn0flxgirrlnxsbxarnm97309dkp1w7nva9zv1q3wj7h"; }
-{ url = "https://github.com/joewa/open-bldc-modelica.git"; rev = "7817cd703b88fc1f433269d32c31e75eb50a21c6"; sha256="1plkxkx51f9yi99ysarmx2ymldizvyr0m66k996y5lj5h81jv8a8"; }
-]
diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/src-libs-svn.nix b/nixpkgs/pkgs/applications/science/misc/openmodelica/src-libs-svn.nix
deleted file mode 100644
index 244da64fb4e6..000000000000
--- a/nixpkgs/pkgs/applications/science/misc/openmodelica/src-libs-svn.nix
+++ /dev/null
@@ -1,5 +0,0 @@
-[
-{ url = "https://svn.modelica.org/projects/Modelica_ElectricalSystems/InstantaneousSymmetricalComponents"; rev = "7978"; sha256="0f100c7bz4ai3ryhpkbbszw8z6mykvg40p03ic92n2qq58wjk37z"; }
-{ url = "https://svn.modelica.org/projects/Modelica_EmbeddedSystems/trunk/Modelica_StateGraph2"; rev = "8121"; sha256="1cys57nc1yzkr5admc139qs5pa48rj3g69pb3j3s9xcmpd483hzp"; }
-{ url = "https://svn.modelica.org/projects/Modelica_ElectricalSystems/Modelica_PowerFlow/trunk"; rev = "3174"; sha256="0yviw1b8psn8vfyl4q1naylak3lcqi2q1bqplqg3gg9iw4aiymxl"; }
-]
diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/src-main.nix b/nixpkgs/pkgs/applications/science/misc/openmodelica/src-main.nix
deleted file mode 100644
index 99e82259bfe6..000000000000
--- a/nixpkgs/pkgs/applications/science/misc/openmodelica/src-main.nix
+++ /dev/null
@@ -1,6 +0,0 @@
-{
-  url = "https://openmodelica.org/git-readonly/OpenModelica.git";
-  fetchSubmodules = true;
-  rev = "8c5d48eb31a638d5220621b20377bfe6f9e9535e";
-  sha256 = "0i5cznkh4wwayjqms14f3phizqm493nrr1yjgs9747nfw7vnwsff";
-}
diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/update-src-libs-git.sh b/nixpkgs/pkgs/applications/science/misc/openmodelica/update-src-libs-git.sh
deleted file mode 100755
index 481a89796415..000000000000
--- a/nixpkgs/pkgs/applications/science/misc/openmodelica/update-src-libs-git.sh
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/bin/sh
-
-CWD=`pwd`
-
-chko() { (
-T=`mktemp -d`
-trap "rm -rf $T" EXIT INT PIPE
-cd $T
-cat >check.nix <<EOF
-with import <nixpkgs> {};
-fetchgit `cat $CWD/src-main.nix`
-EOF
-nix-build check.nix
-cat result/libraries/Makefile.libs
-) }
-
-getsha256() { (
-T=`mktemp -d`
-trap "rm -rf $T" EXIT INT PIPE
-cd $T
-
-L=`echo $2 | wc -c`
-if expr $L '<' 10 >/dev/null; then
-T=`echo $2 | sed 's@"\(.*\)"@"refs/tags/\1"@'`
-cat >check.nix <<EOF
-with import <nixpkgs> {};
-fetchgit {
-  url = $1;
-  rev = $T;
-  sha256 = "0000000000000000000000000000000000000000000000000000";
-}
-EOF
-SHA=`nix-build check.nix 2>&1 | sed -n 's/.*instead has ‘\(.*\)’.*/\1/g p'`
-echo "{ url = $1; rev = $T; sha256=\"$SHA\"; }"
-else
-cat >check.nix <<EOF
-with import <nixpkgs> {};
-fetchgit {
-  url = $1;
-  rev = $2;
-  sha256 = "0000000000000000000000000000000000000000000000000000";
-}
-EOF
-SHA=`nix-build check.nix 2>&1 | sed -n 's/.*instead has ‘\(.*\)’.*/\1/g p'`
-echo "{ url = $1; rev = $2; sha256=\"$SHA\"; }"
-fi
-
-# nix-build check.nix
-) }
-
-OUT=src-libs-git.nix
-
-echo '[' > $OUT
-
-chko |
-grep checkout-git.sh |
-tr \' \" |
-while read NM TGT URL BR REV ; do
-  echo Trying $TGT $URL $REV >&2
-  getsha256 $URL $REV >> $OUT || exit 1
-done
-
-echo ']' >> $OUT
-
diff --git a/nixpkgs/pkgs/applications/science/misc/openmodelica/update-src-libs-svn.sh b/nixpkgs/pkgs/applications/science/misc/openmodelica/update-src-libs-svn.sh
deleted file mode 100755
index 972bc7d61f13..000000000000
--- a/nixpkgs/pkgs/applications/science/misc/openmodelica/update-src-libs-svn.sh
+++ /dev/null
@@ -1,50 +0,0 @@
-#!/bin/sh
-
-CWD=`pwd`
-
-chko() { (
-T=`mktemp -d`
-trap "rm -rf $T" EXIT INT PIPE
-cd $T
-cat >check.nix <<EOF
-with import <nixpkgs> {};
-fetchgit `cat $CWD/src-main.nix`
-EOF
-nix-build check.nix
-cat result/libraries/Makefile.libs
-) }
-
-getsha256() { (
-T=`mktemp -d`
-trap "rm -rf $T" EXIT INT PIPE
-cd $T
-
-L=`echo $2 | wc -c`
-cat >check.nix <<EOF
-with import <nixpkgs> {};
-fetchsvn {
-  url = $1;
-  rev = $2;
-  sha256 = "0000000000000000000000000000000000000000000000000000";
-}
-EOF
-SHA=`nix-build check.nix 2>&1 | sed -n 's/.*instead has ‘\(.*\)’.*/\1/g p'`
-echo "{ url = $1; rev = $2; sha256=\"$SHA\"; }"
-
-# nix-build check.nix
-) }
-
-OUT=src-libs-svn.nix
-
-echo '[' > $OUT
-
-chko |
-grep checkout-svn.sh |
-tr \' \" |
-while read NM TGT URL REV ; do
-  echo Trying $TGT $URL $REV >&2
-  getsha256 $URL $REV >> $OUT || exit 1
-done
-
-echo ']' >> $OUT
-
diff --git a/nixpkgs/pkgs/applications/science/misc/snakemake/default.nix b/nixpkgs/pkgs/applications/science/misc/snakemake/default.nix
index 419323cfa31f..4ff751ff8d18 100644
--- a/nixpkgs/pkgs/applications/science/misc/snakemake/default.nix
+++ b/nixpkgs/pkgs/applications/science/misc/snakemake/default.nix
@@ -2,7 +2,7 @@
 
 python3Packages.buildPythonApplication rec {
   pname = "snakemake";
-  version = "6.6.1";
+  version = "6.7.0";
 
   propagatedBuildInputs = with python3Packages; [
     appdirs
@@ -31,7 +31,7 @@ python3Packages.buildPythonApplication rec {
 
   src = python3Packages.fetchPypi {
     inherit pname version;
-    sha256 = "91637a801342f3bc349c033b284fef7c0201b4e5e29d5650cb6c7f69096d4184";
+    sha256 = "6f53d54044c5d1718c7858f45286beeffb220c794fe5f602a5c20bf0caf8ec07";
   };
 
   doCheck = false; # Tests depend on Google Cloud credentials at ${HOME}/gcloud-service-key.json
diff --git a/nixpkgs/pkgs/applications/science/physics/quantomatic/default.nix b/nixpkgs/pkgs/applications/science/physics/quantomatic/default.nix
index c1400869a258..8c33a8ae6b1a 100644
--- a/nixpkgs/pkgs/applications/science/physics/quantomatic/default.nix
+++ b/nixpkgs/pkgs/applications/science/physics/quantomatic/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ makeWrapper ];
   buildInputs = [ jre ];
 
-  phases = [ "installPhase" ];
+  dontUnpack = true;
 
   installPhase = ''
     mkdir -p $out/libexec/quantomatic
diff --git a/nixpkgs/pkgs/applications/science/physics/sherpa/default.nix b/nixpkgs/pkgs/applications/science/physics/sherpa/default.nix
index ba519cc2d032..eb718be12e4a 100644
--- a/nixpkgs/pkgs/applications/science/physics/sherpa/default.nix
+++ b/nixpkgs/pkgs/applications/science/physics/sherpa/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "1iwa17s8ipj6a2b8zss5csb1k5y9s5js38syvq932rxcinbyjsl4";
   };
 
-  postPatch = lib.optional (stdenv.hostPlatform.libc == "glibc") ''
+  postPatch = lib.optionalString (stdenv.hostPlatform.libc == "glibc") ''
     sed -ie '/sys\/sysctl.h/d' ATOOLS/Org/Run_Parameter.C
   '';
 
diff --git a/nixpkgs/pkgs/applications/science/physics/xflr5/default.nix b/nixpkgs/pkgs/applications/science/physics/xflr5/default.nix
index 5ae56528f964..85e20f38b668 100644
--- a/nixpkgs/pkgs/applications/science/physics/xflr5/default.nix
+++ b/nixpkgs/pkgs/applications/science/physics/xflr5/default.nix
@@ -9,8 +9,6 @@ mkDerivation rec {
     sha256 = "02x3r9iv3ndwxa65mxn9m5dlhcrnjiq7cffi6rmb456gs3v3dnav";
   };
 
-  enableParallelBuilding = true;
-
   nativeBuildInputs = [ qmake ];
 
   meta = with lib; {
diff --git a/nixpkgs/pkgs/applications/science/programming/plm/default.nix b/nixpkgs/pkgs/applications/science/programming/plm/default.nix
index e56282b68631..ca8e87a05533 100644
--- a/nixpkgs/pkgs/applications/science/programming/plm/default.nix
+++ b/nixpkgs/pkgs/applications/science/programming/plm/default.nix
@@ -1,37 +1,39 @@
-{lib, stdenv, fetchurl, makeWrapper, jre, gcc, valgrind}:
+{ lib, stdenv, fetchurl, makeWrapper, jre, gcc, valgrind }:
 # gcc and valgrind are not strict dependencies, they could be made
 # optional. They are here because plm can only help you learn C if you
 # have them installed.
 stdenv.mkDerivation rec {
-  major = "2";
-  minor = "5";
-  version = "${major}-${minor}";
   pname = "plm";
+  version = "2.9.3";
 
   src = fetchurl {
-    url = "http://webloria.loria.fr/~quinson/Teaching/PLM/plm-${major}_${minor}.jar";
-    sha256 = "0m17cxa3nxi2cbswqvlfzp0mlfi3wrkw8ry2xhkxy6aqzm2mlgcc";
+    url = "https://github.com/BuggleInc/PLM/releases/download/v${version}/plm-${version}.jar";
+    sha256 = "0i9ghx9pm3kpn9x9n1hl10zdr36v5mv3drx8lvhsqwhlsvz42p5i";
     name = "${pname}-${version}.jar";
   };
 
   nativeBuildInputs = [ makeWrapper ];
   buildInputs = [ jre gcc valgrind ];
 
-  phases = [ "installPhase" ];
+  dontUnpack = true;
 
   installPhase = ''
+    runHook preInstall
+
     mkdir -p "$prefix/bin"
 
     makeWrapper ${jre}/bin/java $out/bin/plm \
       --add-flags "-jar $src" \
       --prefix PATH : "$PATH"
+
+    runHook postInstall
   '';
 
   meta = with lib; {
     description = "Free cross-platform programming exerciser";
+    homepage = "http://people.irisa.fr/Martin.Quinson/Teaching/PLM/";
     license = licenses.gpl3;
     maintainers = [ ];
     platforms = lib.platforms.all;
-    broken = true;
   };
 }
diff --git a/nixpkgs/pkgs/applications/science/robotics/apmplanner2/default.nix b/nixpkgs/pkgs/applications/science/robotics/apmplanner2/default.nix
index 0f5e7e6daa85..b65c23521395 100644
--- a/nixpkgs/pkgs/applications/science/robotics/apmplanner2/default.nix
+++ b/nixpkgs/pkgs/applications/science/robotics/apmplanner2/default.nix
@@ -30,8 +30,6 @@ mkDerivation rec {
       --replace /usr $out
   '';
 
-  enableParallelBuilding = true;
-
   meta = {
     description = "Ground station software for autonomous vehicles";
     longDescription = ''
diff --git a/nixpkgs/pkgs/applications/science/robotics/mavproxy/default.nix b/nixpkgs/pkgs/applications/science/robotics/mavproxy/default.nix
index ba0c2530849a..4f83f957dbf7 100644
--- a/nixpkgs/pkgs/applications/science/robotics/mavproxy/default.nix
+++ b/nixpkgs/pkgs/applications/science/robotics/mavproxy/default.nix
@@ -3,11 +3,11 @@
 
 buildPythonApplication rec {
   pname = "MAVProxy";
-  version = "1.8.39";
+  version = "1.8.40";
 
   src = fetchPypi {
     inherit pname version;
-    sha256 = "sha256-1RXuAiz9i5ZnLtDGQ+o3DNgWJ2FDJGIoelmlDmEzrts=";
+    sha256 = "cad317e2e879f1f7cb59af078788aaf0d09cd761ecd91ad091adf7ac6cc1bcdb";
   };
 
   postPatch = ''
diff --git a/nixpkgs/pkgs/applications/science/robotics/qgroundcontrol/default.nix b/nixpkgs/pkgs/applications/science/robotics/qgroundcontrol/default.nix
index 1b9304d49e71..2759723841cc 100644
--- a/nixpkgs/pkgs/applications/science/robotics/qgroundcontrol/default.nix
+++ b/nixpkgs/pkgs/applications/science/robotics/qgroundcontrol/default.nix
@@ -17,7 +17,6 @@ mkDerivation rec {
     gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad wayland
   ];
 
-  enableParallelBuilding = true;
   buildInputs = [ SDL2 ] ++ gstInputs ++ qtInputs;
   nativeBuildInputs = [ pkg-config qmake qttools ];