summary refs log tree commit diff
path: root/pkgs
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs')
-rw-r--r--pkgs/applications/misc/googleearth/default.nix97
-rw-r--r--pkgs/applications/misc/xterm/default.nix4
-rw-r--r--pkgs/applications/networking/browsers/falkon/default.nix4
-rw-r--r--pkgs/applications/networking/browsers/qutebrowser/default.nix4
-rw-r--r--pkgs/applications/networking/browsers/tor-browser-bundle-bin/default.nix6
-rw-r--r--pkgs/applications/networking/instant-messengers/signal-desktop/default.nix4
-rw-r--r--pkgs/applications/networking/instant-messengers/telegram/tdesktop/generic.nix2
-rw-r--r--pkgs/applications/networking/seafile-client/default.nix4
-rw-r--r--pkgs/applications/version-management/git-and-tools/git-cola/default.nix4
-rw-r--r--pkgs/applications/virtualization/docker/default.nix8
-rw-r--r--pkgs/applications/window-managers/i3/status.nix4
-rw-r--r--pkgs/data/misc/scowl/default.nix4
-rw-r--r--pkgs/data/misc/tzdata/default.nix16
-rw-r--r--pkgs/desktops/enlightenment/enlightenment.suid-exes.patch4
-rw-r--r--pkgs/development/compilers/gcc/4.8/default.nix18
-rw-r--r--pkgs/development/compilers/gcc/4.9/default.nix18
-rw-r--r--pkgs/development/compilers/gcc/5/default.nix18
-rw-r--r--pkgs/development/compilers/gcc/6/default.nix18
-rw-r--r--pkgs/development/compilers/gcc/7/default.nix18
-rw-r--r--pkgs/development/compilers/gcc/8/default.nix18
-rw-r--r--pkgs/development/compilers/gcc/common/platform-flags.nix13
-rw-r--r--pkgs/development/compilers/gcc/snapshot/default.nix19
-rw-r--r--pkgs/development/libraries/glibc/common.nix17
-rw-r--r--pkgs/development/libraries/openbsm/bsm-add-audit_token_to_pid.patch24
-rw-r--r--pkgs/development/libraries/openbsm/default.nix2
-rw-r--r--pkgs/development/libraries/silgraphite/graphite2.nix4
-rw-r--r--pkgs/development/mobile/cocoapods/Gemfile.lock42
-rw-r--r--pkgs/development/mobile/cocoapods/gemset.nix58
-rw-r--r--pkgs/development/python-modules/configobj/default.nix23
-rw-r--r--pkgs/development/python-modules/contextvars/default.nix21
-rw-r--r--pkgs/development/python-modules/immutables/default.nix19
-rw-r--r--pkgs/development/python-modules/prometheus_client/default.nix19
-rw-r--r--pkgs/games/dwarf-fortress/default.nix6
-rw-r--r--pkgs/games/dwarf-fortress/game.nix78
-rw-r--r--pkgs/games/dwarf-fortress/wrapper/default.nix2
-rw-r--r--pkgs/games/dwarf-fortress/wrapper/dwarf-fortress-init.in1
-rw-r--r--pkgs/games/dwarf-fortress/wrapper/dwarf-fortress.in5
-rw-r--r--pkgs/games/wesnoth/default.nix4
-rw-r--r--pkgs/games/zandronum/fmod.nix22
-rw-r--r--pkgs/misc/emulators/retroarch/default.nix36
-rw-r--r--pkgs/misc/emulators/retroarch/wrapper.nix4
-rw-r--r--pkgs/os-specific/darwin/osx-private-sdk/default.nix2
-rw-r--r--pkgs/os-specific/darwin/skhd/default.nix4
-rw-r--r--pkgs/os-specific/linux/acpid/default.nix12
-rw-r--r--pkgs/os-specific/linux/bluez/default.nix35
-rw-r--r--pkgs/os-specific/linux/kernel/mips-ext3-n32.patch17
-rw-r--r--pkgs/os-specific/linux/kernel/mips-fpu-sigill.patch507
-rw-r--r--pkgs/os-specific/linux/kernel/mips-fpureg-emulation.patch144
-rw-r--r--pkgs/os-specific/linux/kernel/patches.nix15
-rw-r--r--pkgs/os-specific/linux/systemd/default.nix12
-rw-r--r--pkgs/servers/emby/default.nix4
-rw-r--r--pkgs/servers/home-assistant/component-packages.nix2
-rw-r--r--pkgs/test/default.nix26
-rw-r--r--pkgs/tools/admin/certbot/default.nix4
-rw-r--r--pkgs/tools/backup/backup/Gemfile23
-rw-r--r--pkgs/tools/backup/backup/Gemfile.lock276
-rw-r--r--pkgs/tools/backup/backup/default.nix19
-rw-r--r--pkgs/tools/backup/backup/gemset.nix778
-rw-r--r--pkgs/tools/misc/youtube-dl/default.nix4
-rw-r--r--pkgs/tools/package-management/nix/default.nix5
-rw-r--r--pkgs/tools/system/sleuthkit/default.nix4
-rw-r--r--pkgs/top-level/all-packages.nix68
-rw-r--r--pkgs/top-level/python-packages.nix6
-rw-r--r--pkgs/top-level/release.nix5
64 files changed, 542 insertions, 2122 deletions
diff --git a/pkgs/applications/misc/googleearth/default.nix b/pkgs/applications/misc/googleearth/default.nix
new file mode 100644
index 00000000000..c77f8658220
--- /dev/null
+++ b/pkgs/applications/misc/googleearth/default.nix
@@ -0,0 +1,97 @@
+{ stdenv, fetchurl, glibc, libGLU_combined, freetype, glib, libSM, libICE, libXi, libXv
+, libXrender, libXrandr, libXfixes, libXcursor, libXinerama, libXext, libX11, qt4
+, zlib, fontconfig, dpkg, libproxy, libxml2, gstreamer, gst_all_1, dbus }:
+
+let
+  arch =
+    if stdenv.system == "x86_64-linux" then "amd64"
+    else if stdenv.system == "i686-linux" then "i386"
+    else throw "Unsupported system ${stdenv.system}";
+  sha256 =
+    if arch == "amd64"
+    then "0dwnppn5snl5bwkdrgj4cyylnhngi0g66fn2k41j3dvis83x24k6"
+    else "0gndbxrj3kgc2dhjqwjifr3cl85hgpm695z0wi01wvwzhrjqs0l2";
+  version = "7.1.8.3036";
+  fullPath = stdenv.lib.makeLibraryPath [
+    glibc
+    glib
+    stdenv.cc.cc
+    libSM
+    libICE
+    libXi
+    libXv
+    libGLU_combined
+    libXrender
+    libXrandr
+    libXfixes
+    libXcursor
+    libXinerama
+    freetype
+    libXext
+    libX11
+    zlib
+    fontconfig
+    libproxy
+    libxml2
+    gstreamer
+    dbus
+    gst_all_1.gstreamer
+    gst_all_1.gst-plugins-base
+  ];
+in
+stdenv.mkDerivation rec {
+  name = "googleearth-${version}";
+  src = fetchurl {
+    url = "https://dl.google.com/linux/earth/deb/pool/main/g/google-earth-stable/google-earth-stable_${version}-r0_${arch}.deb";
+    inherit sha256;
+  };
+
+  phases = [ "unpackPhase" "installPhase" "checkPhase" ];
+
+  doCheck = true;
+
+  buildInputs = [ dpkg ];
+
+  unpackPhase = ''
+    dpkg-deb -x ${src} ./
+  '';
+
+  installPhase =''
+    mkdir $out
+    mv usr/* $out/
+    rmdir usr
+    mv * $out/
+    rm $out/bin/google-earth $out/opt/google/earth/free/googleearth
+
+    # patch and link googleearth binary
+    ln -s $out/opt/google/earth/free/googleearth-bin $out/bin/googleearth
+    patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
+      --set-rpath "${fullPath}:\$ORIGIN" \
+      $out/opt/google/earth/free/googleearth-bin
+
+    # patch and link gpsbabel binary
+    ln -s $out/opt/google/earth/free/gpsbabel $out/bin/gpsbabel
+    patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
+      --set-rpath "${fullPath}:\$ORIGIN" \
+      $out/opt/google/earth/free/gpsbabel
+
+    # patch libraries
+    for a in $out/opt/google/earth/free/*.so* ; do
+      patchelf --set-rpath "${fullPath}:\$ORIGIN" $a
+    done
+  '';
+
+  checkPhase = ''
+    $out/bin/gpsbabel -V > /dev/null
+  '';
+
+  dontPatchELF = true;
+
+  meta = with stdenv.lib; {
+    description = "A world sphere viewer";
+    homepage = http://earth.google.com;
+    license = licenses.unfree;
+    maintainers = with maintainers; [ markus1189 ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/applications/misc/xterm/default.nix b/pkgs/applications/misc/xterm/default.nix
index bcaf89797b4..8b15b030789 100644
--- a/pkgs/applications/misc/xterm/default.nix
+++ b/pkgs/applications/misc/xterm/default.nix
@@ -3,14 +3,14 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "xterm-332";
+  name = "xterm-333";
 
   src = fetchurl {
     urls = [
      "ftp://ftp.invisible-island.net/xterm/${name}.tgz"
      "https://invisible-mirror.net/archives/xterm/${name}.tgz"
    ];
-    sha256 = "0zdjiik4ravc3zld5c9i2ndrvazjmwiwbgl2c21348762wki2jsx";
+    sha256 = "0y7gl26mxw6kwqx9j9mi6lx1lp1v3nrlga19ddn07j2m9q0l479g";
   };
 
   buildInputs =
diff --git a/pkgs/applications/networking/browsers/falkon/default.nix b/pkgs/applications/networking/browsers/falkon/default.nix
index de56a0605b8..9dad2df7fd0 100644
--- a/pkgs/applications/networking/browsers/falkon/default.nix
+++ b/pkgs/applications/networking/browsers/falkon/default.nix
@@ -3,13 +3,13 @@
 
 stdenv.mkDerivation rec {
   name = "falkon-${version}";
-  version = "3.0.0";
+  version = "3.0.1";
 
   src = fetchFromGitHub {
     owner  = "KDE";
     repo   = "falkon";
     rev    = "v${version}";
-    sha256 = "148idxvx32iwg18m3b7s22awcijnbrywz9r8gnfrq6gpwr0m2jna";
+    sha256 = "1ay1ljrdjcfqwjv4rhf4psh3dfihnvhpmpqcayd3p9lh57x7fh41";
   };
 
   preConfigure = ''
diff --git a/pkgs/applications/networking/browsers/qutebrowser/default.nix b/pkgs/applications/networking/browsers/qutebrowser/default.nix
index 2e31f625f2e..0cebdd62140 100644
--- a/pkgs/applications/networking/browsers/qutebrowser/default.nix
+++ b/pkgs/applications/networking/browsers/qutebrowser/default.nix
@@ -29,13 +29,13 @@ let
 in python3Packages.buildPythonApplication rec {
   name = "qutebrowser-${version}${versionPostfix}";
   namePrefix = "";
-  version = "1.2.1";
+  version = "1.3.0";
   versionPostfix = "";
 
   # the release tarballs are different from the git checkout!
   src = fetchurl {
     url = "https://github.com/qutebrowser/qutebrowser/releases/download/v${version}/${name}.tar.gz";
-    sha256 = "1svbski378x276033v07jailm81b0i6hxdakbiqkwvgh6hkczrhw";
+    sha256 = "159h669x60pfla71zx28wnrik8rvsrw5i8kbd3xccynk6klm3kw3";
   };
 
   # Needs tox
diff --git a/pkgs/applications/networking/browsers/tor-browser-bundle-bin/default.nix b/pkgs/applications/networking/browsers/tor-browser-bundle-bin/default.nix
index a2094305db5..97b719c1471 100644
--- a/pkgs/applications/networking/browsers/tor-browser-bundle-bin/default.nix
+++ b/pkgs/applications/networking/browsers/tor-browser-bundle-bin/default.nix
@@ -98,7 +98,7 @@ let
   fteLibPath = makeLibraryPath [ stdenv.cc.cc gmp ];
 
   # Upstream source
-  version = "7.5.3";
+  version = "7.5.4";
 
   lang = "en-US";
 
@@ -108,7 +108,7 @@ let
         "https://github.com/TheTorProject/gettorbrowser/releases/download/v${version}/tor-browser-linux64-${version}_${lang}.tar.xz"
         "https://dist.torproject.org/torbrowser/${version}/tor-browser-linux64-${version}_${lang}.tar.xz"
       ];
-      sha256 = "0vgw1qsd6rqbbgnsw9zwcv5m308abh7wp1p12mp8g04xndxnzw0d";
+      sha256 = "1d5q2vc7kyd2wizl4551yf54rcagh3y2xf1lzvrswxq4kasii3h9";
     };
 
     "i686-linux" = fetchurl {
@@ -116,7 +116,7 @@ let
         "https://github.com/TheTorProject/gettorbrowser/releases/download/v${version}/tor-browser-linux32-${version}_${lang}.tar.xz"
         "https://dist.torproject.org/torbrowser/${version}/tor-browser-linux32-${version}_${lang}.tar.xz"
       ];
-      sha256 = "0scjy51zmyn7za0gii0dvndq06slip64nd0ik2cjyq232agvbxmr";
+      sha256 = "18v7ykv23gsylvn9mlkp5547yz3y833i9h126r7195wsqdshizdj";
     };
   };
 in
diff --git a/pkgs/applications/networking/instant-messengers/signal-desktop/default.nix b/pkgs/applications/networking/instant-messengers/signal-desktop/default.nix
index 479b89bcecb..4fe4d6ceca2 100644
--- a/pkgs/applications/networking/instant-messengers/signal-desktop/default.nix
+++ b/pkgs/applications/networking/instant-messengers/signal-desktop/default.nix
@@ -40,13 +40,13 @@ in
   stdenv.mkDerivation rec {
     name = "signal-desktop-${version}";
 
-    version = "1.9.0";
+    version = "1.10.0";
 
     src =
       if stdenv.system == "x86_64-linux" then
         fetchurl {
           url = "https://updates.signal.org/desktop/apt/pool/main/s/signal-desktop/signal-desktop_${version}_amd64.deb";
-          sha256 = "18i9chyarpcw369rqyldckkln1lxy5g9qy9f5gy5gsz9y5qngxqa";
+          sha256 = "0fjc5zf3lr5pmlc57yv3spjk2hq4b3lxngc6iw6c73ficnz4ij7i";
         }
       else
         throw "Signal for Desktop is not currently supported on ${stdenv.system}";
diff --git a/pkgs/applications/networking/instant-messengers/telegram/tdesktop/generic.nix b/pkgs/applications/networking/instant-messengers/telegram/tdesktop/generic.nix
index 2588340de1d..7581482504b 100644
--- a/pkgs/applications/networking/instant-messengers/telegram/tdesktop/generic.nix
+++ b/pkgs/applications/networking/instant-messengers/telegram/tdesktop/generic.nix
@@ -114,7 +114,7 @@ mkDerivation rec {
     install -m444 "$src/lib/xdg/telegramdesktop.desktop" "$out/share/applications/telegram-desktop.desktop"
     sed "s,/usr/bin,$out/bin,g" $archPatches/tg.protocol > $out/share/kde4/services/tg.protocol
     for icon_size in 16 32 48 64 128 256 512; do
-      install -Dm644 "../../../Telegram/Resources/art/icon''${icon_size}.png" "$out/share/icons/hicolor/''${icon_size}x''${icon_size}/apps/telegram-desktop.png"
+      install -Dm644 "../../../Telegram/Resources/art/icon''${icon_size}.png" "$out/share/icons/hicolor/''${icon_size}x''${icon_size}/apps/telegram.png"
     done
   '';
 
diff --git a/pkgs/applications/networking/seafile-client/default.nix b/pkgs/applications/networking/seafile-client/default.nix
index 35926836e30..279dc508225 100644
--- a/pkgs/applications/networking/seafile-client/default.nix
+++ b/pkgs/applications/networking/seafile-client/default.nix
@@ -5,14 +5,14 @@
 with stdenv.lib;
 
 stdenv.mkDerivation rec {
-  version = "6.1.7";
+  version = "6.1.8";
   name = "seafile-client-${version}";
 
   src = fetchFromGitHub {
     owner = "haiwen";
     repo = "seafile-client";
     rev = "v${version}";
-    sha256 = "1wf258sxn4pqdn1xypqwlxbnls771k2c6whpbinpns3knv5zvgaq";
+    sha256 = "0gy7jfxr5f8qvbqj80g7fzaw9b3vax750c4z5cr7f43rv99284pc";
   };
 
   nativeBuildInputs = [ pkgconfig cmake makeWrapper ];
diff --git a/pkgs/applications/version-management/git-and-tools/git-cola/default.nix b/pkgs/applications/version-management/git-and-tools/git-cola/default.nix
index 73f9921d486..391ca26de25 100644
--- a/pkgs/applications/version-management/git-and-tools/git-cola/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/git-cola/default.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchFromGitHub, pythonPackages, makeWrapper, gettext, git }:
 
 let
-  inherit (pythonPackages) buildPythonApplication pyqt4 sip pyinotify python mock;
+  inherit (pythonPackages) buildPythonApplication pyqt5 sip pyinotify python mock;
 in buildPythonApplication rec {
   name = "git-cola-${version}";
   version = "3.1";
@@ -14,7 +14,7 @@ in buildPythonApplication rec {
   };
 
   buildInputs = [ git gettext ];
-  propagatedBuildInputs = [ pyqt4 sip pyinotify ];
+  propagatedBuildInputs = [ pyqt5 sip pyinotify ];
 
   doCheck = false;
 
diff --git a/pkgs/applications/virtualization/docker/default.nix b/pkgs/applications/virtualization/docker/default.nix
index 2a271a96ecd..2ab2bd02219 100644
--- a/pkgs/applications/virtualization/docker/default.nix
+++ b/pkgs/applications/virtualization/docker/default.nix
@@ -209,10 +209,10 @@ rec {
     tiniSha256 = "0zj4kdis1vvc6dwn4gplqna0bs7v6d1y2zc8v80s3zi018inhznw";
   };
 
-  docker_18_04 = dockerGen rec {
-    version = "18.04.0-ce";
-    rev = "3d479c0af67cb9ea43a9cfc1bf2ef097e06a3470"; # git commit
-    sha256 = "1askbk8b92cdv7vlm688g2f1v2xjhmx77578318x76dydfql3jfl";
+  docker_18_05 = dockerGen rec {
+    version = "18.05.0-ce";
+    rev = "f150324782643a5268a04e7d1a675587125da20e"; # git commit
+    sha256 = "0vgh03qwlfm25sm3yaa6vf5ap2ag575f814ccgcrp5zlcal13r0z";
     runcRev = "4fc53a81fb7c994640722ac585fa9ca548971871";
     runcSha256 = "1ikqw39jn8dzb4snc4pcg3z85jb67ivskdhx028k17ss29bf4062";
     containerdRev = "773c489c9c1b21a6d78b5c538cd395416ec50f88";
diff --git a/pkgs/applications/window-managers/i3/status.nix b/pkgs/applications/window-managers/i3/status.nix
index fa964e86974..ae6d8bd22b7 100644
--- a/pkgs/applications/window-managers/i3/status.nix
+++ b/pkgs/applications/window-managers/i3/status.nix
@@ -2,11 +2,11 @@
   }:
 
 stdenv.mkDerivation rec {
-  name = "i3status-2.11";
+  name = "i3status-2.12";
 
   src = fetchurl {
     url = "https://i3wm.org/i3status/${name}.tar.bz2";
-    sha256 = "0pwcy599fw8by1a1sf91crkqba7679qhvhbacpmhis8c1xrpxnwq";
+    sha256 = "06krpbijv4yi33nypg6qcn4hilcrdyarsdpd9fmr2cq46qaqiikg";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/data/misc/scowl/default.nix b/pkgs/data/misc/scowl/default.nix
index e54dc3fa9fe..c90b8aa7e37 100644
--- a/pkgs/data/misc/scowl/default.nix
+++ b/pkgs/data/misc/scowl/default.nix
@@ -5,13 +5,13 @@
 stdenv.mkDerivation rec {
   name = "${pname}-${version}";
   pname = "scowl";
-  version = "2017.08.24";
+  version = "2018.04.16";
 
   src = fetchFromGitHub {
     owner = "en-wl";
     repo = "wordlist";
     rev = "rel-${version}";
-    sha256 = "16mgk6scbw8i38g63kh60bsnzgzfs8gvvz2n5jh4x5didbwly8nz";
+    sha256 = "0p0hgg5y88bb802z210cdk1c4fjwlpxxkci6yph3fk7g6s9xc73g";
   };
 
   postPatch = ''
diff --git a/pkgs/data/misc/tzdata/default.nix b/pkgs/data/misc/tzdata/default.nix
index 2c22bfe93b9..0f790f78f19 100644
--- a/pkgs/data/misc/tzdata/default.nix
+++ b/pkgs/data/misc/tzdata/default.nix
@@ -2,28 +2,31 @@
 
 stdenv.mkDerivation rec {
   name = "tzdata-${version}";
-  version = "2017c";
+  version = "2018e";
 
   srcs =
     [ (fetchurl {
         url = "http://www.iana.org/time-zones/repository/releases/tzdata${version}.tar.gz";
-        sha256 = "02yrrfj0p7ar885ja41ylijzbr8wc6kz6kzlw8c670i9m693ym6n";
+        sha256 = "0bk97fv2i5ns42prpmlaadsswdjwv0ifi7whj2s4q6l44rcqwa3b";
       })
       (fetchurl {
         url = "http://www.iana.org/time-zones/repository/releases/tzcode${version}.tar.gz";
-        sha256 = "1dvrq0b2hz7cjqdyd7x21wpy4qcng3rvysr61ij0c2g64fyb9s41";
+        sha256 = "1kpb02631s58i068mwq63xlamcv1ffj4p6y4wpb9kdl01vr0qd6a";
       })
     ];
 
   sourceRoot = ".";
 
-  outputs = [ "out" "man" "dev" ];
+  outputs = [ "out" "bin" "man" "dev" ];
   propagatedBuildOutputs = [];
 
   makeFlags = [
     "TOPDIR=$(out)"
     "TZDIR=$(out)/share/zoneinfo"
+    "BINDIR=$(bin)/bin"
+    "ZICDIR=$(bin)/bin"
     "ETCDIR=$(TMPDIR)/etc"
+    "TZDEFAULT=$(TMPDIR)/etc"
     "LIBDIR=$(dev)/lib"
     "MANDIR=$(man)/share/man"
     "AWK=awk"
@@ -60,9 +63,10 @@ stdenv.mkDerivation rec {
 
   setupHook = ./tzdata-setup-hook.sh;
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = http://www.iana.org/time-zones;
     description = "Database of current and historical time zones";
-    platforms = stdenv.lib.platforms.all;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ fpletz ];
   };
 }
diff --git a/pkgs/desktops/enlightenment/enlightenment.suid-exes.patch b/pkgs/desktops/enlightenment/enlightenment.suid-exes.patch
index 7a89309c89f..f53f6ffa7ca 100644
--- a/pkgs/desktops/enlightenment/enlightenment.suid-exes.patch
+++ b/pkgs/desktops/enlightenment/enlightenment.suid-exes.patch
@@ -14,9 +14,9 @@
  for x in "$@" ; do
 -	chown root "$DESTDIR/$x"
 -	chmod a=rx,u+xs "$DESTDIR/$x"
-+	f="$DESTDIR/$x";
++	f="$DESTDIR$x";
 +	b=$(basename "$f".orig)
-+	mv -v "$f"{,.orig}
++	mv -v "$f" "$f".orig
 +	ln -sv /run/wrappers/bin/"$b" "$f"
 +	echo "    \"$b\".source = \"$f.orig\";" >> $w
  done
diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix
index 1808b95f34d..5d4221c168b 100644
--- a/pkgs/development/compilers/gcc/4.8/default.nix
+++ b/pkgs/development/compilers/gcc/4.8/default.nix
@@ -100,22 +100,6 @@ let version = "4.8.5";
 
     javaAwtGtk = langJava && x11Support;
 
-    /* Platform flags */
-    platformFlags = let
-        gccArch = targetPlatform.platform.gcc.arch or null;
-        gccCpu = targetPlatform.platform.gcc.cpu or null;
-        gccAbi = targetPlatform.platform.gcc.abi or null;
-        gccFpu = targetPlatform.platform.gcc.fpu or null;
-        gccFloat = targetPlatform.platform.gcc.float or null;
-        gccMode = targetPlatform.platform.gcc.mode or null;
-      in
-        optional (gccArch != null) "--with-arch=${gccArch}" ++
-        optional (gccCpu != null) "--with-cpu=${gccCpu}" ++
-        optional (gccAbi != null) "--with-abi=${gccAbi}" ++
-        optional (gccFpu != null) "--with-fpu=${gccFpu}" ++
-        optional (gccFloat != null) "--with-float=${gccFloat}" ++
-        optional (gccMode != null) "--with-mode=${gccMode}";
-
     /* Cross-gcc settings (build == host != target) */
     crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
     crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
@@ -357,7 +341,7 @@ stdenv.mkDerivation ({
     optional javaAwtGtk "--enable-java-awt=gtk" ++
     optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++
 
-    platformFlags ++
+    (import ../common/platform-flags.nix { inherit (stdenv) lib targetPlatform; }) ++
     optional (targetPlatform != hostPlatform) crossConfigureFlags ++
     optional (!bootstrap) "--disable-bootstrap" ++
 
diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix
index 05305dead06..437a9d83a56 100644
--- a/pkgs/development/compilers/gcc/4.9/default.nix
+++ b/pkgs/development/compilers/gcc/4.9/default.nix
@@ -105,22 +105,6 @@ let version = "4.9.4";
 
     javaAwtGtk = langJava && x11Support;
 
-    /* Platform flags */
-    platformFlags = let
-        gccArch = targetPlatform.platform.gcc.arch or null;
-        gccCpu = targetPlatform.platform.gcc.cpu or null;
-        gccAbi = targetPlatform.platform.gcc.abi or null;
-        gccFpu = targetPlatform.platform.gcc.fpu or null;
-        gccFloat = targetPlatform.platform.gcc.float or null;
-        gccMode = targetPlatform.platform.gcc.mode or null;
-      in
-        optional (gccArch != null) "--with-arch=${gccArch}" ++
-        optional (gccCpu != null) "--with-cpu=${gccCpu}" ++
-        optional (gccAbi != null) "--with-abi=${gccAbi}" ++
-        optional (gccFpu != null) "--with-fpu=${gccFpu}" ++
-        optional (gccFloat != null) "--with-float=${gccFloat}" ++
-        optional (gccMode != null) "--with-mode=${gccMode}";
-
     /* Cross-gcc settings (build == host != target) */
     crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
     crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
@@ -379,7 +363,7 @@ stdenv.mkDerivation ({
     optional javaAwtGtk "--enable-java-awt=gtk" ++
     optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++
 
-    platformFlags ++
+    (import ../common/platform-flags.nix { inherit (stdenv) lib targetPlatform; }) ++
     optional (targetPlatform != hostPlatform) crossConfigureFlags ++
     optional (!bootstrap) "--disable-bootstrap" ++
 
diff --git a/pkgs/development/compilers/gcc/5/default.nix b/pkgs/development/compilers/gcc/5/default.nix
index 3d9f471e503..91935b172a0 100644
--- a/pkgs/development/compilers/gcc/5/default.nix
+++ b/pkgs/development/compilers/gcc/5/default.nix
@@ -95,22 +95,6 @@ let version = "5.5.0";
 
     javaAwtGtk = langJava && x11Support;
 
-    /* Platform flags */
-    platformFlags = let
-        gccArch = targetPlatform.platform.gcc.arch or null;
-        gccCpu = targetPlatform.platform.gcc.cpu or null;
-        gccAbi = targetPlatform.platform.gcc.abi or null;
-        gccFpu = targetPlatform.platform.gcc.fpu or null;
-        gccFloat = targetPlatform.platform.gcc.float or null;
-        gccMode = targetPlatform.platform.gcc.mode or null;
-      in
-        optional (gccArch != null) "--with-arch=${gccArch}" ++
-        optional (gccCpu != null) "--with-cpu=${gccCpu}" ++
-        optional (gccAbi != null) "--with-abi=${gccAbi}" ++
-        optional (gccFpu != null) "--with-fpu=${gccFpu}" ++
-        optional (gccFloat != null) "--with-float=${gccFloat}" ++
-        optional (gccMode != null) "--with-mode=${gccMode}";
-
     /* Cross-gcc settings (build == host != target) */
     crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
     crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
@@ -381,7 +365,7 @@ stdenv.mkDerivation ({
     optional javaAwtGtk "--enable-java-awt=gtk" ++
     optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++
 
-    platformFlags ++
+    (import ../common/platform-flags.nix { inherit (stdenv) lib targetPlatform; }) ++
     optional (targetPlatform != hostPlatform) crossConfigureFlags ++
     optional (!bootstrap) "--disable-bootstrap" ++
 
diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix
index 1f56f6e573e..56b09cba126 100644
--- a/pkgs/development/compilers/gcc/6/default.nix
+++ b/pkgs/development/compilers/gcc/6/default.nix
@@ -89,22 +89,6 @@ let version = "6.4.0";
 
     javaAwtGtk = langJava && x11Support;
 
-    /* Platform flags */
-    platformFlags = let
-        gccArch = targetPlatform.platform.gcc.arch or null;
-        gccCpu = targetPlatform.platform.gcc.cpu or null;
-        gccAbi = targetPlatform.platform.gcc.abi or null;
-        gccFpu = targetPlatform.platform.gcc.fpu or null;
-        gccFloat = targetPlatform.platform.gcc.float or null;
-        gccMode = targetPlatform.platform.gcc.mode or null;
-      in
-        optional (gccArch != null) "--with-arch=${gccArch}" ++
-        optional (gccCpu != null) "--with-cpu=${gccCpu}" ++
-        optional (gccAbi != null) "--with-abi=${gccAbi}" ++
-        optional (gccFpu != null) "--with-fpu=${gccFpu}" ++
-        optional (gccFloat != null) "--with-float=${gccFloat}" ++
-        optional (gccMode != null) "--with-mode=${gccMode}";
-
     /* Cross-gcc settings (build == host != target) */
     crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
     crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
@@ -385,7 +369,7 @@ stdenv.mkDerivation ({
     optional javaAwtGtk "--enable-java-awt=gtk" ++
     optional (langJava && javaAntlr != null) "--with-antlr-jar=${javaAntlr}" ++
 
-    platformFlags ++
+    (import ../common/platform-flags.nix { inherit (stdenv) lib targetPlatform; }) ++
     optional (targetPlatform != hostPlatform) crossConfigureFlags ++
     optional (!bootstrap) "--disable-bootstrap" ++
 
diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix
index b5da4c8c766..a86d87feb65 100644
--- a/pkgs/development/compilers/gcc/7/default.nix
+++ b/pkgs/development/compilers/gcc/7/default.nix
@@ -60,22 +60,6 @@ let version = "7.3.0";
       })
       ++ optional langFortran ../gfortran-driving.patch;
 
-    /* Platform flags */
-    platformFlags = let
-        gccArch = targetPlatform.platform.gcc.arch or null;
-        gccCpu = targetPlatform.platform.gcc.cpu or null;
-        gccAbi = targetPlatform.platform.gcc.abi or null;
-        gccFpu = targetPlatform.platform.gcc.fpu or null;
-        gccFloat = targetPlatform.platform.gcc.float or null;
-        gccMode = targetPlatform.platform.gcc.mode or null;
-      in
-        optional (gccArch != null) "--with-arch=${gccArch}" ++
-        optional (gccCpu != null) "--with-cpu=${gccCpu}" ++
-        optional (gccAbi != null) "--with-abi=${gccAbi}" ++
-        optional (gccFpu != null) "--with-fpu=${gccFpu}" ++
-        optional (gccFloat != null) "--with-float=${gccFloat}" ++
-        optional (gccMode != null) "--with-mode=${gccMode}";
-
     /* Cross-gcc settings (build == host != target) */
     crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
     crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
@@ -337,7 +321,7 @@ stdenv.mkDerivation ({
     # Optional features
     optional (isl != null) "--with-isl=${isl}" ++
 
-    platformFlags ++
+    (import ../common/platform-flags.nix { inherit (stdenv) lib targetPlatform; }) ++
     optional (targetPlatform != hostPlatform) crossConfigureFlags ++
     optional (!bootstrap) "--disable-bootstrap" ++
 
diff --git a/pkgs/development/compilers/gcc/8/default.nix b/pkgs/development/compilers/gcc/8/default.nix
index 239735bc657..b26b11c8e18 100644
--- a/pkgs/development/compilers/gcc/8/default.nix
+++ b/pkgs/development/compilers/gcc/8/default.nix
@@ -55,22 +55,6 @@ let version = "8.1.0";
       }) */
       ++ optional langFortran ../gfortran-driving.patch;
 
-    /* Platform flags */
-    platformFlags = let
-        gccArch = targetPlatform.platform.gcc.arch or null;
-        gccCpu = targetPlatform.platform.gcc.cpu or null;
-        gccAbi = targetPlatform.platform.gcc.abi or null;
-        gccFpu = targetPlatform.platform.gcc.fpu or null;
-        gccFloat = targetPlatform.platform.gcc.float or null;
-        gccMode = targetPlatform.platform.gcc.mode or null;
-      in
-        optional (gccArch != null) "--with-arch=${gccArch}" ++
-        optional (gccCpu != null) "--with-cpu=${gccCpu}" ++
-        optional (gccAbi != null) "--with-abi=${gccAbi}" ++
-        optional (gccFpu != null) "--with-fpu=${gccFpu}" ++
-        optional (gccFloat != null) "--with-float=${gccFloat}" ++
-        optional (gccMode != null) "--with-mode=${gccMode}";
-
     /* Cross-gcc settings (build == host != target) */
     crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
     crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
@@ -332,7 +316,7 @@ stdenv.mkDerivation ({
     # Optional features
     optional (isl != null) "--with-isl=${isl}" ++
 
-    platformFlags ++
+    (import ../common/platform-flags.nix { inherit (stdenv) lib targetPlatform; }) ++
     optional (targetPlatform != hostPlatform) crossConfigureFlags ++
     optional (!bootstrap) "--disable-bootstrap" ++
 
diff --git a/pkgs/development/compilers/gcc/common/platform-flags.nix b/pkgs/development/compilers/gcc/common/platform-flags.nix
new file mode 100644
index 00000000000..e261f54f582
--- /dev/null
+++ b/pkgs/development/compilers/gcc/common/platform-flags.nix
@@ -0,0 +1,13 @@
+{ lib, targetPlatform }:
+
+let
+  p = targetPlatform.platform.gcc or {};
+  float = p.float or (targetPlatform.parsed.abi.float or null);
+in lib.concatLists [
+  (lib.optional (p ? arch) "--with-arch=${p.arch}")
+  (lib.optional (p ? cpu) "--with-cpu=${p.cpu}")
+  (lib.optional (p ? abi) "--with-abi=${p.abi}")
+  (lib.optional (p ? fpu) "--with-fpu=${p.fpu}")
+  (lib.optional (float != null) "--with-float=${float}")
+  (lib.optional (p ? mode) "--with-mode=${p.mode}")
+]
diff --git a/pkgs/development/compilers/gcc/snapshot/default.nix b/pkgs/development/compilers/gcc/snapshot/default.nix
index 1af8c75669e..52e262e0b99 100644
--- a/pkgs/development/compilers/gcc/snapshot/default.nix
+++ b/pkgs/development/compilers/gcc/snapshot/default.nix
@@ -53,22 +53,6 @@ let version = "7-20170409";
       ++ optional noSysDirs ../no-sys-dirs.patch
       ++ optional langFortran ../gfortran-driving.patch;
 
-    /* Platform flags */
-    platformFlags = let
-        gccArch = targetPlatform.platform.gcc.arch or null;
-        gccCpu = targetPlatform.platform.gcc.cpu or null;
-        gccAbi = targetPlatform.platform.gcc.abi or null;
-        gccFpu = targetPlatform.platform.gcc.fpu or null;
-        gccFloat = targetPlatform.platform.gcc.float or null;
-        gccMode = targetPlatform.platform.gcc.mode or null;
-      in
-        optional (gccArch != null) "--with-arch=${gccArch}" ++
-        optional (gccCpu != null) "--with-cpu=${gccCpu}" ++
-        optional (gccAbi != null) "--with-abi=${gccAbi}" ++
-        optional (gccFpu != null) "--with-fpu=${gccFpu}" ++
-        optional (gccFloat != null) "--with-float=${gccFloat}" ++
-        optional (gccMode != null) "--with-mode=${gccMode}";
-
     /* Cross-gcc settings (build == host != target) */
     crossMingw = targetPlatform != hostPlatform && targetPlatform.libc == "msvcrt";
     crossDarwin = targetPlatform != hostPlatform && targetPlatform.libc == "libSystem";
@@ -300,7 +284,8 @@ stdenv.mkDerivation ({
     # Optional features
     optional (isl != null) "--with-isl=${isl}" ++
 
-    platformFlags ++
+
+    (import ../common/platform-flags.nix { inherit (stdenv) lib targetPlatform; }) ++
     optional (targetPlatform != hostPlatform) crossConfigureFlags ++
     optional (!bootstrap) "--disable-bootstrap" ++
 
diff --git a/pkgs/development/libraries/glibc/common.nix b/pkgs/development/libraries/glibc/common.nix
index af006bdb4cf..5c504d0d8e2 100644
--- a/pkgs/development/libraries/glibc/common.nix
+++ b/pkgs/development/libraries/glibc/common.nix
@@ -39,7 +39,6 @@ let
   version = "2.27";
   patchSuffix = "";
   sha256 = "0wpwq7gsm7sd6ysidv0z575ckqdg13cr2njyfgrbgh4f65adwwji";
-  cross = if buildPlatform != hostPlatform then hostPlatform else null;
 in
 
 assert withLinuxHeaders -> linuxHeaders != null;
@@ -49,9 +48,6 @@ stdenv.mkDerivation ({
   inherit version installLocales;
   linuxHeaders = if withLinuxHeaders then linuxHeaders else null;
 
-  # The host/target system.
-  crossConfig = if cross != null then cross.config else null;
-
   inherit (stdenv) is64bit;
 
   enableParallelBuilding = true;
@@ -123,11 +119,12 @@ stdenv.mkDerivation ({
        else "--disable-profile")
     ] ++ lib.optionals withLinuxHeaders [
       "--enable-kernel=3.2.0" # can't get below with glibc >= 2.26
-    ] ++ lib.optionals (cross != null) [
-      (if cross ? float && cross.float == "soft" then "--without-fp" else "--with-fp")
-    ] ++ lib.optionals (cross != null) [
+    ] ++ lib.optionals (hostPlatform != buildPlatform) [
+      (if hostPlatform.platform.gcc.float or (hostPlatform.parsed.abi.float or "hard") == "soft"
+       then "--without-fp"
+       else "--with-fp")
       "--with-__thread"
-    ] ++ lib.optionals (cross == null && stdenv.isAarch32) [
+    ] ++ lib.optionals (hostPlatform == buildPlatform && hostPlatform.isAarch32) [
       "--host=arm-linux-gnueabi"
       "--build=arm-linux-gnueabi"
 
@@ -179,7 +176,7 @@ stdenv.mkDerivation ({
     }
 
 
-  '' + lib.optionalString (cross != null) ''
+  '' + lib.optionalString (hostPlatform != buildPlatform) ''
     sed -i s/-lgcc_eh//g "../$sourceRoot/Makeconfig"
 
     cat > config.cache << "EOF"
@@ -213,7 +210,7 @@ stdenv.mkDerivation ({
   } // meta;
 }
 
-// lib.optionalAttrs (cross != null) {
+// lib.optionalAttrs (hostPlatform != buildPlatform) {
   preInstall = null; # clobber the native hook
 
   dontStrip = true;
diff --git a/pkgs/development/libraries/openbsm/bsm-add-audit_token_to_pid.patch b/pkgs/development/libraries/openbsm/bsm-add-audit_token_to_pid.patch
new file mode 100644
index 00000000000..77b9e1febdd
--- /dev/null
+++ b/pkgs/development/libraries/openbsm/bsm-add-audit_token_to_pid.patch
@@ -0,0 +1,24 @@
+Subject: Add audit_token_to_pid()
+
+Description: Apple provides audit_token_to_pid to get the pid of an
+audit token. Unfortunately, they have never released this to the
+OpenBSM project.
+
+diff -r -u -p1 a/bsm/libbsm.h b/bsm/libbsm.h
+--- a/bsm/libbsm.h	      2009-04-15 16:45:54.000000000 -0500
++++ b/bsm/libbsm.h	      2018-05-11 04:11:14.063083147 -0500
+@@ -1298,1 +1298,2 @@ int audit_set_stat(au_stat_t *stats, siz
+ int audit_send_trigger(int *trigger);
++pid_t audit_token_to_pid(audit_token_t atoken);
+
+diff -r -u -p1 a/libbsm/bsm_wrappers.c b/libbsm/bsm_wrappers.c
+--- a/libbsm/bsm_wrappers.c	       2009-04-15 16:46:06.000000000 -0500
++++ b/libbsm/bsm_wrappers.c	       2018-05-11 04:10:15.710820393 -0500
+@@ -823,1 +823,6 @@ audit_get_car(char *path, size_t sz)
+ }
++
++pid_t audit_token_to_pid(audit_token_t atoken)
++{
++	return atoken.val[5];
++}
+ 
\ No newline at end of file
diff --git a/pkgs/development/libraries/openbsm/default.nix b/pkgs/development/libraries/openbsm/default.nix
index a6e62cea9d7..9f75bff40e9 100644
--- a/pkgs/development/libraries/openbsm/default.nix
+++ b/pkgs/development/libraries/openbsm/default.nix
@@ -12,6 +12,8 @@ stdenv.mkDerivation rec {
     sha256 = "0b98359hd8mm585sh145ss828pg2y8vgz38lqrb7nypapiyqdnd1";
   };
 
+  patches = [ ./bsm-add-audit_token_to_pid.patch ];
+
   meta = {
     homepage = http://www.openbsm.org/;
     platforms = lib.platforms.unix;
diff --git a/pkgs/development/libraries/silgraphite/graphite2.nix b/pkgs/development/libraries/silgraphite/graphite2.nix
index a5dc1f41e98..30a99415981 100644
--- a/pkgs/development/libraries/silgraphite/graphite2.nix
+++ b/pkgs/development/libraries/silgraphite/graphite2.nix
@@ -10,8 +10,8 @@ stdenv.mkDerivation rec {
     sha256 = "0xdg6bc02bl8yz39l5i2skczfg17q4lif0qqan0dhvk0mibpcpj7";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ freetype cmake ];
+  nativeBuildInputs = [ pkgconfig cmake ];
+  buildInputs = [ freetype ];
 
   patches = stdenv.lib.optionals stdenv.isDarwin [ ./macosx.patch ];
 
diff --git a/pkgs/development/mobile/cocoapods/Gemfile.lock b/pkgs/development/mobile/cocoapods/Gemfile.lock
index 0ab15f1efd2..7ca6e40406a 100644
--- a/pkgs/development/mobile/cocoapods/Gemfile.lock
+++ b/pkgs/development/mobile/cocoapods/Gemfile.lock
@@ -1,38 +1,39 @@
 GEM
   remote: https://rubygems.org/
   specs:
-    CFPropertyList (2.3.6)
+    CFPropertyList (3.0.0)
     activesupport (4.2.10)
       i18n (~> 0.7)
       minitest (~> 5.1)
       thread_safe (~> 0.3, >= 0.3.4)
       tzinfo (~> 1.1)
+    atomos (0.1.2)
     claide (1.0.2)
-    cocoapods (1.3.1)
+    cocoapods (1.5.0)
       activesupport (>= 4.0.2, < 5)
       claide (>= 1.0.2, < 2.0)
-      cocoapods-core (= 1.3.1)
-      cocoapods-deintegrate (>= 1.0.1, < 2.0)
-      cocoapods-downloader (>= 1.1.3, < 2.0)
+      cocoapods-core (= 1.5.0)
+      cocoapods-deintegrate (>= 1.0.2, < 2.0)
+      cocoapods-downloader (>= 1.2.0, < 2.0)
       cocoapods-plugins (>= 1.0.0, < 2.0)
       cocoapods-search (>= 1.0.0, < 2.0)
       cocoapods-stats (>= 1.0.0, < 2.0)
-      cocoapods-trunk (>= 1.2.0, < 2.0)
+      cocoapods-trunk (>= 1.3.0, < 2.0)
       cocoapods-try (>= 1.1.0, < 2.0)
       colored2 (~> 3.1)
       escape (~> 0.0.4)
       fourflusher (~> 2.0.1)
       gh_inspector (~> 1.0)
-      molinillo (~> 0.5.7)
+      molinillo (~> 0.6.5)
       nap (~> 1.0)
       ruby-macho (~> 1.1)
-      xcodeproj (>= 1.5.1, < 2.0)
-    cocoapods-core (1.3.1)
+      xcodeproj (>= 1.5.7, < 2.0)
+    cocoapods-core (1.5.0)
       activesupport (>= 4.0.2, < 6)
       fuzzy_match (~> 2.0.4)
       nap (~> 1.0)
-    cocoapods-deintegrate (1.0.1)
-    cocoapods-downloader (1.1.3)
+    cocoapods-deintegrate (1.0.2)
+    cocoapods-downloader (1.2.0)
     cocoapods-plugins (1.0.0)
       nap
     cocoapods-search (1.0.0)
@@ -46,23 +47,24 @@ GEM
     escape (0.0.4)
     fourflusher (2.0.1)
     fuzzy_match (2.0.4)
-    gh_inspector (1.0.3)
-    i18n (0.9.1)
+    gh_inspector (1.1.3)
+    i18n (0.9.5)
       concurrent-ruby (~> 1.0)
-    minitest (5.10.3)
-    molinillo (0.5.7)
-    nanaimo (0.2.3)
+    minitest (5.11.3)
+    molinillo (0.6.5)
+    nanaimo (0.2.5)
     nap (1.1.0)
     netrc (0.11.0)
     ruby-macho (1.1.0)
     thread_safe (0.3.6)
-    tzinfo (1.2.4)
+    tzinfo (1.2.5)
       thread_safe (~> 0.1)
-    xcodeproj (1.5.3)
-      CFPropertyList (~> 2.3.3)
+    xcodeproj (1.5.7)
+      CFPropertyList (>= 2.3.3, < 4.0)
+      atomos (~> 0.1.2)
       claide (>= 1.0.2, < 2.0)
       colored2 (~> 3.1)
-      nanaimo (~> 0.2.3)
+      nanaimo (~> 0.2.4)
 
 PLATFORMS
   ruby
diff --git a/pkgs/development/mobile/cocoapods/gemset.nix b/pkgs/development/mobile/cocoapods/gemset.nix
index ff7b14e6dd8..cd4156d141c 100644
--- a/pkgs/development/mobile/cocoapods/gemset.nix
+++ b/pkgs/development/mobile/cocoapods/gemset.nix
@@ -8,13 +8,21 @@
     };
     version = "4.2.10";
   };
+  atomos = {
+    source = {
+      remotes = ["https://rubygems.org"];
+      sha256 = "10z69hjv30r2w5q5wmlf0cq4jv3w744jrac8ylln8sf45ckqj7wk";
+      type = "gem";
+    };
+    version = "0.1.2";
+  };
   CFPropertyList = {
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "0hadm41xr1fq3qp74jd9l5q8l0j9083rgklgzsilllwaav7qrrid";
+      sha256 = "0ykjag3k5msz3sf1j91rb55da2xh596y06m3a4yl79fiy2id0w9z";
       type = "gem";
     };
-    version = "2.3.6";
+    version = "3.0.0";
   };
   claide = {
     source = {
@@ -28,35 +36,35 @@
     dependencies = ["activesupport" "claide" "cocoapods-core" "cocoapods-deintegrate" "cocoapods-downloader" "cocoapods-plugins" "cocoapods-search" "cocoapods-stats" "cocoapods-trunk" "cocoapods-try" "colored2" "escape" "fourflusher" "gh_inspector" "molinillo" "nap" "ruby-macho" "xcodeproj"];
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "050b7795jc6802wcpcgi702qkgy8vjidgq6c6mbx2alrq7l0n8q7";
+      sha256 = "0pg2rkw6rlqq0y2vpajw4946hmvcnrg6lhr1i5p7j7kj8y5az167";
       type = "gem";
     };
-    version = "1.3.1";
+    version = "1.5.0";
   };
   cocoapods-core = {
     dependencies = ["activesupport" "fuzzy_match" "nap"];
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "0pr42lpqs6q51gnnfxmgmbx7sw0dwyawylssj588izj8av18rhpy";
+      sha256 = "0mqxgd22rj49pfasvinsn7z1bzm899m8cfw38yr38nspri10acad";
       type = "gem";
     };
-    version = "1.3.1";
+    version = "1.5.0";
   };
   cocoapods-deintegrate = {
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "1x4hxlip6zkrs1vcmw7sh45ayn5pxvsg782iifnmgjwn2pyskj7l";
+      sha256 = "10b49glw3jd0r1vj36zb0vz2idwgziq8qgzf7yjkrsm41xm098zz";
       type = "gem";
     };
-    version = "1.0.1";
+    version = "1.0.2";
   };
   cocoapods-downloader = {
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "1664qg1wml70slcfklpnyq5ixp145f6iyn3c6pcqkqc64i1bsg87";
+      sha256 = "1azzwyxvcqk5g394ica80x7pj7bh9zysk2q7x1jh8zbwrp6c0x8c";
       type = "gem";
     };
-    version = "1.1.3";
+    version = "1.2.0";
   };
   cocoapods-plugins = {
     dependencies = ["nap"];
@@ -143,43 +151,43 @@
   gh_inspector = {
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "1lxvp8xpjd2cazzcp90phy567spp4v41bnk9awgx8absndv70k1x";
+      sha256 = "0f8r9byajj3bi2c7c5sqrc7m0zrv3nblfcd4782lw5l73cbsgk04";
       type = "gem";
     };
-    version = "1.0.3";
+    version = "1.1.3";
   };
   i18n = {
     dependencies = ["concurrent-ruby"];
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "032wbfixfpwa67c893x5sn02ab0928vfqfshcs02bwkkxpqy9x8s";
+      sha256 = "038qvz7kd3cfxk8bvagqhakx68pfbnmghpdkx7573wbf0maqp9a3";
       type = "gem";
     };
-    version = "0.9.1";
+    version = "0.9.5";
   };
   minitest = {
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "05521clw19lrksqgvg2kmm025pvdhdaniix52vmbychrn2jm7kz2";
+      sha256 = "0icglrhghgwdlnzzp4jf76b0mbc71s80njn5afyfjn4wqji8mqbq";
       type = "gem";
     };
-    version = "5.10.3";
+    version = "5.11.3";
   };
   molinillo = {
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "19h1nks0x2ljwyijs2rd1f9sh05j8xqvjaqk1rslp5nyy6h4a758";
+      sha256 = "19zlshd1ra15x0a4jzss6ilz2xsnq293p43kxsljiy7xxq7bipx7";
       type = "gem";
     };
-    version = "0.5.7";
+    version = "0.6.5";
   };
   nanaimo = {
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "0z6rbji02x75vm5jw4hbpp75khp4z5yfgbaz1h9l8aa00hqf0fxd";
+      sha256 = "03x5f7hk0s21hlkj309w0qipjxz34kyd3c5yj25zq3s2yyn57idi";
       type = "gem";
     };
-    version = "0.2.3";
+    version = "0.2.5";
   };
   nap = {
     source = {
@@ -217,18 +225,18 @@
     dependencies = ["thread_safe"];
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "09dpbrih054mn42flbbcdpzk2727mzfvjrgqb12zdafhx7p9rrzp";
+      sha256 = "1fjx9j327xpkkdlxwmkl3a8wqj7i4l4jwlrv3z13mg95z9wl253z";
       type = "gem";
     };
-    version = "1.2.4";
+    version = "1.2.5";
   };
   xcodeproj = {
-    dependencies = ["CFPropertyList" "claide" "colored2" "nanaimo"];
+    dependencies = ["CFPropertyList" "atomos" "claide" "colored2" "nanaimo"];
     source = {
       remotes = ["https://rubygems.org"];
-      sha256 = "1gvnd5ixa4wbn1cpc6jp6i9z0dxhcwlxny47irzbr6zr8wpj3ww7";
+      sha256 = "16743g16mrh47f1lxkbw28xn9mmlf1r0zicin4malalsxxkc7ykz";
       type = "gem";
     };
-    version = "1.5.3";
+    version = "1.5.7";
   };
 }
\ No newline at end of file
diff --git a/pkgs/development/python-modules/configobj/default.nix b/pkgs/development/python-modules/configobj/default.nix
index 98631b6920b..dd2b26e0f59 100644
--- a/pkgs/development/python-modules/configobj/default.nix
+++ b/pkgs/development/python-modules/configobj/default.nix
@@ -1,19 +1,30 @@
-{ stdenv, buildPythonPackage, fetchPypi, six }:
+{ stdenv, buildPythonPackage
+, fetchFromGitHub
+, six
+, mock, pytest
+}:
 
 buildPythonPackage rec {
   pname = "configobj";
   version = "5.0.6";
 
-  src = fetchPypi {
-    inherit pname version;
-    sha256 = "00h9rcmws03xvdlfni11yb60bz3kxfvsj6dg6nrpzj71f03nbxd2";
+  # Pypi archives don't contain the tests
+  src = fetchFromGitHub {
+    owner = "DiffSK";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0x97794nk3dfn0i3si9fv7y19jnpnarb34bkdwlz7ii7ag6xihhw";
   };
 
-  # error: invalid command 'test'
-  doCheck = false;
 
   propagatedBuildInputs = [ six ];
 
+  checkPhase = ''
+    pytest --deselect=tests/test_configobj.py::test_options_deprecation
+  '';
+
+  checkInputs = [ mock pytest ];
+
   meta = with stdenv.lib; {
     description = "Config file reading, writing and validation";
     homepage = https://pypi.python.org/pypi/configobj;
diff --git a/pkgs/development/python-modules/contextvars/default.nix b/pkgs/development/python-modules/contextvars/default.nix
new file mode 100644
index 00000000000..d8ee3b1ca9e
--- /dev/null
+++ b/pkgs/development/python-modules/contextvars/default.nix
@@ -0,0 +1,21 @@
+{ lib, buildPythonPackage, fetchPypi, isPy36, immutables }:
+
+buildPythonPackage rec {
+  pname = "contextvars";
+  version = "2.2";
+  disabled = !isPy36;
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "046b385nfzkjh0wqmd268p2jkgn9fg6hz40npq7j1w3c8aqzhwvx";
+  };
+
+  propagatedBuildInputs = [ immutables ];
+
+  meta = {
+    description = "A backport of the Python 3.7 contextvars module for Python 3.6";
+    homepage = https://github.com/MagicStack/contextvars;
+    license = with lib.licenses; [ asl20 ];
+    maintainers = with lib.maintainers; [ catern ];
+  };
+}
diff --git a/pkgs/development/python-modules/immutables/default.nix b/pkgs/development/python-modules/immutables/default.nix
new file mode 100644
index 00000000000..975353406ca
--- /dev/null
+++ b/pkgs/development/python-modules/immutables/default.nix
@@ -0,0 +1,19 @@
+{ lib, buildPythonPackage, fetchPypi, pythonOlder }:
+
+buildPythonPackage rec {
+  pname = "immutables";
+  version = "0.5";
+  disabled = pythonOlder "3.5";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1hba0vkqanwfnb5b3rs14bs7schsmczhan5nd93c1i6fzi17glap";
+  };
+
+  meta = {
+    description = "An immutable mapping type for Python";
+    homepage = https://github.com/MagicStack/immutables;
+    license = with lib.licenses; [ asl20 ];
+    maintainers = with lib.maintainers; [ catern ];
+  };
+}
diff --git a/pkgs/development/python-modules/prometheus_client/default.nix b/pkgs/development/python-modules/prometheus_client/default.nix
new file mode 100644
index 00000000000..eaf353af082
--- /dev/null
+++ b/pkgs/development/python-modules/prometheus_client/default.nix
@@ -0,0 +1,19 @@
+{ lib, stdenv, buildPythonPackage, fetchPypi, pytest }:
+
+buildPythonPackage rec {
+  pname = "prometheus_client";
+  version = "0.2.0";
+
+  src = fetchPypi {
+    inherit pname version;
+    sha256 = "1r3510jq6iryd2a8jln2qpvqy112y5502ncbfkn116xl7gj74r6r";
+  };
+
+  doCheck = false;
+
+  meta = with lib; {
+    description = "Prometheus instrumentation library for Python applications";
+    homepage = https://github.com/prometheus/client_python;
+    license = licenses.asl20;
+  };
+}
diff --git a/pkgs/games/dwarf-fortress/default.nix b/pkgs/games/dwarf-fortress/default.nix
index c759c4c60da..82710256c63 100644
--- a/pkgs/games/dwarf-fortress/default.nix
+++ b/pkgs/games/dwarf-fortress/default.nix
@@ -1,4 +1,4 @@
-{ pkgs, pkgsi686Linux }:
+{ pkgs, pkgsi686Linux, stdenv }:
 
 let
   callPackage = pkgs.newScope self;
@@ -13,7 +13,9 @@ let
 
     soundSense = callPackage ./soundsense.nix { };
 
-    dwarf-fortress-unfuck = callPackage ./unfuck.nix { };
+    # unfuck is linux-only right now, we will just use it there
+    dwarf-fortress-unfuck = if stdenv.isLinux then callPackage ./unfuck.nix { }
+                                              else null;
 
     dwarf-fortress = callPackage ./wrapper {
       themes = {
diff --git a/pkgs/games/dwarf-fortress/game.nix b/pkgs/games/dwarf-fortress/game.nix
index 79dd46c2191..79eb6e19132 100644
--- a/pkgs/games/dwarf-fortress/game.nix
+++ b/pkgs/games/dwarf-fortress/game.nix
@@ -1,57 +1,93 @@
 { stdenv, lib, fetchurl
 , SDL, dwarf-fortress-unfuck
+
+# Our own "unfuck" libs for macOS
+, ncurses, fmodex, gcc
 }:
 
+with lib;
+
 let
   baseVersion = "44";
   patchVersion = "09";
   dfVersion = "0.${baseVersion}.${patchVersion}";
-  libpath = lib.makeLibraryPath [ stdenv.cc.cc stdenv.glibc dwarf-fortress-unfuck SDL ];
-  platform =
-    if stdenv.system == "x86_64-linux" then "linux"
-    else if stdenv.system == "i686-linux" then "linux32"
-    else throw "Unsupported platform";
-  sha256 =
-    if stdenv.system == "x86_64-linux" then "1haikynkg1pqyrzzqk1qxm19p36ww58qp8brh3fjxssp4x71rcdy"
-    else if stdenv.system == "i686-linux" then "0lmbrdf7wjdwj5yx0khnq871yxvhfwqxjjyfkqcdy5ik18lvlkj8"
-    else throw "Unsupported platform";
+
+  libpath = makeLibraryPath [ stdenv.cc.cc stdenv.cc.libc dwarf-fortress-unfuck SDL ];
+
+  homepage = http://www.bay12games.com/dwarves/;
+
+  # Other srcs are avilable like 32-bit mac & win, but I have only
+  # included the ones most likely to be needed by Nixpkgs users.
+  srcs = {
+    "x86_64-linux" = fetchurl {
+      url = "${homepage}df_${baseVersion}_${patchVersion}_linux.tar.bz2";
+      sha256 = "1haikynkg1pqyrzzqk1qxm19p36ww58qp8brh3fjxssp4x71rcdy";
+    };
+    "i686-linux" = fetchurl {
+      url = "${homepage}df_${baseVersion}_${patchVersion}_linux32.tar.bz2";
+      sha256 = "0lmbrdf7wjdwj5yx0khnq871yxvhfwqxjjyfkqcdy5ik18lvlkj8";
+    };
+    "x86_64-darwin" = fetchurl {
+      url = "${homepage}df_${baseVersion}_${patchVersion}_osx.tar.bz2";
+      sha256 = "01dss8g9lmi8majp6lxcfw166ydz4himkz6am5pi29gixaf4vfqs";
+    };
+  };
 
 in
 
-assert dwarf-fortress-unfuck.dfVersion == dfVersion;
+assert dwarf-fortress-unfuck != null ->
+       dwarf-fortress-unfuck.dfVersion == dfVersion;
 
 stdenv.mkDerivation {
   name = "dwarf-fortress-original-${dfVersion}";
 
-  src = fetchurl {
-    url = "http://www.bay12games.com/dwarves/df_${baseVersion}_${patchVersion}_${platform}.tar.bz2";
-    inherit sha256;
-  };
+  src = if builtins.hasAttr stdenv.system srcs
+        then builtins.getAttr stdenv.system srcs
+        else throw "Unsupported systems";
 
   installPhase = ''
     mkdir -p $out
     cp -r * $out
     rm $out/libs/lib*
 
-    # Store the original hash
-    md5sum $out/libs/Dwarf_Fortress | awk '{ print $1 }' > $out/hash.md5.orig
+    exe=$out/${if stdenv.isLinux then "libs/Dwarf_Fortress"
+                                 else "dwarfort.exe"}
 
+    # Store the original hash
+    md5sum $exe | awk '{ print $1 }' > $out/hash.md5.orig
+  '' + optionalString stdenv.isLinux ''
     patchelf \
       --set-interpreter $(cat ${stdenv.cc}/nix-support/dynamic-linker) \
       --set-rpath "${libpath}" \
-      $out/libs/Dwarf_Fortress
+      $exe
+  '' + optionalString stdenv.isDarwin ''
+    # My custom unfucked dwarfort.exe for macOS. Can't use
+    # absolute paths because original doesn't have enough
+    # header space. Someone plz break into Tarn's house & put
+    # -headerpad_max_install_names into his LDFLAGS.
+
+    ln -s ${getLib ncurses}/lib/libncurses.dylib $out/libs
+    ln -s ${getLib gcc.cc}/lib/libstdc++.6.dylib $out/libs
+    ln -s ${getLib fmodex}/lib/libfmodex.dylib $out/libs
 
+    install_name_tool \
+      -change /usr/lib/libncurses.5.4.dylib \
+              @executable_path/libs/libncurses.dylib \
+      -change /usr/local/lib/x86_64/libstdc++.6.dylib \
+              @executable_path/libs/libstdc++.6.dylib \
+      $exe
+  '' + ''
     # Store the new hash
-    md5sum $out/libs/Dwarf_Fortress | awk '{ print $1 }' > $out/hash.md5
+    md5sum $exe | awk '{ print $1 }' > $out/hash.md5
   '';
 
   passthru = { inherit baseVersion patchVersion dfVersion; };
 
-  meta = with stdenv.lib; {
+  meta = {
     description = "A single-player fantasy game with a randomly generated adventure world";
-    homepage = http://www.bay12games.com/dwarves;
+    inherit homepage;
     license = licenses.unfreeRedistributable;
-    platforms = platforms.linux;
+    platforms = attrNames srcs;
     maintainers = with maintainers; [ a1russell robbinch roconnor the-kenny abbradar ];
   };
 }
diff --git a/pkgs/games/dwarf-fortress/wrapper/default.nix b/pkgs/games/dwarf-fortress/wrapper/default.nix
index 3d904d006e4..e82cc2be680 100644
--- a/pkgs/games/dwarf-fortress/wrapper/default.nix
+++ b/pkgs/games/dwarf-fortress/wrapper/default.nix
@@ -47,6 +47,8 @@ stdenv.mkDerivation rec {
     name = "dwarf-fortress-init";
     src = ./dwarf-fortress-init.in;
     inherit env;
+    exe = if stdenv.isLinux then "libs/Dwarf_Fortress"
+                             else "dwarfort.exe";
   };
 
   runDF = ./dwarf-fortress.in;
diff --git a/pkgs/games/dwarf-fortress/wrapper/dwarf-fortress-init.in b/pkgs/games/dwarf-fortress/wrapper/dwarf-fortress-init.in
index 093dae562c2..054935af012 100644
--- a/pkgs/games/dwarf-fortress/wrapper/dwarf-fortress-init.in
+++ b/pkgs/games/dwarf-fortress/wrapper/dwarf-fortress-init.in
@@ -2,6 +2,7 @@ shopt -s extglob
 
 [ -z "$DF_DIR" ] && DF_DIR="${XDG_DATA_HOME:-$HOME/.local/share}/df_linux"
 env_dir="@env@"
+exe="$env_dir/@exe@"
 
 update_path() {
   local path="$1"
diff --git a/pkgs/games/dwarf-fortress/wrapper/dwarf-fortress.in b/pkgs/games/dwarf-fortress/wrapper/dwarf-fortress.in
index f405f1b0e39..4448bd05fda 100644
--- a/pkgs/games/dwarf-fortress/wrapper/dwarf-fortress.in
+++ b/pkgs/games/dwarf-fortress/wrapper/dwarf-fortress.in
@@ -2,5 +2,8 @@
 
 source @dfInit@
 
+export DYLD_LIBRARY_PATH="$env_dir/libs"
+export DYLD_FRAMEWORK_PATH="$env_dir/libs"
+
 cd "$DF_DIR"
-exec "$env_dir/libs/Dwarf_Fortress" "$@"
+exec "$exe" "$@"
diff --git a/pkgs/games/wesnoth/default.nix b/pkgs/games/wesnoth/default.nix
index 81ffd6b135f..4a3d2bd78a0 100644
--- a/pkgs/games/wesnoth/default.nix
+++ b/pkgs/games/wesnoth/default.nix
@@ -5,13 +5,13 @@
 
 stdenv.mkDerivation rec {
   pname = "wesnoth";
-  version = "1.14.0";
+  version = "1.14.1";
 
   name = "${pname}-${version}";
 
   src = fetchurl {
     url = "mirror://sourceforge/sourceforge/${pname}/${name}.tar.bz2";
-    sha256 = "09niq53y17faizhmd98anx3dha7hvacvj9a0a64lg8wn915cm0bw";
+    sha256 = "1mzrnbv71b4s41c5x8clhb53l8lidiwzny1hl828228pvys5bxkb";
   };
 
   nativeBuildInputs = [ cmake pkgconfig ];
diff --git a/pkgs/games/zandronum/fmod.nix b/pkgs/games/zandronum/fmod.nix
index 7f76101d8ce..2c53d93e401 100644
--- a/pkgs/games/zandronum/fmod.nix
+++ b/pkgs/games/zandronum/fmod.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchurl, alsaLib, libpulseaudio }:
+{ stdenv, lib, fetchurl, alsaLib, libpulseaudio, undmg }:
 
 let
   bits = stdenv.lib.optionalString (stdenv.system == "x86_64-linux") "64";
@@ -8,20 +8,30 @@ in
 stdenv.mkDerivation rec {
   name = "fmod-${version}";
   version = "4.44.64";
+  shortVersion = builtins.replaceStrings [ "." ] [ "" ] version;
 
-  src = fetchurl {
-    url = "https://zdoom.org/files/fmod/fmodapi44464linux.tar.gz";
+  src = fetchurl (if stdenv.isLinux then {
+    url = "https://zdoom.org/files/fmod/fmodapi${shortVersion}linux.tar.gz";
     sha256 = "047hk92xapwwqj281f4zwl0ih821rrliya70gfj82sdfjh9lz8i1";
-  };
+  } else {
+    url = "https://zdoom.org/files/fmod/fmodapi${shortVersion}mac-installer.dmg";
+    sha256 = "1m1y4cpcwpkl8x31d3s68xzp107f343ma09w2437i2adn5y7m8ii";
+  });
+
+  nativeBuildInputs = [ undmg ];
 
   dontStrip = true;
   dontPatchELF = true;
   dontBuild = true;
 
-  installPhase = ''
+  installPhase = lib.optionalString stdenv.isLinux ''
     install -Dm755 api/lib/libfmodex${bits}-${version}.so $out/lib/libfmodex-${version}.so
     ln -s libfmodex-${version}.so $out/lib/libfmodex.so
     patchelf --set-rpath ${libPath} $out/lib/libfmodex.so
+  '' + lib.optionalString stdenv.isDarwin ''
+    install -D api/lib/libfmodex.dylib $out/lib/libfmodex.dylib
+    install -D api/lib/libfmodexL.dylib $out/lib/libfmodexL.dylib
+  '' + ''
     cp -r api/inc $out/include
   '';
 
@@ -29,7 +39,7 @@ stdenv.mkDerivation rec {
     description = "Programming library and toolkit for the creation and playback of interactive audio";
     homepage    = http://www.fmod.org/;
     license     = licenses.unfreeRedistributable;
-    platforms   = [ "x86_64-linux" "i686-linux" ];
+    platforms   = [ "x86_64-linux" "i686-linux" "x86_64-darwin" ];
     maintainers = [ maintainers.lassulus ];
   };
 }
diff --git a/pkgs/misc/emulators/retroarch/default.nix b/pkgs/misc/emulators/retroarch/default.nix
index e898a5804b0..c834f6c9047 100644
--- a/pkgs/misc/emulators/retroarch/default.nix
+++ b/pkgs/misc/emulators/retroarch/default.nix
@@ -12,11 +12,20 @@
 , udev ? null
 , enableNvidiaCgToolkit ? false, nvidia_cg_toolkit ? null
 , withVulkan ? stdenv.isLinux, vulkan-loader ? null
+, targetPlatform, fetchurl
 }:
 
 with stdenv.lib;
 
-stdenv.mkDerivation rec {
+let
+
+  # ibtool is closed source so we have to download the blob
+  osx-MainMenu = fetchurl {
+    url = "https://github.com/matthewbauer/RetroArch/raw/b146a9ac6b2b516652a7bf05a9db5a804eab323d/pkg/apple/OSX/en.lproj/MainMenu.nib";
+    sha256 = "13k1l628wy0rp6wxrpwr4g1m9c997d0q8ks50f8zhmh40l5j2sp8";
+  };
+
+in stdenv.mkDerivation rec {
   name = "retroarch-bare-${version}";
   version = "1.7.1";
 
@@ -39,8 +48,31 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  postInstall = optional withVulkan ''
+  postInstall = optionalString withVulkan ''
     wrapProgram $out/bin/retroarch --prefix LD_LIBRARY_PATH ':' ${vulkan-loader}/lib
+  '' + optionalString targetPlatform.isDarwin ''
+    EXECUTABLE_NAME=RetroArch
+    PRODUCT_NAME=RetroArch
+    MACOSX_DEPLOYMENT_TARGET=10.5
+    app=$out/Applications/$PRODUCT_NAME.app
+
+    install -D pkg/apple/OSX/Info.plist $app/Contents/Info.plist
+    echo "APPL????" > $app/Contents/PkgInfo
+    mkdir -p $app/Contents/MacOS
+    ln -s $out/bin/retroarch $app/Contents/MacOS/$EXECUTABLE_NAME
+
+    # Hack to fill in Info.plist template w/o using xcode
+    sed -i -e 's,''${EXECUTABLE_NAME}'",$EXECUTABLE_NAME," \
+           -e 's,''${MACOSX_DEPLOYMENT_TARGET}'",$MACOSX_DEPLOYMENT_TARGET," \
+           -e 's,''${PRODUCT_NAME}'",$PRODUCT_NAME," \
+           -e 's,''${PRODUCT_NAME:rfc1034identifier}'",$PRODUCT_NAME," \
+           $app/Contents/Info.plist
+
+    install -D ${osx-MainMenu} \
+               $app/Contents/Resources/en.lproj/MainMenu.nib
+    install -D pkg/apple/OSX/en.lproj/InfoPlist.strings \
+               $app/Contents/Resources/en.lproj/InfoPlist.strings
+    install -D media/retroarch.icns $app/Contents/Resources/retroarch.icns
   '';
 
   preFixup = "rm $out/bin/retroarch-cg2glsl";
diff --git a/pkgs/misc/emulators/retroarch/wrapper.nix b/pkgs/misc/emulators/retroarch/wrapper.nix
index 58d41699854..71b26b4af6f 100644
--- a/pkgs/misc/emulators/retroarch/wrapper.nix
+++ b/pkgs/misc/emulators/retroarch/wrapper.nix
@@ -21,6 +21,10 @@ stdenv.mkDerivation {
 
     ln -s -t $out ${retroarch}/share
 
+    if [ -d ${retroarch}/Applications ]; then
+      ln -s -t $out ${retroarch}/Applications
+    fi
+
     makeWrapper ${retroarch}/bin/retroarch $out/bin/retroarch \
       --suffix-each LD_LIBRARY_PATH ':' "$cores" \
       --add-flags "-L $out/lib/ --menu" \
diff --git a/pkgs/os-specific/darwin/osx-private-sdk/default.nix b/pkgs/os-specific/darwin/osx-private-sdk/default.nix
index 1eecdbc5618..115512a6feb 100644
--- a/pkgs/os-specific/darwin/osx-private-sdk/default.nix
+++ b/pkgs/os-specific/darwin/osx-private-sdk/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation {
     sha256 = "0bv0884yxpvk2ishxj8gdy1w6wb0gwfq55q5qjp0s8z0z7f63zqh";
   };
 
-  # NOTE: we install only headers that are really needed to keep closure sie
+  # NOTE: we install only headers that are really needed to keep closure size
   # reasonable.
   installPhase = ''
     mkdir -p $out/include
diff --git a/pkgs/os-specific/darwin/skhd/default.nix b/pkgs/os-specific/darwin/skhd/default.nix
index 3331084d807..c51ada10d68 100644
--- a/pkgs/os-specific/darwin/skhd/default.nix
+++ b/pkgs/os-specific/darwin/skhd/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   name = "skhd-${version}";
-  version = "0.0.14";
+  version = "0.1.1";
 
   src = fetchFromGitHub {
     owner = "koekeishiya";
     repo = "skhd";
     rev = "v${version}";
-    sha256 = "0kkmlka1hxsjdkx0ywkm48p9v1jhld26lfplls20n0hj97i5iwlz";
+    sha256 = "1wh7v90ydh27gbaiwn2r6ncx6yiic4mph3w9vi1282nz2q02zxss";
   };
 
   buildInputs = [ Carbon ];
diff --git a/pkgs/os-specific/linux/acpid/default.nix b/pkgs/os-specific/linux/acpid/default.nix
index 7a234b16c91..ad763d2ee29 100644
--- a/pkgs/os-specific/linux/acpid/default.nix
+++ b/pkgs/os-specific/linux/acpid/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ stdenv, fetchurl, autoreconfHook }:
 
 stdenv.mkDerivation rec {
   name = "acpid-2.0.29";
@@ -8,6 +8,16 @@ stdenv.mkDerivation rec {
     sha256 = "1zq38al07z92r2md18zivrzgjqnn7m2wahdpgri6wijwjwkknl2q";
   };
 
+  nativeBuildInputs = [ autoreconfHook ];
+
+  # remove when https://sourceforge.net/p/acpid2/code/merge-requests/1/ is merged
+  postPatch = ''
+    substituteInPlace configure.ac \
+      --replace "AC_FUNC_MALLOC" "" \
+      --replace "AC_FUNC_REALLOC" "" \
+      --replace "strrchr strtol" "strrchr strtol malloc realloc"
+  '';
+
   meta = with stdenv.lib; {
     homepage = http://tedfelix.com/linux/acpid-netlink.html;
     description = "A daemon for delivering ACPI events to userspace programs";
diff --git a/pkgs/os-specific/linux/bluez/default.nix b/pkgs/os-specific/linux/bluez/default.nix
index bbf01e5027c..a67133c3236 100644
--- a/pkgs/os-specific/linux/bluez/default.nix
+++ b/pkgs/os-specific/linux/bluez/default.nix
@@ -10,24 +10,28 @@ stdenv.mkDerivation rec {
     sha256 = "15ffsaz7l3fgdg03l7g1xx9jw7xgs6pc548zxqsxawsca5x1sc1k";
   };
 
-  pythonPath = with pythonPackages;
-    [ dbus-python pygobject2 pygobject3 recursivePthLoader ];
+  pythonPath = with pythonPackages; [
+    dbus-python pygobject2 pygobject3 recursivePthLoader
+  ];
 
   buildInputs = [
-    pkgconfig dbus glib alsaLib pythonPackages.python pythonPackages.wrapPython
+    dbus glib alsaLib pythonPackages.python pythonPackages.wrapPython
     readline udev libical
   ];
 
+  nativeBuildInputs = [ pkgconfig ];
+
   outputs = [ "out" "dev" "test" ];
 
   patches = [ ./bluez-5.37-obexd_without_systemd-1.patch ];
 
-  preConfigure = ''
-      substituteInPlace tools/hid2hci.rules --replace /sbin/udevadm ${systemd}/bin/udevadm
-      substituteInPlace tools/hid2hci.rules --replace "hid2hci " "$out/lib/udev/hid2hci "
-    '';
+  postConfigure = ''
+    substituteInPlace tools/hid2hci.rules \
+      --replace /sbin/udevadm ${systemd}/bin/udevadm \
+      --replace "hid2hci " "$out/lib/udev/hid2hci "
+  '';
 
-  configureFlags = [
+  configureFlags = (with stdenv.lib; [
     "--localstatedir=/var"
     "--enable-library"
     "--enable-cups"
@@ -38,8 +42,8 @@ stdenv.mkDerivation rec {
     "--with-systemdsystemunitdir=$(out)/etc/systemd/system"
     "--with-systemduserunitdir=$(out)/etc/systemd/user"
     "--with-udevdir=$(out)/lib/udev"
-    ] ++ stdenv.lib.optional enableWiimote [ "--enable-wiimote" ]
-    ++ stdenv.lib.optional enableMidi [ "--enable-midi" ];
+    ] ++ optional enableWiimote [ "--enable-wiimote" ]
+      ++ optional enableMidi    [ "--enable-midi" ]);
 
   # Work around `make install' trying to create /var/lib/bluetooth.
   installFlags = "statedir=$(TMPDIR)/var/lib/bluetooth";
@@ -71,14 +75,21 @@ stdenv.mkDerivation rec {
     # Add extra configuration
     mkdir $out/etc/bluetooth
     ln -s /etc/bluetooth/main.conf $out/etc/bluetooth/main.conf
+
+    # Add missing tools, ref https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/bluez
+    for files in `find tools/ -type f -perm -755`; do
+      filename=$(basename $files)
+      install -Dm755 tools/$filename $out/bin/$filename
+    done
   '';
 
   enableParallelBuilding = true;
 
   meta = with stdenv.lib; {
-    homepage = http://www.bluez.org/;
-    repositories.git = https://git.kernel.org/pub/scm/bluetooth/bluez.git;
     description = "Bluetooth support for Linux";
+    homepage = http://www.bluez.org/;
+    license = with licenses; [ gpl2 lgpl21 ];
     platforms = platforms.linux;
+    repositories.git = https://git.kernel.org/pub/scm/bluetooth/bluez.git;
   };
 }
diff --git a/pkgs/os-specific/linux/kernel/mips-ext3-n32.patch b/pkgs/os-specific/linux/kernel/mips-ext3-n32.patch
deleted file mode 100644
index fcb6f9177c7..00000000000
--- a/pkgs/os-specific/linux/kernel/mips-ext3-n32.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-Dirty patch that makes ext3 work again on 3.5 and 3.6 kernels,
-on mips n32.
-
-http://www.linux-mips.org/archives/linux-mips/2012-11/msg00030.html
-
-diff --git a/fs/ext3/dir.c b/fs/ext3/dir.c
-index 92490e9..bf63d7b 100644
---- a/fs/ext3/dir.c
-+++ b/fs/ext3/dir.c
-@@ -228,6 +228,7 @@ out:
- 
- static inline int is_32bit_api(void)
- {
-+	return 1;
- #ifdef CONFIG_COMPAT
- 	return is_compat_task();
- #else
diff --git a/pkgs/os-specific/linux/kernel/mips-fpu-sigill.patch b/pkgs/os-specific/linux/kernel/mips-fpu-sigill.patch
deleted file mode 100644
index 248aba2b2c2..00000000000
--- a/pkgs/os-specific/linux/kernel/mips-fpu-sigill.patch
+++ /dev/null
@@ -1,507 +0,0 @@
-From bf55ef4e3c2f622ac013f196affbd11b67b59223 Mon Sep 17 00:00:00 2001
-From: Mark H Weaver <mhw@netris.org>
-Date: Fri, 28 Oct 2011 13:24:37 -0400
-Subject: [PATCH 2/4] Fix handling of prefx instruction in mips/math-emu
-
-* The instruction is named prefx, not pfetch, and its function
-  field is 0x17, not 0x07.
-
-* Recognize the prefx instruction regardless of what bits happen to be
-  in bits 21-25, which is the format field of the floating-point ops,
-  but holds the base register of the prefx instruction.
----
- arch/mips/include/asm/inst.h |    4 ++--
- arch/mips/math-emu/cp1emu.c  |   16 +++++++---------
- 2 files changed, 9 insertions(+), 11 deletions(-)
-
-diff --git a/arch/mips/include/asm/inst.h b/arch/mips/include/asm/inst.h
-index ab84064..3048edc 100644
---- a/arch/mips/include/asm/inst.h
-+++ b/arch/mips/include/asm/inst.h
-@@ -161,8 +161,8 @@ enum cop1_sdw_func {
-  */
- enum cop1x_func {
- 	lwxc1_op     =  0x00, ldxc1_op     =  0x01,
--	pfetch_op    =  0x07, swxc1_op     =  0x08,
--	sdxc1_op     =  0x09, madd_s_op    =  0x20,
-+	swxc1_op     =  0x08, sdxc1_op     =  0x09,
-+	prefx_op     =  0x17, madd_s_op    =  0x20,
- 	madd_d_op    =  0x21, madd_e_op    =  0x22,
- 	msub_s_op    =  0x28, msub_d_op    =  0x29,
- 	msub_e_op    =  0x2a, nmadd_s_op   =  0x30,
-diff --git a/arch/mips/math-emu/cp1emu.c b/arch/mips/math-emu/cp1emu.c
-index dbf2f93..87ddba1 100644
---- a/arch/mips/math-emu/cp1emu.c
-+++ b/arch/mips/math-emu/cp1emu.c
-@@ -739,7 +739,7 @@ static int fpux_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
- 			break;
- 
- 		default:
--			return SIGILL;
-+			goto SIGILL_unless_prefx_op;
- 		}
- 		break;
- 	}
-@@ -809,19 +809,17 @@ static int fpux_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
- 			goto copcsr;
- 
- 		default:
--			return SIGILL;
-+			goto SIGILL_unless_prefx_op;
- 		}
- 		break;
- 	}
- 
--	case 0x7:		/* 7 */
--		if (MIPSInst_FUNC(ir) != pfetch_op) {
--			return SIGILL;
--		}
--		/* ignore prefx operation */
--		break;
--
- 	default:
-+	      SIGILL_unless_prefx_op:
-+		if (MIPSInst_FUNC(ir) == prefx_op) {
-+			/* ignore prefx operation */
-+			break;
-+		}
- 		return SIGILL;
- 	}
- 
--- 
-1.7.5.4
-
-From 97a564e3eddbfb84844b8eccb3bd751c71dfb3eb Mon Sep 17 00:00:00 2001
-From: Mark H Weaver <mhw@netris.org>
-Date: Fri, 28 Oct 2011 13:35:27 -0400
-Subject: [PATCH 3/4] Don't process empty cause flags after simple fp move on
- mips
-
----
- arch/mips/math-emu/cp1emu.c |    4 ++--
- 1 files changed, 2 insertions(+), 2 deletions(-)
-
-diff --git a/arch/mips/math-emu/cp1emu.c b/arch/mips/math-emu/cp1emu.c
-index 87ddba1..fefcba2 100644
---- a/arch/mips/math-emu/cp1emu.c
-+++ b/arch/mips/math-emu/cp1emu.c
-@@ -912,7 +912,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
- 		case fmov_op:
- 			/* an easy one */
- 			SPFROMREG(rv.s, MIPSInst_FS(ir));
--			goto copcsr;
-+			break;
- 
- 			/* binary op on handler */
- 		      scopbop:
-@@ -1099,7 +1099,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
- 		case fmov_op:
- 			/* an easy one */
- 			DPFROMREG(rv.d, MIPSInst_FS(ir));
--			goto copcsr;
-+			break;
- 
- 			/* binary op on handler */
- 		      dcopbop:{
--- 
-1.7.5.4
-
-From 4051727b3007ef3675e7258ed86fa8517f86d929 Mon Sep 17 00:00:00 2001
-From: Mark H Weaver <mhw@netris.org>
-Date: Fri, 28 Oct 2011 13:39:10 -0400
-Subject: [PATCH 4/4] Support Loongson2f floating-point instructions in
- mips/math-emu
-
-* (arch/mips/include/asm/inst.h): Add Loongson2f function field values
-  for madd/msub/nmadd/nmsub that use the spec2 opcode, and the
-  Loongson2f/MIPS-5 format field value for paired-single
-  floating-point operations.
-
-* (arch/mips/math-emu/cp1emu.c): Add support for the Loongson2f
-  instructions for madd/msub/nmadd/nmsub, which use the spec2 opcode.
-  Also add support for the Loongson2f instructions that use the
-  paired-single floating-point format.
----
- arch/mips/include/asm/inst.h |    4 +-
- arch/mips/math-emu/cp1emu.c  |  287 +++++++++++++++++++++++++++++++++++++++++-
- 2 files changed, 289 insertions(+), 2 deletions(-)
-
-diff --git a/arch/mips/include/asm/inst.h b/arch/mips/include/asm/inst.h
-index 3048edc..0e8ba7c 100644
---- a/arch/mips/include/asm/inst.h
-+++ b/arch/mips/include/asm/inst.h
-@@ -61,6 +61,8 @@ enum spec_op {
- enum spec2_op {
- 	madd_op, maddu_op, mul_op, spec2_3_unused_op,
- 	msub_op, msubu_op, /* more unused ops */
-+	loongson_madd_op = 0x18, loongson_msub_op,
-+	loongson_nmadd_op, loongson_nmsub_op,
- 	clz_op = 0x20, clo_op,
- 	dclz_op = 0x24, dclo_op,
- 	sdbpp_op = 0x3f
-@@ -133,7 +135,7 @@ enum cop0_com_func {
-  */
- enum cop1_fmt {
- 	s_fmt, d_fmt, e_fmt, q_fmt,
--	w_fmt, l_fmt
-+	w_fmt, l_fmt, ps_fmt
- };
- 
- /*
-diff --git a/arch/mips/math-emu/cp1emu.c b/arch/mips/math-emu/cp1emu.c
-index fefcba2..166b2a4 100644
---- a/arch/mips/math-emu/cp1emu.c
-+++ b/arch/mips/math-emu/cp1emu.c
-@@ -7,6 +7,9 @@
-  * Kevin D. Kissell, kevink@mips.com and Carsten Langgaard, carstenl@mips.com
-  * Copyright (C) 2000  MIPS Technologies, Inc.
-  *
-+ * Loongson instruction support
-+ * Copyright (C) 2011  Mark H Weaver <mhw@netris.org>
-+ *
-  *  This program is free software; you can distribute it and/or modify it
-  *  under the terms of the GNU General Public License (Version 2) as
-  *  published by the Free Software Foundation.
-@@ -57,6 +60,14 @@
- #endif
- #define __mips 4
- 
-+#ifdef __loongson_fp
-+#undef __loongson_fp
-+#endif
-+#if __mips >= 4 && __mips != 32
-+/* Include support for Loongson floating point instructions */
-+#define __loongson_fp 1
-+#endif
-+
- /* Function which emulates a floating point instruction. */
- 
- static int fpu_emu(struct pt_regs *, struct mips_fpu_struct *,
-@@ -66,6 +77,10 @@ static int fpu_emu(struct pt_regs *, struct mips_fpu_struct *,
- static int fpux_emu(struct pt_regs *,
- 	struct mips_fpu_struct *, mips_instruction, void *__user *);
- #endif
-+#ifdef __loongson_fp
-+static int loongson_spec2_emu(struct pt_regs *,
-+	struct mips_fpu_struct *, mips_instruction, void *__user *);
-+#endif
- 
- /* Further private data for which no space exists in mips_fpu_struct */
- 
-@@ -203,6 +218,14 @@ static inline int cop1_64bit(struct pt_regs *xcp)
- #define DPFROMREG(dp, x)	DIFROMREG((dp).bits, x)
- #define DPTOREG(dp, x)	DITOREG((dp).bits, x)
- 
-+/* Support for Loongson paired single floating-point format */
-+#define PSIFROMREG(si1, si2, x) ({ u64 di; DIFROMREG(di, x);		\
-+			(si1) = (u32)di; (si2) = (u32)(di >> 32); })
-+#define PSITOREG(si1, si2, x) DITOREG((si1) | ((u64)(si2) << 32), x)
-+
-+#define PSPFROMREG(sp1, sp2, x) PSIFROMREG((sp1).bits, (sp2).bits, x)
-+#define PSPTOREG(sp1, sp2, x)	PSITOREG((sp1).bits, (sp2).bits, x)
-+
- /*
-  * Emulate the single floating point instruction pointed at by EPC.
-  * Two instructions if the instruction is in a branch delay slot.
-@@ -568,6 +591,15 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
- 		break;
- #endif
- 
-+#ifdef __loongson_fp
-+	case spec2_op:{
-+		int sig = loongson_spec2_emu(xcp, ctx, ir, fault_addr);
-+		if (sig)
-+			return sig;
-+		break;
-+	}
-+#endif
-+
- 	default:
- 		return SIGILL;
- 	}
-@@ -646,6 +678,172 @@ DEF3OP(msub, dp, ieee754dp_mul, ieee754dp_sub, );
- DEF3OP(nmadd, dp, ieee754dp_mul, ieee754dp_add, ieee754dp_neg);
- DEF3OP(nmsub, dp, ieee754dp_mul, ieee754dp_sub, ieee754dp_neg);
- 
-+#ifdef __loongson_fp
-+static int loongson_spec2_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
-+	mips_instruction ir, void *__user *fault_addr)
-+{
-+	int rfmt;		/* resulting format */
-+	unsigned rcsr = 0;	/* resulting csr */
-+	union {
-+		ieee754dp d;
-+		struct {
-+			ieee754sp s;
-+			ieee754sp s2;
-+		};
-+	} rv;			/* resulting value */
-+
-+	/* XXX maybe add a counter for loongson spec2 fp instructions? */
-+	/* MIPS_FPU_EMU_INC_STATS(cp1xops); */
-+
-+	switch (rfmt = (MIPSInst_FFMT(ir) & 0xf)) {
-+	case s_fmt:{
-+		ieee754sp(*handler) (ieee754sp, ieee754sp, ieee754sp);
-+		ieee754sp fd, fs, ft;
-+
-+		switch (MIPSInst_FUNC(ir)) {
-+		case loongson_madd_op:
-+			handler = fpemu_sp_madd;
-+			goto scoptop;
-+		case loongson_msub_op:
-+			handler = fpemu_sp_msub;
-+			goto scoptop;
-+		case loongson_nmadd_op:
-+			handler = fpemu_sp_nmadd;
-+			goto scoptop;
-+		case loongson_nmsub_op:
-+			handler = fpemu_sp_nmsub;
-+			goto scoptop;
-+
-+		      scoptop:
-+			SPFROMREG(fd, MIPSInst_FD(ir));
-+			SPFROMREG(fs, MIPSInst_FS(ir));
-+			SPFROMREG(ft, MIPSInst_FT(ir));
-+			rv.s = (*handler) (fd, fs, ft);
-+
-+		      copcsr:
-+			if (ieee754_cxtest(IEEE754_INEXACT))
-+				rcsr |= FPU_CSR_INE_X | FPU_CSR_INE_S;
-+			if (ieee754_cxtest(IEEE754_UNDERFLOW))
-+				rcsr |= FPU_CSR_UDF_X | FPU_CSR_UDF_S;
-+			if (ieee754_cxtest(IEEE754_OVERFLOW))
-+				rcsr |= FPU_CSR_OVF_X | FPU_CSR_OVF_S;
-+			if (ieee754_cxtest(IEEE754_INVALID_OPERATION))
-+				rcsr |= FPU_CSR_INV_X | FPU_CSR_INV_S;
-+
-+			break;
-+
-+		default:
-+			return SIGILL;
-+		}
-+		break;
-+	}
-+
-+	case d_fmt:{
-+		ieee754dp(*handler) (ieee754dp, ieee754dp, ieee754dp);
-+		ieee754dp fd, fs, ft;
-+
-+		switch (MIPSInst_FUNC(ir)) {
-+		case loongson_madd_op:
-+			handler = fpemu_dp_madd;
-+			goto dcoptop;
-+		case loongson_msub_op:
-+			handler = fpemu_dp_msub;
-+			goto dcoptop;
-+		case loongson_nmadd_op:
-+			handler = fpemu_dp_nmadd;
-+			goto dcoptop;
-+		case loongson_nmsub_op:
-+			handler = fpemu_dp_nmsub;
-+			goto dcoptop;
-+
-+		      dcoptop:
-+			DPFROMREG(fd, MIPSInst_FD(ir));
-+			DPFROMREG(fs, MIPSInst_FS(ir));
-+			DPFROMREG(ft, MIPSInst_FT(ir));
-+			rv.d = (*handler) (fd, fs, ft);
-+			goto copcsr;
-+
-+		default:
-+			return SIGILL;
-+		}
-+		break;
-+	}
-+
-+	case ps_fmt:{
-+		ieee754sp(*handler) (ieee754sp, ieee754sp, ieee754sp);
-+		struct _ieee754_csr ieee754_csr_save;
-+		ieee754sp fd1, fs1, ft1;
-+		ieee754sp fd2, fs2, ft2;
-+
-+		switch (MIPSInst_FUNC(ir)) {
-+		case loongson_madd_op:
-+			handler = fpemu_sp_madd;
-+			goto pscoptop;
-+		case loongson_msub_op:
-+			handler = fpemu_sp_msub;
-+			goto pscoptop;
-+		case loongson_nmadd_op:
-+			handler = fpemu_sp_nmadd;
-+			goto pscoptop;
-+		case loongson_nmsub_op:
-+			handler = fpemu_sp_nmsub;
-+			goto pscoptop;
-+
-+		      pscoptop:
-+			PSPFROMREG(fd1, fd2, MIPSInst_FD(ir));
-+			PSPFROMREG(fs1, fs2, MIPSInst_FS(ir));
-+			PSPFROMREG(ft1, ft2, MIPSInst_FT(ir));
-+			rv.s = (*handler) (fd1, fs1, ft1);
-+			ieee754_csr_save = ieee754_csr;
-+			rv.s2 = (*handler) (fd2, fs2, ft2);
-+			ieee754_csr.cx |= ieee754_csr_save.cx;
-+			ieee754_csr.sx |= ieee754_csr_save.sx;
-+			goto copcsr;
-+
-+		default:
-+			return SIGILL;
-+		}
-+		break;
-+	}
-+
-+	default:
-+		return SIGILL;
-+	}
-+
-+	/*
-+	 * Update the fpu CSR register for this operation.
-+	 * If an exception is required, generate a tidy SIGFPE exception,
-+	 * without updating the result register.
-+	 * Note: cause exception bits do not accumulate, they are rewritten
-+	 * for each op; only the flag/sticky bits accumulate.
-+	 */
-+	ctx->fcr31 = (ctx->fcr31 & ~FPU_CSR_ALL_X) | rcsr;
-+	if ((ctx->fcr31 >> 5) & ctx->fcr31 & FPU_CSR_ALL_E) {
-+		/*printk ("SIGFPE: fpu csr = %08x\n",ctx->fcr31); */
-+		return SIGFPE;
-+	}
-+
-+	/*
-+	 * Now we can safely write the result back to the register file.
-+	 */
-+	switch (rfmt) {
-+	case d_fmt:
-+		DPTOREG(rv.d, MIPSInst_FD(ir));
-+		break;
-+	case s_fmt:
-+		SPTOREG(rv.s, MIPSInst_FD(ir));
-+		break;
-+	case ps_fmt:
-+		PSPTOREG(rv.s, rv.s2, MIPSInst_FD(ir));
-+		break;
-+	default:
-+		return SIGILL;
-+	}
-+
-+	return 0;
-+}
-+#endif
-+
- static int fpux_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
- 	mips_instruction ir, void *__user *fault_addr)
- {
-@@ -840,7 +1038,12 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
- 	unsigned cond;
- 	union {
- 		ieee754dp d;
--		ieee754sp s;
-+		struct {
-+			ieee754sp s;
-+#ifdef __loongson_fp
-+			ieee754sp s2; /* for Loongson paired singles */
-+#endif
-+		};
- 		int w;
- #ifdef __mips64
- 		s64 l;
-@@ -1210,6 +1413,83 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
- 		break;
- 	}
- 
-+#ifdef __loongson_fp
-+	case ps_fmt:{		/* 6 */
-+		/* Support for Loongson paired single fp instructions */
-+		union {
-+			ieee754sp(*b) (ieee754sp, ieee754sp);
-+			ieee754sp(*u) (ieee754sp);
-+		} handler;
-+
-+		switch (MIPSInst_FUNC(ir)) {
-+			/* binary ops */
-+		case fadd_op:
-+			handler.b = ieee754sp_add;
-+			goto pscopbop;
-+		case fsub_op:
-+			handler.b = ieee754sp_sub;
-+			goto pscopbop;
-+		case fmul_op:
-+			handler.b = ieee754sp_mul;
-+			goto pscopbop;
-+
-+			/* unary  ops */
-+		case fabs_op:
-+			handler.u = ieee754sp_abs;
-+			goto pscopuop;
-+		case fneg_op:
-+			handler.u = ieee754sp_neg;
-+			goto pscopuop;
-+		case fmov_op:
-+			/* an easy one */
-+			PSPFROMREG(rv.s, rv.s2, MIPSInst_FS(ir));
-+			break;
-+
-+		      pscopbop: /* paired binary op handler */
-+			{
-+				struct _ieee754_csr ieee754_csr_save;
-+				ieee754sp fs1, ft1;
-+				ieee754sp fs2, ft2;
-+
-+				PSPFROMREG(fs1, fs2, MIPSInst_FS(ir));
-+				PSPFROMREG(ft1, ft2, MIPSInst_FT(ir));
-+				rv.s  = (*handler.b) (fs1, ft1);
-+				ieee754_csr_save = ieee754_csr;
-+				rv.s2 = (*handler.b) (fs2, ft2);
-+				ieee754_csr.cx |= ieee754_csr_save.cx;
-+				ieee754_csr.sx |= ieee754_csr_save.sx;
-+				goto copcsr;
-+			}
-+		      pscopuop: /* paired unary op handler */
-+			{
-+				struct _ieee754_csr ieee754_csr_save;
-+				ieee754sp fs1;
-+				ieee754sp fs2;
-+
-+				PSPFROMREG(fs1, fs2, MIPSInst_FS(ir));
-+				rv.s  = (*handler.u) (fs1);
-+				ieee754_csr_save = ieee754_csr;
-+				rv.s2 = (*handler.u) (fs2);
-+				ieee754_csr.cx |= ieee754_csr_save.cx;
-+				ieee754_csr.sx |= ieee754_csr_save.sx;
-+				goto copcsr;
-+			}
-+			break;
-+
-+		default:
-+			if (MIPSInst_FUNC(ir) >= fcmp_op) {
-+				/* Loongson fp hardware handles all
-+				   cases of fp compare insns, so we
-+				   shouldn't have to */
-+				printk ("Loongson paired-single fp compare"
-+					" unimplemented in cp1emu.c\n");
-+			}
-+			return SIGILL;
-+		}
-+		break;
-+	}
-+#endif
-+
- 	case w_fmt:{
- 		ieee754sp fs;
- 
-@@ -1299,6 +1579,11 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
- 		DITOREG(rv.l, MIPSInst_FD(ir));
- 		break;
- #endif
-+#ifdef __loongson_fp
-+	case ps_fmt:
-+		PSPTOREG(rv.s, rv.s2, MIPSInst_FD(ir));
-+		break;
-+#endif
- 	default:
- 		return SIGILL;
- 	}
--- 
-1.7.5.4
-
diff --git a/pkgs/os-specific/linux/kernel/mips-fpureg-emulation.patch b/pkgs/os-specific/linux/kernel/mips-fpureg-emulation.patch
deleted file mode 100644
index 452c4f26f6f..00000000000
--- a/pkgs/os-specific/linux/kernel/mips-fpureg-emulation.patch
+++ /dev/null
@@ -1,144 +0,0 @@
-From ab1ce0a6cd51ca83194a865837f3b90f366a733d Mon Sep 17 00:00:00 2001
-From: Lluis Batlle i Rossell <viric@viric.name>
-Date: Sat, 16 Jun 2012 00:22:53 +0200
-Subject: [PATCH] MIPS: Add emulation for fpureg-mem unaligned access
-To: linux-mips@linux-mips.org
-Cc: loongson-dev@googlegroups.com
-
-Reusing most of the code from lw,ld,sw,sd emulation,
-I add the emulation for lwc1,ldc1,swc1,sdc1.
-
-This avoids the direct SIGBUS sent to userspace processes that have
-misaligned memory accesses.
-
-I've tested the change in Loongson2F, with an own test program, and
-WebKit 1.4.0, as both were killed by sigbus without this patch.
-
-Signed-off: Lluis Batlle i Rossell <viric@viric.name>
----
- arch/mips/kernel/unaligned.c |   43 +++++++++++++++++++++++++++++-------------
- 1 file changed, 30 insertions(+), 13 deletions(-)
-
-diff --git a/arch/mips/kernel/unaligned.c b/arch/mips/kernel/unaligned.c
-index 9c58bdf..4531e6c 100644
---- a/arch/mips/kernel/unaligned.c
-+++ b/arch/mips/kernel/unaligned.c
-@@ -85,6 +85,7 @@
- #include <asm/cop2.h>
- #include <asm/inst.h>
- #include <asm/uaccess.h>
-+#include <asm/fpu.h>
- 
- #define STR(x)  __STR(x)
- #define __STR(x)  #x
-@@ -108,6 +109,7 @@ static void emulate_load_store_insn(struct pt_regs *regs,
- 	union mips_instruction insn;
- 	unsigned long value;
- 	unsigned int res;
-+	fpureg_t *fpuregs;
- 
- 	perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, 0);
- 
-@@ -183,6 +185,7 @@ static void emulate_load_store_insn(struct pt_regs *regs,
- 		break;
- 
- 	case lw_op:
-+	case lwc1_op:
- 		if (!access_ok(VERIFY_READ, addr, 4))
- 			goto sigbus;
- 
-@@ -209,7 +212,12 @@ static void emulate_load_store_insn(struct pt_regs *regs,
- 		if (res)
- 			goto fault;
- 		compute_return_epc(regs);
--		regs->regs[insn.i_format.rt] = value;
-+		if (insn.i_format.opcode == lw_op) {
-+			regs->regs[insn.i_format.rt] = value;
-+		} else {
-+			fpuregs = get_fpu_regs(current);
-+			fpuregs[insn.i_format.rt] = value;
-+		}
- 		break;
- 
- 	case lhu_op:
-@@ -291,6 +299,7 @@ static void emulate_load_store_insn(struct pt_regs *regs,
- 		goto sigill;
- 
- 	case ld_op:
-+	case ldc1_op:
- #ifdef CONFIG_64BIT
- 		/*
- 		 * A 32-bit kernel might be running on a 64-bit processor.  But
-@@ -325,7 +334,12 @@ static void emulate_load_store_insn(struct pt_regs *regs,
- 		if (res)
- 			goto fault;
- 		compute_return_epc(regs);
--		regs->regs[insn.i_format.rt] = value;
-+		if (insn.i_format.opcode == ld_op) {
-+			regs->regs[insn.i_format.rt] = value;
-+		} else {
-+			fpuregs = get_fpu_regs(current);
-+			fpuregs[insn.i_format.rt] = value;
-+		}
- 		break;
- #endif /* CONFIG_64BIT */
- 
-@@ -370,10 +384,16 @@ static void emulate_load_store_insn(struct pt_regs *regs,
- 		break;
- 
- 	case sw_op:
-+	case swc1_op:
- 		if (!access_ok(VERIFY_WRITE, addr, 4))
- 			goto sigbus;
- 
--		value = regs->regs[insn.i_format.rt];
-+		if (insn.i_format.opcode == sw_op) {
-+			value = regs->regs[insn.i_format.rt];
-+		} else {
-+			fpuregs = get_fpu_regs(current);
-+			value = fpuregs[insn.i_format.rt];
-+		}
- 		__asm__ __volatile__ (
- #ifdef __BIG_ENDIAN
- 			"1:\tswl\t%1,(%2)\n"
-@@ -401,6 +421,7 @@ static void emulate_load_store_insn(struct pt_regs *regs,
- 		break;
- 
- 	case sd_op:
-+	case sdc1_op:
- #ifdef CONFIG_64BIT
- 		/*
- 		 * A 32-bit kernel might be running on a 64-bit processor.  But
-@@ -412,7 +433,12 @@ static void emulate_load_store_insn(struct pt_regs *regs,
- 		if (!access_ok(VERIFY_WRITE, addr, 8))
- 			goto sigbus;
- 
--		value = regs->regs[insn.i_format.rt];
-+		if (insn.i_format.opcode == sd_op) {
-+			value = regs->regs[insn.i_format.rt];
-+		} else {
-+			fpuregs = get_fpu_regs(current);
-+			value = fpuregs[insn.i_format.rt];
-+		}
- 		__asm__ __volatile__ (
- #ifdef __BIG_ENDIAN
- 			"1:\tsdl\t%1,(%2)\n"
-@@ -443,15 +469,6 @@ static void emulate_load_store_insn(struct pt_regs *regs,
- 		/* Cannot handle 64-bit instructions in 32-bit kernel */
- 		goto sigill;
- 
--	case lwc1_op:
--	case ldc1_op:
--	case swc1_op:
--	case sdc1_op:
--		/*
--		 * I herewith declare: this does not happen.  So send SIGBUS.
--		 */
--		goto sigbus;
--
- 	/*
- 	 * COP2 is available to implementor for application specific use.
- 	 * It's up to applications to register a notifier chain and do
--- 
-1.7.9.5
-
diff --git a/pkgs/os-specific/linux/kernel/patches.nix b/pkgs/os-specific/linux/kernel/patches.nix
index cedb2dfc223..4ba182ea5a5 100644
--- a/pkgs/os-specific/linux/kernel/patches.nix
+++ b/pkgs/os-specific/linux/kernel/patches.nix
@@ -31,21 +31,6 @@ rec {
       patch = ./p9-fixes.patch;
     };
 
-  mips_fpureg_emu =
-    { name = "mips-fpureg-emulation";
-      patch = ./mips-fpureg-emulation.patch;
-    };
-
-  mips_fpu_sigill =
-    { name = "mips-fpu-sigill";
-      patch = ./mips-fpu-sigill.patch;
-    };
-
-  mips_ext3_n32 =
-    { name = "mips-ext3-n32";
-      patch = ./mips-ext3-n32.patch;
-    };
-
   modinst_arg_list_too_long =
     { name = "modinst-arglist-too-long";
       patch = ./modinst-arg-list-too-long.patch;
diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix
index 1c5dd6dadf1..89bd123d938 100644
--- a/pkgs/os-specific/linux/systemd/default.nix
+++ b/pkgs/os-specific/linux/systemd/default.nix
@@ -1,9 +1,9 @@
 { stdenv, fetchFromGitHub, fetchpatch, pkgconfig, intltool, gperf, libcap, kmod
 , zlib, xz, pam, acl, cryptsetup, libuuid, m4, utillinux, libffi
 , glib, kbd, libxslt, coreutils, libgcrypt, libgpgerror, libidn2, libapparmor
-, audit, lz4, bzip2, kexectools, libmicrohttpd, pcre2
+, audit, lz4, bzip2, libmicrohttpd, pcre2
 , linuxHeaders ? stdenv.cc.libc.linuxHeaders
-, libseccomp, iptables, gnu-efi
+, iptables, gnu-efi
 , autoreconfHook, gettext, docbook_xsl, docbook_xml_dtd_42, docbook_xml_dtd_45
 , ninja, meson, python3Packages, glibcLocales
 , patchelf
@@ -11,6 +11,8 @@
 , hostPlatform
 , buildPackages
 , withSelinux ? false, libselinux
+, withLibseccomp ? libseccomp.meta.available, libseccomp
+, withKexectools ? kexectools.meta.available, kexectools
 }:
 
 let
@@ -42,13 +44,13 @@ in stdenv.mkDerivation rec {
     [ linuxHeaders libcap kmod xz pam acl
       /* cryptsetup */ libuuid glib libgcrypt libgpgerror libidn2
       libmicrohttpd pcre2 ] ++
-      stdenv.lib.meta.enableIfAvailable kexectools ++
-      stdenv.lib.meta.enableIfAvailable libseccomp ++
+      stdenv.lib.optional withKexectools kexectools ++
+      stdenv.lib.optional withLibseccomp libseccomp ++
     [ libffi audit lz4 bzip2 libapparmor
       iptables gnu-efi
       # This is actually native, but we already pull it from buildPackages
       pythonLxmlEnv
-    ] ++ stdenv.lib.optionals withSelinux [ libselinux ];
+    ] ++ stdenv.lib.optional withSelinux libselinux;
 
   #dontAddPrefix = true;
 
diff --git a/pkgs/servers/emby/default.nix b/pkgs/servers/emby/default.nix
index 4defe9787ba..f781e1114eb 100644
--- a/pkgs/servers/emby/default.nix
+++ b/pkgs/servers/emby/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "emby-${version}";
-  version = "3.4.0.0";
+  version = "3.4.1.0";
 
   src = fetchurl {
     url = "https://github.com/MediaBrowser/Emby/releases/download/${version}/Emby.Mono.zip";
-    sha256 = "1936d5bcrf23av5nc8yh6708gxngsbkh86gvmzpsv3d33jgqv1nl";
+    sha256 = "08jr6v8xhmiwbby0lfvpjrlma280inwh5qp6v4p93lzd07fjynh5";
   };
 
   buildInputs = with pkgs; [
diff --git a/pkgs/servers/home-assistant/component-packages.nix b/pkgs/servers/home-assistant/component-packages.nix
index 6e0e216488d..1fc3a828603 100644
--- a/pkgs/servers/home-assistant/component-packages.nix
+++ b/pkgs/servers/home-assistant/component-packages.nix
@@ -256,7 +256,7 @@
     "nuheat" = ps: with ps; [  ];
     "nuimo_controller" = ps: with ps; [  ];
     "pilight" = ps: with ps; [  ];
-    "prometheus" = ps: with ps; [  ];
+    "prometheus" = ps: with ps; [ prometheus_client ];
     "python_script" = ps: with ps; [  ];
     "qwikswitch" = ps: with ps; [  ];
     "rainbird" = ps: with ps; [  ];
diff --git a/pkgs/test/default.nix b/pkgs/test/default.nix
new file mode 100644
index 00000000000..38f6cb8e564
--- /dev/null
+++ b/pkgs/test/default.nix
@@ -0,0 +1,26 @@
+{ pkgs, callPackage }:
+
+with pkgs;
+
+{
+  cc-wrapper = callPackage ./cc-wrapper { };
+  cc-wrapper-gcc = callPackage ./cc-wrapper { stdenv = gccStdenv; };
+  cc-wrapper-gcc7 = callPackage ./cc-wrapper { stdenv = gcc7Stdenv; };
+  cc-wrapper-gcc8 = callPackage ./cc-wrapper { stdenv = gcc8Stdenv; };
+  cc-wrapper-clang = callPackage ./cc-wrapper { stdenv = llvmPackages.stdenv; };
+  cc-wrapper-libcxx = callPackage ./cc-wrapper { stdenv = llvmPackages.libcxxStdenv; };
+  cc-wrapper-clang-39 = callPackage ./cc-wrapper { stdenv = llvmPackages_39.stdenv; };
+  cc-wrapper-libcxx-39 = callPackage ./cc-wrapper { stdenv = llvmPackages_39.libcxxStdenv; };
+  cc-wrapper-clang-4 = callPackage ./cc-wrapper { stdenv = llvmPackages_4.stdenv; };
+  cc-wrapper-libcxx-4 = callPackage ./cc-wrapper { stdenv = llvmPackages_4.libcxxStdenv; };
+  cc-wrapper-clang-5 = callPackage ./cc-wrapper { stdenv = llvmPackages_5.stdenv; };
+  cc-wrapper-libcxx-5 = callPackage ./cc-wrapper { stdenv = llvmPackages_5.libcxxStdenv; };
+  cc-wrapper-clang-6 = callPackage ./cc-wrapper { stdenv = llvmPackages_6.stdenv; };
+  cc-wrapper-libcxx-6 = callPackage ./cc-wrapper { stdenv = llvmPackages_6.libcxxStdenv; };
+  stdenv-inputs = callPackage ./stdenv-inputs { };
+
+  cc-multilib-gcc = callPackage ./cc-wrapper/multilib.nix { stdenv = gccMultiStdenv; };
+  cc-multilib-clang = callPackage ./cc-wrapper/multilib.nix { stdenv = clangMultiStdenv; };
+
+  macOSSierraShared = callPackage ./macos-sierra-shared {};
+}
diff --git a/pkgs/tools/admin/certbot/default.nix b/pkgs/tools/admin/certbot/default.nix
index 3106552a661..7a26896bbc2 100644
--- a/pkgs/tools/admin/certbot/default.nix
+++ b/pkgs/tools/admin/certbot/default.nix
@@ -4,13 +4,13 @@
 
 pythonPackages.buildPythonApplication rec {
   name = "certbot-${version}";
-  version = "0.23.0";
+  version = "0.24.0";
 
   src = fetchFromGitHub {
     owner = "certbot";
     repo = "certbot";
     rev = "v${version}";
-    sha256 = "0dv9d1byppnvx54rhi2w3gqjk01444m5hbr9553n9gin4ribviii";
+    sha256 = "0gsq4si0bqwzd7ywf87y7bbprqg1m72qdj11h64qmwb5zl4vh444";
   };
 
   propagatedBuildInputs = with pythonPackages; [
diff --git a/pkgs/tools/backup/backup/Gemfile b/pkgs/tools/backup/backup/Gemfile
deleted file mode 100644
index 2f1825b590e..00000000000
--- a/pkgs/tools/backup/backup/Gemfile
+++ /dev/null
@@ -1,23 +0,0 @@
-source "https://rubygems.org"
-
-gem 'backup'
-gem 'thor'
-gem 'open4'
-gem 'fog'
-gem 'unf' 
-gem 'dropbox-sdk', '= 1.5.1' # patched
-gem 'net-ssh'
-gem 'net-scp'
-gem 'net-sftp'
-gem 'mail', '= 2.5.4' # patched
-gem 'pagerduty'
-gem 'twitter'
-gem 'hipchat'
-gem 'flowdock'
-gem 'json'
-gem 'dogapi'
-gem 'aws-ses'
-gem 'rspec'
-gem 'fuubar'
-gem 'mocha'
-gem 'timecop'
diff --git a/pkgs/tools/backup/backup/Gemfile.lock b/pkgs/tools/backup/backup/Gemfile.lock
deleted file mode 100644
index 0725ded8add..00000000000
--- a/pkgs/tools/backup/backup/Gemfile.lock
+++ /dev/null
@@ -1,276 +0,0 @@
-GEM
-  remote: https://rubygems.org/
-  specs:
-    CFPropertyList (2.3.1)
-    addressable (2.3.5)
-    atomic (1.1.14)
-    aws-ses (0.5.0)
-      builder
-      mail (> 2.2.5)
-      mime-types
-      xml-simple
-    backup (4.2.2)
-      CFPropertyList (= 2.3.1)
-      addressable (= 2.3.5)
-      atomic (= 1.1.14)
-      aws-ses (= 0.5.0)
-      buftok (= 0.2.0)
-      builder (= 3.2.2)
-      descendants_tracker (= 0.0.3)
-      dogapi (= 1.11.0)
-      dropbox-sdk (= 1.5.1)
-      equalizer (= 0.0.9)
-      excon (= 0.44.4)
-      faraday (= 0.8.8)
-      fission (= 0.5.0)
-      flowdock (= 0.4.0)
-      fog (= 1.28.0)
-      fog-atmos (= 0.1.0)
-      fog-aws (= 0.1.1)
-      fog-brightbox (= 0.7.1)
-      fog-core (= 1.29.0)
-      fog-ecloud (= 0.0.2)
-      fog-json (= 1.0.0)
-      fog-profitbricks (= 0.0.2)
-      fog-radosgw (= 0.0.3)
-      fog-riakcs (= 0.1.0)
-      fog-sakuracloud (= 1.0.0)
-      fog-serverlove (= 0.1.1)
-      fog-softlayer (= 0.4.1)
-      fog-storm_on_demand (= 0.1.0)
-      fog-terremark (= 0.0.4)
-      fog-vmfusion (= 0.0.1)
-      fog-voxel (= 0.0.2)
-      fog-xml (= 0.1.1)
-      formatador (= 0.2.5)
-      hipchat (= 1.0.1)
-      http (= 0.5.0)
-      http_parser.rb (= 0.6.0)
-      httparty (= 0.12.0)
-      inflecto (= 0.0.2)
-      ipaddress (= 0.8.0)
-      json (= 1.8.2)
-      mail (= 2.5.4)
-      memoizable (= 0.4.0)
-      mime-types (= 1.25.1)
-      mini_portile (= 0.6.2)
-      multi_json (= 1.10.1)
-      multi_xml (= 0.5.5)
-      multipart-post (= 1.2.0)
-      net-scp (= 1.2.1)
-      net-sftp (= 2.1.2)
-      net-ssh (= 2.9.2)
-      nokogiri (= 1.6.6.2)
-      open4 (= 1.3.0)
-      pagerduty (= 2.0.0)
-      polyglot (= 0.3.3)
-      simple_oauth (= 0.2.0)
-      thor (= 0.18.1)
-      thread_safe (= 0.1.3)
-      treetop (= 1.4.15)
-      twitter (= 5.5.0)
-      unf (= 0.1.3)
-      unf_ext (= 0.0.6)
-      xml-simple (= 1.1.4)
-    buftok (0.2.0)
-    builder (3.2.2)
-    descendants_tracker (0.0.3)
-    diff-lcs (1.2.5)
-    dogapi (1.11.0)
-      json (>= 1.5.1)
-    dropbox-sdk (1.5.1)
-      json
-    equalizer (0.0.9)
-    excon (0.44.4)
-    faraday (0.8.8)
-      multipart-post (~> 1.2.0)
-    fission (0.5.0)
-      CFPropertyList (~> 2.2)
-    flowdock (0.4.0)
-      httparty (~> 0.7)
-      multi_json
-    fog (1.28.0)
-      fog-atmos
-      fog-aws (~> 0.0)
-      fog-brightbox (~> 0.4)
-      fog-core (~> 1.27, >= 1.27.3)
-      fog-ecloud
-      fog-json
-      fog-profitbricks
-      fog-radosgw (>= 0.0.2)
-      fog-riakcs
-      fog-sakuracloud (>= 0.0.4)
-      fog-serverlove
-      fog-softlayer
-      fog-storm_on_demand
-      fog-terremark
-      fog-vmfusion
-      fog-voxel
-      fog-xml (~> 0.1.1)
-      ipaddress (~> 0.5)
-      nokogiri (~> 1.5, >= 1.5.11)
-    fog-atmos (0.1.0)
-      fog-core
-      fog-xml
-    fog-aws (0.1.1)
-      fog-core (~> 1.27)
-      fog-json (~> 1.0)
-      fog-xml (~> 0.1)
-      ipaddress (~> 0.8)
-    fog-brightbox (0.7.1)
-      fog-core (~> 1.22)
-      fog-json
-      inflecto (~> 0.0.2)
-    fog-core (1.29.0)
-      builder
-      excon (~> 0.38)
-      formatador (~> 0.2)
-      mime-types
-      net-scp (~> 1.1)
-      net-ssh (>= 2.1.3)
-    fog-ecloud (0.0.2)
-      fog-core
-      fog-xml
-    fog-json (1.0.0)
-      multi_json (~> 1.0)
-    fog-profitbricks (0.0.2)
-      fog-core
-      fog-xml
-      nokogiri
-    fog-radosgw (0.0.3)
-      fog-core (>= 1.21.0)
-      fog-json
-      fog-xml (>= 0.0.1)
-    fog-riakcs (0.1.0)
-      fog-core
-      fog-json
-      fog-xml
-    fog-sakuracloud (1.0.0)
-      fog-core
-      fog-json
-    fog-serverlove (0.1.1)
-      fog-core
-      fog-json
-    fog-softlayer (0.4.1)
-      fog-core
-      fog-json
-    fog-storm_on_demand (0.1.0)
-      fog-core
-      fog-json
-    fog-terremark (0.0.4)
-      fog-core
-      fog-xml
-    fog-vmfusion (0.0.1)
-      fission
-      fog-core
-    fog-voxel (0.0.2)
-      fog-core
-      fog-xml
-    fog-xml (0.1.1)
-      fog-core
-      nokogiri (~> 1.5, >= 1.5.11)
-    formatador (0.2.5)
-    fuubar (2.0.0)
-      rspec (~> 3.0)
-      ruby-progressbar (~> 1.4)
-    hipchat (1.0.1)
-      httparty
-    http (0.5.0)
-      http_parser.rb
-    http_parser.rb (0.6.0)
-    httparty (0.12.0)
-      json (~> 1.8)
-      multi_xml (>= 0.5.2)
-    inflecto (0.0.2)
-    ipaddress (0.8.0)
-    json (1.8.2)
-    mail (2.5.4)
-      mime-types (~> 1.16)
-      treetop (~> 1.4.8)
-    memoizable (0.4.0)
-      thread_safe (~> 0.1.3)
-    metaclass (0.0.4)
-    mime-types (1.25.1)
-    mini_portile (0.6.2)
-    mocha (1.1.0)
-      metaclass (~> 0.0.1)
-    multi_json (1.10.1)
-    multi_xml (0.5.5)
-    multipart-post (1.2.0)
-    net-scp (1.2.1)
-      net-ssh (>= 2.6.5)
-    net-sftp (2.1.2)
-      net-ssh (>= 2.6.5)
-    net-ssh (2.9.2)
-    nokogiri (1.6.6.2)
-      mini_portile (~> 0.6.0)
-    open4 (1.3.0)
-    pagerduty (2.0.0)
-      json (>= 1.7.7)
-    polyglot (0.3.3)
-    rspec (3.4.0)
-      rspec-core (~> 3.4.0)
-      rspec-expectations (~> 3.4.0)
-      rspec-mocks (~> 3.4.0)
-    rspec-core (3.4.1)
-      rspec-support (~> 3.4.0)
-    rspec-expectations (3.4.0)
-      diff-lcs (>= 1.2.0, < 2.0)
-      rspec-support (~> 3.4.0)
-    rspec-mocks (3.4.0)
-      diff-lcs (>= 1.2.0, < 2.0)
-      rspec-support (~> 3.4.0)
-    rspec-support (3.4.1)
-    ruby-progressbar (1.7.5)
-    simple_oauth (0.2.0)
-    thor (0.18.1)
-    thread_safe (0.1.3)
-      atomic
-    timecop (0.8.0)
-    treetop (1.4.15)
-      polyglot
-      polyglot (>= 0.3.1)
-    twitter (5.5.0)
-      addressable (~> 2.3)
-      buftok (~> 0.2.0)
-      descendants_tracker (~> 0.0.3)
-      equalizer (~> 0.0.9)
-      faraday (>= 0.8, < 0.10)
-      http (~> 0.5.0)
-      http_parser.rb (~> 0.6.0)
-      json (~> 1.8)
-      memoizable (~> 0.4.0)
-      simple_oauth (~> 0.2.0)
-    unf (0.1.3)
-      unf_ext
-    unf_ext (0.0.6)
-    xml-simple (1.1.4)
-
-PLATFORMS
-  ruby
-
-DEPENDENCIES
-  aws-ses
-  backup
-  dogapi
-  dropbox-sdk (= 1.5.1)
-  flowdock
-  fog
-  fuubar
-  hipchat
-  json
-  mail (= 2.5.4)
-  mocha
-  net-scp
-  net-sftp
-  net-ssh
-  open4
-  pagerduty
-  rspec
-  thor
-  timecop
-  twitter
-  unf
-
-BUNDLED WITH
-   1.10.6
diff --git a/pkgs/tools/backup/backup/default.nix b/pkgs/tools/backup/backup/default.nix
deleted file mode 100644
index 23affbb8af6..00000000000
--- a/pkgs/tools/backup/backup/default.nix
+++ /dev/null
@@ -1,19 +0,0 @@
-{ stdenv, lib, bundlerEnv, ruby, curl }:
-
-bundlerEnv {
-  name = "backup_v4";
-
-  inherit ruby;
-  gemdir = ./.;
-
-  buildInputs = [ curl ];
-
-  meta = with lib; {
-    broken = true; # need ruby 2.1
-    description = "Easy full stack backup operations on UNIX-like systems";
-    homepage    = http://backup.github.io/backup/v4/;
-    license     = licenses.mit;
-    maintainers = [ maintainers.mrVanDalo ];
-    platforms   = platforms.unix;
-  };
-}
diff --git a/pkgs/tools/backup/backup/gemset.nix b/pkgs/tools/backup/backup/gemset.nix
deleted file mode 100644
index e2de995996e..00000000000
--- a/pkgs/tools/backup/backup/gemset.nix
+++ /dev/null
@@ -1,778 +0,0 @@
-{
-  "CFPropertyList" = {
-    version = "2.3.1";
-    source = {
-      type = "gem";
-      sha256 = "1wnk3gxnhfafbhgp0ic7qhzlx3lhv04v8nws2s31ii5s8135hs6k";
-    };
-  };
-  "addressable" = {
-    version = "2.3.5";
-    source = {
-      type = "gem";
-      sha256 = "11hv69v6h39j7m4v51a4p7my7xwjbhxbsg3y7ja156z7by10wkg7";
-    };
-  };
-  "atomic" = {
-    version = "1.1.14";
-    source = {
-      type = "gem";
-      sha256 = "09dzi1gxr5yj273s6s6ss7l2sq4ayavpg95561kib3n4kzvxrhk4";
-    };
-  };
-  "aws-ses" = {
-    version = "0.5.0";
-    source = {
-      type = "gem";
-      sha256 = "1kpfcdnakngypgkzn1f8cl8p4jg1rvmx3ag4ggcl0c7gs91ki8k3";
-    };
-    dependencies = [
-      "builder"
-      "mail"
-      "mime-types"
-      "xml-simple"
-    ];
-  };
-  "backup" = {
-    version = "4.2.2";
-    source = {
-      type = "gem";
-      sha256 = "0fj5jq6s1kpgp4bl1sr7qw1dgyc9zk0afh6mrfgbscg82irfxi1p";
-    };
-    dependencies = [
-      "CFPropertyList"
-      "addressable"
-      "atomic"
-      "aws-ses"
-      "buftok"
-      "builder"
-      "descendants_tracker"
-      "dogapi"
-      "dropbox-sdk"
-      "equalizer"
-      "excon"
-      "faraday"
-      "fission"
-      "flowdock"
-      "fog"
-      "fog-atmos"
-      "fog-aws"
-      "fog-brightbox"
-      "fog-core"
-      "fog-ecloud"
-      "fog-json"
-      "fog-profitbricks"
-      "fog-radosgw"
-      "fog-riakcs"
-      "fog-sakuracloud"
-      "fog-serverlove"
-      "fog-softlayer"
-      "fog-storm_on_demand"
-      "fog-terremark"
-      "fog-vmfusion"
-      "fog-voxel"
-      "fog-xml"
-      "formatador"
-      "hipchat"
-      "http"
-      "http_parser.rb"
-      "httparty"
-      "inflecto"
-      "ipaddress"
-      "json"
-      "mail"
-      "memoizable"
-      "mime-types"
-      "mini_portile"
-      "multi_json"
-      "multi_xml"
-      "multipart-post"
-      "net-scp"
-      "net-sftp"
-      "net-ssh"
-      "nokogiri"
-      "open4"
-      "pagerduty"
-      "polyglot"
-      "simple_oauth"
-      "thor"
-      "thread_safe"
-      "treetop"
-      "twitter"
-      "unf"
-      "unf_ext"
-      "xml-simple"
-    ];
-  };
-  "buftok" = {
-    version = "0.2.0";
-    source = {
-      type = "gem";
-      sha256 = "1rzsy1vy50v55x9z0nivf23y0r9jkmq6i130xa75pq9i8qrn1mxs";
-    };
-  };
-  "builder" = {
-    version = "3.2.2";
-    source = {
-      type = "gem";
-      sha256 = "14fii7ab8qszrvsvhz6z2z3i4dw0h41a62fjr2h1j8m41vbrmyv2";
-    };
-  };
-  "descendants_tracker" = {
-    version = "0.0.3";
-    source = {
-      type = "gem";
-      sha256 = "0819j80k85j62qjg90v8z8s3h4nf3v6afxxz73hl6iqxr2dhgmq1";
-    };
-  };
-  "diff-lcs" = {
-    version = "1.2.5";
-    source = {
-      type = "gem";
-      sha256 = "1vf9civd41bnqi6brr5d9jifdw73j9khc6fkhfl1f8r9cpkdvlx1";
-    };
-  };
-  "dogapi" = {
-    version = "1.11.0";
-    source = {
-      type = "gem";
-      sha256 = "01v5jphxbqdn8h0pifgl97igcincd1pjwd177a80ig9fpwndd19d";
-    };
-    dependencies = [
-      "json"
-    ];
-  };
-  "dropbox-sdk" = {
-    version = "1.5.1";
-    source = {
-      type = "gem";
-      sha256 = "1zrzxzjfgwkdnn5vjvkhhjh10azyy28982hpkw5xv0kwrqg07axj";
-    };
-    dependencies = [
-      "json"
-    ];
-  };
-  "equalizer" = {
-    version = "0.0.9";
-    source = {
-      type = "gem";
-      sha256 = "1i6vfh2lzyrvvm35qa9cf3xh2gxj941x0v78pp0c7bwji3f5hawr";
-    };
-  };
-  "excon" = {
-    version = "0.44.4";
-    source = {
-      type = "gem";
-      sha256 = "062ynrdazix4w1lz6n8qgm3dasi2837sfn88ma96pbp4sk11gbp5";
-    };
-  };
-  "faraday" = {
-    version = "0.8.8";
-    source = {
-      type = "gem";
-      sha256 = "1cnyj5japrnv6wvl01la5amf7hikckfznh8234ad21n730b2wci4";
-    };
-    dependencies = [
-      "multipart-post"
-    ];
-  };
-  "fission" = {
-    version = "0.5.0";
-    source = {
-      type = "gem";
-      sha256 = "09pmp1j1rr8r3pcmbn2na2ls7s1j9ijbxj99xi3a8r6v5xhjdjzh";
-    };
-    dependencies = [
-      "CFPropertyList"
-    ];
-  };
-  "flowdock" = {
-    version = "0.4.0";
-    source = {
-      type = "gem";
-      sha256 = "1myza5n6wqk550ky3ld4np89cd491prndqy0l1fqsddxpap6pp60";
-    };
-    dependencies = [
-      "httparty"
-      "multi_json"
-    ];
-  };
-  "fog" = {
-    version = "1.28.0";
-    source = {
-      type = "gem";
-      sha256 = "12b03r77vdicbsc7j6by2gysm16wij32z65qp6bkrxkfba9yb37h";
-    };
-    dependencies = [
-      "fog-atmos"
-      "fog-aws"
-      "fog-brightbox"
-      "fog-core"
-      "fog-ecloud"
-      "fog-json"
-      "fog-profitbricks"
-      "fog-radosgw"
-      "fog-riakcs"
-      "fog-sakuracloud"
-      "fog-serverlove"
-      "fog-softlayer"
-      "fog-storm_on_demand"
-      "fog-terremark"
-      "fog-vmfusion"
-      "fog-voxel"
-      "fog-xml"
-      "ipaddress"
-      "nokogiri"
-    ];
-  };
-  "fog-atmos" = {
-    version = "0.1.0";
-    source = {
-      type = "gem";
-      sha256 = "1aaxgnw9zy96gsh4h73kszypc32sx497s6bslvhfqh32q9d1y8c9";
-    };
-    dependencies = [
-      "fog-core"
-      "fog-xml"
-    ];
-  };
-  "fog-aws" = {
-    version = "0.1.1";
-    source = {
-      type = "gem";
-      sha256 = "17a3sspf81bgvkrrrmwx7aci7fjy1m7b3w61ljc2mpqbafz80v7i";
-    };
-    dependencies = [
-      "fog-core"
-      "fog-json"
-      "fog-xml"
-      "ipaddress"
-    ];
-  };
-  "fog-brightbox" = {
-    version = "0.7.1";
-    source = {
-      type = "gem";
-      sha256 = "1cpa92q2ls51gidxzn407x53f010k0hmrl94ipw7rdzdapp8c4cn";
-    };
-    dependencies = [
-      "fog-core"
-      "fog-json"
-      "inflecto"
-    ];
-  };
-  "fog-core" = {
-    version = "1.29.0";
-    source = {
-      type = "gem";
-      sha256 = "0ayv9j3i7jy2d1l4gw6sfchgb8l62590a6fpvpr7qvdjc79mvm3p";
-    };
-    dependencies = [
-      "builder"
-      "excon"
-      "formatador"
-      "mime-types"
-      "net-scp"
-      "net-ssh"
-    ];
-  };
-  "fog-ecloud" = {
-    version = "0.0.2";
-    source = {
-      type = "gem";
-      sha256 = "0lhxjp6gi48zanqmkblyhxjp0lknl1akifgfk5lq3j3vj2d3pnr8";
-    };
-    dependencies = [
-      "fog-core"
-      "fog-xml"
-    ];
-  };
-  "fog-json" = {
-    version = "1.0.0";
-    source = {
-      type = "gem";
-      sha256 = "1517sm8bl0bmaw2fbaf5ra6midq3wzgkpm55lb9rw6jm5ys23lyw";
-    };
-    dependencies = [
-      "multi_json"
-    ];
-  };
-  "fog-profitbricks" = {
-    version = "0.0.2";
-    source = {
-      type = "gem";
-      sha256 = "0hk290cw99qx727sxfhxlmczv9kv15hlnrflh00wfprqxk4r8rd4";
-    };
-    dependencies = [
-      "fog-core"
-      "fog-xml"
-      "nokogiri"
-    ];
-  };
-  "fog-radosgw" = {
-    version = "0.0.3";
-    source = {
-      type = "gem";
-      sha256 = "1fbpi0sfff5f5hrn4f7ish260cykzcqvzwmvm61i6mprfrfnx10r";
-    };
-    dependencies = [
-      "fog-core"
-      "fog-json"
-      "fog-xml"
-    ];
-  };
-  "fog-riakcs" = {
-    version = "0.1.0";
-    source = {
-      type = "gem";
-      sha256 = "1nbxc4dky3agfwrmgm1aqmi59p6vnvfnfbhhg7xpg4c2cf41whxm";
-    };
-    dependencies = [
-      "fog-core"
-      "fog-json"
-      "fog-xml"
-    ];
-  };
-  "fog-sakuracloud" = {
-    version = "1.0.0";
-    source = {
-      type = "gem";
-      sha256 = "1805m44x2pclhjyvdrpj6zg8l9dldgnc20h0g61r7hqxpydz066x";
-    };
-    dependencies = [
-      "fog-core"
-      "fog-json"
-    ];
-  };
-  "fog-serverlove" = {
-    version = "0.1.1";
-    source = {
-      type = "gem";
-      sha256 = "094plkkr6xiss8k85fp66g7z544kxgfx1ck0f3sqndk27miw26jk";
-    };
-    dependencies = [
-      "fog-core"
-      "fog-json"
-    ];
-  };
-  "fog-softlayer" = {
-    version = "0.4.1";
-    source = {
-      type = "gem";
-      sha256 = "1cf6y6xxjjpjglz31kf6jmmyh687x7sxhn4bx3hlr1nb1hcy19sq";
-    };
-    dependencies = [
-      "fog-core"
-      "fog-json"
-    ];
-  };
-  "fog-storm_on_demand" = {
-    version = "0.1.0";
-    source = {
-      type = "gem";
-      sha256 = "0rrfv37x9y07lvdd03pbappb8ybvqb6g8rxzwvgy3mmbmbc6l6d2";
-    };
-    dependencies = [
-      "fog-core"
-      "fog-json"
-    ];
-  };
-  "fog-terremark" = {
-    version = "0.0.4";
-    source = {
-      type = "gem";
-      sha256 = "0bxznlc904zaw3qaxhkvhqqbrv9n6nf5idih8ra9dihvacifwhvc";
-    };
-    dependencies = [
-      "fog-core"
-      "fog-xml"
-    ];
-  };
-  "fog-vmfusion" = {
-    version = "0.0.1";
-    source = {
-      type = "gem";
-      sha256 = "0x1vxc4a627g7ambcprhxiqvywy64li90145r96b2ig9z23hmy7g";
-    };
-    dependencies = [
-      "fission"
-      "fog-core"
-    ];
-  };
-  "fog-voxel" = {
-    version = "0.0.2";
-    source = {
-      type = "gem";
-      sha256 = "0by7cs0c044b8dkcmcf3pjzydnrakj8pnbcxzhw8hwlgqr0jfqgn";
-    };
-    dependencies = [
-      "fog-core"
-      "fog-xml"
-    ];
-  };
-  "fog-xml" = {
-    version = "0.1.1";
-    source = {
-      type = "gem";
-      sha256 = "0kgxjwz0mzyp7bgj1ycl9jyfmzfqc1fjdz9sm57fgj5w31jfvxw5";
-    };
-    dependencies = [
-      "fog-core"
-      "nokogiri"
-    ];
-  };
-  "formatador" = {
-    version = "0.2.5";
-    source = {
-      type = "gem";
-      sha256 = "1gc26phrwlmlqrmz4bagq1wd5b7g64avpx0ghxr9xdxcvmlii0l0";
-    };
-  };
-  "fuubar" = {
-    version = "2.0.0";
-    source = {
-      type = "gem";
-      sha256 = "0xwqs24y8s73aayh39si17kccsmr0bjgmi6jrjyfp7gkjb6iyhpv";
-    };
-    dependencies = [
-      "rspec"
-      "ruby-progressbar"
-    ];
-  };
-  "hipchat" = {
-    version = "1.0.1";
-    source = {
-      type = "gem";
-      sha256 = "1khcb6cxrr1qn104rl87wq85anigykf45x7knxnyqfpwnbda2nh1";
-    };
-    dependencies = [
-      "httparty"
-    ];
-  };
-  "http" = {
-    version = "0.5.0";
-    source = {
-      type = "gem";
-      sha256 = "1vw10xxs0i7kn90lx3b2clfkm43nb59jjph902bafpsaarqsai8d";
-    };
-    dependencies = [
-      "http_parser.rb"
-    ];
-  };
-  "http_parser.rb" = {
-    version = "0.6.0";
-    source = {
-      type = "gem";
-      sha256 = "15nidriy0v5yqfjsgsra51wmknxci2n2grliz78sf9pga3n0l7gi";
-    };
-  };
-  "httparty" = {
-    version = "0.12.0";
-    source = {
-      type = "gem";
-      sha256 = "10y3znh7s1fx88lbnbsmyx5zri6jr1gi48zzzq89wir8q9zlp28c";
-    };
-    dependencies = [
-      "json"
-      "multi_xml"
-    ];
-  };
-  "inflecto" = {
-    version = "0.0.2";
-    source = {
-      type = "gem";
-      sha256 = "085l5axmvqw59mw5jg454a3m3gr67ckq9405a075isdsn7bm3sp4";
-    };
-  };
-  "ipaddress" = {
-    version = "0.8.0";
-    source = {
-      type = "gem";
-      sha256 = "0cwy4pyd9nl2y2apazp3hvi12gccj5a3ify8mi8k3knvxi5wk2ir";
-    };
-  };
-  "json" = {
-    version = "1.8.2";
-    source = {
-      type = "gem";
-      sha256 = "0zzvv25vjikavd3b1bp6lvbgj23vv9jvmnl4vpim8pv30z8p6vr5";
-    };
-  };
-  "mail" = {
-    version = "2.5.4";
-    source = {
-      type = "gem";
-      sha256 = "0z15ksb8blcppchv03g34844f7xgf36ckp484qjj2886ig1qara4";
-    };
-    dependencies = [
-      "mime-types"
-      "treetop"
-    ];
-  };
-  "memoizable" = {
-    version = "0.4.0";
-    source = {
-      type = "gem";
-      sha256 = "0xhg8c9qw4y35qp1k8kv20snnxk6rlyilx354n1d72r0y10s7qcr";
-    };
-    dependencies = [
-      "thread_safe"
-    ];
-  };
-  "metaclass" = {
-    version = "0.0.4";
-    source = {
-      type = "gem";
-      sha256 = "0hp99y2b1nh0nr8pc398n3f8lakgci6pkrg4bf2b2211j1f6hsc5";
-    };
-  };
-  "mime-types" = {
-    version = "1.25.1";
-    source = {
-      type = "gem";
-      sha256 = "0mhzsanmnzdshaba7gmsjwnv168r1yj8y0flzw88frw1cickrvw8";
-    };
-  };
-  "mini_portile" = {
-    version = "0.6.2";
-    source = {
-      type = "gem";
-      sha256 = "0h3xinmacscrnkczq44s6pnhrp4nqma7k056x5wv5xixvf2wsq2w";
-    };
-  };
-  "mocha" = {
-    version = "1.1.0";
-    source = {
-      type = "gem";
-      sha256 = "107nmnngbv8lq2g7hbjpn5kplb4v2c8gs9lxrg6vs8gdbddkilzi";
-    };
-    dependencies = [
-      "metaclass"
-    ];
-  };
-  "multi_json" = {
-    version = "1.10.1";
-    source = {
-      type = "gem";
-      sha256 = "1ll21dz01jjiplr846n1c8yzb45kj5hcixgb72rz0zg8fyc9g61c";
-    };
-  };
-  "multi_xml" = {
-    version = "0.5.5";
-    source = {
-      type = "gem";
-      sha256 = "0i8r7dsz4z79z3j023l8swan7qpbgxbwwz11g38y2vjqjk16v4q8";
-    };
-  };
-  "multipart-post" = {
-    version = "1.2.0";
-    source = {
-      type = "gem";
-      sha256 = "12p7lnmc52di1r4h73h6xrpppplzyyhani9p7wm8l4kgf1hnmwnc";
-    };
-  };
-  "net-scp" = {
-    version = "1.2.1";
-    source = {
-      type = "gem";
-      sha256 = "0b0jqrcsp4bbi4n4mzyf70cp2ysyp6x07j8k8cqgxnvb4i3a134j";
-    };
-    dependencies = [
-      "net-ssh"
-    ];
-  };
-  "net-sftp" = {
-    version = "2.1.2";
-    source = {
-      type = "gem";
-      sha256 = "04674g4n6mryjajlcd82af8g8k95la4b1bj712dh71hw1c9vhw1y";
-    };
-    dependencies = [
-      "net-ssh"
-    ];
-  };
-  "net-ssh" = {
-    version = "2.9.2";
-    source = {
-      type = "gem";
-      sha256 = "1p0bj41zrmw5lhnxlm1pqb55zfz9y4p9fkrr9a79nrdmzrk1ph8r";
-    };
-  };
-  "nokogiri" = {
-    version = "1.6.6.2";
-    source = {
-      type = "gem";
-      sha256 = "1j4qv32qjh67dcrc1yy1h8sqjnny8siyy4s44awla8d6jk361h30";
-    };
-    dependencies = [
-      "mini_portile"
-    ];
-  };
-  "open4" = {
-    version = "1.3.0";
-    source = {
-      type = "gem";
-      sha256 = "12jyp97p7pq29q1zmkdrhzvg5cg2x3hlfdbq6asnb9nqlkx6vhf2";
-    };
-  };
-  "pagerduty" = {
-    version = "2.0.0";
-    source = {
-      type = "gem";
-      sha256 = "1ads8bj2swm3gbhr6193ls83pnwsy39xyh3i8sw6rl8fxfdf717v";
-    };
-    dependencies = [
-      "json"
-    ];
-  };
-  "polyglot" = {
-    version = "0.3.3";
-    source = {
-      type = "gem";
-      sha256 = "082zmail2h3cxd9z1wnibhk6aj4sb1f3zzwra6kg9bp51kx2c00v";
-    };
-  };
-  "rspec" = {
-    version = "3.4.0";
-    source = {
-      type = "gem";
-      sha256 = "12axhz2nj2m0dy350lxym76m36m1hq48hc59mf00z9dajbpnj78s";
-    };
-    dependencies = [
-      "rspec-core"
-      "rspec-expectations"
-      "rspec-mocks"
-    ];
-  };
-  "rspec-core" = {
-    version = "3.4.1";
-    source = {
-      type = "gem";
-      sha256 = "0zl4fbrzl4gg2bn3fhv910q04sm2jvzdidmvd71gdgqwbzk0zngn";
-    };
-    dependencies = [
-      "rspec-support"
-    ];
-  };
-  "rspec-expectations" = {
-    version = "3.4.0";
-    source = {
-      type = "gem";
-      sha256 = "07pz570glwg87zpyagxxal0daa1jrnjkiksnn410s6846884fk8h";
-    };
-    dependencies = [
-      "diff-lcs"
-      "rspec-support"
-    ];
-  };
-  "rspec-mocks" = {
-    version = "3.4.0";
-    source = {
-      type = "gem";
-      sha256 = "0iw9qvpawj3cfcg3xipi1v4y11g9q4f5lvmzgksn6f0chf97sjy1";
-    };
-    dependencies = [
-      "diff-lcs"
-      "rspec-support"
-    ];
-  };
-  "rspec-support" = {
-    version = "3.4.1";
-    source = {
-      type = "gem";
-      sha256 = "0l6zzlf22hn3pcwnxswsjsiwhqjg7a8mhvm680k5vq98307bkikr";
-    };
-  };
-  "ruby-progressbar" = {
-    version = "1.7.5";
-    source = {
-      type = "gem";
-      sha256 = "0hynaavnqzld17qdx9r7hfw00y16ybldwq730zrqfszjwgi59ivi";
-    };
-  };
-  "simple_oauth" = {
-    version = "0.2.0";
-    source = {
-      type = "gem";
-      sha256 = "1vsjhxybif9r53jx4dhhwf80qjkg7gbwpfmskjqns223qrhwsxig";
-    };
-  };
-  "thor" = {
-    version = "0.18.1";
-    source = {
-      type = "gem";
-      sha256 = "0d1g37j6sc7fkidf8rqlm3wh9zgyg3g7y8h2x1y34hmil5ywa8c3";
-    };
-  };
-  "thread_safe" = {
-    version = "0.1.3";
-    source = {
-      type = "gem";
-      sha256 = "0f2w62x5nx95d2c2lrn9v4g60xhykf8zw7jaddkrgal913dzifgq";
-    };
-    dependencies = [
-      "atomic"
-    ];
-  };
-  "timecop" = {
-    version = "0.8.0";
-    source = {
-      type = "gem";
-      sha256 = "0zf46hkd36y2ywysjfgkvpcc5v04s2rwlg2k7k8j23bh7k8sgiqs";
-    };
-  };
-  "treetop" = {
-    version = "1.4.15";
-    source = {
-      type = "gem";
-      sha256 = "1zqj5y0mvfvyz11nhsb4d5ch0i0rfcyj64qx19mw4qhg3hh8z9pz";
-    };
-    dependencies = [
-      "polyglot"
-      "polyglot"
-    ];
-  };
-  "twitter" = {
-    version = "5.5.0";
-    source = {
-      type = "gem";
-      sha256 = "0yl1im3s4svl4hxxsyc60mm7cxvwz538amc9y0vzw6lkiii5f197";
-    };
-    dependencies = [
-      "addressable"
-      "buftok"
-      "descendants_tracker"
-      "equalizer"
-      "faraday"
-      "http"
-      "http_parser.rb"
-      "json"
-      "memoizable"
-      "simple_oauth"
-    ];
-  };
-  "unf" = {
-    version = "0.1.3";
-    source = {
-      type = "gem";
-      sha256 = "1f2q8mxxngg8q608r6xajpharp9zz1ia3336y1lsg1asn2ach2sm";
-    };
-    dependencies = [
-      "unf_ext"
-    ];
-  };
-  "unf_ext" = {
-    version = "0.0.6";
-    source = {
-      type = "gem";
-      sha256 = "07zbmkzcid6pzdqgla3456ipfdka7j1v4hsx1iaa8rbnllqbmkdg";
-    };
-  };
-  "xml-simple" = {
-    version = "1.1.4";
-    source = {
-      type = "gem";
-      sha256 = "0x5c3mqhahh8hzqqq41659bxj0wn3n6bhj5p6b4hsia2k4akzg6s";
-    };
-  };
-}
\ No newline at end of file
diff --git a/pkgs/tools/misc/youtube-dl/default.nix b/pkgs/tools/misc/youtube-dl/default.nix
index d2e490373da..19173de41e5 100644
--- a/pkgs/tools/misc/youtube-dl/default.nix
+++ b/pkgs/tools/misc/youtube-dl/default.nix
@@ -16,11 +16,11 @@ with stdenv.lib;
 buildPythonApplication rec {
 
   pname = "youtube-dl";
-  version = "2018.05.01";
+  version = "2018.05.09";
 
   src = fetchurl {
     url = "https://yt-dl.org/downloads/${version}/${pname}-${version}.tar.gz";
-    sha256 = "1mpyqdyjip5a6nn8lj1kaaab4pj75js6i8qzgap8bmn0k46awb1n";
+    sha256 = "0sl4bi2jls3417rd62awbqdq1b6wskkjbfwpnyw4a61qarfxid1d";
   };
 
   nativeBuildInputs = [ makeWrapper ];
diff --git a/pkgs/tools/package-management/nix/default.nix b/pkgs/tools/package-management/nix/default.nix
index 1d15bd11b7f..8f503d12935 100644
--- a/pkgs/tools/package-management/nix/default.nix
+++ b/pkgs/tools/package-management/nix/default.nix
@@ -1,11 +1,12 @@
 { lib, stdenv, fetchurl, fetchFromGitHub, perl, curl, bzip2, sqlite, openssl ? null, xz
 , pkgconfig, boehmgc, perlPackages, libsodium, aws-sdk-cpp, brotli, boost
 , autoreconfHook, autoconf-archive, bison, flex, libxml2, libxslt, docbook5, docbook5_xsl
-, libseccomp, busybox-sandbox-shell
+, busybox-sandbox-shell
 , hostPlatform, buildPlatform
 , storeDir ? "/nix/store"
 , stateDir ? "/nix/var"
 , confDir ? "/etc"
+, withLibseccomp ? libseccomp.meta.available, libseccomp
 }:
 
 let
@@ -30,7 +31,7 @@ let
     buildInputs = [ curl openssl sqlite xz bzip2 ]
       ++ lib.optional (stdenv.isLinux || stdenv.isDarwin) libsodium
       ++ lib.optionals is20 [ brotli ] # Since 1.12
-      ++ lib.meta.enableIfAvailable libseccomp
+      ++ lib.optional withLibseccomp libseccomp
       ++ lib.optional ((stdenv.isLinux || stdenv.isDarwin) && is20)
           (aws-sdk-cpp.override {
             apis = ["s3"];
diff --git a/pkgs/tools/system/sleuthkit/default.nix b/pkgs/tools/system/sleuthkit/default.nix
index 61649859397..ad16746a266 100644
--- a/pkgs/tools/system/sleuthkit/default.nix
+++ b/pkgs/tools/system/sleuthkit/default.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchFromGitHub, autoreconfHook, libewf, afflib, openssl, zlib }:
 
 stdenv.mkDerivation rec {
-  version = "4.6.0";
+  version = "4.6.1";
   name = "sleuthkit-${version}";
 
   src = fetchFromGitHub {
     owner = "sleuthkit";
     repo = "sleuthkit";
     rev = name;
-    sha256 = "0m5ll5sx0pxkn58y582b3v90rsfdrh8dm02kmv61psd0k6q0p91x";
+    sha256 = "1hf783mwa5ws9qvjpj6zgvivi0cfhs8r8m1869ajz5m80lv8fggw";
   };
 
   postPatch = ''
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 9ef98ef0e46..04a356be18a 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -61,6 +61,8 @@ with pkgs;
     by Hydra.
   '';
 
+  tests = recurseIntoAttrs (callPackages ../test {});
+
   ### Nixpkgs maintainer tools
 
   nix-generate-from-cpan = callPackage ../../maintainers/scripts/nix-generate-from-cpan.nix { };
@@ -774,8 +776,6 @@ with pkgs;
 
   backblaze-b2 = python.pkgs.callPackage ../development/tools/backblaze-b2 { };
 
-  backup = callPackage ../tools/backup/backup { };
-
   bar = callPackage ../tools/system/bar {};
 
   base16-builder = callPackage ../misc/base16-builder { };
@@ -13355,11 +13355,6 @@ with pkgs;
         kernelPatches.p9_fixes
         kernelPatches.cpu-cgroup-v2."4.9"
         kernelPatches.modinst_arg_list_too_long
-      ]
-      ++ lib.optionals ((platform.kernelArch or null) == "mips")
-      [ kernelPatches.mips_fpureg_emu
-        kernelPatches.mips_fpu_sigill
-        kernelPatches.mips_ext3_n32
       ];
   };
 
@@ -13374,11 +13369,6 @@ with pkgs;
       [ kernelPatches.bridge_stp_helper
         kernelPatches.cpu-cgroup-v2."4.4"
         kernelPatches.modinst_arg_list_too_long
-      ]
-      ++ lib.optionals ((platform.kernelArch or null) == "mips")
-      [ kernelPatches.mips_fpureg_emu
-        kernelPatches.mips_fpu_sigill
-        kernelPatches.mips_ext3_n32
       ];
   };
 
@@ -13387,11 +13377,6 @@ with pkgs;
       [ kernelPatches.bridge_stp_helper
         kernelPatches.cpu-cgroup-v2."4.9"
         kernelPatches.modinst_arg_list_too_long
-      ]
-      ++ lib.optionals ((platform.kernelArch or null) == "mips")
-      [ kernelPatches.mips_fpureg_emu
-        kernelPatches.mips_fpu_sigill
-        kernelPatches.mips_ext3_n32
       ];
   };
 
@@ -13402,11 +13387,6 @@ with pkgs;
         # when adding a new linux version
         kernelPatches.cpu-cgroup-v2."4.11"
         kernelPatches.modinst_arg_list_too_long
-      ]
-      ++ lib.optionals ((platform.kernelArch or null) == "mips")
-      [ kernelPatches.mips_fpureg_emu
-        kernelPatches.mips_fpu_sigill
-        kernelPatches.mips_ext3_n32
       ];
   };
 
@@ -13418,11 +13398,6 @@ with pkgs;
         # kernelPatches.cpu-cgroup-v2."4.11"
         kernelPatches.modinst_arg_list_too_long
         kernelPatches.bcm2835_mmal_v4l2_camera_driver # Only needed for 4.16!
-      ]
-      ++ lib.optionals ((platform.kernelArch or null) == "mips")
-      [ kernelPatches.mips_fpureg_emu
-        kernelPatches.mips_fpu_sigill
-        kernelPatches.mips_ext3_n32
       ];
   };
 
@@ -13430,10 +13405,6 @@ with pkgs;
     kernelPatches = [
       kernelPatches.bridge_stp_helper
       kernelPatches.modinst_arg_list_too_long
-    ] ++ lib.optionals ((platform.kernelArch or null) == "mips") [
-      kernelPatches.mips_fpureg_emu
-      kernelPatches.mips_fpu_sigill
-      kernelPatches.mips_ext3_n32
     ];
   };
 
@@ -13441,11 +13412,6 @@ with pkgs;
     kernelPatches =
       [ kernelPatches.bridge_stp_helper
         kernelPatches.modinst_arg_list_too_long
-      ]
-      ++ lib.optionals ((platform.kernelArch or null) == "mips")
-      [ kernelPatches.mips_fpureg_emu
-        kernelPatches.mips_fpu_sigill
-        kernelPatches.mips_ext3_n32
       ];
   };
 
@@ -15228,10 +15194,10 @@ with pkgs;
   # go 1.9 pin until https://github.com/moby/moby/pull/35739
   inherit (callPackage ../applications/virtualization/docker { go = go_1_9; })
     docker_18_03
-    docker_18_04;
+    docker_18_05;
 
   docker = docker_18_03;
-  docker-edge = docker_18_04;
+  docker-edge = docker_18_05;
 
   docker-proxy = callPackage ../applications/virtualization/docker/proxy.nix { };
 
@@ -16060,6 +16026,8 @@ with pkgs;
 
   gollum = callPackage ../applications/misc/gollum { };
 
+  googleearth = callPackage ../applications/misc/googleearth { };
+
   google-chrome = callPackage ../applications/networking/browsers/google-chrome { gconf = gnome2.GConf; };
 
   google-chrome-beta = google-chrome.override { chromium = chromiumBeta; channel = "beta"; };
@@ -21318,30 +21286,6 @@ with pkgs;
 
   openfst = callPackage ../development/libraries/openfst {};
 
-  # `recurseIntoAttrs` for sake of hydra, not nix-env
-  tests = recurseIntoAttrs {
-    cc-wrapper = callPackage ../test/cc-wrapper { };
-    cc-wrapper-gcc = callPackage ../test/cc-wrapper { stdenv = gccStdenv; };
-    cc-wrapper-gcc7 = callPackage ../test/cc-wrapper { stdenv = gcc7Stdenv; };
-    cc-wrapper-gcc8 = callPackage ../test/cc-wrapper { stdenv = gcc8Stdenv; };
-    cc-wrapper-clang = callPackage ../test/cc-wrapper { stdenv = llvmPackages.stdenv; };
-    cc-wrapper-libcxx = callPackage ../test/cc-wrapper { stdenv = llvmPackages.libcxxStdenv; };
-    cc-wrapper-clang-39 = callPackage ../test/cc-wrapper { stdenv = llvmPackages_39.stdenv; };
-    cc-wrapper-libcxx-39 = callPackage ../test/cc-wrapper { stdenv = llvmPackages_39.libcxxStdenv; };
-    cc-wrapper-clang-4 = callPackage ../test/cc-wrapper { stdenv = llvmPackages_4.stdenv; };
-    cc-wrapper-libcxx-4 = callPackage ../test/cc-wrapper { stdenv = llvmPackages_4.libcxxStdenv; };
-    cc-wrapper-clang-5 = callPackage ../test/cc-wrapper { stdenv = llvmPackages_5.stdenv; };
-    cc-wrapper-libcxx-5 = callPackage ../test/cc-wrapper { stdenv = llvmPackages_5.libcxxStdenv; };
-    cc-wrapper-clang-6 = callPackage ../test/cc-wrapper { stdenv = llvmPackages_6.stdenv; };
-    cc-wrapper-libcxx-6 = callPackage ../test/cc-wrapper { stdenv = llvmPackages_6.libcxxStdenv; };
-    stdenv-inputs = callPackage ../test/stdenv-inputs { };
-
-    cc-multilib-gcc = callPackage ../test/cc-wrapper/multilib.nix { stdenv = gccMultiStdenv; };
-    cc-multilib-clang = callPackage ../test/cc-wrapper/multilib.nix { stdenv = clangMultiStdenv; };
-
-    macOSSierraShared = callPackage ../test/macos-sierra-shared {};
-  };
-
   duti = callPackage ../os-specific/darwin/duti {};
 
   dnstracer = callPackage ../tools/networking/dnstracer {
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index de67df6d595..f7506ff979a 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -1629,6 +1629,8 @@ in {
 
   contexter = callPackage ../development/python-modules/contexter { };
 
+  contextvars = callPackage ../development/python-modules/contextvars {};
+
   contextlib2 = callPackage ../development/python-modules/contextlib2 { };
 
   cookiecutter = callPackage ../development/python-modules/cookiecutter { };
@@ -3122,6 +3124,8 @@ in {
 
   imbalanced-learn = callPackage ../development/python-modules/imbalanced-learn { };
 
+  immutables = callPackage ../development/python-modules/immutables {};
+
   imread = buildPythonPackage rec {
     name = "python-imread-${version}";
     version = "0.6";
@@ -18247,6 +18251,8 @@ EOF
   coinmarketcap = callPackage ../development/python-modules/coinmarketcap { };
 
   pyowm = callPackage ../development/python-modules/pyowm { };
+
+  prometheus_client = callPackage ../development/python-modules/prometheus_client { };
 });
 
 in fix' (extends overrides packages)
diff --git a/pkgs/top-level/release.nix b/pkgs/top-level/release.nix
index 5a2de846ade..b4eeef1f3de 100644
--- a/pkgs/top-level/release.nix
+++ b/pkgs/top-level/release.nix
@@ -110,7 +110,10 @@ let
               jobs.tests.cc-wrapper-gcc7.x86_64-linux
               jobs.tests.cc-wrapper-gcc7.x86_64-darwin
               jobs.tests.cc-wrapper-gcc8.x86_64-linux
-              jobs.tests.cc-wrapper-gcc8.x86_64-darwin
+
+              # broken see issue #40038
+              # jobs.tests.cc-wrapper-gcc8.x86_64-darwin
+
               jobs.tests.cc-wrapper-clang.x86_64-linux
               jobs.tests.cc-wrapper-clang.x86_64-darwin
               jobs.tests.cc-wrapper-libcxx.x86_64-linux