about summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
authorJan Tojnar <jtojnar@gmail.com>2018-11-30 20:09:45 +0100
committerJan Tojnar <jtojnar@gmail.com>2018-11-30 20:09:45 +0100
commitc5881ec2c91da7bcb4b0299f5842019c70cb90f5 (patch)
tree9efaa7fe9f326a04e98760f5b3f10f6f463905ce /pkgs
parente6834171b930f6db3796a16785d7cbb3173541b1 (diff)
parent095544187a8ed13f14356f5df7dbe0ecc059ceb5 (diff)
downloadnixlib-c5881ec2c91da7bcb4b0299f5842019c70cb90f5.tar
nixlib-c5881ec2c91da7bcb4b0299f5842019c70cb90f5.tar.gz
nixlib-c5881ec2c91da7bcb4b0299f5842019c70cb90f5.tar.bz2
nixlib-c5881ec2c91da7bcb4b0299f5842019c70cb90f5.tar.lz
nixlib-c5881ec2c91da7bcb4b0299f5842019c70cb90f5.tar.xz
nixlib-c5881ec2c91da7bcb4b0299f5842019c70cb90f5.tar.zst
nixlib-c5881ec2c91da7bcb4b0299f5842019c70cb90f5.zip
Merge remote-tracking branch 'upstream/master' into staging
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/applications/audio/distrho/default.nix37
-rw-r--r--pkgs/applications/editors/android-studio/default.nix6
-rw-r--r--pkgs/applications/inferno/default.nix58
-rwxr-xr-xpkgs/applications/inferno/inferno31
-rw-r--r--pkgs/applications/misc/oneko/default.nix13
-rw-r--r--pkgs/applications/misc/slic3r/prusa3d.nix4
-rw-r--r--pkgs/applications/misc/xcruiser/default.nix14
-rw-r--r--pkgs/applications/misc/xmove/default.nix19
-rw-r--r--pkgs/applications/misc/xxkb/default.nix19
-rw-r--r--pkgs/applications/networking/p2p/tixati/default.nix4
-rw-r--r--pkgs/applications/networking/remote/ssvnc/default.nix4
-rw-r--r--pkgs/applications/science/astronomy/xearth/default.nix13
-rw-r--r--pkgs/applications/science/electronics/tkgate/1.x.nix4
-rw-r--r--pkgs/applications/science/math/R/default.nix2
-rw-r--r--pkgs/applications/version-management/gitlab/gitlab-shell/remove-hardcoded-locations.patch13
-rw-r--r--pkgs/applications/virtualization/qemu/default.nix24
-rw-r--r--pkgs/applications/window-managers/larswm/default.nix12
-rw-r--r--pkgs/applications/window-managers/sway/beta.nix4
-rw-r--r--pkgs/build-support/build-maven.nix18
-rw-r--r--pkgs/build-support/ocaml/dune.nix4
-rw-r--r--pkgs/development/interpreters/erlang/R21.nix4
-rw-r--r--pkgs/development/libraries/Xaw3d/default.nix1
-rw-r--r--pkgs/development/libraries/bootil/default.nix26
-rw-r--r--pkgs/development/libraries/libngspice/default.nix8
-rw-r--r--pkgs/development/libraries/osip/3.nix17
-rw-r--r--pkgs/development/libraries/talloc/default.nix14
-rw-r--r--pkgs/development/libraries/wlroots/default.nix21
-rw-r--r--pkgs/development/libraries/yojimbo/default.nix6
-rw-r--r--pkgs/development/ocaml-modules/csv/default.nix4
-rw-r--r--pkgs/development/ocaml-modules/opam-file-format/default.nix4
-rw-r--r--pkgs/development/ocaml-modules/visitors/default.nix6
-rw-r--r--pkgs/development/python-modules/cairosvg/1_x.nix37
-rw-r--r--pkgs/development/python-modules/datrie/default.nix9
-rw-r--r--pkgs/development/python-modules/gst-python/default.nix11
-rw-r--r--pkgs/development/python-modules/nose-focus/default.nix35
-rw-r--r--pkgs/development/python-modules/nose-of-yeti/default.nix30
-rw-r--r--pkgs/development/python-modules/nose-pattern-exclude/default.nix23
-rw-r--r--pkgs/development/python-modules/piexif/default.nix15
-rw-r--r--pkgs/development/python-modules/preggy/default.nix25
-rw-r--r--pkgs/development/python-modules/pyres/default.nix45
-rw-r--r--pkgs/development/python-modules/pyssim/default.nix32
-rw-r--r--pkgs/development/python-modules/python-mnist/default.nix18
-rw-r--r--pkgs/development/python-modules/remotecv/default.nix38
-rw-r--r--pkgs/development/python-modules/remotecv/install_requires.patch16
-rw-r--r--pkgs/development/python-modules/should-dsl/default.nix22
-rw-r--r--pkgs/development/python-modules/thumbor/default.nix58
-rw-r--r--pkgs/development/python-modules/yanc/default.nix27
-rw-r--r--pkgs/development/tools/misc/premake/3.nix3
-rw-r--r--pkgs/development/tools/misc/premake/5.nix3
-rw-r--r--pkgs/development/tools/misc/premake/default.nix7
-rw-r--r--pkgs/development/tools/misc/premake/setup-hook.sh19
-rw-r--r--pkgs/development/tools/pipenv/default.nix4
-rw-r--r--pkgs/development/tools/tychus/default.nix28
-rw-r--r--pkgs/development/tools/tychus/deps.nix30
-rw-r--r--pkgs/games/boohu/default.nix4
-rw-r--r--pkgs/games/gmad/default.nix2
-rw-r--r--pkgs/games/tome4/default.nix16
-rw-r--r--pkgs/games/xsnow/default.nix18
-rw-r--r--pkgs/misc/screensavers/xautolock/default.nix12
-rw-r--r--pkgs/misc/themes/nordic/default.nix2
-rw-r--r--pkgs/os-specific/linux/fusionio/srcs.nix22
-rw-r--r--pkgs/os-specific/linux/fusionio/util.nix45
-rw-r--r--pkgs/os-specific/linux/fusionio/vsl-fix-file-inode.patch13
-rw-r--r--pkgs/os-specific/linux/fusionio/vsl.nix39
-rw-r--r--pkgs/os-specific/linux/kernel/common-config.nix1
-rw-r--r--pkgs/os-specific/linux/reptyr/default.nix16
-rw-r--r--pkgs/servers/jackett/default.nix4
-rw-r--r--pkgs/servers/nas/default.nix7
-rw-r--r--pkgs/servers/roundcube/default.nix8
-rw-r--r--pkgs/servers/sql/cockroachdb/default.nix44
-rw-r--r--pkgs/servers/x11/xorg/darwin-imake-setup-hook.sh1
-rw-r--r--pkgs/servers/x11/xorg/imake-setup-hook.sh19
-rw-r--r--pkgs/servers/x11/xorg/overrides.nix8
-rw-r--r--pkgs/stdenv/generic/make-derivation.nix2
-rw-r--r--pkgs/test/cross/default.nix62
-rw-r--r--pkgs/tools/X11/x2x/default.nix16
-rw-r--r--pkgs/tools/X11/xbrightness/default.nix22
-rw-r--r--pkgs/tools/X11/xvkbd/default.nix15
-rw-r--r--pkgs/tools/X11/xzoom/default.nix17
-rw-r--r--pkgs/tools/admin/tightvnc/default.nix38
-rw-r--r--pkgs/tools/filesystems/jfsutils/ar-fix.patch10
-rw-r--r--pkgs/tools/filesystems/jfsutils/default.nix10
-rw-r--r--pkgs/tools/filesystems/reiserfsprogs/default.nix4
-rw-r--r--pkgs/tools/filesystems/reiserfsprogs/reiserfsprogs-ar-fix.patch10
-rw-r--r--pkgs/tools/graphics/perceptualdiff/default.nix25
-rw-r--r--pkgs/tools/graphics/transfig/default.nix12
-rw-r--r--pkgs/tools/misc/otfcc/default.nix14
-rw-r--r--pkgs/tools/networking/x11-ssh-askpass/default.nix10
-rw-r--r--pkgs/tools/video/vncrec/default.nix13
-rw-r--r--pkgs/top-level/all-packages.nix18
-rw-r--r--pkgs/top-level/perl-packages.nix15
-rw-r--r--pkgs/top-level/python-packages.nix22
-rw-r--r--pkgs/top-level/release-lib.nix2
93 files changed, 975 insertions, 592 deletions
diff --git a/pkgs/applications/audio/distrho/default.nix b/pkgs/applications/audio/distrho/default.nix
index bf79b68bc7db..1c41451b08f3 100644
--- a/pkgs/applications/audio/distrho/default.nix
+++ b/pkgs/applications/audio/distrho/default.nix
@@ -1,7 +1,13 @@
 { stdenv, fetchFromGitHub, alsaLib, fftwSinglePrec, freetype, libjack2
-, pkgconfig, premake3, xorg, ladspa-sdk }:
+, pkgconfig, ladspa-sdk, premake3
+, libX11, libXcomposite, libXcursor, libXext, libXinerama, libXrender
+}:
 
-stdenv.mkDerivation rec {
+let
+  premakeos = if stdenv.hostPlatform.isDarwin then "osx"
+              else if stdenv.hostPlatform.isWindows then "mingw"
+              else "linux";
+in stdenv.mkDerivation rec {
   name = "distrho-ports-${version}";
   version = "2018-04-16";
 
@@ -12,27 +18,26 @@ stdenv.mkDerivation rec {
     sha256 = "0l4zwl4mli8jzch32a1fh7c88r9q17xnkxsdw17ds5hadnxlk12v";
   };
 
+  configurePhase = ''
+    runHook preConfigure
+
+    sh ./scripts/premake-update.sh ${premakeos}
+
+    runHook postConfigure
+  '';
+
   patchPhase = ''
     sed -e "s#@./scripts#sh scripts#" -i Makefile
   '';
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig premake3 ];
   buildInputs = [
-    alsaLib fftwSinglePrec freetype libjack2 premake3
-    xorg.libX11 xorg.libXcomposite xorg.libXcursor xorg.libXext
-    xorg.libXinerama xorg.libXrender ladspa-sdk
+    alsaLib fftwSinglePrec freetype libjack2
+    libX11 libXcomposite libXcursor libXext
+    libXinerama libXrender ladspa-sdk
   ];
 
-  buildPhase = ''
-    sh ./scripts/premake-update.sh linux
-    make lv2
-  '';
-
-  installPhase = ''
-    mkdir -p $out/bin
-    mkdir -p $out/lib/lv2
-    cp -a bin/lv2/* $out/lib/lv2/
-  '';
+  makeFlags = "PREFIX=$(out)";
 
   meta = with stdenv.lib; {
     homepage = http://distrho.sourceforge.net;
diff --git a/pkgs/applications/editors/android-studio/default.nix b/pkgs/applications/editors/android-studio/default.nix
index b849f1fa62d5..de7e3977ad83 100644
--- a/pkgs/applications/editors/android-studio/default.nix
+++ b/pkgs/applications/editors/android-studio/default.nix
@@ -18,9 +18,9 @@ let
     sha256Hash = "0apc566l4gwkwvfgj50d4qxm2gw26rxdlyr8kj3kfcra9a33c2b7";
   };
   latestVersion = { # canary & dev
-    version = "3.4.0.4"; # "Android Studio 3.4 Canary 5"
-    build = "183.5141831";
-    sha256Hash = "0xfk5vyjk3pdb44jp43vb5394486z2qgzrdhjzbf1ncbhvaf0aji";
+    version = "3.4.0.5"; # "Android Studio 3.4 Canary 6"
+    build = "183.5146016";
+    sha256Hash = "1z2asimpsw15iild7c4aqicph6v327qx3ffjgvl2n8vr5rspsns1";
   };
 in rec {
   # Old alias
diff --git a/pkgs/applications/inferno/default.nix b/pkgs/applications/inferno/default.nix
deleted file mode 100644
index de9be76b6e45..000000000000
--- a/pkgs/applications/inferno/default.nix
+++ /dev/null
@@ -1,58 +0,0 @@
-{ fetchhg, stdenv, xorg, makeWrapper }:
-
-stdenv.mkDerivation rec {
-  # Inferno is a rolling release from a mercurial repository. For the verison number
-  # of the package I'm using the mercurial commit number.
-  rev = "785";
-  name = "inferno-${rev}";
-  host = "Linux";
-  objtype = "386";
-
-  src = fetchhg {
-    url    = "https://bitbucket.org/inferno-os/inferno-os";
-    sha256 = "1b428ma9fi5skvfrxp91dr43a62kax89wmx7950ahc1cxyx90k7x";
-  };
-
-  buildInputs = [ makeWrapper ] ++ (with xorg; [ libX11 libXpm libXext xextproto ]);
-
-  infernoWrapper = ./inferno;
-
-  configurePhase = ''
-    sed -e 's@^ROOT=.*$@ROOT='"$out"'/share/inferno@g' \
-        -e 's@^OBJTYPE=.*$@OBJTYPE=${objtype}@g' \
-        -e 's@^SYSHOST=.*$@SYSHOST=${host}@g' \
-        -i mkconfig
-    # Get rid of an annoying warning
-    sed -e 's/_BSD_SOURCE/_DEFAULT_SOURCE/g' \
-        -i ${host}/${objtype}/include/lib9.h
-  '';
-
-  buildPhase = ''
-    mkdir -p $out/share/inferno
-    cp -r . $out/share/inferno
-    ./makemk.sh
-    export PATH=$PATH:$out/share/inferno/Linux/386/bin
-    mk nuke
-    mk
-  '';
-
-  installPhase = ''
-    # Installs executables in $out/share/inferno/${host}/${objtype}/bin
-    mk install
-    mkdir -p $out/bin
-    # Install start-up script
-    makeWrapper $infernoWrapper $out/bin/inferno \
-      --suffix PATH ':' "$out/share/inferno/Linux/386/bin" \
-      --set INFERNO_ROOT "$out/share/inferno"
-  '';
-
-  hardeningDisable = [ "fortify" ];
-
-  meta = {
-    description = "A compact distributed operating system for building cross-platform distributed systems";
-    homepage = http://inferno-os.org/;
-    license = stdenv.lib.licenses.gpl2;
-    maintainers = with stdenv.lib.maintainers; [ doublec kovirobi ];
-    platforms = with stdenv.lib.platforms; linux;
-  };
-}
diff --git a/pkgs/applications/inferno/inferno b/pkgs/applications/inferno/inferno
deleted file mode 100755
index 6eb6da8861a5..000000000000
--- a/pkgs/applications/inferno/inferno
+++ /dev/null
@@ -1,31 +0,0 @@
-#! /usr/bin/env bash
-
-
-export INFERNO_HOME="$HOME/.local/share/inferno"
-if [ -n "$XDG_DATA_HOME" ]
-  then export INFERNO_HOME="$XDG_DATA_HOME/inferno"
-fi
-
-if [ ! -d $INFERNO_HOME ]; then
-  mkdir -p $INFERNO_HOME
-fi
-
-if [ ! -d $INFERNO_HOME/tmp ]; then
-  mkdir -p $INFERNO_HOME/tmp
-fi
-
-for d in $INFERNO_HOME/{acme,appl,dis,lib,man,module,usr/inferno}; do
-  if [ ! -d $d ]; then
-    mkdir -p $d
-    cp --no-preserve=all -r $INFERNO_ROOT/${d#$INFERNO_HOME/}/* $d/
-    chmod -R +w $d
-  fi
-done
-
-if [ ! -d $INFERNO_HOME/usr/$USER ]; then
-  mkdir -p $INFERNO_HOME/usr/$USER
-  cp -r $INFERNO_ROOT/usr/inferno/* $INFERNO_HOME/usr/$USER/
-  chmod -R +w $INFERNO_HOME/usr/$USER
-fi
-
-exec emu "$@" /dis/sh.dis -c "bind -b -c '#U*$INFERNO_HOME/' /; /dis/sh.dis"
diff --git a/pkgs/applications/misc/oneko/default.nix b/pkgs/applications/misc/oneko/default.nix
index 76df2a264e26..b87f11d7b05d 100644
--- a/pkgs/applications/misc/oneko/default.nix
+++ b/pkgs/applications/misc/oneko/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, xorg, xlibsWrapper }:
+{ stdenv, fetchurl, imake, gccmakedep, xlibsWrapper }:
 
 stdenv.mkDerivation rec {
   version_name = "1.2.sakura.5";
@@ -8,14 +8,11 @@ stdenv.mkDerivation rec {
     url = "http://www.daidouji.com/oneko/distfiles/oneko-${version_name}.tar.gz";
     sha256 = "2c2e05f1241e9b76f54475b5577cd4fb6670de058218d04a741a04ebd4a2b22f";
   };
-  buildInputs = [ xorg.imake xorg.gccmakedep xlibsWrapper ];
+  nativeBuildInputs = [ imake gccmakedep ];
+  buildInputs = [ xlibsWrapper ];
 
-  configurePhase = "xmkmf";
-
-  installPhase = ''
-    make install BINDIR=$out/bin
-    make install.man MANPATH=$out/share/man
-  '';
+  makeFlags = [ "BINDIR=$(out)/bin" "MANPATH=$(out)/share/man" ];
+  installTargets = "install install.man";
 
   meta = with stdenv.lib; {
     description = "Creates a cute cat chasing around your mouse cursor";
diff --git a/pkgs/applications/misc/slic3r/prusa3d.nix b/pkgs/applications/misc/slic3r/prusa3d.nix
index 2f5486a0f4bc..251ee4d918b4 100644
--- a/pkgs/applications/misc/slic3r/prusa3d.nix
+++ b/pkgs/applications/misc/slic3r/prusa3d.nix
@@ -33,7 +33,7 @@ let
 in
 stdenv.mkDerivation rec {
   name = "slic3r-prusa-edition-${version}";
-  version = "1.41.1";
+  version = "1.41.2";
 
   enableParallelBuilding = true;
 
@@ -118,7 +118,7 @@ stdenv.mkDerivation rec {
   src = fetchFromGitHub {
     owner = "prusa3d";
     repo = "Slic3r";
-    sha256 = "0crjrll8cjpkllval6abrqzvzp8g3rnb4vmwi5vivw0jvdv3w5y7";
+    sha256 = "046ircwc0wr586v7106ys557ypslmyq9p4qgi34ads1d6bgxhlyy";
     rev = "version_${version}";
   };
 
diff --git a/pkgs/applications/misc/xcruiser/default.nix b/pkgs/applications/misc/xcruiser/default.nix
index 3a25147971a9..945072ce026e 100644
--- a/pkgs/applications/misc/xcruiser/default.nix
+++ b/pkgs/applications/misc/xcruiser/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gccmakedep, xorg }:
+{ stdenv, fetchurl, gccmakedep, xorg, imake, libXt, libXaw, libXpm, libXext }:
 
 stdenv.mkDerivation {
   name = "xcruiser-0.30";
@@ -8,13 +8,13 @@ stdenv.mkDerivation {
       sha256 = "1r8whva38xizqdh7jmn6wcmfmsndc67pkw22wzfzr6rq0vf6hywi";
     };
 
-  buildInputs = with xorg; [ gccmakedep imake libXt libXaw libXpm libXext ];
+  nativeBuildInputs = [ gccmakedep imake ];
+  buildInputs = [ libXt libXaw libXpm libXext ];
 
-  configurePhase = "xmkmf -a";
-
-  preBuild = ''
-    makeFlagsArray=( BINDIR=$out/bin XAPPLOADDIR=$out/etc/X11/app-defaults)
-  '';
+  makeFlags = [
+    "BINDIR=$(out)/bin"
+    "XAPPLOADDIR=$(out)/etc/X11/app-defaults"
+  ];
 
   meta = with stdenv.lib; {
     description = "Filesystem visualization utility";
diff --git a/pkgs/applications/misc/xmove/default.nix b/pkgs/applications/misc/xmove/default.nix
deleted file mode 100644
index e461a2c8816a..000000000000
--- a/pkgs/applications/misc/xmove/default.nix
+++ /dev/null
@@ -1,19 +0,0 @@
-{stdenv, fetchurl, libX11, libXi, imake, xauth, libXau}:
-stdenv.mkDerivation {
-  name = "xmove-2.0b2";
-
-  src = fetchurl {
-    url = mirror://debian/pool/main/x/xmove/xmove_2.0beta2.orig.tar.gz;
-    sha256 = "0q310k3bi39vdk0kqqvsahnb1k6lx9hlx80iyxnkq59l6jxnhyhf";
-  };
-
-  buildPhase = "cd xmove; sed -e 's/.*No address for our host.*/{hp = gethostbyname(\"localhost\");};/' -i main.c; cp ../man/man1/xmove.1 xmove.man ; xmkmf; make; cd .. ; cd xmovectrl ; cp ../man/man1/xmovectrl.1 xmovectrl.man; xmkmf; make ; cd ..";
-  installPhase = "cd xmove; make install install.man MANDIR=\${out}/man/man1 BINDIR=\${out}/bin; cd .. ; cd xmovectrl ; make install install.man MANDIR=\${out}/man/man1 BINDIR=\${out}/bin; cd ..";
-
-  buildInputs = [libX11 libXi imake xauth libXau];
-
-  meta = {
-    platforms = stdenv.lib.platforms.linux;
-    license = stdenv.lib.licenses.mit;
-  };
-}
diff --git a/pkgs/applications/misc/xxkb/default.nix b/pkgs/applications/misc/xxkb/default.nix
index 90e2723a9067..56638d126c19 100644
--- a/pkgs/applications/misc/xxkb/default.nix
+++ b/pkgs/applications/misc/xxkb/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl, libX11, libXt, libXext, libXpm, imake
-, svgSupport ? true, librsvg, glib, gdk_pixbuf, pkgconfig
+{ stdenv, fetchurl, libX11, libXt, libXext, libXpm, imake, gccmakedep
+, svgSupport ? false, librsvg, glib, gdk_pixbuf, pkgconfig
 }:
 
 assert svgSupport ->
@@ -13,20 +13,21 @@ stdenv.mkDerivation rec {
     sha256 = "0hl1i38z9xnbgfjkaz04vv1n8xbgfg88g5z8fyzyb2hxv2z37anf";
   };
 
+  nativeBuildInputs = [ imake gccmakedep ];
   buildInputs = [
-    imake
     libX11 libXt libXext libXpm
   ] ++ stdenv.lib.optionals svgSupport [ librsvg glib gdk_pixbuf pkgconfig ];
 
   outputs = [ "out" "man" ];
 
-  configurePhase = ''
-    xmkmf ${stdenv.lib.optionalString svgSupport "-DWITH_SVG_SUPPORT"}
-  '';
+  imakeFlags = stdenv.lib.optionalString svgSupport "-DWITH_SVG_SUPPORT";
 
-  preBuild = ''
-    makeFlagsArray=( BINDIR=$out/bin PIXMAPDIR=$out/share/xxkb XAPPLOADDIR=$out/etc/X11/app-defaults MANDIR=$man/share/man )
-  '';
+  makeFlags = [
+    "BINDIR=${placeholder "out"}/bin"
+    "PIXMAPDIR=${placeholder "out"}/share/xxkb"
+    "XAPPLOADDIR=${placeholder "out"}/etc/X11/app-defaults"
+    "MANDIR=${placeholder "man"}/share/man"
+  ];
 
   installTargets = "install install.man";
 
diff --git a/pkgs/applications/networking/p2p/tixati/default.nix b/pkgs/applications/networking/p2p/tixati/default.nix
index 9f47f8464a13..13d44655df84 100644
--- a/pkgs/applications/networking/p2p/tixati/default.nix
+++ b/pkgs/applications/networking/p2p/tixati/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "tixati-${version}";
-  version = "2.57";
+  version = "2.58";
 
   src = fetchurl {
     url = "https://download2.tixati.com/download/tixati-${version}-1.x86_64.manualinstall.tar.gz";
-    sha256 = "0z6znh62ry4fmc6c54zq79pk1b5bwkz93bxsfgvxpf6sajpyf9n7";
+    sha256 = "077z5i0grkxkgw2npylv4r897434k2pr03brqx5hjpjw3797r141";
   };
 
   installPhase = ''
diff --git a/pkgs/applications/networking/remote/ssvnc/default.nix b/pkgs/applications/networking/remote/ssvnc/default.nix
index f20bb740615c..99835627f879 100644
--- a/pkgs/applications/networking/remote/ssvnc/default.nix
+++ b/pkgs/applications/networking/remote/ssvnc/default.nix
@@ -12,7 +12,9 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ imake zlib jdk libX11 libXt libXmu libXaw libXext libXpm openjpeg openssl ];
 
-  configurePhase = "makeFlags=PREFIX=$out";
+  dontUseImakeConfigure = true;
+
+  makeFlags = "PREFIX=$(out)";
 
   hardeningDisable = [ "format" ];
 
diff --git a/pkgs/applications/science/astronomy/xearth/default.nix b/pkgs/applications/science/astronomy/xearth/default.nix
index 5f276a1b3c70..fef4ca1907fd 100644
--- a/pkgs/applications/science/astronomy/xearth/default.nix
+++ b/pkgs/applications/science/astronomy/xearth/default.nix
@@ -1,21 +1,20 @@
-{ stdenv, fetchurl, xorg }:
+{ stdenv, fetchurl, imake, gccmakedep, libXt, libXext }:
+
 stdenv.mkDerivation rec {
   name = "xearth-${version}";
   version = "1.1";
-  
+
   src = fetchurl {
     url = "http://xearth.org/${name}.tar.gz";
     sha256 = "bcb1407cc35b3f6dd3606b2c6072273b6a912cbd9ed1ae22fb2d26694541309c";
   };
 
-  buildInputs = with xorg; [  imake libXt libXext ];
-
-  dontAddPrefix = true;
-  configureScript="xmkmf";
+  nativeBuildInputs = [ imake gccmakedep ];
+  buildInputs = [ libXt libXext ];
 
   installFlags=[ "DESTDIR=$(out)/" "BINDIR=bin" "MANDIR=man/man1"];
   installTargets="install install.man";
-  
+
   meta = with stdenv.lib; {
     description = "sets the X root window to an image of the Earth";
     homepage = "http://xplanet.org";
diff --git a/pkgs/applications/science/electronics/tkgate/1.x.nix b/pkgs/applications/science/electronics/tkgate/1.x.nix
index aca1f9a35898..ab2b75917b92 100644
--- a/pkgs/applications/science/electronics/tkgate/1.x.nix
+++ b/pkgs/applications/science/electronics/tkgate/1.x.nix
@@ -12,7 +12,9 @@ stdenv.mkDerivation rec {
     sha256 = "1pqywkidfpdbj18i03h97f4cimld4fb3mqfy8jjsxs12kihm18fs";
   };
 
-  buildInputs = [ tcl tk libX11 which yacc flex imake xproto gccmakedep ];
+  nativeBuildInputs = [ which yacc flex imake gccmakedep ];
+  buildInputs = [ tcl tk libX11 xproto ];
+  dontUseImakeConfigure = true;
 
   patchPhase = ''
     sed -i config.h \
diff --git a/pkgs/applications/science/math/R/default.nix b/pkgs/applications/science/math/R/default.nix
index 2fa8f3e5d7be..5cd6bbf4bdd9 100644
--- a/pkgs/applications/science/math/R/default.nix
+++ b/pkgs/applications/science/math/R/default.nix
@@ -15,6 +15,8 @@ stdenv.mkDerivation rec {
     sha256 = "0463bff5eea0f3d93fa071f79c18d0993878fd4f2e18ae6cf22c1639d11457ed";
   };
 
+  dontUseImakeConfigure = true;
+
   buildInputs = [
     bzip2 gfortran libX11 libXmu libXt libXt libjpeg libpng libtiff ncurses
     pango pcre perl readline texLive xz zlib less texinfo graphviz icu
diff --git a/pkgs/applications/version-management/gitlab/gitlab-shell/remove-hardcoded-locations.patch b/pkgs/applications/version-management/gitlab/gitlab-shell/remove-hardcoded-locations.patch
index 6d29f5f9e6c5..3d381404c63b 100644
--- a/pkgs/applications/version-management/gitlab/gitlab-shell/remove-hardcoded-locations.patch
+++ b/pkgs/applications/version-management/gitlab/gitlab-shell/remove-hardcoded-locations.patch
@@ -43,3 +43,16 @@ index 57c70f5..700569b 100644
    end
  
    def api
+diff --git a/lib/gitlab_keys.rb b/lib/gitlab_keys.rb
+index 0600a18..6814f0a 100644
+--- a/lib/gitlab_keys.rb
++++ b/lib/gitlab_keys.rb
+@@ -10,7 +10,7 @@ class GitlabKeys # rubocop:disable Metrics/ClassLength
+   attr_accessor :auth_file, :key
+
+   def self.command(whatever)
+-    "#{ROOT_PATH}/bin/gitlab-shell #{whatever}"
++    "/run/current-system/sw/bin/gitlab-shell #{whatever}"
+   end
+
+   def self.command_key(key_id)
diff --git a/pkgs/applications/virtualization/qemu/default.nix b/pkgs/applications/virtualization/qemu/default.nix
index d9495bd984ef..ea330d595557 100644
--- a/pkgs/applications/virtualization/qemu/default.nix
+++ b/pkgs/applications/virtualization/qemu/default.nix
@@ -18,6 +18,10 @@
 , virglSupport ? openGLSupport, virglrenderer
 , smbdSupport ? false, samba
 , hostCpuOnly ? false
+, hostCpuTargets ? (if hostCpuOnly
+                    then (stdenv.lib.optional stdenv.isx86_64 "i386-softmmu"
+                          ++ ["${stdenv.hostPlatform.qemuArch}-softmmu"])
+                    else null)
 , nixosTestRunner ? false
 }:
 
@@ -27,11 +31,6 @@ let
     + optionalString pulseSupport "pa,"
     + optionalString sdlSupport "sdl,";
 
-  hostCpuTargets = if stdenv.isx86_64 then "i386-softmmu,x86_64-softmmu"
-                   else if stdenv.isi686 then "i386-softmmu"
-                   else if stdenv.isAarch32 then "arm-softmmu"
-                   else if stdenv.isAarch64 then "aarch64-softmmu"
-                   else throw "Don't know how to build a 'hostCpuOnly = true' QEMU";
 in
 
 stdenv.mkDerivation rec {
@@ -113,7 +112,7 @@ stdenv.mkDerivation rec {
     ++ optional smartcardSupport "--enable-smartcard"
     ++ optional spiceSupport "--enable-spice"
     ++ optional usbredirSupport "--enable-usb-redir"
-    ++ optional hostCpuOnly "--target-list=${hostCpuTargets}"
+    ++ optional (hostCpuTargets != null) "--target-list=${stdenv.lib.concatStringsSep "," hostCpuTargets}"
     ++ optional stdenv.isDarwin "--enable-cocoa"
     ++ optional stdenv.isLinux "--enable-linux-aio"
     ++ optional gtkSupport "--enable-gtk"
@@ -135,12 +134,13 @@ stdenv.mkDerivation rec {
     '';
 
   # Add a ‘qemu-kvm’ wrapper for compatibility/convenience.
-  postInstall =
-    if stdenv.isx86_64       then ''makeWrapper $out/bin/qemu-system-x86_64  $out/bin/qemu-kvm --add-flags "\$([ -e /dev/kvm ] && echo -enable-kvm)"''
-    else if stdenv.isi686    then ''makeWrapper $out/bin/qemu-system-i386    $out/bin/qemu-kvm --add-flags "\$([ -e /dev/kvm ] && echo -enable-kvm)"''
-    else if stdenv.isAarch32 then ''makeWrapper $out/bin/qemu-system-arm     $out/bin/qemu-kvm --add-flags "\$([ -e /dev/kvm ] && echo -enable-kvm)"''
-    else if stdenv.isAarch64 then ''makeWrapper $out/bin/qemu-system-aarch64 $out/bin/qemu-kvm --add-flags "\$([ -e /dev/kvm ] && echo -enable-kvm)"''
-    else "";
+  postInstall = ''
+    if [ -x $out/bin/qemu-system-${stdenv.hostPlatform.qemuArch} ]; then
+      makeWrapper $out/bin/qemu-system-${stdenv.hostPlatform.qemuArch} \
+                  $out/bin/qemu-kvm \
+                  --add-flags "\$([ -e /dev/kvm ] && echo -enable-kvm)"
+    fi
+  '';
 
   passthru = {
     qemu-system-i386 = "bin/qemu-system-i386";
diff --git a/pkgs/applications/window-managers/larswm/default.nix b/pkgs/applications/window-managers/larswm/default.nix
index 21ea00d110e0..4ec1a4bcd059 100644
--- a/pkgs/applications/window-managers/larswm/default.nix
+++ b/pkgs/applications/window-managers/larswm/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, imake, libX11, libXext, libXmu}:
+{ stdenv, fetchurl, imake, gccmakedep, libX11, libXext, libXmu }:
 
 stdenv.mkDerivation {
   name = "larswm-7.5.3";
@@ -8,13 +8,11 @@ stdenv.mkDerivation {
     sha256 = "1xmlx9g1nhklxjrg0wvsya01s4k5b9fphnpl9zdwp29mm484ni3v";
   };
 
-  buildInputs = [ imake libX11 libXext libXmu ];
+  nativeBuildInputs = [ imake gccmakedep ];
+  buildInputs = [ libX11 libXext libXmu ];
 
-  configurePhase = ''
-    xmkmf
-    makeFlags="BINDIR=$out/bin MANPATH=$out/share/man"
-    installTargets="install install.man"
-  '';
+  makeFlags = [ "BINDIR=$(out)/bin" "MANPATH=$(out)/share/man" ];
+  installTargets = "install install.man";
 
   meta = {
     homepage = http://www.fnurt.net/larswm;
diff --git a/pkgs/applications/window-managers/sway/beta.nix b/pkgs/applications/window-managers/sway/beta.nix
index 5aebb7ed8dd1..fd3e2275b442 100644
--- a/pkgs/applications/window-managers/sway/beta.nix
+++ b/pkgs/applications/window-managers/sway/beta.nix
@@ -10,13 +10,13 @@
 stdenv.mkDerivation rec {
   name = "${pname}-${version}";
   pname = "sway";
-  version = "1.0-beta.1";
+  version = "1.0-beta.2";
 
   src = fetchFromGitHub {
     owner = "swaywm";
     repo = "sway";
     rev = version;
-    sha256 = "0h9kgrg9mh2acks63z72bw3lwff32pf2nb4i7i5xhd9i6l4gfnqa";
+    sha256 = "0f9rniwizbc3vzxdy6rc47749p6gczfbgfdy4r458134rbl551hw";
   };
 
   nativeBuildInputs = [
diff --git a/pkgs/build-support/build-maven.nix b/pkgs/build-support/build-maven.nix
index b9da06c43c82..f47e3ebc61c2 100644
--- a/pkgs/build-support/build-maven.nix
+++ b/pkgs/build-support/build-maven.nix
@@ -15,16 +15,15 @@ infoFile: let
 
   script = writeText "build-maven-repository.sh" ''
     ${lib.concatStrings (map (dep: let
-      inherit (dep)
-        url sha1 groupId artifactId
-        version metadata repository-id;
+      inherit (dep) sha1 groupId artifactId version metadata repository-id;
 
       versionDir = dep.unresolved-version or version;
       authenticated = dep.authenticated or false;
+      url = dep.url or "";
 
-      fetch = (if authenticated then requireFile else fetchurl) {
+      fetch = if (url != "") then ((if authenticated then requireFile else fetchurl) {
         inherit url sha1;
-      };
+      }) else "";
 
       fetchMetadata = (if authenticated then requireFile else fetchurl) {
         inherit (metadata) url sha1;
@@ -32,10 +31,15 @@ infoFile: let
     in ''
       dir=$out/$(echo ${groupId} | sed 's|\.|/|g')/${artifactId}/${versionDir}
       mkdir -p $dir
-      ln -sv ${fetch} $dir/${fetch.name}
+
+      ${lib.optionalString (fetch != "") ''
+        ln -sv ${fetch} $dir/${fetch.name}
+      ''}
       ${lib.optionalString (dep ? metadata) ''
         ln -svf ${fetchMetadata} $dir/maven-metadata-${repository-id}.xml
-        ln -sv ${fetch} $dir/$(echo ${fetch.name} | sed 's|${version}|${dep.unresolved-version}|')
+        ${lib.optionalString (fetch != "") ''
+          ln -sv ${fetch} $dir/$(echo ${fetch.name} | sed 's|${version}|${dep.unresolved-version}|')
+        ''}
       ''}
     '') info.dependencies)}
   '';
diff --git a/pkgs/build-support/ocaml/dune.nix b/pkgs/build-support/ocaml/dune.nix
index 7386b07f575c..4d6ed76aca01 100644
--- a/pkgs/build-support/ocaml/dune.nix
+++ b/pkgs/build-support/ocaml/dune.nix
@@ -25,12 +25,12 @@ stdenv.mkDerivation ({
     runHook postInstall
   '';
 
-  meta.platform = ocaml.meta.platform;
-
 } // args // {
 
   name = "ocaml${ocaml.version}-${pname}-${version}";
 
   buildInputs = [ ocaml dune findlib ] ++ buildInputs;
 
+  meta = (args.meta or {}) // { platforms = args.meta.platforms or ocaml.meta.platforms; };
+
 })
diff --git a/pkgs/development/interpreters/erlang/R21.nix b/pkgs/development/interpreters/erlang/R21.nix
index 1ca652eed660..965845c5a33a 100644
--- a/pkgs/development/interpreters/erlang/R21.nix
+++ b/pkgs/development/interpreters/erlang/R21.nix
@@ -1,8 +1,8 @@
 { mkDerivation }:
 
 mkDerivation rec {
-  version = "21.1.2";
-  sha256 = "0kn6ghr151b1qmbazc1c8k1r0wpsrqh9l3wrhfyxix3ld5yc3a5c";
+  version = "21.1.3";
+  sha256 = "0374qpafrpnfspsvjaa3sgs0h8ryi3ah8fvmr7dm7zsmgb4ihdsg";
 
   prePatch = ''
     substituteInPlace configure.in --replace '`sw_vers -productVersion`' '10.10'
diff --git a/pkgs/development/libraries/Xaw3d/default.nix b/pkgs/development/libraries/Xaw3d/default.nix
index 0a7f02f17e59..3e496b7e981f 100644
--- a/pkgs/development/libraries/Xaw3d/default.nix
+++ b/pkgs/development/libraries/Xaw3d/default.nix
@@ -8,6 +8,7 @@ stdenv.mkDerivation {
     url = https://www.x.org/releases/individual/lib/libXaw3d-1.6.3.tar.bz2;
     sha256 = "0i653s8g25cc0mimkwid9366bqkbyhdyjhckx7bw77j20hzrkfid";
   };
+  dontUseImakeConfigure = true;
   nativeBuildInputs = [ pkgconfig bison flex imake gccmakedep ];
   buildInputs = [ libXpm libXp ];
   propagatedBuildInputs = [ xlibsWrapper libXmu ];
diff --git a/pkgs/development/libraries/bootil/default.nix b/pkgs/development/libraries/bootil/default.nix
index b64cdd5245fd..0ed223832b6c 100644
--- a/pkgs/development/libraries/bootil/default.nix
+++ b/pkgs/development/libraries/bootil/default.nix
@@ -23,21 +23,21 @@ stdenv.mkDerivation rec {
     url = https://github.com/garrynewman/bootil/pull/22.patch;
     name = "github-pull-request-22.patch";
     sha256 = "1qf8wkv00pb9w1aa0dl89c8gm4rmzkxfl7hidj4gz0wpy7a24qa2";
-  })];
-
-  platform =
-    if stdenv.isLinux then "linux"
-    else if stdenv.isDarwin then "macosx"
-    else throw "unrecognized system ${stdenv.hostPlatform.system}";
-
-  buildInputs = [ premake4 ];
+  }) ];
+
+  # Avoid guessing where files end up. Just use current directory.
+  postPatch = ''
+    substituteInPlace projects/premake4.lua \
+      --replace 'location ( os.get() .. "/" .. _ACTION )' 'location ( ".." )'
+    substituteInPlace projects/bootil.lua \
+      --replace 'targetdir ( "../lib/" .. os.get() .. "/" .. _ACTION )' 'targetdir ( ".." )'
+  '';
 
-  configurePhase = "premake4 --file=projects/premake4.lua gmake";
-  makeFlags = "-C projects/${platform}/gmake";
+  nativeBuildInputs = [ premake4 ];
+  premakefile = "projects/premake4.lua";
 
   installPhase = ''
-    mkdir -p $out/lib
-    cp lib/${platform}/gmake/libbootil_static.a $out/lib/
-    cp -r include $out/
+    install -D libbootil_static.a $out/lib/libbootil_static.a
+    cp -r include $out
   '';
 }
diff --git a/pkgs/development/libraries/libngspice/default.nix b/pkgs/development/libraries/libngspice/default.nix
index 5a34910924ce..87382bd1ae21 100644
--- a/pkgs/development/libraries/libngspice/default.nix
+++ b/pkgs/development/libraries/libngspice/default.nix
@@ -3,11 +3,11 @@
 # Note that this does not provide the ngspice command-line utility. For that see
 # the ngspice derivation.
 stdenv.mkDerivation {
-  name = "libngspice-28";
+  name = "libngspice-29";
 
   src = fetchurl {
-    url = "mirror://sourceforge/ngspice/ngspice-28.tar.gz";
-    sha256 = "0rnz2rdgyav16w7wfn3sfrk2lwvvgz1fh0l9107zkcldijklz04l";
+    url = "mirror://sourceforge/ngspice/ngspice-29.tar.gz";
+    sha256 = "0jjwz73naq7l9yhwdqbpnrfckywp2ffkppivxjv8w92zq7xhyvcd";
   };
 
   nativeBuildInputs = [ flex bison ];
@@ -18,7 +18,7 @@ stdenv.mkDerivation {
   meta = with stdenv.lib; {
     description = "The Next Generation Spice (Electronic Circuit Simulator)";
     homepage = http://ngspice.sourceforge.net;
-    license = with licenses; [ "BSD" gpl2 ];
+    license = with licenses; [ bsd3 gpl2Plus lgpl2Plus ]; # See https://sourceforge.net/p/ngspice/ngspice/ci/master/tree/COPYING
     maintainers = with maintainers; [ bgamari ];
     platforms = platforms.linux;
   };
diff --git a/pkgs/development/libraries/osip/3.nix b/pkgs/development/libraries/osip/3.nix
deleted file mode 100644
index b485fa3e947b..000000000000
--- a/pkgs/development/libraries/osip/3.nix
+++ /dev/null
@@ -1,17 +0,0 @@
-{stdenv, fetchurl}:
-stdenv.mkDerivation rec {
-  version = "3.6.0";
-  src = fetchurl {
-    url = "mirror://gnu/osip/libosip2-${version}.tar.gz";
-    sha256 = "1kcndqvsyxgbhkksgydvvjw15znfq6jiznvw058d21h5fq68p8f9";
-  };
-  name = "libosip2-${version}";
-
-  meta = {
-    license = stdenv.lib.licenses.lgpl21Plus;
-    homepage = http://www.gnu.org/software/osip/;
-    description = "The GNU oSIP library, an implementation of the Session Initiation Protocol (SIP)";
-    maintainers = with stdenv.lib.maintainers; [ raskin ];
-    platforms = stdenv.lib.platforms.linux;
-  };
-}
diff --git a/pkgs/development/libraries/talloc/default.nix b/pkgs/development/libraries/talloc/default.nix
index 7c758d298357..745587609352 100644
--- a/pkgs/development/libraries/talloc/default.nix
+++ b/pkgs/development/libraries/talloc/default.nix
@@ -1,5 +1,6 @@
 { stdenv, fetchurl, python, pkgconfig, readline, libxslt
 , docbook_xsl, docbook_xml_dtd_42, fixDarwinDylibNames
+, buildPackages
 }:
 
 stdenv.mkDerivation rec {
@@ -10,10 +11,9 @@ stdenv.mkDerivation rec {
     sha256 = "1kk76dyav41ip7ddbbf04yfydb4jvywzi2ps0z2vla56aqkn11di";
   };
 
-  nativeBuildInputs = [ pkgconfig fixDarwinDylibNames ];
-  buildInputs = [
-    python readline libxslt docbook_xsl docbook_xml_dtd_42
-  ];
+  nativeBuildInputs = [ pkgconfig fixDarwinDylibNames python
+                        docbook_xsl docbook_xml_dtd_42 ];
+  buildInputs = [ readline libxslt ];
 
   prePatch = ''
     patchShebangs buildtools/bin/waf
@@ -23,10 +23,14 @@ stdenv.mkDerivation rec {
     "--enable-talloc-compat1"
     "--bundled-libraries=NONE"
     "--builtin-libraries=replace"
+  ] ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+    "--cross-compile"
+    "--cross-execute=${stdenv.hostPlatform.emulator buildPackages}"
   ];
+  configurePlatforms = [];
 
   postInstall = ''
-    ar q $out/lib/libtalloc.a bin/default/talloc_[0-9]*.o
+    ${stdenv.cc.targetPrefix}ar q $out/lib/libtalloc.a bin/default/talloc_[0-9]*.o
   '';
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/libraries/wlroots/default.nix b/pkgs/development/libraries/wlroots/default.nix
index 4aff60631834..efe7214ab6a1 100644
--- a/pkgs/development/libraries/wlroots/default.nix
+++ b/pkgs/development/libraries/wlroots/default.nix
@@ -7,7 +7,7 @@
 
 let
   pname = "wlroots";
-  version = "0.1";
+  version = "0.2";
   meson480 = meson.overrideAttrs (oldAttrs: rec {
     name = pname + "-" + version;
     pname = "meson";
@@ -17,8 +17,11 @@ let
       inherit pname version;
       sha256 = "0qawsm6px1vca3babnqwn0hmkzsxy4w0gi345apd2qk3v0cv7ipc";
     };
-    patches = builtins.filter # Remove gir-fallback-path.patch
-      (str: !(stdenv.lib.hasSuffix "gir-fallback-path.patch" str))
+    # Remove gir-fallback-path.patch and
+    # a87496addd9160300837aa50193f4798c6f1d251.patch (already in 0.48.0):
+    patches = builtins.filter
+      (str: !(stdenv.lib.hasSuffix "gir-fallback-path.patch" str
+              || stdenv.lib.hasSuffix "a87496addd9160300837aa50193f4798c6f1d251.patch" str))
       oldAttrs.patches;
   });
 in stdenv.mkDerivation rec {
@@ -28,13 +31,13 @@ in stdenv.mkDerivation rec {
     owner = "swaywm";
     repo = "wlroots";
     rev = version;
-    sha256 = "0xfipgg2qh2xcf3a1pzx8pyh1aqpb9rijdyi0as4s6fhgy4w269c";
+    sha256 = "0gfxawjlb736xl90zfv3n6zzf5n1cacgzflqi1zq1wn7wd3j6ppv";
   };
 
-  patches = [ (fetchpatch { # TODO: Only required for version 0.1
-    url = https://github.com/swaywm/wlroots/commit/be6210cf8216c08a91e085dac0ec11d0e34fb217.patch;
-    sha256 = "0njv7mr4ark603w79cxcsln29galh87vpzsx2dzkrl1x5x4i6cj5";
-  }) ];
+  postPatch = ''
+    substituteInPlace meson.build \
+      --replace "version: '0.1.0'" "version: '${version}.0'"
+  '';
 
   # $out for the library, $bin for rootston, and $examples for the example
   # programs (in examples) AND rootston
@@ -50,7 +53,7 @@ in stdenv.mkDerivation rec {
 
   mesonFlags = [
     "-Dlibcap=enabled" "-Dlogind=enabled" "-Dxwayland=enabled" "-Dx11-backend=enabled"
-    "-Dxcb-icccm=enabled" "-Dxcb-xkb=enabled" "-Dxcb-errors=enabled"
+    "-Dxcb-icccm=enabled" "-Dxcb-errors=enabled"
   ];
 
   postInstall = ''
diff --git a/pkgs/development/libraries/yojimbo/default.nix b/pkgs/development/libraries/yojimbo/default.nix
index 9bd20ee2607d..6305b6c03a46 100644
--- a/pkgs/development/libraries/yojimbo/default.nix
+++ b/pkgs/development/libraries/yojimbo/default.nix
@@ -15,9 +15,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ premake5 doxygen ];
   propagatedBuildInputs = [ libsodium mbedtls ];
 
-  buildPhase = ''
-    premake5 gmake
-    make all
+  postBuild = ''
     premake5 docs
   '';
 
@@ -28,6 +26,8 @@ stdenv.mkDerivation rec {
     cp -r docs/html $out/share/doc/yojimbo
   '';
 
+  doCheck = true;
+
   meta = with stdenv.lib; {
     description = "A network library for client/server games with dedicated servers";
     longDescription = ''
diff --git a/pkgs/development/ocaml-modules/csv/default.nix b/pkgs/development/ocaml-modules/csv/default.nix
index e10b21286ddf..bfddc8d1c662 100644
--- a/pkgs/development/ocaml-modules/csv/default.nix
+++ b/pkgs/development/ocaml-modules/csv/default.nix
@@ -2,11 +2,11 @@
 
 buildDunePackage rec {
   pname = "csv";
-	version = "2.1";
+	version = "2.2";
 
 	src = fetchurl {
 		url = "https://github.com/Chris00/ocaml-${pname}/releases/download/${version}/csv-${version}.tbz";
-		sha256 = "0cgfb6cwhwy7ypc1i3jyfz6sdnykp75aqi6kk0g1a2d81yjwzbcg";
+		sha256 = "1llwjdi14vvfy4966crapibq0djii71x47b0yxhjcl5jw4xnsaha";
 	};
 
 	meta = {
diff --git a/pkgs/development/ocaml-modules/opam-file-format/default.nix b/pkgs/development/ocaml-modules/opam-file-format/default.nix
index 1dec7e36e1c9..f61a690da190 100644
--- a/pkgs/development/ocaml-modules/opam-file-format/default.nix
+++ b/pkgs/development/ocaml-modules/opam-file-format/default.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchFromGitHub, ocaml, findlib }:
 
 stdenv.mkDerivation rec {
-  version = "2.0.0-rc2";
+  version = "2.0.0";
   name = "ocaml${ocaml.version}-opam-file-format-${version}";
 
   src = fetchFromGitHub {
     owner = "ocaml";
     repo = "opam-file-format";
     rev = "${version}";
-    sha256 = "05g0pikmifmfkwyws5x82fglgsz3d317yfn6nrz7zmpn22cirvir";
+    sha256 = "0fqb99asnair0043hhc8r158d6krv5nzvymd0xwycr5y72yrp0hv";
   };
 
   buildInputs = [ ocaml findlib ];
diff --git a/pkgs/development/ocaml-modules/visitors/default.nix b/pkgs/development/ocaml-modules/visitors/default.nix
index 506721f7bf5e..25a83fa79128 100644
--- a/pkgs/development/ocaml-modules/visitors/default.nix
+++ b/pkgs/development/ocaml-modules/visitors/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, ocaml, findlib, ocamlbuild, cppo, ppx_tools, ppx_deriving, result }:
 
 stdenv.mkDerivation {
-  name = "ocaml${ocaml.version}-visitors-20171124";
+  name = "ocaml${ocaml.version}-visitors-20180513";
 
   src = fetchurl {
-    url = http://gallium.inria.fr/~fpottier/visitors/visitors-20171124.tar.gz;
-    sha256 = "04047k2v0pgwcdkgw7jk4955pgil0nj2ji0zfhmlqrdbinyfqzac";
+    url = http://gallium.inria.fr/~fpottier/visitors/visitors-20180513.tar.gz;
+    sha256 = "12j8n9fkl43sd0j78x2zqix8m1vinswl2jgwndd62vmx98f5rl1v";
   };
 
   buildInputs = [ ocaml findlib ocamlbuild cppo ];
diff --git a/pkgs/development/python-modules/cairosvg/1_x.nix b/pkgs/development/python-modules/cairosvg/1_x.nix
new file mode 100644
index 000000000000..b6d40a5fdb70
--- /dev/null
+++ b/pkgs/development/python-modules/cairosvg/1_x.nix
@@ -0,0 +1,37 @@
+{ stdenv, buildPythonPackage, fetchFromGitHub, cairocffi, nose, fontconfig
+, cssselect2, defusedxml, pillow, tinycss2 }:
+
+# CairoSVG 2.x dropped support for Python 2 so offer CairoSVG 1.x as an
+# alternative
+buildPythonPackage rec {
+  pname = "CairoSVG";
+  version = "1.0.22";
+
+  # PyPI doesn't include tests so use GitHub
+  src = fetchFromGitHub {
+    owner = "Kozea";
+    repo = pname;
+    rev = version;
+    sha256 = "15z0cag5s79ghhrlgs5xc9ayvzzdr3v8151vf6k819f1drsfjfxl";
+  };
+
+  propagatedBuildInputs = [ cairocffi ];
+
+  checkInputs = [ nose fontconfig cssselect2 defusedxml pillow tinycss2 ];
+
+  # Almost all tests just fail. Not sure how to fix them.
+  doCheck = false;
+
+  # checkInputs = [ nose fontconfig cssselect2 defusedxml pillow tinycss2 ];
+
+  # checkPhase = ''
+  #   FONTCONFIG_FILE=${fontconfig.out}/etc/fonts/fonts.conf nosetests .
+  # '';
+
+  meta = with stdenv.lib; {
+    homepage = https://cairosvg.org;
+    license = licenses.lgpl3;
+    description = "SVG converter based on Cairo";
+    maintainers = with maintainers; [ jluttine ];
+  };
+}
diff --git a/pkgs/development/python-modules/datrie/default.nix b/pkgs/development/python-modules/datrie/default.nix
index f9ac491dc81d..eb654c650778 100644
--- a/pkgs/development/python-modules/datrie/default.nix
+++ b/pkgs/development/python-modules/datrie/default.nix
@@ -1,5 +1,5 @@
 { stdenv, buildPythonPackage, fetchPypi
-, pytest, pytestrunner, hypothesis}:
+, cython, pytest, pytestrunner, hypothesis }:
 
 buildPythonPackage rec {
   pname = "datrie";
@@ -10,8 +10,15 @@ buildPythonPackage rec {
     sha256 = "08r0if7dry2q7p34gf7ffyrlnf4bdvnprxgydlfxgfnvq8f3f4bs";
   };
 
+  nativeBuildInputs = [ cython ];
   buildInputs = [ pytest pytestrunner hypothesis ];
 
+  # recompile pxd and pyx for python37
+  # https://github.com/pytries/datrie/issues/52
+  preBuild = ''
+    ./update_c.sh
+  '';
+
   meta = with stdenv.lib; {
     description = "Super-fast, efficiently stored Trie for Python";
     homepage = "https://github.com/kmike/datrie";
diff --git a/pkgs/development/python-modules/gst-python/default.nix b/pkgs/development/python-modules/gst-python/default.nix
index 8cbc08dbbfd0..96da9bcf4f67 100644
--- a/pkgs/development/python-modules/gst-python/default.nix
+++ b/pkgs/development/python-modules/gst-python/default.nix
@@ -28,6 +28,17 @@ in buildPythonPackage rec {
       url = https://bugzilla.gnome.org/attachment.cgi?id=371989;
       sha256 = "1k46nvw175c1wvkqnx783i9d4w9vn431spcl48jb3y224jj3va08";
     })
+    # Fixes `from gi.repository import Gst` when gst-python's site-package is in
+    # PYTHONPATH
+    (fetchurl {
+      url = https://gitlab.freedesktop.org/gstreamer/gst-python/commit/d64bbc1e0c3c948c148f505cc5f856ce56732880.diff;
+      sha256 = "1n9pxmcl1x491mp47avpcw2a6n71lm0haz6mfas168prkgsk8q3r";
+    })
+    # Fixes python2 build from the above changes
+    (fetchurl {
+      url = https://gitlab.freedesktop.org/gstreamer/gst-python/commit/f79ac2d1434d7ba9717f3e943cfdc76e121eb5dd.diff;
+      sha256 = "17a164b0v36g0kwiqdlkjx6g0pjhcs6ilizck7iky8bgjnmiypm1";
+    })
   ];
 
   # TODO: First python_dep in meson.build needs to be removed
diff --git a/pkgs/development/python-modules/nose-focus/default.nix b/pkgs/development/python-modules/nose-focus/default.nix
new file mode 100644
index 000000000000..ef86a35b3041
--- /dev/null
+++ b/pkgs/development/python-modules/nose-focus/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, buildPythonPackage, fetchFromGitHub, six, nose, nose-of-yeti
+, nose-pattern-exclude, which }:
+
+buildPythonPackage rec {
+  pname = "nose-focus";
+  version = "0.1.3";
+
+  propagatedBuildInputs = [ six ];
+
+  checkInputs = [ nose nose-of-yeti nose-pattern-exclude which ];
+
+  # PyPI doesn't contain tests so let's use GitHub. See:
+  # https://github.com/delfick/nose-focus/issues/4
+  #
+  # However, the versions aren't tagged on GitHub so need to use a manually
+  # checked revision. See: https://github.com/delfick/nose-focus/issues/5
+  src = fetchFromGitHub {
+    owner = "delfick";
+    repo = pname;
+    rev = "4dac785ba07ed6e1df61b0fe2854685eef3bd115";
+    sha256 = "0gpd4j4433dc5ifh31w08c3bx862md0qm1ix6aam1rz4ayxpq51f";
+  };
+
+  checkPhase = ''
+    patchShebangs test.sh
+    ./test.sh
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Decorator and plugin to make nose focus on specific tests";
+    homepage = https://nose-focus.readthedocs.io/en/latest/;
+    license = licenses.wtfpl;
+    maintainers = with maintainers; [ jluttine ];
+  };
+}
diff --git a/pkgs/development/python-modules/nose-of-yeti/default.nix b/pkgs/development/python-modules/nose-of-yeti/default.nix
new file mode 100644
index 000000000000..7a783da31177
--- /dev/null
+++ b/pkgs/development/python-modules/nose-of-yeti/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, buildPythonPackage, fetchFromGitHub, six, nose, fudge, should-dsl }:
+
+buildPythonPackage rec {
+  pname = "nose-of-yeti";
+  version = "1.8";
+
+  propagatedBuildInputs = [ six ];
+
+  checkInputs = [ nose fudge should-dsl ];
+
+  # PyPI doesn't contain tests so let's use GitHub.
+  src = fetchFromGitHub {
+    owner = "delfick";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1pq9bf47k0csv41vdh2g6n336p3pd11q91hj5ypk0ls3nj756gbx";
+  };
+
+  checkPhase = ''
+    patchShebangs test.sh
+    ./test.sh
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Nose plugin providing BDD dsl for python";
+    homepage = https://github.com/delfick/nose-of-yeti;
+    license = licenses.mit;
+    maintainers = with maintainers; [ jluttine ];
+  };
+}
diff --git a/pkgs/development/python-modules/nose-pattern-exclude/default.nix b/pkgs/development/python-modules/nose-pattern-exclude/default.nix
new file mode 100644
index 000000000000..24d74b938afb
--- /dev/null
+++ b/pkgs/development/python-modules/nose-pattern-exclude/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, buildPythonPackage, fetchPypi, nose }:
+
+buildPythonPackage rec {
+  pname = "nose-pattern-exclude";
+  version = "0.1.3";
+
+  propagatedBuildInputs = [ nose ];
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "0apzxx8lavsdlxlpaxqw1snx5p7q8v5dfbip6v32f9pj2vyain1i";
+  };
+
+  # There are no tests
+  doCheck = false;
+
+  meta = with stdenv.lib; {
+    description = "Exclude specific files and directories from nosetests runs";
+    homepage = https://github.com/jakubroztocil/nose-pattern-exclude;
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ jluttine ];
+  };
+}
diff --git a/pkgs/development/python-modules/piexif/default.nix b/pkgs/development/python-modules/piexif/default.nix
index b5460e8b6080..0de96a3f585e 100644
--- a/pkgs/development/python-modules/piexif/default.nix
+++ b/pkgs/development/python-modules/piexif/default.nix
@@ -2,22 +2,15 @@
 
 buildPythonPackage rec {
   pname = "piexif";
-  version = "1.0.13";
+  version = "1.1.2";
 
-  # pillow needed for unit tests
-  buildInputs = [ pillow ];
-
-  postPatch = ''
-    # incompatibility with pillow => 4.2.0
-    # has been resolved in https://github.com/hMatoba/Piexif/commit/c3a8272f5e6418f223b25f6486d8ddda201bbdf1
-    # remove this in the next version
-    sed -i -e 's/RGBA/RGB/' tests/s_test.py
-  '';
+  # Pillow needed for unit tests
+  checkInputs = [ pillow ];
 
   src = fetchPypi {
     inherit pname version;
     extension = "zip";
-    sha256 = "1d3dde03bd6298393645bc11d585b67a6ea98fd7e9e1aded6d5d6ec3e4cfbdda";
+    sha256 = "0dj6wiw4mk65zn7p0qpghra39mf88m3ph2xn7ff9jvasgczrgkb0";
   };
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/python-modules/preggy/default.nix b/pkgs/development/python-modules/preggy/default.nix
new file mode 100644
index 000000000000..b88366de88fa
--- /dev/null
+++ b/pkgs/development/python-modules/preggy/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, buildPythonPackage, fetchPypi, six, unidecode, nose, yanc }:
+
+buildPythonPackage rec {
+  pname = "preggy";
+  version = "1.4.2";
+
+  propagatedBuildInputs = [ six unidecode ];
+  checkInputs = [ nose yanc ];
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "0g4ifjh01dkmdzs4621ahk8hpkngid1xxhl51jvzy4h4li4590hw";
+  };
+
+  checkPhase = ''
+    nosetests .
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Assertion library for Python";
+    homepage = http://heynemann.github.io/preggy/;
+    license = licenses.mit;
+    maintainers = with maintainers; [ jluttine ];
+  };
+}
diff --git a/pkgs/development/python-modules/pyres/default.nix b/pkgs/development/python-modules/pyres/default.nix
new file mode 100644
index 000000000000..2ea6043c4279
--- /dev/null
+++ b/pkgs/development/python-modules/pyres/default.nix
@@ -0,0 +1,45 @@
+{ stdenv, fetchPypi, buildPythonPackage, fetchFromGitHub, simplejson, redis, setproctitle, nose, pkgs }:
+
+let
+
+  # the requirements of `pyres` support Redis 3.x (due to a missing upper-bound),
+  # but it doesn't support Redis 3.x.
+  redis' = redis.overridePythonAttrs (old: rec {
+    pname = "redis";
+    version = "2.10.6";
+    src = fetchPypi {
+      inherit pname version;
+      sha256 = "03vcgklykny0g0wpvqmy8p6azi2s078317wgb2xjv5m2rs9sjb52";
+    };
+  });
+
+in
+
+buildPythonPackage rec {
+  pname = "pyres";
+  version = "1.5";
+
+  # ps is used in Worker.worker_pids method
+  propagatedBuildInputs = [ simplejson setproctitle redis' pkgs.ps ];
+  checkInputs = [ nose pkgs.redis ];
+
+  # PyPI tarball doesn't contain tests so let's use GitHub
+  src = fetchFromGitHub {
+    owner = "binarydud";
+    repo = pname;
+    rev = version;
+    sha256 = "1rkpv7gbjxl9h9g7kncmsrgmi77l7pgfq8d7dbnsr3ia2jmjqb8y";
+  };
+
+  checkPhase = ''
+    redis-server &
+    nosetests .
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Python resque clone";
+    homepage = https://github.com/binarydud/pyres;
+    license = licenses.mit;
+    maintainers = with maintainers; [ jluttine ];
+  };
+}
diff --git a/pkgs/development/python-modules/pyssim/default.nix b/pkgs/development/python-modules/pyssim/default.nix
new file mode 100644
index 000000000000..38dddda9b2e5
--- /dev/null
+++ b/pkgs/development/python-modules/pyssim/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, buildPythonPackage, fetchFromGitHub, numpy, scipy, pillow }:
+
+buildPythonPackage rec {
+  pname = "pyssim";
+  version = "0.4";
+
+  propagatedBuildInputs = [ numpy scipy pillow ];
+
+  # PyPI tarball doesn't contain test images so let's use GitHub
+  src = fetchFromGitHub {
+    owner = "jterrace";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0rnj3xdhma1fc0fg0jjsdy74ar0hgr3w8kygbnijqjdms7m3asqm";
+  };
+
+  # Tests are copied from .travis.yml
+  checkPhase = ''
+    $out/bin/pyssim test-images/test1-1.png test-images/test1-1.png | grep 1
+    $out/bin/pyssim test-images/test1-1.png test-images/test1-2.png | grep 0.998
+    $out/bin/pyssim test-images/test1-1.png "test-images/*" | grep -E " 1| 0.998| 0.672| 0.648" | wc -l | grep 4
+    $out/bin/pyssim --cw --width 128 --height 128 test-images/test1-1.png test-images/test1-1.png | grep 1
+    $out/bin/pyssim --cw --width 128 --height 128 test-images/test3-orig.jpg test-images/test3-rot.jpg | grep 0.938
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Module for computing Structured Similarity Image Metric (SSIM) in Python";
+    homepage = https://github.com/jterrace/pyssim;
+    license = licenses.mit;
+    maintainers = with maintainers; [ jluttine ];
+  };
+}
diff --git a/pkgs/development/python-modules/python-mnist/default.nix b/pkgs/development/python-modules/python-mnist/default.nix
new file mode 100644
index 000000000000..67cb4eae2511
--- /dev/null
+++ b/pkgs/development/python-modules/python-mnist/default.nix
@@ -0,0 +1,18 @@
+{ stdenv, buildPythonPackage, fetchPypi }:
+
+buildPythonPackage rec {
+  pname = "python-mnist";
+  version = "0.6";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "5d59a44335eccb4b310efb2ebb76f44e8588a1732cfb4923f4a502b61d8b653a";
+  };
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/sorki/python-mnist;
+    description = "Simple MNIST data parser written in Python";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ cmcdragonkai ];
+  };
+}
diff --git a/pkgs/development/python-modules/remotecv/default.nix b/pkgs/development/python-modules/remotecv/default.nix
new file mode 100644
index 000000000000..2102cf064250
--- /dev/null
+++ b/pkgs/development/python-modules/remotecv/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, buildPythonPackage, fetchFromGitHub, pillow, argparse, pyres, nose
+, preggy, numpy, yanc, nose-focus, mock, opencv }:
+
+buildPythonPackage rec {
+  pname = "remotecv";
+  version = "2.2.2";
+
+  propagatedBuildInputs = [ pillow argparse pyres ];
+
+  checkInputs = [ nose preggy numpy yanc nose-focus mock opencv ];
+
+  # PyPI tarball doesn't contain tests so let's use GitHub
+  src = fetchFromGitHub {
+    owner = "thumbor";
+    repo = pname;
+    rev = version;
+    sha256 = "0slalp1x626ajy2cbdfifhxf0ffzckqdz6siqsqr6s03hrl877hy";
+  };
+
+  # Remove unnecessary argparse dependency and some seemingly unnecessary
+  # version upper bounds because nixpkgs contains (or could contain) newer
+  # versions.
+  # See: https://github.com/thumbor/remotecv/issues/15
+  patches = [
+    ./install_requires.patch
+  ];
+
+  checkPhase = ''
+    nosetests --with-yanc -s tests/
+  '';
+
+  meta = with stdenv.lib; {
+    description = "OpenCV worker for facial and feature recognition";
+    homepage = https://github.com/thumbor/remotecv/wiki;
+    license = licenses.mit;
+    maintainers = with maintainers; [ jluttine ];
+  };
+}
diff --git a/pkgs/development/python-modules/remotecv/install_requires.patch b/pkgs/development/python-modules/remotecv/install_requires.patch
new file mode 100644
index 000000000000..37203128486e
--- /dev/null
+++ b/pkgs/development/python-modules/remotecv/install_requires.patch
@@ -0,0 +1,16 @@
+diff --git a/setup.py b/setup.py
+index 70f765c..8003cda 100644
+--- a/setup.py
++++ b/setup.py
+@@ -53,9 +53,8 @@ remotecv is an OpenCV worker for facial and feature recognition
+     },
+ 
+     install_requires=[
+-        "argparse>=1.2.1,<1.3.0",
+-        "pyres>=1.5,<1.6",
+-        "Pillow>=4.3.0,<5.2.0",
++        "pyres>=1.5",
++        "Pillow>=4.3.0",
+     ],
+ 
+     entry_points={
diff --git a/pkgs/development/python-modules/should-dsl/default.nix b/pkgs/development/python-modules/should-dsl/default.nix
new file mode 100644
index 000000000000..987d7e60cea6
--- /dev/null
+++ b/pkgs/development/python-modules/should-dsl/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, buildPythonPackage, fetchPypi }:
+
+buildPythonPackage rec {
+  pname = "should-dsl";
+  version = "2.1.2";
+
+  src = fetchPypi {
+    inherit version;
+    pname = "should_dsl";
+    sha256 = "0ai30dxgygwzaj9sgdzyfr9p5b7gwc9piq59nzr4xy5x1zcm7xrn";
+  };
+
+  # There are no tests
+  doCheck = false;
+
+  meta = with stdenv.lib; {
+    description = "Should assertions in Python as clear and readable as possible";
+    homepage = http://www.should-dsl.info/;
+    license = licenses.mit;
+    maintainers = with maintainers; [ jluttine ];
+  };
+}
diff --git a/pkgs/development/python-modules/thumbor/default.nix b/pkgs/development/python-modules/thumbor/default.nix
index ec33a5020d47..27e90514b729 100644
--- a/pkgs/development/python-modules/thumbor/default.nix
+++ b/pkgs/development/python-modules/thumbor/default.nix
@@ -1,6 +1,8 @@
-{ buildPythonPackage, tornado, pycrypto, pycurl, pytz
-, pillow, derpconf, python_magic, pexif, libthumbor, opencv, webcolors
-, piexif, futures, statsd, thumborPexif, fetchPypi, isPy3k, lib
+{ buildPythonPackage, python, tornado, pycrypto, pycurl, pytz
+, pillow, derpconf, python_magic, libthumbor, webcolors
+, piexif, futures, statsd, thumborPexif, fetchFromGitHub, isPy3k, lib
+, mock, raven, nose, yanc, remotecv, pyssim, cairosvg1, preggy, opencv3
+, pkgs, coreutils
 }:
 
 buildPythonPackage rec {
@@ -9,16 +11,40 @@ buildPythonPackage rec {
 
   disabled = isPy3k; # see https://github.com/thumbor/thumbor/issues/1004
 
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "1icfnzwzi5lvnh576n7v3r819jaw15ph9ja2w3fwg5z9qs40xvl8";
+  # Tests aren't included in PyPI tarball so use GitHub instead
+  src = fetchFromGitHub {
+    owner = pname;
+    repo = pname;
+    rev = version;
+    sha256 = "1ys5ymwbvgh2ir85g9nyrzzf8vgi16j6pzzi53b0rgjx0kwlmnxg";
   };
 
   postPatch = ''
     substituteInPlace "setup.py" \
       --replace '"argparse",' "" ${lib.optionalString isPy3k ''--replace '"futures",' ""''}
+    substituteInPlace "setup.py" \
+      --replace "piexif>=1.0.13,<1.1.0" "piexif>=1.0.13"
+    substituteInPlace "tests/test_utils.py" \
+      --replace "/bin/ls" "${coreutils}/bin/ls"
+    substituteInPlace "tests/detectors/test_face_detector.py" \
+      --replace "./thumbor" "$out/lib/${python.libPrefix}/site-packages/thumbor"
+    substituteInPlace "tests/detectors/test_glasses_detector.py" \
+      --replace "./thumbor" "$out/lib/${python.libPrefix}/site-packages/thumbor"
   '';
 
+  checkInputs = [
+    nose
+    pyssim
+    preggy
+    mock
+    yanc
+    remotecv
+    cairosvg1
+    raven
+    pkgs.redis
+    pkgs.glibcLocales
+  ];
+
   propagatedBuildInputs = [
     tornado
     pycrypto
@@ -27,18 +53,26 @@ buildPythonPackage rec {
     pillow
     derpconf
     python_magic
-    pexif
     libthumbor
-    opencv
+    opencv3
     webcolors
     piexif
     statsd
+    pkgs.exiftool
+    pkgs.libjpeg
+    pkgs.ffmpeg
+    pkgs.gifsicle
   ] ++ lib.optionals (!isPy3k) [ futures thumborPexif ];
 
-  # disabled due to too many impure tests and issues with native modules in
-  # the pure testing environment. See https://github.com/NixOS/nixpkgs/pull/37147
-  # for further reference.
-  doCheck = false;
+  # Remove the source tree before running nosetests because otherwise nosetests
+  # uses that instead of the installed package. Is there some other way to
+  # achieve this?
+  checkPhase = ''
+    redis-server --port 6668 --requirepass hey_you &
+    rm -r thumbor
+    export LC_ALL="en_US.UTF-8"
+    nosetests -v --with-yanc -s tests/
+  '';
 
   meta = with lib; {
     description = "A smart imaging service";
diff --git a/pkgs/development/python-modules/yanc/default.nix b/pkgs/development/python-modules/yanc/default.nix
new file mode 100644
index 000000000000..690b110fc93a
--- /dev/null
+++ b/pkgs/development/python-modules/yanc/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, buildPythonPackage, pythonOlder, fetchPypi, nose }:
+
+buildPythonPackage rec {
+  pname = "yanc";
+  version = "0.3.3";
+
+  # Tests fail on Python>=3.5. See: https://github.com/0compute/yanc/issues/10
+  disabled = !(pythonOlder "3.5");
+
+  checkInputs = [ nose ];
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "0z35bkk9phs40lf5061k1plhjdl5fskm0dmdikrsqi1bjihnxp8w";
+  };
+
+  checkPhase = ''
+    nosetests .
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Yet another nose colorer";
+    homepage = https://github.com/0compute/yanc;
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ jluttine ];
+  };
+}
diff --git a/pkgs/development/tools/misc/premake/3.nix b/pkgs/development/tools/misc/premake/3.nix
index 77f613868747..8b02bf96fd57 100644
--- a/pkgs/development/tools/misc/premake/3.nix
+++ b/pkgs/development/tools/misc/premake/3.nix
@@ -18,6 +18,9 @@ stdenv.mkDerivation {
     install -Dm755 bin/premake $out/bin/premake
   '';
 
+  premake_cmd = "premake3";
+  setupHook = ./setup-hook.sh;
+
   meta = {
     homepage = http://industriousone.com/premake;
     description = "A simple build configuration and project generation tool using lua";
diff --git a/pkgs/development/tools/misc/premake/5.nix b/pkgs/development/tools/misc/premake/5.nix
index 93220a02e2df..8ceb3d4a4367 100644
--- a/pkgs/development/tools/misc/premake/5.nix
+++ b/pkgs/development/tools/misc/premake/5.nix
@@ -31,6 +31,9 @@ stdenv.mkDerivation rec {
     install -Dm755 bin/release/premake5 $out/bin/premake5
   '';
 
+  premake_cmd = "premake5";
+  setupHook = ./setup-hook.sh;
+
   meta = {
     homepage = https://premake.github.io;
     description = "A simple build configuration and project generation tool using lua";
diff --git a/pkgs/development/tools/misc/premake/default.nix b/pkgs/development/tools/misc/premake/default.nix
index 770c80710953..99bf8cac81fa 100644
--- a/pkgs/development/tools/misc/premake/default.nix
+++ b/pkgs/development/tools/misc/premake/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation {
     sha256 = "1017rd0wsjfyq2jvpjjhpszaa7kmig6q1nimw76qx3cjz2868lrn";
   };
 
-  buildInputs = [ unzip ];
+  nativeBuildInputs = [ unzip ];
 
   buildPhase = ''
     make -C build/gmake.unix/
@@ -22,11 +22,14 @@ stdenv.mkDerivation {
     install -Dm755 bin/release/premake4 $out/bin/premake4
   '';
 
+  premake_cmd = "premake4";
+  setupHook = ./setup-hook.sh;
+
   meta = with stdenv.lib; {
     homepage = http://industriousone.com/premake;
     description = "A simple build configuration and project generation tool using lua";
     license = stdenv.lib.licenses.bsd3;
-    platforms = platforms.linux;
+    platforms = platforms.unix;
     maintainers = [ maintainers.bjornfor ];
   };
 }
diff --git a/pkgs/development/tools/misc/premake/setup-hook.sh b/pkgs/development/tools/misc/premake/setup-hook.sh
new file mode 100644
index 000000000000..ba06ea2c7617
--- /dev/null
+++ b/pkgs/development/tools/misc/premake/setup-hook.sh
@@ -0,0 +1,19 @@
+premakeConfigurePhase() {
+    runHook preConfigure
+
+    local flagsArray=(
+        ${premakefile:+--file=$premakefile}
+        $premakeFlags ${premakeFlagsArray[@]}
+        ${premakeBackend:-gmake}
+    )
+
+    echoCmd 'configure flags' "${flagsArray[@]}"
+
+    @premake_cmd@ "${flagsArray[@]}"
+
+    runHook postConfigure
+}
+
+if [ -z "$configurePhase" ]; then
+    configurePhase=premakeConfigurePhase
+fi
diff --git a/pkgs/development/tools/pipenv/default.nix b/pkgs/development/tools/pipenv/default.nix
index 7d4a58d0e394..46b77a2b9989 100644
--- a/pkgs/development/tools/pipenv/default.nix
+++ b/pkgs/development/tools/pipenv/default.nix
@@ -2,11 +2,11 @@
 with python3Packages; buildPythonApplication rec {
     name = "${pname}-${version}";
     pname = "pipenv";
-    version = "2018.10.13";
+    version = "2018.11.14";
 
     src = fetchPypi {
       inherit pname version;
-      sha256 = "0qwflq00rwk3pnldndb30f3avnbi4hvv6c8mm6l5xxnxy9dj71d7";
+      sha256 = "1ni2cjgm04dwi8a0376nzwwy3gklqk9d0hkl8d9j760lvqshsxjz";
     };
 
     LC_ALL = "en_US.UTF-8";
diff --git a/pkgs/development/tools/tychus/default.nix b/pkgs/development/tools/tychus/default.nix
new file mode 100644
index 000000000000..775e26eb6a8c
--- /dev/null
+++ b/pkgs/development/tools/tychus/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchFromGitHub, buildGoPackage, CoreFoundation }:
+
+buildGoPackage rec {
+  name = "tychus-${version}";
+  version = "0.6.3";
+
+  goPackagePath = "github.com/devlocker/tychus";
+  goDeps = ./deps.nix;
+  subPackages = [];
+
+  src = fetchFromGitHub {
+    owner = "devlocker";
+    repo = "tychus";
+    rev = "v${version}";
+    sha256 = "02ybxjsfga89gpg0k21zmykhhnpx1vy3ny8fcwj0qsg73i11alvw";
+  };
+
+  buildInputs = stdenv.lib.optionals stdenv.hostPlatform.isDarwin [ CoreFoundation ];
+
+  buildFlags = "--tags release";
+
+  meta = {
+    description = "Command line utility to live-reload your application.";
+    homepage = https://github.com/devlocker/tychus;
+    license = stdenv.lib.licenses.mit;
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/development/tools/tychus/deps.nix b/pkgs/development/tools/tychus/deps.nix
new file mode 100644
index 000000000000..194aa96ae3ce
--- /dev/null
+++ b/pkgs/development/tools/tychus/deps.nix
@@ -0,0 +1,30 @@
+# file generated from Gopkg.lock using dep2nix (https://github.com/nixcloud/dep2nix)
+[
+  {
+    goPackagePath  = "github.com/inconshreveable/mousetrap";
+    fetch = {
+      type = "git";
+      url = "https://github.com/inconshreveable/mousetrap";
+      rev =  "76626ae9c91c4f2a10f34cad8ce83ea42c93bb75";
+      sha256 = "1mn0kg48xkd74brf48qf5hzp0bc6g8cf5a77w895rl3qnlpfw152";
+    };
+  }
+  {
+    goPackagePath  = "github.com/spf13/cobra";
+    fetch = {
+      type = "git";
+      url = "https://github.com/spf13/cobra";
+      rev =  "f91529fc609202eededff4de2dc0ba2f662240a3";
+      sha256 = "10c3d5dp98rys134dnsl19ldj8bca183z91lj8rkbsy78qzrr9af";
+    };
+  }
+  {
+    goPackagePath  = "github.com/spf13/pflag";
+    fetch = {
+      type = "git";
+      url = "https://github.com/spf13/pflag";
+      rev =  "e57e3eeb33f795204c1ca35f56c44f83227c6e66";
+      sha256 = "13mhx4i913jil32j295m3a36jzvq1y64xig0naadiz7q9ja011r2";
+    };
+  }
+]
\ No newline at end of file
diff --git a/pkgs/games/boohu/default.nix b/pkgs/games/boohu/default.nix
index ccfdf8d905c2..2504e6935abd 100644
--- a/pkgs/games/boohu/default.nix
+++ b/pkgs/games/boohu/default.nix
@@ -3,13 +3,13 @@
 buildGoPackage rec {
 
   name = "boohu-${version}";
-  version = "0.11.0";
+  version = "0.11.1";
 
   goPackagePath = "git.tuxfamily.org/boohu/boohu.git";
 
   src = fetchurl {
     url = "https://download.tuxfamily.org/boohu/downloads/boohu-${version}.tar.gz";
-    sha256 = "1qc3mz1mj6byyslmx1afprg1l7x8rcy7i004sy32g590jaahwqdr";
+    sha256 = "0m0ajxiyx8qwxj2zq33s5qpjr65cr33f7dpirg6b4w4y9gyhhv1g";
   };
 
   buildFlags = "--tags ansi";
diff --git a/pkgs/games/gmad/default.nix b/pkgs/games/gmad/default.nix
index a15914877ccb..78936ec19499 100644
--- a/pkgs/games/gmad/default.nix
+++ b/pkgs/games/gmad/default.nix
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
     else if stdenv.isDarwin then "gmad_osx"
     else "gmad";
 
-  configurePhase = "premake4 --bootil_lib=${bootil}/lib --bootil_inc=${bootil}/include gmake";
+  premakeFlags = "--bootil_lib=${bootil}/lib --bootil_inc=${bootil}/include";
 
   installPhase = ''
     mkdir -p $out/bin
diff --git a/pkgs/games/tome4/default.nix b/pkgs/games/tome4/default.nix
index 3f6726a17f18..ec529676463f 100644
--- a/pkgs/games/tome4/default.nix
+++ b/pkgs/games/tome4/default.nix
@@ -25,9 +25,10 @@ in stdenv.mkDerivation rec {
     sha256 = "0mc5dgh2x9nbili7gy6srjhb23ckalf08wqq2amyjr5rq392jvd7";
   };
 
-  nativeBuildInputs = [ premake4 makeWrapper unzip ];
+  nativeBuildInputs = [ makeWrapper unzip premake4 ];
 
-  # tome4 vendors quite a few libraries so someone might want to look into avoiding that...
+  # tome4 vendors quite a few libraries so someone might want to look
+  # into avoiding that...
   buildInputs = [
     libGLU openal libpng libvorbis SDL2 SDL2_ttf SDL2_image
   ];
@@ -36,20 +37,11 @@ in stdenv.mkDerivation rec {
   enableParallelBuilding = false;
 
   NIX_CFLAGS_COMPILE = [
+    "-I${SDL2.dev}/include/SDL2"
     "-I${SDL2_image}/include/SDL2"
     "-I${SDL2_ttf}/include/SDL2"
   ];
 
-  postPatch = ''
-    substituteInPlace premake4.lua \
-      --replace "/opt/SDL-2.0/include/SDL2" "${SDL2.dev}/include/SDL2" \
-      --replace "/usr/include/GL" "/run/opengl-driver/include"
-  '';
-
-  preConfigure = ''
-    premake4 gmake
-  '';
-
   makeFlags = [ "config=release" ];
 
   # The wrapper needs to cd into the correct directory as tome4's detection of
diff --git a/pkgs/games/xsnow/default.nix b/pkgs/games/xsnow/default.nix
index 47a321c99b4a..07ed50d4e7b3 100644
--- a/pkgs/games/xsnow/default.nix
+++ b/pkgs/games/xsnow/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libXt, libXpm, libXext, imake }:
+{ stdenv, fetchurl, libXt, libXpm, libXext, imake, gccmakedep }:
 
 stdenv.mkDerivation rec {
 
@@ -10,25 +10,17 @@ stdenv.mkDerivation rec {
     sha256 = "06jnbp88wc9i9dbmy7kggplw4hzlx2bhghxijmlhkjlizgqwimyh";
   };
 
+  nativeBuildInputs = [ imake gccmakedep ];
   buildInputs = [
-    libXt libXpm libXext imake
+    libXt libXpm libXext
   ];
 
-  buildPhase = ''
-    xmkmf
-    make
-  '';
-
-  installPhase = ''
-    mkdir -p $out/bin $out/share/man/man1
-    cp xsnow $out/bin/
-    cp xsnow.1 $out/share/man/man1/
-  '';
+  makeFlags = [ "BINDIR=$(out)/bin" "MANPATH=$(out)/share/man" ];
 
   meta = {
     description = "An X-windows application that will let it snow on the root, in between and on windows";
     homepage = http://janswaal.home.xs4all.nl/Xsnow/;
     license = stdenv.lib.licenses.unfree;
     maintainers = [ stdenv.lib.maintainers.robberer ];
-  }; 
+  };
 }
diff --git a/pkgs/misc/screensavers/xautolock/default.nix b/pkgs/misc/screensavers/xautolock/default.nix
index 0c1446f0672f..cce4b351c577 100644
--- a/pkgs/misc/screensavers/xautolock/default.nix
+++ b/pkgs/misc/screensavers/xautolock/default.nix
@@ -1,4 +1,5 @@
-{ stdenv, fetchurl, xlibsWrapper, imake, libXScrnSaver, scrnsaverproto }:
+{ stdenv, fetchurl, xlibsWrapper
+, imake, gccmakedep, libXScrnSaver, scrnsaverproto }:
 
 stdenv.mkDerivation rec {
   name = "xautolock-2.2";
@@ -14,10 +15,13 @@ stdenv.mkDerivation rec {
     })
   ];
   NIX_CFLAGS_COMPILE = "-DSYSV";
-  makeFlags="BINDIR=\${out}/bin MANPATH=\${out}/man";
-  preBuild = "xmkmf";
+  makeFlags = [
+    "BINDIR=$(out)/bin"
+    "MANPATH=$(out)/share/man"
+  ];
   installTargets = "install install.man";
-  buildInputs = [xlibsWrapper imake libXScrnSaver scrnsaverproto];
+  nativeBuildInputs = [ imake gccmakedep ];
+  buildInputs = [ xlibsWrapper libXScrnSaver scrnsaverproto ];
   meta = with stdenv.lib; {
     description = "A program that launches a given program when your X session has been idle for a given time.";
     homepage = http://www.ibiblio.org/pub/linux/X11/screensavers;
diff --git a/pkgs/misc/themes/nordic/default.nix b/pkgs/misc/themes/nordic/default.nix
index c375e21e3aec..ac24e35c66f7 100644
--- a/pkgs/misc/themes/nordic/default.nix
+++ b/pkgs/misc/themes/nordic/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     })
     (fetchurl {
       url = "https://github.com/EliverLara/Nordic/releases/download/v${version}/Nordic-standard-buttons.tar.xz";
-      sha256 = "0xnj1am1q26xppp8y07iik648hhgn3gmzqvkdhg3il4qnkndjvld";
+      sha256 = "1h0690cijaipidb5if2bxhvvkrx5src3akyxvfywxg4bf8x7jxs5";
     })
   ];
 
diff --git a/pkgs/os-specific/linux/fusionio/srcs.nix b/pkgs/os-specific/linux/fusionio/srcs.nix
deleted file mode 100644
index fb632a6e9fba..000000000000
--- a/pkgs/os-specific/linux/fusionio/srcs.nix
+++ /dev/null
@@ -1,22 +0,0 @@
-{ fetchurl }:
-rec {
-  version = "3.2.10";
-
-  libvsl = fetchurl {
-    name = "fusionio-libvsl-${version}.deb";
-    url = "https://drive.google.com/uc?export=download&id=0B7U0_ZBLoB2Wc01uNk1nVURMVFk";
-    sha256 = "1i8ii9dlyskj2dvad7nfvlm1wz2s4gy5llbl29hfa13w6nhcl5wk";
-  };
-
-  util = fetchurl {
-    name = "fusionio-util-${version}.deb";
-    url = "https://drive.google.com/uc?export=download&id=0B7U0_ZBLoB2WbDVuQkwzWjZONGs";
-    sha256 = "0aw64kk5cwchjhqh5n1lpqrrh5gn4qdalnmasd25z7sijy2flxgq";
-  };
-
-  vsl = fetchurl {
-    name = "fusionio-iomemory-vsl-${version}.tar.gz";
-    url = "https://drive.google.com/uc?export=download&id=0B7U0_ZBLoB2WbXFMbExEMUFCcWM";
-    sha256 = "1zm20aa1jmmqcqkb4p9r4jsgbg371zr1abdz32rw02i9687fsgcc";
-  };
-}
diff --git a/pkgs/os-specific/linux/fusionio/util.nix b/pkgs/os-specific/linux/fusionio/util.nix
deleted file mode 100644
index 6327a95f39d7..000000000000
--- a/pkgs/os-specific/linux/fusionio/util.nix
+++ /dev/null
@@ -1,45 +0,0 @@
-{ stdenv, fetchurl, dpkg, glibc, gcc, libuuid }:
-
-let
-  srcs = import ./srcs.nix { inherit fetchurl; };
-in
-stdenv.mkDerivation {
-  name = "fusionio-util-${srcs.version}";
-
-  nativeBuildInputs = [ dpkg ];
-
-  buildCommand = ''
-    dpkg-deb -R ${srcs.libvsl} $TMPDIR
-    dpkg-deb -R ${srcs.util} $TMPDIR
-
-    rm $TMPDIR/usr/bin/fio-{bugreport,sanitize}
-
-    mkdir -p $out
-    cp -r $TMPDIR/{etc,usr/{bin,lib,share}} $out
-    for BIN in $(find $out/bin -type f); do
-      echo Patching $BIN
-      patchelf --set-interpreter "${glibc.out}/lib/ld-linux-x86-64.so.2" --set-rpath "${stdenv.lib.makeLibraryPath [ glibc gcc.cc libuuid ] }:$out/lib" $BIN
-
-      # Test our binary to see if it was correctly patched
-      set +e
-      $BIN --help >/dev/null 2>&1
-      ST="$?"
-      set -e
-      if [ "$ST" -ge "10" ]; then
-        echo "Failed testing $BIN"
-        exit 1;
-      fi
-    done
-  '';
-
-  dontStrip = true;
-
-  meta = with stdenv.lib; {
-    homepage = http://fusionio.com;
-    description = "Fusionio command line utilities";
-    license = licenses.unfree;
-    platforms = [ "x86_64-linux" ];
-    broken = stdenv.hostPlatform.system != "x86_64-linux";
-    maintainers = with maintainers; [ wkennington ];
-  };
-}
diff --git a/pkgs/os-specific/linux/fusionio/vsl-fix-file-inode.patch b/pkgs/os-specific/linux/fusionio/vsl-fix-file-inode.patch
deleted file mode 100644
index 25887ceee0f6..000000000000
--- a/pkgs/os-specific/linux/fusionio/vsl-fix-file-inode.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/kfile.c b/kfile.c
-index 5014e77..a65d921 100644
---- a/kfile.c
-+++ b/kfile.c
-@@ -51,7 +51,7 @@ fusion_inode * noinline kfio_fs_inode(fusion_file *fp)
- #if KFIOC_STRUCT_FILE_HAS_PATH
-     return (fusion_inode *) ((struct file *)fp)->f_path.dentry->d_inode;
- #else
--    return (fusion_inode *) ((struct file *)fp)->f_dentry->d_inode;
-+    return (fusion_inode *) file_inode((struct file *)fp);
- #endif
- }
- 
diff --git a/pkgs/os-specific/linux/fusionio/vsl.nix b/pkgs/os-specific/linux/fusionio/vsl.nix
deleted file mode 100644
index 6ebe2e0cdaf5..000000000000
--- a/pkgs/os-specific/linux/fusionio/vsl.nix
+++ /dev/null
@@ -1,39 +0,0 @@
-{ stdenv, fetchurl, kernel }:
-
-let
-  srcs = import ./srcs.nix { inherit fetchurl; };
-in
-stdenv.mkDerivation rec {
-  name = "fusionio-iomemory-vsl-${srcs.version}";
-
-  src = srcs.vsl;
-
-  hardeningDisable = [ "pic" ];
-
-  prePatch = ''
-    cd root/usr/src/iomemory-vsl-*
-  '';
-
-  patches = stdenv.lib.optional (stdenv.lib.versionAtLeast kernel.version "3.19") ./vsl-fix-file-inode.patch;
-
-  preBuild = ''
-    sed -i Makefile kfio_config.sh \
-      -e "s,\(KERNELDIR=\"\|KERNEL_SRC =\)[^\"]*,\1${kernel.dev}/lib/modules/${kernel.modDirVersion}/build,g"
-    export DKMS_KERNEL_VERSION=${kernel.modDirVersion}
-    export TARGET="x86_64_cc48"
-  '';
-
-  installPhase = ''
-    export INSTALL_ROOT=$out
-    make modules_install
-  '';
-
-  meta = with stdenv.lib; {
-    homepage = http://fusionio.com;
-    description = "Kernel driver for accessing fusion-io cards";
-    license = licenses.unfree;
-    platforms = [ "x86_64-linux" ];
-    broken = stdenv.hostPlatform.system != "x86_64-linux";
-    maintainers = with maintainers; [ wkennington ];
-  };
-}
diff --git a/pkgs/os-specific/linux/kernel/common-config.nix b/pkgs/os-specific/linux/kernel/common-config.nix
index b94e34c8f6c4..ec9aed402bf4 100644
--- a/pkgs/os-specific/linux/kernel/common-config.nix
+++ b/pkgs/os-specific/linux/kernel/common-config.nix
@@ -641,6 +641,7 @@ let
       MEGARAID_NEWGEN       = yes;
 
       MLX4_EN_VXLAN = whenOlder "4.8" yes;
+      MLX5_CORE_EN       = option yes;
 
       MODVERSIONS        = whenOlder "4.9" yes;
       MOUSE_PS2_ELANTECH = yes; # Elantech PS/2 protocol extension
diff --git a/pkgs/os-specific/linux/reptyr/default.nix b/pkgs/os-specific/linux/reptyr/default.nix
index d8880542e518..37f1362e14ea 100644
--- a/pkgs/os-specific/linux/reptyr/default.nix
+++ b/pkgs/os-specific/linux/reptyr/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ stdenv, lib, fetchFromGitHub }:
 
 stdenv.mkDerivation rec {
   version = "0.6.2";
@@ -20,9 +20,15 @@ stdenv.mkDerivation rec {
 
   makeFlags = ["PREFIX=$(out)"];
   meta = {
-    platforms = [ "i686-linux" "x86_64-linux" ];
-    maintainers = with stdenv.lib.maintainers; [raskin];
-    license = stdenv.lib.licenses.mit;
-    description = ''A Linux tool to change controlling pty of a process'';
+    platforms = [
+      "i686-linux"
+      "x86_64-linux"
+      "i686-freebsd"
+      "x86_64-freebsd"
+    ] ++ lib.platforms.arm;
+    maintainers = with lib.maintainers; [raskin];
+    license = lib.licenses.mit;
+    description = "Reparent a running program to a new terminal";
+    homepage = https://github.com/nelhage/reptyr;
   };
 }
diff --git a/pkgs/servers/jackett/default.nix b/pkgs/servers/jackett/default.nix
index 9f297873dd0c..b33285384960 100644
--- a/pkgs/servers/jackett/default.nix
+++ b/pkgs/servers/jackett/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "jackett-${version}";
-  version = "0.10.446";
+  version = "0.10.471";
 
   src = fetchurl {
     url = "https://github.com/Jackett/Jackett/releases/download/v${version}/Jackett.Binaries.Mono.tar.gz";
-    sha256 = "1vmgywklax5br3pynjp5b74l2mkmhk3njiccjrl0l7j8ikyar1fw";
+    sha256 = "0la05akvpvfg9jdgfd39wnc87zi7axzx7499w9m3py7qqqyvgyin";
   };
 
   buildInputs = [ makeWrapper ];
diff --git a/pkgs/servers/nas/default.nix b/pkgs/servers/nas/default.nix
index 9b8402ec0e08..86f75a21359d 100644
--- a/pkgs/servers/nas/default.nix
+++ b/pkgs/servers/nas/default.nix
@@ -16,12 +16,9 @@ in stdenv.mkDerivation {
 
   buildInputs = [ xproto libXau libXt libXext libXaw libXpm ];
 
-  buildPhase = ''
-    xmkmf
-    make WORLDOPTS="" World
-  '';
+  buildFlags = [ "WORLDOPTS=" "World" ];
 
-  installFlags = "LDLIBS=-lfl DESTDIR=\${out}";
+  installFlags = [ "LDLIBS=-lfl" "DESTDIR=${placeholder "out"}" ];
 
   postInstall = ''
     mv $out/${xorgcffiles}/* $out
diff --git a/pkgs/servers/roundcube/default.nix b/pkgs/servers/roundcube/default.nix
index 40afd7043e41..c0648f5183d9 100644
--- a/pkgs/servers/roundcube/default.nix
+++ b/pkgs/servers/roundcube/default.nix
@@ -1,13 +1,13 @@
 { lib, stdenv, fetchzip }:
 let
-  version = "1.3.7";
+  version = "1.3.8";
 in
 fetchzip rec {
   name= "roundcube-${version}";
 
-  url = "https://github.com/roundcube/roundcubemail/releases/download/${version}/roundcubemail-${version}-complete.tar.gz"; 
-  sha256 = "0xwqy0adynx7066a0cvz9vyg85waax1i4p70kcdkz7q5jnw4jzhf";
- 
+  url = "https://github.com/roundcube/roundcubemail/releases/download/${version}/roundcubemail-${version}-complete.tar.gz";
+  sha256 = "1lhwr13bglm8rqgamnb480b07wpqhw9bskjj2xxb0x8kdjly29ks";
+
   extraPostFetch = ''
     ln -sf /etc/roundcube/config.inc.php $out/config/config.inc.php
     rm -rf $out/installer
diff --git a/pkgs/servers/sql/cockroachdb/default.nix b/pkgs/servers/sql/cockroachdb/default.nix
index aba997d75f13..6f4b10759e31 100644
--- a/pkgs/servers/sql/cockroachdb/default.nix
+++ b/pkgs/servers/sql/cockroachdb/default.nix
@@ -1,18 +1,28 @@
-{ stdenv, buildGoPackage, fetchurl, cmake, xz, which, autoconf, ncurses6, libedit }:
+{ stdenv, buildGoPackage, fetchurl
+, cmake, xz, which, autoconf
+, ncurses6, libedit, libunwind
+}:
 
+let
+  darwinDeps = [ libunwind libedit ];
+  linuxDeps  = [ ncurses6 ];
+
+  buildInputs = if stdenv.isDarwin then darwinDeps else linuxDeps;
+  nativeBuildInputs = [ cmake xz which autoconf ];
+
+in
 buildGoPackage rec {
   name = "cockroach-${version}";
-  version = "2.0.0";
+  version = "2.1.1";
 
   goPackagePath = "github.com/cockroachdb/cockroach";
 
   src = fetchurl {
     url = "https://binaries.cockroachdb.com/cockroach-v${version}.src.tgz";
-    sha256 = "0x8hf5qwvgb2w6dcnvy20v77nf19f0l1pb40jf31rm72xhk3bwvy";
+    sha256 = "1z34zlwznh4lgbc1ryn577w7mmycyjbmz28k1hhhb6ricmk1x847";
   };
 
-  buildInputs = [ (if stdenv.isDarwin then libedit else ncurses6) ];
-  nativeBuildInputs = [ cmake xz which autoconf ];
+  inherit nativeBuildInputs buildInputs;
 
   buildPhase = ''
     runHook preBuild
@@ -21,24 +31,34 @@ buildGoPackage rec {
     make buildoss
     cd src/${goPackagePath}
     for asset in man autocomplete; do
-      ./cockroach gen $asset
+      ./cockroachoss gen $asset
     done
     runHook postBuild
   '';
 
   installPhase = ''
     runHook preInstall
-    install -D cockroach $bin/bin/cockroach
+
+    install -D cockroachoss $bin/bin/cockroach
     install -D cockroach.bash $bin/share/bash-completion/completions/cockroach.bash
-    cp -r man $bin/share/man
+
+    mkdir -p $man/share/man
+    cp -r man $man/share/man
+
     runHook postInstall
   '';
 
+  # Unfortunately we have to keep an empty reference to $out, because it seems
+  # buildGoPackages only nukes references to the go compiler under $bin, effectively
+  # making all binary output under $bin mandatory. Ideally, we would just use
+  # $out and $man and remove $bin since there's no point in an empty path. :(
+  outputs = [ "bin" "man" "out" ];
+
   meta = with stdenv.lib; {
-    homepage = https://www.cockroachlabs.com;
+    homepage    = https://www.cockroachlabs.com;
     description = "A scalable, survivable, strongly-consistent SQL database";
-    license = licenses.asl20;
-    platforms = [ "x86_64-linux" "x86_64-darwin" ];
-    maintainers = [ maintainers.rushmorem ];
+    license     = licenses.asl20;
+    platforms   = [ "x86_64-linux" "aarch64-linux" "x86_64-darwin" ];
+    maintainers = with maintainers; [ rushmorem thoughtpolice ];
   };
 }
diff --git a/pkgs/servers/x11/xorg/darwin-imake-setup-hook.sh b/pkgs/servers/x11/xorg/darwin-imake-setup-hook.sh
deleted file mode 100644
index 6dbaf724092b..000000000000
--- a/pkgs/servers/x11/xorg/darwin-imake-setup-hook.sh
+++ /dev/null
@@ -1 +0,0 @@
-export IMAKECPP="@tradcpp@/bin/tradcpp"
diff --git a/pkgs/servers/x11/xorg/imake-setup-hook.sh b/pkgs/servers/x11/xorg/imake-setup-hook.sh
new file mode 100644
index 000000000000..10f54198f7fb
--- /dev/null
+++ b/pkgs/servers/x11/xorg/imake-setup-hook.sh
@@ -0,0 +1,19 @@
+export IMAKECPP="@tradcpp@/bin/tradcpp"
+
+imakeConfigurePhase() {
+    runHook preConfigure
+
+    echoCmd 'configuring with imake'
+
+    if [ -z "${imakefile:-}" -a ! -e Imakefile ]; then
+        echo "no Imakefile, doing nothing"
+    else
+        xmkmf -a
+    fi
+
+    runHook postConfigure
+}
+
+if [ -z "$dontUseImakeConfigure" -a -z "$configurePhase" ]; then
+    configurePhase=imakeConfigurePhase
+fi
diff --git a/pkgs/servers/x11/xorg/overrides.nix b/pkgs/servers/x11/xorg/overrides.nix
index 8f4c251335a9..48e67ac74a80 100644
--- a/pkgs/servers/x11/xorg/overrides.nix
+++ b/pkgs/servers/x11/xorg/overrides.nix
@@ -63,12 +63,12 @@ self: super:
     inherit (self) xorgcffiles;
     x11BuildHook = ./imake.sh;
     patches = [./imake.patch ./imake-cc-wrapper-uberhack.patch];
-    setupHook = if stdenv.isDarwin then ./darwin-imake-setup-hook.sh else null;
-    CFLAGS = [ "-DIMAKE_COMPILETIME_CPP=\\\"${if stdenv.isDarwin
+    setupHook = ./imake-setup-hook.sh;
+    CFLAGS = [ ''-DIMAKE_COMPILETIME_CPP='"${if stdenv.isDarwin
       then "${tradcpp}/bin/cpp"
-      else "gcc"}\\\""
+      else "gcc"}"' ''
     ];
-    tradcpp = if stdenv.isDarwin then tradcpp else null;
+    inherit tradcpp;
   });
 
   mkfontdir = super.mkfontdir.overrideAttrs (attrs: {
diff --git a/pkgs/stdenv/generic/make-derivation.nix b/pkgs/stdenv/generic/make-derivation.nix
index fa0d4ea405e2..f3c4afb613e6 100644
--- a/pkgs/stdenv/generic/make-derivation.nix
+++ b/pkgs/stdenv/generic/make-derivation.nix
@@ -98,7 +98,7 @@ rec {
                                       ++ depsTargetTarget ++ depsTargetTargetPropagated) == 0;
       dontAddHostSuffix = attrs ? outputHash && !noNonNativeDeps || stdenv.cc == null;
       supportedHardeningFlags = [ "fortify" "stackprotector" "pie" "pic" "strictoverflow" "format" "relro" "bindnow" ];
-      defaultHardeningFlags = if stdenv.targetPlatform.isMusl
+      defaultHardeningFlags = if stdenv.hostPlatform.isMusl
                               then supportedHardeningFlags
                               else lib.remove "pie" supportedHardeningFlags;
       enabledHardeningOptions =
diff --git a/pkgs/test/cross/default.nix b/pkgs/test/cross/default.nix
index 6f41447ca76a..622799106cd2 100644
--- a/pkgs/test/cross/default.nix
+++ b/pkgs/test/cross/default.nix
@@ -1,12 +1,11 @@
-{ pkgs, pkgsCross, lib }:
+{ pkgs, lib }:
 
 let
 
-  emulators = {
-    mingw32 = "WINEDEBUG=-all ${pkgs.winePackages.minimal}/bin/wine";
-    mingwW64 = "WINEDEBUG=-all ${pkgs.wineWowPackages.minimal}/bin/wine";
-    # TODO: add some qemu-based emulaltors here
-  };
+  testedSystems = lib.filterAttrs (name: value: let
+    platform = lib.systems.elaborate value;
+  in platform.isLinux || platform.isWindows
+  ) lib.systems.examples;
 
   getExecutable = pkgs: pkgFun: exec:
     "${pkgFun pkgs}${exec}${pkgs.hostPlatform.extensions.executable}";
@@ -17,6 +16,10 @@ let
   in pkgs.runCommand "test-${pkgName}-${crossPkgs.hostPlatform.config}" {
     nativeBuildInputs = [ pkgs.dos2unix ];
   } ''
+    # Just in case we are using wine, get rid of that annoying extra
+    # stuff.
+    export WINEDEBUG=-all
+
     HOME=$(pwd)
     mkdir -p $out
 
@@ -44,29 +47,29 @@ let
     fi
   '';
 
-in
+  mapMultiPlatformTest = test: lib.mapAttrs (name: system: test rec {
+    crossPkgs = import pkgs.path {
+      localSystem = { inherit (pkgs.hostPlatform) config; };
+      crossSystem = system;
+    };
 
-lib.mapAttrs (name: emulator: let
-  crossPkgs = pkgsCross.${name};
+    emulator = crossPkgs.hostPlatform.emulator pkgs;
 
-  # Apply some transformation on windows to get dlls in the right
-  # place. Unfortunately mingw doesn’t seem to be able to do linking
-  # properly.
-  platformFun = pkg: if crossPkgs.hostPlatform.isWindows then
-    pkgs.buildEnv {
-      name = "${pkg.name}-winlinks";
-      paths = [pkg] ++ pkg.buildInputs;
-    } else pkg;
-in {
+    # Apply some transformation on windows to get dlls in the right
+    # place. Unfortunately mingw doesn’t seem to be able to do linking
+    # properly.
+    platformFun = pkg: if crossPkgs.hostPlatform.isWindows then
+      pkgs.buildEnv {
+        name = "${pkg.name}-winlinks";
+        paths = [pkg] ++ pkg.buildInputs;
+      } else pkg;
+  }) testedSystems;
 
-  hello = compareTest {
-    inherit emulator crossPkgs;
-    hostPkgs = pkgs;
-    exec = "/bin/hello";
-    pkgFun = pkgs: pkgs.hello;
-  };
+in
+
+lib.mapAttrs (_: mapMultiPlatformTest) {
 
-  file = compareTest {
+  file = {platformFun, crossPkgs, emulator}: compareTest {
     inherit emulator crossPkgs;
     hostPkgs = pkgs;
     exec = "/bin/file";
@@ -77,4 +80,11 @@ in {
     pkgFun = pkgs: platformFun pkgs.file;
   };
 
-}) emulators
+  hello = {platformFun, crossPkgs, emulator}: compareTest {
+    inherit emulator crossPkgs;
+    hostPkgs = pkgs;
+    exec = "/bin/hello";
+    pkgFun = pkgs: pkgs.hello;
+  };
+
+}
diff --git a/pkgs/tools/X11/x2x/default.nix b/pkgs/tools/X11/x2x/default.nix
index 24cf4f6b2e16..0c3538a0db9c 100644
--- a/pkgs/tools/X11/x2x/default.nix
+++ b/pkgs/tools/X11/x2x/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, imake, libX11, libXtst, libXext}:
+{ stdenv, fetchurl, imake, libX11, libXtst, libXext, gccmakedep }:
 
 stdenv.mkDerivation {
   name = "x2x-1.27";
@@ -8,20 +8,16 @@ stdenv.mkDerivation {
     sha256 = "0dha0kn1lbc4as0wixsvk6bn4innv49z9a0sm5wlx4q1v0vzqzyj";
   };
 
-  buildInputs = [ imake libX11 libXtst libXext ];
+  nativeBuildInputs = [ imake gccmakedep ];
+  buildInputs = [ libX11 libXtst libXext ];
 
   hardeningDisable = [ "format" ];
 
-  configurePhase = ''
-    xmkmf
-    makeFlags="BINDIR=$out/bin x2x"
-  '';
+  buildFlags = [ "x2x" ];
 
   installPhase = ''
-    mkdir -p $out/bin
-    mkdir -p $out/man/man1
-    cp x2x $out/bin/
-    cp x2x.1 $out/man/man1/
+    install -D x2x $out/bin/x2x
+    install -D x2x.1 $out/man/man1/x2x.1
   '';
 
   meta = with stdenv.lib; {
diff --git a/pkgs/tools/X11/xbrightness/default.nix b/pkgs/tools/X11/xbrightness/default.nix
index f4112765e675..2857ea6c7be4 100644
--- a/pkgs/tools/X11/xbrightness/default.nix
+++ b/pkgs/tools/X11/xbrightness/default.nix
@@ -1,4 +1,5 @@
-{ stdenv, fetchurl, xorg }:
+{ stdenv, fetchurl, imake, gccmakedep
+, libX11, libXaw, libXext, libXmu, libXpm, libXxf86vm  }:
 
 stdenv.mkDerivation {
 
@@ -8,22 +9,11 @@ stdenv.mkDerivation {
     sha256 = "2564dbd393544657cdabe4cbf535d9cfb9abe8edddb1b8cdb1ed4d12f358626e";
   };
 
-  buildInputs = [
-    xorg.imake
-    xorg.libX11
-    xorg.libXaw
-    xorg.libXext
-    xorg.libXmu
-    xorg.libXpm
-    xorg.libXxf86vm
-  ];
+  nativeBuildInputs = [ imake gccmakedep ];
+  buildInputs = [ libX11 libXaw libXext libXmu libXpm libXxf86vm ];
 
-  configurePhase = "xmkmf";
-
-  installPhase = ''
-    make install BINDIR=$out/bin
-    make install.man MANPATH=$out/share/man
-  '';
+  makeFlags = [ "BINDIR=$(out)/bin" "MANPATH=$(out)/share/man" ];
+  installTargets = "install install.man";
 
   meta = {
     description = "X11 brigthness and gamma software control";
diff --git a/pkgs/tools/X11/xvkbd/default.nix b/pkgs/tools/X11/xvkbd/default.nix
index 06824f882a44..6ccc8a24caee 100644
--- a/pkgs/tools/X11/xvkbd/default.nix
+++ b/pkgs/tools/X11/xvkbd/default.nix
@@ -1,4 +1,5 @@
-{ stdenv, fetchurl, imake, libXt, libXaw, libXtst, libXi, libXpm, xextproto, gccmakedep, Xaw3d }:
+{ stdenv, fetchurl, imake, libXt, libXaw, libXtst
+, libXi, libXpm, xextproto, gccmakedep, Xaw3d }:
 
 stdenv.mkDerivation rec {
   name = "xvkbd-${version}";
@@ -8,12 +9,14 @@ stdenv.mkDerivation rec {
     sha256 = "17csj6x5zm3g67izfwhagkal1rbqzpw09lqmmlyrjy3vzgfkf75q";
   };
 
-  buildInputs = [ imake libXt libXaw libXtst xextproto libXi Xaw3d libXpm gccmakedep ];
+  nativeBuildInputs = [ imake gccmakedep ];
+  buildInputs = [ libXt libXaw libXtst xextproto libXi Xaw3d libXpm ];
   installTargets = [ "install" "install.man" ];
-  preBuild = ''
-    makeFlagsArray=( BINDIR=$out/bin XAPPLOADDIR=$out/etc/X11/app-defaults MANPATH=$out/man )
-  '';
-  configurePhase = '' xmkmf -a '';
+  makeFlags = [
+    "BINDIR=$(out)/bin"
+    "XAPPLOADDIR=$(out)/etc/X11/app-defaults"
+    "MANPATH=$(out)/man"
+  ];
 
   meta = with stdenv.lib; {
     description = "Virtual keyboard for X window system";
diff --git a/pkgs/tools/X11/xzoom/default.nix b/pkgs/tools/X11/xzoom/default.nix
index 05154e282636..d1867e3b077b 100644
--- a/pkgs/tools/X11/xzoom/default.nix
+++ b/pkgs/tools/X11/xzoom/default.nix
@@ -1,4 +1,5 @@
-{stdenv, fetchurl, libX11, imake, libXext, libXt}:
+{ stdenv, fetchurl, libX11, libXext, libXt, imake, gccmakedep}:
+
 stdenv.mkDerivation rec {
   name = "${pname}-${version}.${patchlevel}";
   pname = "xzoom";
@@ -16,12 +17,16 @@ stdenv.mkDerivation rec {
        sha256 = "0zhc06whbvaz987bzzzi2bz6h9jp6rv812qs7b71drivvd820qbh";
     })
   ];
-  buildInputs = [libX11 imake libXext libXt];
 
-  configurePhase = ''
-    xmkmf
-    makeFlags="$makeFlags PREFIX=$out BINDIR=$out/bin MANPATH=$out/share/man"
-  '';
+  nativeBuildInputs = [ imake gccmakedep ];
+  buildInputs = [ libX11 libXext libXt ];
+
+  makeFlags = [
+    "PREFIX=$(out)"
+    "BINDIR=$(out)/bin"
+    "MANPATH=$(out)/share/man"
+  ];
+  installTargets = "install install.man";
 
   meta = {
     inherit version;
diff --git a/pkgs/tools/admin/tightvnc/default.nix b/pkgs/tools/admin/tightvnc/default.nix
index 4027b3d531c3..5a76b500d149 100644
--- a/pkgs/tools/admin/tightvnc/default.nix
+++ b/pkgs/tools/admin/tightvnc/default.nix
@@ -10,15 +10,14 @@ stdenv.mkDerivation {
   };
 
   # for the builder script
-  inherit xauth fontDirectories perl;
-  gcc = stdenv.cc.cc;
+  inherit fontDirectories;
 
   hardeningDisable = [ "format" ];
 
   buildInputs = [ xlibsWrapper zlib libjpeg imake gccmakedep libXmu libXaw
                   libXpm libXp xauth openssh ];
 
-  patchPhase = ''
+  postPatch = ''
     fontPath=
     for i in $fontDirectories; do
       for j in $(find $i -name fonts.dir); do
@@ -27,37 +26,38 @@ stdenv.mkDerivation {
     done
 
     sed -i "s@/usr/bin/ssh@${openssh}/bin/ssh@g" vncviewer/vncviewer.h
-  '';
 
-  buildPhase = ''
-    xmkmf
-    make World
     sed -e 's@/usr/bin/perl@${perl}/bin/perl@' \
         -e 's@unix/:7100@'$fontPath'@' \
         -i vncserver
 
-    cd Xvnc
-    sed -e 's@.* CppCmd .*@#define CppCmd		'$gcc'/bin/cpp@' -i config/cf/linux.cf
-    sed -e 's@.* CppCmd .*@#define CppCmd		'$gcc'/bin/cpp@' -i config/cf/Imake.tmpl
+    sed -e 's@.* CppCmd .*@#define CppCmd		cpp@' -i Xvnc/config/cf/linux.cf
+    sed -e 's@.* CppCmd .*@#define CppCmd		cpp@' -i Xvnc/config/cf/Imake.tmpl
     sed -i \
         -e 's@"uname","xauth","Xvnc","vncpasswd"@"uname","Xvnc","vncpasswd"@g' \
         -e "s@\<xauth\>@${xauth}/bin/xauth@g" \
-        ../vncserver
-    ./configure
-    make
-    cd ..
+        vncserver
   '';
 
-  installPhase = ''
+  preInstall = ''
     mkdir -p $out/bin
     mkdir -p $out/share/man/man1
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
     ./vncinstall $out/bin $out/share/man
 
+    runHook postInstall
+  '';
+
+  postInstall = ''
     # fix HTTP client:
-    t=$out/share/tightvnc
-    mkdir -p $t
-    sed -i "s@/usr/local/vnc/classes@$out/vnc/classes@g" $out/bin/vncserver
-    cp -r classes $t
+    mkdir -p $out/share/tightvnc
+    cp -r classes $out/share/tightvnc
+    substituteInPlace $out/bin/vncserver \
+      --replace /usr/local/vnc/classes $out/share/tightvnc/classes
   '';
 
   meta = {
diff --git a/pkgs/tools/filesystems/jfsutils/ar-fix.patch b/pkgs/tools/filesystems/jfsutils/ar-fix.patch
new file mode 100644
index 000000000000..697029cd5a8c
--- /dev/null
+++ b/pkgs/tools/filesystems/jfsutils/ar-fix.patch
@@ -0,0 +1,10 @@
+--- jfsutils-1.1.15/configure.in.orig	2018-11-27 20:46:55.830242385 +0300
++++ jfsutils-1.1.15/configure.in	2018-11-27 20:47:00.596307630 +0300
+@@ -15,6 +15,7 @@
+ AC_PATH_PROG(LN, ln, ln)
+ AC_PROG_LN_S
+ AC_PROG_RANLIB
++AM_PROG_AR
+ 
+ dnl Checks for header files.
+ AC_HEADER_STDC
diff --git a/pkgs/tools/filesystems/jfsutils/default.nix b/pkgs/tools/filesystems/jfsutils/default.nix
index acc7a91d93f5..92dfe00c9514 100644
--- a/pkgs/tools/filesystems/jfsutils/default.nix
+++ b/pkgs/tools/filesystems/jfsutils/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libuuid }:
+{ stdenv, fetchurl, libuuid, autoreconfHook }:
 
 stdenv.mkDerivation rec {
   name = "jfsutils-1.1.15";
@@ -8,8 +8,14 @@ stdenv.mkDerivation rec {
     sha256 = "0kbsy2sk1jv4m82rxyl25gwrlkzvl3hzdga9gshkxkhm83v1aji4";
   };
 
-  patches = [ ./types.patch ./hardening-format.patch ];
+  patches = [
+    ./types.patch
+    ./hardening-format.patch
+    # required for cross-compilation
+    ./ar-fix.patch
+  ];
 
+  nativeBuildInputs = [ autoreconfHook ];
   buildInputs = [ libuuid ];
 
   meta = with stdenv.lib; {
diff --git a/pkgs/tools/filesystems/reiserfsprogs/default.nix b/pkgs/tools/filesystems/reiserfsprogs/default.nix
index e23dd5f0bd14..345974bed58d 100644
--- a/pkgs/tools/filesystems/reiserfsprogs/default.nix
+++ b/pkgs/tools/filesystems/reiserfsprogs/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libuuid }:
+{ stdenv, fetchurl, libuuid, autoreconfHook }:
 
 let version = "3.6.24"; in
 stdenv.mkDerivation rec {
@@ -9,6 +9,8 @@ stdenv.mkDerivation rec {
     sha256 = "0q07df9wxxih8714a3mdp61h5n347l7j2a0l351acs3xapzgwi3y";
   };
 
+  patches = [ ./reiserfsprogs-ar-fix.patch ];
+  nativeBuildInputs = [ autoreconfHook ];
   buildInputs = [ libuuid ];
 
   NIX_CFLAGS_COMPILE = "-std=gnu90";
diff --git a/pkgs/tools/filesystems/reiserfsprogs/reiserfsprogs-ar-fix.patch b/pkgs/tools/filesystems/reiserfsprogs/reiserfsprogs-ar-fix.patch
new file mode 100644
index 000000000000..356782a3d984
--- /dev/null
+++ b/pkgs/tools/filesystems/reiserfsprogs/reiserfsprogs-ar-fix.patch
@@ -0,0 +1,10 @@
+--- reiserfsprogs-3.6.24/configure.ac.orig	2018-11-29 17:16:52.313624894 +0300
++++ reiserfsprogs-3.6.24/configure.ac	2018-11-29 17:16:54.480669132 +0300
+@@ -21,6 +21,7 @@
+ AC_PROG_LN_S
+ AC_PROG_MAKE_SET
+ AC_PROG_RANLIB
++AM_PROG_AR
+ 
+ dnl Checks for libraries.
+ 
diff --git a/pkgs/tools/graphics/perceptualdiff/default.nix b/pkgs/tools/graphics/perceptualdiff/default.nix
new file mode 100644
index 000000000000..d394a816a49d
--- /dev/null
+++ b/pkgs/tools/graphics/perceptualdiff/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchFromGitHub, cmake, freeimage }:
+
+stdenv.mkDerivation rec {
+  pname = "perceptualdiff";
+  name = "${pname}-${version}";
+  version = "2.1";
+
+  src = fetchFromGitHub {
+    owner = "myint";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "176n518xv0pczf1yyz9r5a8zw5r6sh5ym596kmvw30qznp8n4a8j";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ freeimage ];
+
+  meta = with stdenv.lib; {
+    description = "A program that compares two images using a perceptually based image metric";
+    homepage = "https://github.com/myint/perceptualdiff";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ uri-canva ];
+    platforms = platforms.x86;
+  };
+}
diff --git a/pkgs/tools/graphics/transfig/default.nix b/pkgs/tools/graphics/transfig/default.nix
index cb3f0edff0f8..ceee3b7674d9 100644
--- a/pkgs/tools/graphics/transfig/default.nix
+++ b/pkgs/tools/graphics/transfig/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, zlib, libjpeg, libpng, imake}:
+{ stdenv, fetchurl, zlib, libjpeg, libpng, imake, gccmakedep }:
 
 stdenv.mkDerivation rec {
   name = "transfig-3.2.4";
@@ -7,7 +7,8 @@ stdenv.mkDerivation rec {
     sha256 = "0429snhp5acbz61pvblwlrwv8nxr6gf12p37f9xxwrkqv4ir7dd4";
   };
 
-  buildInputs = [zlib libjpeg libpng imake];
+  nativeBuildInputs = [ imake gccmakedep ];
+  buildInputs = [ zlib libjpeg libpng ];
 
   patches = [
     ./patch-fig2dev-dev-Imakefile
@@ -45,12 +46,7 @@ stdenv.mkDerivation rec {
     runHook postPatch
   '';
 
-  preBuild = ''
-    xmkmf
-    make Makefiles
-  '';
-
-  makeFlags = [ "CC=cc" ];
+  makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];
 
   preInstall = ''
     mkdir -p $out
diff --git a/pkgs/tools/misc/otfcc/default.nix b/pkgs/tools/misc/otfcc/default.nix
index acf46a58a6bf..96e5e6a1d94e 100644
--- a/pkgs/tools/misc/otfcc/default.nix
+++ b/pkgs/tools/misc/otfcc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, premake5, ninja }:
+{ stdenv, fetchFromGitHub, premake5 }:
 
 stdenv.mkDerivation rec {
   name = "otfcc-${version}";
@@ -11,15 +11,15 @@ stdenv.mkDerivation rec {
     sha256 = "1rnjfqqyc6d9nhlh8if9k37wk94mcwz4wf3k239v6idg48nrk10b";
   };
 
-  nativeBuildInputs = [ premake5 ninja ];
+  nativeBuildInputs = [ premake5 ];
 
-  configurePhase = ''
-    premake5 ninja
+  # Don’t guess where our makefiles will end up. Just use current
+  # directory.
+  patchPhase = ''
+    substituteInPlace premake5.lua \
+      --replace 'location "build/gmake"' 'location "."'
   '';
 
-  ninjaFlags = let x = if stdenv.hostPlatform.isi686 then "x86" else "x64"; in
-    [ "-C" "build/ninja" "otfccdump_release_${x}" "otfccbuild_release_${x}" ];
-
   installPhase = ''
     mkdir -p $out/bin
     cp bin/release-x*/otfcc* $out/bin/
diff --git a/pkgs/tools/networking/x11-ssh-askpass/default.nix b/pkgs/tools/networking/x11-ssh-askpass/default.nix
index 896a2ff4daaa..1b9d55349030 100644
--- a/pkgs/tools/networking/x11-ssh-askpass/default.nix
+++ b/pkgs/tools/networking/x11-ssh-askpass/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, xlibsWrapper, imake }:
+{ stdenv, fetchurl, xlibsWrapper, imake, gccmakedep }:
 
 stdenv.mkDerivation {
   name = "x11-ssh-askpass-1.2.4.1";
@@ -10,16 +10,16 @@ stdenv.mkDerivation {
     sha256 = "620de3c32ae72185a2c9aeaec03af24242b9621964e38eb625afb6cdb30b8c88";
   };
 
-  nativeBuildInputs = [ imake ];
+  nativeBuildInputs = [ imake gccmakedep ];
   buildInputs = [ xlibsWrapper ];
 
   configureFlags = [
     "--with-app-defaults-dir=$out/etc/X11/app-defaults"
   ];
 
-  preBuild = ''
-    xmkmf
-    make includes
+  dontUseImakeConfigure = true;
+  postConfigure = ''
+    xmkmf -a
   '';
 
   installTargets = [ "install" "install.man" ];
diff --git a/pkgs/tools/video/vncrec/default.nix b/pkgs/tools/video/vncrec/default.nix
index 7efcf6cbf83a..49a2c4d4acb0 100644
--- a/pkgs/tools/video/vncrec/default.nix
+++ b/pkgs/tools/video/vncrec/default.nix
@@ -12,16 +12,17 @@ stdenv.mkDerivation rec {
 
   hardeningDisable = [ "format" ];
 
+  nativeBuildInputs = [ imake gccmakedep ];
   buildInputs = [
-    libX11 xproto imake gccmakedep libXt libXmu libXaw
+    libX11 xproto libXt libXmu libXaw
     libXext xextproto libSM libICE libXpm libXp
   ];
 
-  buildPhase = ''xmkmf && make World'';
-
-  installPhase = ''
-    make DESTDIR=$out BINDIR=/bin MANDIR=/share/man/man1 install install.man
-  '';
+  makeFlags = [
+    "BINDIR=${placeholder "out"}/bin"
+    "MANDIR=${placeholder "out"}/share/man"
+  ];
+  installTargets = "install install.man";
 
   meta = {
     description = "VNC recorder";
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index ab73b573436a..b52e781111dc 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -4706,6 +4706,8 @@ with pkgs;
 
   pepper = callPackage ../tools/admin/salt/pepper { };
 
+  perceptualdiff = callPackage ../tools/graphics/perceptualdiff { };
+
   percona-xtrabackup = callPackage ../tools/backup/percona-xtrabackup {
     boost = boost159;
   };
@@ -9029,6 +9031,10 @@ with pkgs;
 
   tweak = callPackage ../applications/editors/tweak { };
 
+  tychus = callPackage ../development/tools/tychus {
+    inherit (darwin.apple_sdk.frameworks) CoreFoundation;
+  };
+
   uhd = callPackage ../development/tools/misc/uhd { };
 
   uisp = callPackage ../development/tools/misc/uisp { };
@@ -11092,8 +11098,6 @@ with pkgs;
 
   libosip = callPackage ../development/libraries/osip {};
 
-  libosip_3 = callPackage ../development/libraries/osip/3.nix {};
-
   libosmium = callPackage ../development/libraries/libosmium { };
 
   libosmocore = callPackage ../applications/misc/libosmocore { };
@@ -12526,7 +12530,7 @@ with pkgs;
   taglib-sharp = callPackage ../development/libraries/taglib-sharp { };
 
   talloc = callPackage ../development/libraries/talloc {
-    python = python2;
+    python = buildPackages.python2;
   };
 
   tclap = callPackage ../development/libraries/tclap {};
@@ -14196,8 +14200,6 @@ with pkgs;
   fuse3 = fusePackages.fuse_3;
   fuse-common = hiPrio fusePackages.fuse_3.common;
 
-  fusionio-util = callPackage ../os-specific/linux/fusionio/util.nix { };
-
   fxload = callPackage ../os-specific/linux/fxload { };
 
   gfxtablet = callPackage ../os-specific/linux/gfxtablet {};
@@ -14480,8 +14482,6 @@ with pkgs;
 
     v4l2loopback = callPackage ../os-specific/linux/v4l2loopback { };
 
-    fusionio-vsl = callPackage ../os-specific/linux/fusionio/vsl.nix { };
-
     lttng-modules = callPackage ../os-specific/linux/lttng-modules { };
 
     broadcom_sta = callPackage ../os-specific/linux/broadcom-sta { };
@@ -17502,8 +17502,6 @@ with pkgs;
   # Impressive, formerly known as "KeyJNote".
   impressive = callPackage ../applications/office/impressive { };
 
-  inferno = pkgsi686Linux.callPackage ../applications/inferno { };
-
   inkscape = callPackage ../applications/graphics/inkscape {
     lcms = lcms2;
     poppler = poppler_0_61;
@@ -20088,8 +20086,6 @@ with pkgs;
 
   xmlcopyeditor = callPackage ../applications/editors/xmlcopyeditor { };
 
-  xmove = callPackage ../applications/misc/xmove { };
-
   xmp = callPackage ../applications/audio/xmp { };
 
   xnee = callPackage ../tools/X11/xnee { };
diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix
index 75e817dac771..131ff34c564e 100644
--- a/pkgs/top-level/perl-packages.nix
+++ b/pkgs/top-level/perl-packages.nix
@@ -7462,6 +7462,21 @@ let
     };
   };
 
+  Imager = buildPerlPackage rec {
+    name = "Imager-1.006";
+    src = fetchurl {
+      url = "mirror://cpan/authors/id/T/TO/TONYC/${name}.tar.gz";
+      sha256 = "c1e434a4de6250e3b229aa74aa653e56c38f981864f71a975366c50559c9d52b";
+    };
+    buildInputs = [ ExtUtilsPkgConfig pkgs.freetype pkgs.fontconfig pkgs.libjpeg pkgs.libpng ];
+    makeMakerFlags = "--incpath ${pkgs.libjpeg.dev}/include --libpath ${pkgs.libjpeg.out}/lib --incpath ${pkgs.libpng.dev}/include --libpath ${pkgs.libpng.out}/lib";
+    meta = {
+      homepage = http://imager.perl.org/;
+      description = "Perl extension for Generating 24 bit Images";
+      license = with stdenv.lib.licenses; [ artistic1 gpl1Plus ];
+    };
+  };
+
   ImageInfo = buildPerlPackage rec {
     name = "Image-Info-1.41";
     src = fetchurl {
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 3669c851394d..5d34c61d4b8c 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -595,6 +595,8 @@ in {
 
   pyparser = callPackage ../development/python-modules/pyparser { };
 
+  pyres = callPackage ../development/python-modules/pyres { };
+
   pyqt4 = callPackage ../development/python-modules/pyqt/4.x.nix {
     pythonPackages = self;
   };
@@ -619,6 +621,8 @@ in {
     slurm = pkgs.slurm;
   };
 
+  pyssim = callPackage ../development/python-modules/pyssim { };
+
   pystache = callPackage ../development/python-modules/pystache { };
 
   pytesseract = callPackage ../development/python-modules/pytesseract { };
@@ -635,6 +639,8 @@ in {
 
   python-ldap-test = callPackage ../development/python-modules/python-ldap-test { };
 
+  python-mnist = callPackage ../development/python-modules/python-mnist { };
+
   python-igraph = callPackage ../development/python-modules/python-igraph {
     pkgconfig = pkgs.pkgconfig;
     igraph = pkgs.igraph;
@@ -666,6 +672,8 @@ in {
 
   relatorio = callPackage ../development/python-modules/relatorio { };
 
+  remotecv = callPackage ../development/python-modules/remotecv { };
+
   pyzufall = callPackage ../development/python-modules/pyzufall { };
 
   rhpl = disabledIf isPy3k (callPackage ../development/python-modules/rhpl {});
@@ -1146,6 +1154,8 @@ in {
 
   cairocffi = callPackage ../development/python-modules/cairocffi {};
 
+  cairosvg1 = callPackage ../development/python-modules/cairosvg/1_x.nix {};
+
   cairosvg = callPackage ../development/python-modules/cairosvg {};
 
   carrot = callPackage ../development/python-modules/carrot {};
@@ -3080,6 +3090,8 @@ in {
 
   nose-exclude = callPackage ../development/python-modules/nose-exclude { };
 
+  nose-focus = callPackage ../development/python-modules/nose-focus { };
+
   nose2 = callPackage ../development/python-modules/nose2 { };
 
   nose-cover3 = callPackage ../development/python-modules/nose-cover3 { };
@@ -3090,6 +3102,10 @@ in {
 
   nose-cprof = callPackage ../development/python-modules/nose-cprof { };
 
+  nose-of-yeti = callPackage ../development/python-modules/nose-of-yeti { };
+
+  nose-pattern-exclude = callPackage ../development/python-modules/nose-pattern-exclude { };
+
   nose_warnings_filters = callPackage ../development/python-modules/nose_warnings_filters { };
 
   notebook = callPackage ../development/python-modules/notebook { };
@@ -3857,6 +3873,8 @@ in {
 
   simplegeneric = callPackage ../development/python-modules/simplegeneric { };
 
+  should-dsl = callPackage ../development/python-modules/should-dsl { };
+
   simplejson = callPackage ../development/python-modules/simplejson { };
 
   simplekml = callPackage ../development/python-modules/simplekml { };
@@ -4852,12 +4870,16 @@ in {
 
   packaging = callPackage ../development/python-modules/packaging { };
 
+  preggy = callPackage ../development/python-modules/preggy { };
+
   pytoml = callPackage ../development/python-modules/pytoml { };
 
   pypandoc = callPackage ../development/python-modules/pypandoc { };
 
   yamllint = callPackage ../development/python-modules/yamllint { };
 
+  yanc = callPackage ../development/python-modules/yanc { };
+
   yarl = callPackage ../development/python-modules/yarl { };
 
   suseapi = callPackage ../development/python-modules/suseapi { };
diff --git a/pkgs/top-level/release-lib.nix b/pkgs/top-level/release-lib.nix
index 957de2dcc307..7e7cac95b9c5 100644
--- a/pkgs/top-level/release-lib.nix
+++ b/pkgs/top-level/release-lib.nix
@@ -54,7 +54,7 @@ rec {
   # More poor man's memoisation
   pkgsForCross = let
     examplesByConfig = lib.flip lib.mapAttrs'
-      (builtins.removeAttrs lib.systems.examples [ "riscv" ])
+      lib.systems.examples
       (_: crossSystem: nameValuePair crossSystem.config {
         inherit crossSystem;
         pkgsFor = mkPkgsFor crossSystem;