summary refs log tree commit diff
path: root/pkgs/applications/science
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications/science')
-rw-r--r--pkgs/applications/science/biology/bayescan/default.nix39
-rw-r--r--pkgs/applications/science/biology/blast/default.nix108
-rw-r--r--pkgs/applications/science/biology/blast/no_slash_bin.patch184
-rw-r--r--pkgs/applications/science/biology/last/default.nix4
-rw-r--r--pkgs/applications/science/biology/xenomapper/default.nix2
-rw-r--r--pkgs/applications/science/chemistry/openmolcas/default.nix16
-rw-r--r--pkgs/applications/science/electronics/kicad/default.nix50
-rwxr-xr-xpkgs/applications/science/electronics/kicad/update.sh191
-rw-r--r--pkgs/applications/science/electronics/kicad/versions.nix52
-rw-r--r--pkgs/applications/science/electronics/ngspice/default.nix4
-rw-r--r--pkgs/applications/science/electronics/pcb/default.nix4
-rw-r--r--pkgs/applications/science/math/geogebra/default.nix4
-rw-r--r--pkgs/applications/science/math/gmsh/default.nix4
-rw-r--r--pkgs/applications/science/molecular-dynamics/gromacs/default.nix6
14 files changed, 609 insertions, 59 deletions
diff --git a/pkgs/applications/science/biology/bayescan/default.nix b/pkgs/applications/science/biology/bayescan/default.nix
new file mode 100644
index 00000000000..4e216fbdbe6
--- /dev/null
+++ b/pkgs/applications/science/biology/bayescan/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchurl, unzip, llvmPackages }:
+
+stdenv.mkDerivation rec {
+  pname = "bayescan";
+  version = "2.1";
+
+  src = fetchurl {
+    url = "http://cmpg.unibe.ch/software/BayeScan/files/BayeScan${version}.zip";
+    sha256 = "0ismima8j8z0zj9yc267rpf7z90w57b2pbqzjnayhc3ab8mcbfy6";
+  };
+
+  nativeBuildInputs = [ unzip ];
+  buildInputs = stdenv.lib.optional stdenv.cc.isClang llvmPackages.openmp;
+
+  # Disable FORTIFY_SOURCE or the binary fails with "buffer overflow"
+  hardeningDisable = [ "fortify" ];
+
+  sourceRoot = "BayeScan${version}/source";
+
+  postPatch = ''
+    substituteInPlace Makefile --replace "-static" "" \
+                               --replace "g++" "c++"
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    mkdir -p $out/share/doc/bayescan
+    cp bayescan_${version} $out/bin
+    cp -r ../*pdf ../input_examples ../"R functions" $out/share/doc/bayescan
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Detecting natural selection from population-based genetic data";
+    homepage = "http://cmpg.unibe.ch/software/BayeScan";
+    license = licenses.gpl3;
+    maintainers = [ maintainers.bzizou ];
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/applications/science/biology/blast/default.nix b/pkgs/applications/science/biology/blast/default.nix
new file mode 100644
index 00000000000..ad737c6699d
--- /dev/null
+++ b/pkgs/applications/science/biology/blast/default.nix
@@ -0,0 +1,108 @@
+{ lib, stdenv, fetchurl, zlib, bzip2, perl, cpio, gawk, coreutils, ApplicationServices }:
+
+stdenv.mkDerivation rec {
+  pname = "blast";
+  version = "2.10.0";
+
+  src = fetchurl {
+    url = "ftp://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/${version}/ncbi-blast-${version}+-src.tar.gz";
+    sha256 = "09nry5knj5hhxpn0a5ww1gb1704grd4r1y7adbjl6kqwq37dkk9s";
+  };
+
+  sourceRoot = "ncbi-blast-${version}+-src/c++";
+  
+  configureFlags = [ 
+    # With flat Makefile we can use all_projects in order not to build extra.
+    # These extra cause clang to hang on Darwin.
+    "--with-flat-makefile"
+    "--without-makefile-auto-update" 
+    "--with-dll"  # build dynamic libraries (static are default)
+    ];
+  
+  makeFlags = [ "all_projects=app/" ];
+
+  preConfigure = ''
+    export NCBICXX_RECONF_POLICY=warn
+    export PWD=$(pwd)
+    export HOME=$PWD
+
+    # The configure scripts wants to set AR="ar cr" unless it is already set in
+    # the environment. Because stdenv sets AR="ar", the result is a bad call to
+    # the assembler later in the process. Thus, we need to unset AR
+    unset AR
+
+    for awks in scripts/common/impl/is_log_interesting.awk \
+        scripts/common/impl/report_duplicates.awk; do
+
+        substituteInPlace $awks \
+              --replace /usr/bin/awk ${gawk}/bin/awk
+    done
+
+    for mk in src/build-system/Makefile.meta.in \
+        src/build-system/helpers/run_with_lock.c ; do
+
+        substituteInPlace $mk \
+        --replace /bin/rm ${coreutils}/bin/rm
+    done
+
+    for mk in src/build-system/Makefile.meta.gmake=no \
+        src/build-system/Makefile.meta_l \
+        src/build-system/Makefile.meta_r \
+        src/build-system/Makefile.requirements \
+        src/build-system/Makefile.rules_with_autodep.in; do
+
+        substituteInPlace $mk \
+            --replace /bin/echo ${coreutils}/bin/echo
+    done
+    for mk in src/build-system/Makefile.meta_p \
+        src/build-system/Makefile.rules_with_autodep.in \
+        src/build-system/Makefile.protobuf.in ; do
+
+        substituteInPlace $mk \
+            --replace /bin/mv ${coreutils}/bin/mv
+    done
+
+
+    substituteInPlace src/build-system/configure \
+        --replace /bin/pwd ${coreutils}/bin/pwd \
+        --replace /bin/ln ${coreutils}/bin/ln
+
+    substituteInPlace src/build-system/configure.ac \
+        --replace /bin/pwd ${coreutils}/bin/pwd \
+        --replace /bin/ln ${coreutils}/bin/ln
+
+    substituteInPlace src/build-system/Makefile.meta_l \
+        --replace /bin/date ${coreutils}/bin/date
+  '';
+
+  nativeBuildInputs = [ perl ];
+
+  # perl is necessary in buildInputs so that installed perl scripts get patched
+  # correctly
+  buildInputs = [ coreutils perl gawk zlib bzip2 cpio ]
+    ++ lib.optionals stdenv.isDarwin [ ApplicationServices ];
+  hardeningDisable = [ "format" ];
+
+  postInstall = ''
+    substituteInPlace $out/bin/get_species_taxids.sh \
+        --replace /bin/rm ${coreutils}/bin/rm
+  '';
+  patches = [ ./no_slash_bin.patch ];
+
+  enableParallelBuilding = true;
+
+  # Many tests require either network access or locally available databases
+  doCheck = false;
+
+  meta = with stdenv.lib; {
+    description = ''Basic Local Alignment Search Tool (BLAST) finds regions of
+    similarity between biological sequences'';
+    homepage = https://blast.ncbi.nlm.nih.gov/Blast.cgi;
+    license = licenses.publicDomain;
+
+    # Version 2.10.0 fails on Darwin
+    # See https://github.com/NixOS/nixpkgs/pull/61430
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ luispedro ];
+  };
+}
diff --git a/pkgs/applications/science/biology/blast/no_slash_bin.patch b/pkgs/applications/science/biology/blast/no_slash_bin.patch
new file mode 100644
index 00000000000..9b78ac57926
--- /dev/null
+++ b/pkgs/applications/science/biology/blast/no_slash_bin.patch
@@ -0,0 +1,184 @@
+diff -u --recursive ncbi-blast-2.9.0+-src/scripts/common/impl/collect_outside_libs.sh ncbi-blast-2.9.0+-src.patched/scripts/common/impl/collect_outside_libs.sh
+--- ncbi-blast-2.9.0+-src/scripts/common/impl/collect_outside_libs.sh	2014-08-01 22:01:17.000000000 +0800
++++ ncbi-blast-2.9.0+-src.patched/scripts/common/impl/collect_outside_libs.sh	2019-05-15 12:40:44.145239480 +0800
+@@ -1,8 +1,5 @@
+ #!/bin/sh
+ set -e
+-PATH=/bin:/usr/bin
+-export PATH
+-unset CDPATH
+ 
+ base=$1
+ search=`echo ${2-$LD_LIBRARY_PATH} | tr : ' '`
+diff -u --recursive ncbi-blast-2.9.0+-src/scripts/common/impl/create_flat_tuneups.sh ncbi-blast-2.9.0+-src.patched/scripts/common/impl/create_flat_tuneups.sh
+--- ncbi-blast-2.9.0+-src/scripts/common/impl/create_flat_tuneups.sh	2011-08-17 02:55:10.000000000 +0800
++++ ncbi-blast-2.9.0+-src.patched/scripts/common/impl/create_flat_tuneups.sh	2019-05-15 12:40:48.449276574 +0800
+@@ -1,9 +1,6 @@
+ #!/bin/sh
+ id='$Id: create_flat_tuneups.sh 331412 2011-08-16 18:55:10Z ucko $'
+ 
+-PATH=/bin:/usr/bin
+-export PATH
+-
+ exec > auto_flat_tuneups.mk
+ 
+ cat <<EOF
+diff -u --recursive ncbi-blast-2.9.0+-src/scripts/common/impl/get_lock.sh ncbi-blast-2.9.0+-src.patched/scripts/common/impl/get_lock.sh
+--- ncbi-blast-2.9.0+-src/scripts/common/impl/get_lock.sh	2011-08-20 04:12:28.000000000 +0800
++++ ncbi-blast-2.9.0+-src.patched/scripts/common/impl/get_lock.sh	2019-05-15 12:40:52.901315000 +0800
+@@ -1,7 +1,5 @@
+ #!/bin/sh
+ 
+-PATH=/bin:/usr/bin
+-export PATH
+ 
+ dir=$1.lock
+ 
+diff -u --recursive ncbi-blast-2.9.0+-src/scripts/common/impl/if_diff.sh ncbi-blast-2.9.0+-src.patched/scripts/common/impl/if_diff.sh
+--- ncbi-blast-2.9.0+-src/scripts/common/impl/if_diff.sh	2014-07-30 22:06:45.000000000 +0800
++++ ncbi-blast-2.9.0+-src.patched/scripts/common/impl/if_diff.sh	2019-05-15 12:42:57.298410841 +0800
+@@ -4,9 +4,6 @@
+ # Author:  Denis Vakatov (vakatov@ncbi.nlm.nih.gov)
+ #################################
+ 
+-orig_PATH=$PATH
+-PATH=/bin:/usr/bin
+-
+ script_name=`basename $0`
+ script_args="$*"
+ 
+@@ -16,7 +13,7 @@
+ base_action=`basename "$action"`
+ case "$base_action" in
+   cp | cp\ * | ln | ln\ * )
+-      action=/bin/$base_action
++      action=$base_action
+       rm="rm -f"
+       ;;
+   * )
+@@ -58,10 +55,8 @@
+   shift
+   cmd="$* $dest_file"
+   test "$quiet" = yes || echo "$cmd"
+-  PATH=$orig_PATH
+   "$@" "$dest"
+   status=$?
+-  PATH=/bin:/usr/bin
+   return $status
+ }
+ 
+@@ -74,7 +69,7 @@
+   case "$base_action" in
+     ln | ln\ -f )
+       test "$quiet" = yes || echo "failed; trying \"cp -p ...\" instead"
+-      cmd="/bin/cp -p $src_file $dest_file"
++      cmd="cp -p $src_file $dest_file"
+       ExecHelper "$dest_file" /bin/cp -p "$src_file"  ||
+       Usage "\"$cmd\" failed"
+       ;;
+diff -u --recursive ncbi-blast-2.9.0+-src/scripts/common/impl/make_lock_map.sh ncbi-blast-2.9.0+-src.patched/scripts/common/impl/make_lock_map.sh
+--- ncbi-blast-2.9.0+-src/scripts/common/impl/make_lock_map.sh	2011-11-17 04:43:52.000000000 +0800
++++ ncbi-blast-2.9.0+-src.patched/scripts/common/impl/make_lock_map.sh	2019-05-15 12:40:56.769348434 +0800
+@@ -1,8 +1,6 @@
+ #!/bin/sh
+ # $Id: make_lock_map.sh 344587 2011-11-16 20:43:52Z ucko $
+ 
+-PATH=/bin:/usr/bin
+-export PATH
+ 
+ act=false
+ cache_dir='.#SRC-cache'
+diff -u --recursive ncbi-blast-2.9.0+-src/scripts/common/impl/run_with_lock.sh ncbi-blast-2.9.0+-src.patched/scripts/common/impl/run_with_lock.sh
+--- ncbi-blast-2.9.0+-src/scripts/common/impl/run_with_lock.sh	2015-10-29 22:36:05.000000000 +0800
++++ ncbi-blast-2.9.0+-src.patched/scripts/common/impl/run_with_lock.sh	2019-05-15 12:41:53.401842849 +0800
+@@ -1,10 +1,6 @@
+ #!/bin/sh
+ # $Id: run_with_lock.sh 483249 2015-10-29 14:36:05Z ucko $
+ 
+-orig_PATH=$PATH
+-PATH=/bin:/usr/bin
+-export PATH
+-
+ base=
+ logfile=
+ map=
+@@ -23,7 +19,7 @@
+ : ${base:=`basename "$1"`}
+ 
+ clean_up () {
+-    /bin/rm -rf "$base.lock"
++    rm -rf "$base.lock"
+ }
+ 
+ case $0 in
+@@ -45,7 +41,7 @@
+     trap "clean_up; exit $error_status" 1 2 15
+     if [ -n "$logfile" ]; then
+         status_file=$base.lock/status
+-        (PATH=$orig_PATH; export PATH; "$@"; echo $? > "$status_file") 2>&1 \
++        ("$@"; echo $? > "$status_file") 2>&1 \
+             | tee "$logfile.new"
+         # Emulate egrep -q to avoid having to move from under scripts.
+         if [ ! -f "$logfile" ]  \
+@@ -58,8 +54,6 @@
+             status=1
+         fi
+     else
+-        PATH=$orig_PATH
+-        export PATH
+         "$@"
+         status=$?
+     fi
+diff -u --recursive ncbi-blast-2.9.0+-src/scripts/common/impl/strip_for_install.sh ncbi-blast-2.9.0+-src.patched/scripts/common/impl/strip_for_install.sh
+--- ncbi-blast-2.9.0+-src/scripts/common/impl/strip_for_install.sh	2013-09-24 03:06:51.000000000 +0800
++++ ncbi-blast-2.9.0+-src.patched/scripts/common/impl/strip_for_install.sh	2019-05-15 12:40:13.272975092 +0800
+@@ -1,8 +1,5 @@
+ #!/bin/sh
+ 
+-PATH=/bin:/usr/bin:/usr/ccs/bin
+-export PATH
+-
+ case "$1" in
+     --dirs )
+         shift
+--- ncbi-blast-2.9.0+-src/scripts/common/impl/update_configurable.sh	2017-07-13 22:53:24.000000000 +0800
++++ ncbi-blast-2.9.0+-src.patched/scripts/common/impl/update_configurable.sh	2019-05-15 15:03:35.861276083 +0800
+@@ -1,6 +1,4 @@
+ #!/bin/sh
+-PATH=/bin:/usr/bin
+-export PATH
+ 
+ script_name=`basename $0`
+ script_dir=`dirname $0`
+--- ncbi-blast-2.9.0+-src/src/build-system/Makefile.mk.in	2019-01-04 01:38:37.000000000 +0800
++++ ncbi-blast-2.9.0+-src.patched/src/build-system/Makefile.mk.in	2019-05-15 15:14:41.749416495 +0800
+@@ -50,12 +50,12 @@
+ 
+ ### Auxiliary commands, filters
+ 
+-RM       = /bin/rm -f
+-RMDIR    = /bin/rm -rf
+-COPY     = /bin/cp -p
++RM       = rm -f
++RMDIR    = rm -rf
++COPY     = cp -p
+ BINCOPY  = @BINCOPY@
+ TOUCH    = @TOUCH@
+-MKDIR    = /bin/mkdir
++MKDIR    = mkdir
+ BINTOUCH = $(TOUCH)
+ LN_S     = @LN_S@
+ GREP     = @GREP@
+--- ncbi-blast-2.9.0+-src/src/build-system/configure	2019-03-05 00:49:08.000000000 +0800
++++ ncbi-blast-2.9.0+-src.patched/src/build-system/configure	2019-05-15 16:55:40.711795042 +0800
+@@ -10417,10 +10417,6 @@
+ echo "${ECHO_T}no, using $LN_S" >&6; }
+ fi
+ 
+-case "$LN_S" in
+-    /*) ;;
+-    * ) LN_S=/bin/$LN_S ;;
+-esac
+ 
+ if test -n "$ac_tool_prefix"; then
+   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
diff --git a/pkgs/applications/science/biology/last/default.nix b/pkgs/applications/science/biology/last/default.nix
index 5ece9a463d4..c9e546dc2ce 100644
--- a/pkgs/applications/science/biology/last/default.nix
+++ b/pkgs/applications/science/biology/last/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "last";
-  version = "1042";
+  version = "1045";
 
   src = fetchurl {
     url = "http://last.cbrc.jp/last-${version}.zip";
-    sha256 = "0mgbhd01m9riqza2gx56qk6x5682kg71zflhisr6d3q05wrv103f";
+    sha256 = "0x2wrm52ca935n3yc486m8yy59ap34w1x9h3csjca3jab5agnjkc";
   };
 
   nativeBuildInputs = [ unzip ];
diff --git a/pkgs/applications/science/biology/xenomapper/default.nix b/pkgs/applications/science/biology/xenomapper/default.nix
index cc235c4ca99..f5e538c7096 100644
--- a/pkgs/applications/science/biology/xenomapper/default.nix
+++ b/pkgs/applications/science/biology/xenomapper/default.nix
@@ -14,7 +14,7 @@ buildPythonPackage rec {
   propagatedBuildInputs = [ statistics ];
 
   meta = with lib; {
-    homepage = "http://github.com/genomematt/xenomapper";
+    homepage = "https://github.com/genomematt/xenomapper";
     description = "A utility for post processing mapped reads that have been aligned to a primary genome and a secondary genome and binning reads into species specific, multimapping in each species, unmapped and unassigned bins";
     license = licenses.gpl3;
     platforms = platforms.all;
diff --git a/pkgs/applications/science/chemistry/openmolcas/default.nix b/pkgs/applications/science/chemistry/openmolcas/default.nix
index 487558a23c1..d73e86d2f57 100644
--- a/pkgs/applications/science/chemistry/openmolcas/default.nix
+++ b/pkgs/applications/science/chemistry/openmolcas/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchFromGitLab, cmake, gfortran, perl
 , openblas, hdf5-cpp, python3, texlive
 , armadillo, openmpi, globalarrays, openssh
-, makeWrapper
+, makeWrapper, fetchpatch
 } :
 
 let
-  version = "18.09";
+  version = "19.11";
   gitLabRev = "v${version}";
 
   python = python3.withPackages (ps : with ps; [ six pyparsing ]);
@@ -18,9 +18,19 @@ in stdenv.mkDerivation {
     owner = "Molcas";
     repo = "OpenMolcas";
     rev = gitLabRev;
-    sha256 = "1di1ygifx7ycfpwh25mv76xlv15wqfdmqzjsg5nani2d5z0arri2";
+    sha256 = "1wwqhkyyi7pw5x1ghnp83ir17zl5jsj7phhqxapybyi3bmg0i00q";
   };
 
+  patches = [ (fetchpatch {
+    name = "Fix-MPI-INT-size"; # upstream patch, fixes a Fortran compiler error
+    url = "https://gitlab.com/Molcas/OpenMolcas/commit/860e3350523f05ab18e49a428febac8a4297b6e4.patch";
+    sha256 = "0h96h5ikbi5l6ky41nkxmxfhjiykkiifq7vc2s3fdy1r1siv09sb";
+  }) (fetchpatch {
+    name = "fix-cisandbox"; # upstream patch, fixes a Fortran compiler error
+    url = "https://gitlab.com/Molcas/OpenMolcas/commit/d871590c8ce4689cd94cdbbc618954c65589393d.patch";
+    sha256 = "0dgz1w2rkglnis76spai3m51qa72j4bz6ppnk5zmzrr6ql7gwpgg";
+  })];
+
   nativeBuildInputs = [ perl cmake texlive.combined.scheme-minimal makeWrapper ];
   buildInputs = [
     gfortran
diff --git a/pkgs/applications/science/electronics/kicad/default.nix b/pkgs/applications/science/electronics/kicad/default.nix
index 47222fe4a96..0b627dbb23a 100644
--- a/pkgs/applications/science/electronics/kicad/default.nix
+++ b/pkgs/applications/science/electronics/kicad/default.nix
@@ -21,48 +21,7 @@ let
   stable = pname != "kicad-unstable";
   baseName = if (stable) then "kicad" else "kicad-unstable";
 
-  versions = {
-    "kicad" = {
-      kicadVersion = {
-        version = "5.1.5";
-        src.sha256 = "15h3rwisjss3fdc9bam9n2wq94slhacc3fbg14bnzf4n5agsnv5b";
-      };
-      libVersion = {
-        version = "5.1.5";
-        libSources = {
-          i18n.sha256 = "1rfpifl8vky1gba2angizlb2n7mwmsiai3r6ip6qma60wdj8sbd3";
-          symbols.sha256 = "048b07ffsaav1ssrchw2p870lvb4rsyb5vnniy670k7q9p16qq6h";
-          templates.sha256 = "0cs3bm3zb5ngw5ldn0lzw5bvqm4kvcidyrn76438alffwiz2b15g";
-          footprints.sha256 = "1c4whgn14qhz4yqkl46w13p6rpv1k0hsc9s9h9368fxfcz9knb2j";
-          packages3d.sha256 = "0cff2ms1bsw530kqb1fr1m2pjixyxzwa81mxgac3qpbcf8fnpvaz";
-        };
-      };
-    };
-    "kicad-unstable" = {
-      kicadVersion = {
-        version = "2019-12-31";
-        src = {
-          rev = "eaaa4eb63acb289047dfbb6cc275579dea58f12b";
-          sha256 = "1v2hf2slphjdh14y56pmzlpi6mqidrd8198if1fi0cch72v37zch";
-        };
-      };
-      libVersion = {
-        version = "unstable";
-        libSources = {
-          i18n.rev = "e7439fd76f27cfc26e269c4e6c4d56245345c28b";
-          i18n.sha256 = "1nqm1kx5b4f7s0f9q8bg4rdhqnp0128yp6bgnrkia1kwmfnf5gmy";
-          symbols.rev = "1bc5ff11c76bcbfda227e534b0acf737edddde8f";
-          symbols.sha256 = "05kv93790wi4dpbn2488p587b83yz1zw9h62lkv41h7vn2r1mmb7";
-          templates.rev = "0c0490897f803ab8b7c3dad438b7eb1f80e0417c";
-          templates.sha256 = "0cs3bm3zb5ngw5ldn0lzw5bvqm4kvcidyrn76438alffwiz2b15g";
-          footprints.rev = "454126c125edd3fa8633f301421a7d9c4de61b77";
-          footprints.sha256 = "00nli4kx2i68bk852rivbirzcgpsdlpdk34g1q892952jsbh7fy6";
-          packages3d.rev = "c2b92a411adc93ddeeed74b36b542e1057f81a2a";
-          packages3d.sha256 = "05znc6y2lc31iafspg308cxdda94zg6c7mwslmys76npih1pb8qc";
-        };
-      };
-    };
-  };
+  versions =  import ./versions.nix;
   versionConfig = versions.${baseName};
 
   wxGTK = if (stable)
@@ -157,6 +116,13 @@ stdenv.mkDerivation rec {
     ''
   ;
 
+  # can't run this for each pname
+  # stable and unstable are in the same versions.nix
+  # and kicad-small reuses stable
+  # with "all" it updates both, run it manually if you don't want that
+  # and can't git commit if this could be running in parallel with other scripts
+  passthru.updateScript = [ ./update.sh "all" ];
+
   meta = {
     description = if (stable)
       then "Open Source Electronics Design Automation Suite"
diff --git a/pkgs/applications/science/electronics/kicad/update.sh b/pkgs/applications/science/electronics/kicad/update.sh
new file mode 100755
index 00000000000..b4f744c47ef
--- /dev/null
+++ b/pkgs/applications/science/electronics/kicad/update.sh
@@ -0,0 +1,191 @@
+#!/usr/bin/env nix-shell
+#!nix-shell -i bash -p coreutils git nix curl
+
+# this script will generate versions.nix in the right location
+# this should contain the versions' revs and hashes
+# the stable revs are stored only for ease of skipping
+
+# if you get something like "tar: no space left on device"
+# you may need a bigger tmpfs, this can be set as such
+# services.logind.extraConfig = "RuntimeDirectorySize=8G";
+# this is most likely only needed for the packages3d
+# this can be checked without that config by manual TOFU
+# copy the generated items from ,versions.nix to versions.nix
+# then nix-build and see what it actually gets
+
+# if something goes unrepairably wrong, run 'update.sh all clean'
+
+# TODO
+# support parallel instances for each pname
+#   currently risks reusing old data
+# no getting around manually checking if the build product works...
+# if there is, default to commiting
+# remove items left in /nix/store?
+
+# get the latest tag that isn't an RC or *.99
+latest_tag="$(git ls-remote --tags --sort -version:refname \
+  https://gitlab.com/kicad/code/kicad.git \
+  | grep -o 'refs/tags/[0-9]*\.[0-9]*\.[0-9]*$' \
+  | grep -v ".99" | head -n 1 | cut -d '/' -f 3)"
+
+all_versions=( "${latest_tag}" master )
+
+prefetch="nix-prefetch-url --unpack --quiet"
+
+clean=""
+check_stable=""
+check_unstable=1
+commit=""
+
+for arg in "$@"; do
+  case "${arg}" in
+    help|-h|--help) echo "Read me!" >&2; exit 1; ;;
+    kicad|release|tag|stable|*small|5*|6*) check_stable=1; check_unstable="" ;;
+    all|both|full) check_stable=1; check_unstable=1 ;;
+    commit) commit=1 ;;
+    clean|fix|*fuck) check_stable=1; check_unstable=1; clean=1 ;;
+    master|*unstable|latest|now|today) check_unstable=1 ;;
+    *) ;;
+  esac
+done
+
+here="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
+now=$(date --iso-8601)
+
+file="${here}/versions.nix"
+# just in case this runs in parallel
+rand="$(head -c 3 /dev/urandom | base64)"
+tmp="${here}/,versions.nix.${rand}"
+
+# libraries currently on github, move to $gitlab/libraries planned
+libs=( symbols templates footprints packages3d )
+
+get_rev="git ls-remote --heads --tags"
+
+gitlab="https://gitlab.com/kicad"
+# append commit hash or tag
+gitlab_pre="https://gitlab.com/api/v4/projects/kicad%2Fcode%2Fkicad/repository/archive.tar.gz?sha="
+
+# append "-$lib/archive/[hash or tag].tar.gz
+github="https://github.com/kicad/kicad"
+
+# not a lib, but separate and already moved to gitlab
+i18n="${gitlab}/code/kicad-i18n.git"
+i18n_pre="https://gitlab.com/api/v4/projects/kicad%2Fcode%2Fkicad-i18n/repository/archive.tar.gz?sha="
+
+count=0
+
+printf "Latest tag is\t%s\n" "${latest_tag}" >&2
+
+if [[ ! -f ${file} ]]; then
+  echo "No existing file, generating from scratch" >&2
+  check_stable=1; check_unstable=1; clean=1
+fi
+
+printf "Writing %s\n" "${tmp}" >&2
+
+# not a dangling brace, grouping the output to redirect to file
+{
+
+printf "# This file was generated by update.sh\n\n"
+printf "{\n"
+
+for version in "${all_versions[@]}"; do
+
+  if [[ ${version} == "master" ]]; then
+    pname="kicad-unstable"
+    today="${now}"
+  else
+    pname="kicad"
+    today="${version}"
+  fi
+  # skip a version if we don't want to check it
+  if [[ (${version} != "master" && -n ${check_stable}) \
+     || (${version} == "master" && -n ${check_unstable}) ]]; then
+
+    printf "\nChecking %s\n" "${pname}" >&2
+
+    printf "%2s\"%s\" = {\n" "" "${pname}"
+      printf "%4skicadVersion = {\n" ""
+        printf "%6sversion =\t\t\t\"%s\";\n" "" "${today}"
+        printf "%6ssrc = {\n" ""
+
+    echo "Checking src" >&2
+    src_rev="$(${get_rev} "${gitlab}"/code/kicad.git "${version}" | cut -f1)"
+    ret="$(grep -sm 1 "\"${pname}\"" -A 4 "${file}" | grep -sm 1 "${src_rev}")"
+    has_hash="$(grep -sm 1 "\"${pname}\"" -A 5 "${file}" | grep -sm 1 "sha256")"
+    if [[ -n ${ret} && -n ${has_hash} && -z ${clean} ]]; then
+      echo "Reusing old ${pname}.src.sha256, already latest .rev" >&2
+      grep -sm 1 "\"${pname}\"" -A 5 "${file}" | grep -sm 1 "rev" -A 1
+    else
+          printf "%8srev =\t\t\t\"%s\";\n" "" "${src_rev}"
+          printf "%8ssha256 =\t\t\"%s\";\n" \
+            "" "$(${prefetch} "${gitlab_pre}${src_rev}")"
+          (( count++ ))
+    fi
+        printf "%6s};\n" ""
+      printf "%4s};\n" ""
+
+      printf "%4slibVersion = {\n" ""
+        printf "%6sversion =\t\t\t\"%s\";\n" "" "${today}"
+        printf "%6slibSources = {\n" ""
+
+        echo "Checking i18n" >&2
+        i18n_rev="$(${get_rev} "${i18n}" "${version}" | cut -f1)"
+        ret="$(grep -sm 1 "\"${pname}\"" -A 11 "${file}" | grep -sm 1 "${i18n_rev}")"
+        has_hash="$(grep -sm 1 "\"${pname}\"" -A 12 "${file}" | grep -sm 1 "i18n.sha256")"
+        if [[ -n ${ret} && -n ${has_hash} && -z ${clean} ]]; then
+          echo "Reusing old kicad-i18n-${today}.src.sha256, already latest .rev" >&2
+          grep -sm 1 "\"${pname}\"" -A 12 "${file}" | grep -sm 1 "i18n" -A 1
+        else
+          printf "%8si18n.rev =\t\t\"%s\";\n" "" "${i18n_rev}"
+          printf "%8si18n.sha256 =\t\t\"%s\";\n" "" \
+            "$(${prefetch} "${i18n_pre}${i18n_rev}")"
+          (( count++ ))
+        fi
+
+          for lib in "${libs[@]}"; do
+            echo "Checking ${lib}" >&2
+            url="${github}-${lib}.git"
+            lib_rev="$(${get_rev} "${url}" "${version}" | cut -f1)"
+            ret="$(grep -sm 1 "\"${pname}\"" -A 19 "${file}" | grep -sm 1 "${lib_rev}" -A 1)"
+            has_hash="$(grep -sm 1 "\"${pname}\"" -A 20 "${file}" | grep -sm 1 "${lib}.sha256")"
+            if [[ -n ${ret} && -n ${has_hash} && -z ${clean} ]]; then
+              echo "Reusing old kicad-${lib}-${today}.src.sha256, already latest .rev" >&2
+              grep -sm 1 "\"${pname}\"" -A 20 "${file}" | grep -sm 1 "${lib}" -A 1
+            else
+              printf "%8s%s.rev =\t" "" "${lib}"
+              case "${lib}" in
+                symbols|templates) printf "\t" ;; *) ;;
+              esac
+              printf "\"%s\";\n" "${lib_rev}"
+              printf "%8s%s.sha256 =\t\"%s\";\n" "" \
+              "${lib}" "$(${prefetch} "${github}-${lib}/archive/${lib_rev}.tar.gz")"
+              (( count++ ))
+            fi
+          done
+        printf "%6s};\n" ""
+      printf "%4s};\n" ""
+    printf "%2s};\n" ""
+  else
+    printf "\nReusing old %s\n" "${pname}" >&2
+    grep -sm 1 "\"${pname}\"" -A 23 "${file}"
+  fi
+done 
+printf "}\n"
+} > "${tmp}"
+
+mv "${tmp}" "${file}"
+
+printf "\nFinished\nMoved output to %s\n\n" "${file}" >&2
+
+if [[ ${count} -gt 0 ]]; then
+  if [[ ${count} -gt 1 ]]; then s="s"; else s=""; fi
+  echo "${count} revision${s} changed" >&2
+  if [[ -n ${commit} ]]; then
+    git commit -am "$(printf "kicad: automatic update of %s item%s\n" "${count}" "${s}")"
+  fi
+  echo "Please confirm the new versions.nix works before making a PR." >&2
+else
+  echo "No changes, those checked are up to date" >&2
+fi
diff --git a/pkgs/applications/science/electronics/kicad/versions.nix b/pkgs/applications/science/electronics/kicad/versions.nix
new file mode 100644
index 00000000000..ac273a1265c
--- /dev/null
+++ b/pkgs/applications/science/electronics/kicad/versions.nix
@@ -0,0 +1,52 @@
+# This file was generated by update.sh
+
+{
+  "kicad" = {
+    kicadVersion = {
+      version =			"5.1.5";
+      src = {
+        rev =			"52549c5d09cbfb0e807fcbcb07819bc9f7861544";
+        sha256 =		"15h3rwisjss3fdc9bam9n2wq94slhacc3fbg14bnzf4n5agsnv5b";
+      };
+    };
+    libVersion = {
+      version =			"5.1.5";
+      libSources = {
+        i18n.rev =		"5122cbec6563fb7c8d6f960a639ac470353af91b";
+        i18n.sha256 =		"1rfpifl8vky1gba2angizlb2n7mwmsiai3r6ip6qma60wdj8sbd3";
+        symbols.rev =		"dd122ec170b49e032179511c9d263126f52f4020";
+        symbols.sha256 =	"048b07ffsaav1ssrchw2p870lvb4rsyb5vnniy670k7q9p16qq6h";
+        templates.rev =		"94761f10d06582b33cd55ea2149d72f269f65580";
+        templates.sha256 =	"0cs3bm3zb5ngw5ldn0lzw5bvqm4kvcidyrn76438alffwiz2b15g";
+        footprints.rev =	"e076f8f271f8db96d5fec45616b7554caebb7ef7";
+        footprints.sha256 =	"1c4whgn14qhz4yqkl46w13p6rpv1k0hsc9s9h9368fxfcz9knb2j";
+        packages3d.rev =	"8d233cdcb109aa1c3b8ba4c934ee31f6a3b6e1f4";
+        packages3d.sha256 =	"0cff2ms1bsw530kqb1fr1m2pjixyxzwa81mxgac3qpbcf8fnpvaz";
+      };
+    };
+  };
+  "kicad-unstable" = {
+    kicadVersion = {
+      version =			"2020-01-08";
+      src = {
+        rev =			"ca34ade00c554157f106fde97af5f08a202808ef";
+        sha256 =		"0xx5qkc5pi3qdrdikgq3902ws8zilv2476fb4bbgh95d9wpgr35v";
+      };
+    };
+    libVersion = {
+      version =			"2020-01-08";
+      libSources = {
+        i18n.rev =		"e7439fd76f27cfc26e269c4e6c4d56245345c28b";
+        i18n.sha256 =		"1nqm1kx5b4f7s0f9q8bg4rdhqnp0128yp6bgnrkia1kwmfnf5gmy";
+        symbols.rev =		"ad58768b88d564fd188c6667841adec436da53f2";
+        symbols.sha256 =	"1rdplf04bff0hmgjwr81fbcr9nkqi21n0n88nzs5fdp73mqiywcy";
+        templates.rev =		"0c0490897f803ab8b7c3dad438b7eb1f80e0417c";
+        templates.sha256 =	"0cs3bm3zb5ngw5ldn0lzw5bvqm4kvcidyrn76438alffwiz2b15g";
+        footprints.rev =	"973867de7f33f202e9fd1b3455bd1f7e7fe4a074";
+        footprints.sha256 =	"0yvidpnqbfxjdwaiscl5bdchsg0l4d769vp456dc8h0f3802mibi";
+        packages3d.rev =	"c2b92a411adc93ddeeed74b36b542e1057f81a2a";
+        packages3d.sha256 =	"05znc6y2lc31iafspg308cxdda94zg6c7mwslmys76npih1pb8qc";
+      };
+    };
+  };
+}
diff --git a/pkgs/applications/science/electronics/ngspice/default.nix b/pkgs/applications/science/electronics/ngspice/default.nix
index 78240a40bac..f044f1d88e7 100644
--- a/pkgs/applications/science/electronics/ngspice/default.nix
+++ b/pkgs/applications/science/electronics/ngspice/default.nix
@@ -3,11 +3,11 @@
 
 stdenv.mkDerivation rec {
   pname = "ngspice";
-  version = "30";
+  version = "31";
 
   src = fetchurl {
     url = "mirror://sourceforge/ngspice/ngspice-${version}.tar.gz";
-    sha256 = "15v0jdfy2a2zxp8dmy04fdp7w7a4vwvffcwa688r81b86wphxzh8";
+    sha256 = "10n2lnfrpsv4vyrirkphr4jwjjhy7i617g6za78dwirfjq63npw4";
   };
 
   nativeBuildInputs = [ flex bison ];
diff --git a/pkgs/applications/science/electronics/pcb/default.nix b/pkgs/applications/science/electronics/pcb/default.nix
index d68d4ace54b..ec47a37140f 100644
--- a/pkgs/applications/science/electronics/pcb/default.nix
+++ b/pkgs/applications/science/electronics/pcb/default.nix
@@ -21,11 +21,11 @@
 
 stdenv.mkDerivation rec {
   pname = "pcb";
-  version = "4.2.0";
+  version = "4.2.1";
 
   src = fetchurl {
     url = "mirror://sourceforge/pcb/${pname}-${version}.tar.gz";
-    sha256 = "0hwsqmcrnk4wipbmfqx1yckmmgfn8vr37d1gh5srfy27czgkcjyd";
+    sha256 = "1i9zvcj0vgwp2g2hkmvafdq0k39klj90jsdanqx9xl7gl70345cq";
   };
 
   nativeBuildInputs = [
diff --git a/pkgs/applications/science/math/geogebra/default.nix b/pkgs/applications/science/math/geogebra/default.nix
index 75c49591675..a08c0ee3403 100644
--- a/pkgs/applications/science/math/geogebra/default.nix
+++ b/pkgs/applications/science/math/geogebra/default.nix
@@ -2,7 +2,7 @@
 
 stdenv.mkDerivation rec {
   pname = "geogebra";
-  version = "5-0-569-0";
+  version = "5-0-570-0";
 
   preferLocalBuild = true;
 
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
       "https://download.geogebra.org/installers/5.0/GeoGebra-Linux-Portable-${version}.tar.bz2"
       "http://web.archive.org/https://download.geogebra.org/installers/5.0/GeoGebra-Linux-Portable-${version}.tar.bz2"
     ];
-    sha256 = "16bav6hf80l21gnhdjll82hpjqi7kr3w74jcq7mnf24acmcn70qm";
+    sha256 = "0q6brg5rkl2gyyg9vhiilvb8zy23zlp4a1xcwnv501xzcccv0p37";
   };
 
   srcIcon = fetchurl {
diff --git a/pkgs/applications/science/math/gmsh/default.nix b/pkgs/applications/science/math/gmsh/default.nix
index 66c41bb073a..07ec466e000 100644
--- a/pkgs/applications/science/math/gmsh/default.nix
+++ b/pkgs/applications/science/math/gmsh/default.nix
@@ -3,11 +3,11 @@
 
 stdenv.mkDerivation rec {
   pname = "gmsh";
-  version = "4.4.1";
+  version = "4.5.1";
 
   src = fetchurl {
     url = "http://gmsh.info/src/gmsh-${version}-source.tgz";
-    sha256 = "1p7hibmsgv961lfkzdxlgcvmcb0q155m2sp60r97cjsfzhw68g45";
+    sha256 = "0rjwxpz5qwq6dj7ka53mhxlgnp9bs5jphhsamlb0nk3h8kzckisq";
   };
 
   buildInputs = [ openblasCompat gmm fltk libjpeg zlib libGLU libGL
diff --git a/pkgs/applications/science/molecular-dynamics/gromacs/default.nix b/pkgs/applications/science/molecular-dynamics/gromacs/default.nix
index 4dc6f038ce7..7536d071f6b 100644
--- a/pkgs/applications/science/molecular-dynamics/gromacs/default.nix
+++ b/pkgs/applications/science/molecular-dynamics/gromacs/default.nix
@@ -9,11 +9,11 @@
 }:
 
 stdenv.mkDerivation {
-  name = "gromacs-2019.4";
+  name = "gromacs-2020";
 
   src = fetchurl {
-    url = "ftp://ftp.gromacs.org/pub/gromacs/gromacs-2019.4.tar.gz";
-    sha256 = "0rqqrbjrdhprlw2z6cqid59xwxfdx05ikvywppvdp8f8vzp6chxs";
+    url = "ftp://ftp.gromacs.org/pub/gromacs/gromacs-2020.tar.gz";
+    sha256 = "00ds83n5wnm7g7wq91jycp8h82vnam5b4rwg3fv9rk9x5ca5czj7";
   };
 
   nativeBuildInputs = [ cmake ];