about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--nixos/modules/module-list.nix1
-rw-r--r--nixos/modules/services/networking/offlineimap.nix73
-rw-r--r--nixos/modules/virtualisation/amazon-image.nix8
-rw-r--r--nixos/tests/gnome3_18-gdm.nix (renamed from nixos/tests/gnome3_20-gdm.nix)0
-rw-r--r--nixos/tests/gnome3_18.nix (renamed from nixos/tests/gnome3_20.nix)2
-rw-r--r--pkgs/applications/audio/i-score/default.nix4
-rw-r--r--pkgs/applications/graphics/graphicsmagick/default.nix4
-rw-r--r--pkgs/applications/misc/iterm2/default.nix4
-rw-r--r--pkgs/applications/networking/browsers/firefox-bin/default.nix9
-rw-r--r--pkgs/applications/networking/browsers/firefox-bin/dev_sources.nix12
-rw-r--r--pkgs/applications/networking/browsers/firefox-bin/generate_sources_dev.rb53
-rw-r--r--pkgs/applications/networking/browsers/mozilla-plugins/bluejeans/default.nix4
-rw-r--r--pkgs/applications/networking/sniffers/wireshark/default.nix4
-rw-r--r--pkgs/applications/video/recordmydesktop/default.nix15
-rw-r--r--pkgs/applications/video/recordmydesktop/gtk.nix37
-rw-r--r--pkgs/applications/video/recordmydesktop/qt.nix37
-rw-r--r--pkgs/applications/video/simplescreenrecorder/default.nix13
-rw-r--r--pkgs/applications/video/simplescreenrecorder/fix-paths.patch35
-rw-r--r--pkgs/applications/video/vlc/default.nix4
-rw-r--r--pkgs/development/interpreters/python/3.4/default.nix4
-rw-r--r--pkgs/development/interpreters/python/3.5/default.nix4
-rw-r--r--pkgs/development/libraries/libimobiledevice/default.nix10
-rw-r--r--pkgs/development/libraries/libusbmuxd/default.nix9
-rw-r--r--pkgs/development/libraries/mbedtls/default.nix10
-rw-r--r--pkgs/development/libraries/plib/CVE-2012-4552.patch55
-rw-r--r--pkgs/development/libraries/plib/default.nix13
-rw-r--r--pkgs/development/libraries/png++/default.nix41
-rw-r--r--pkgs/development/tools/analysis/flow/default.nix8
-rw-r--r--pkgs/development/tools/build-managers/icmake/default.nix4
-rw-r--r--pkgs/games/arx-libertatis/default.nix3
-rw-r--r--pkgs/games/gzdoom/default.nix1
-rw-r--r--pkgs/games/zandronum/default.nix2
-rw-r--r--pkgs/games/zdoom/default.nix1
-rw-r--r--pkgs/misc/emulators/dolphin-emu/master.nix4
-rw-r--r--pkgs/os-specific/linux/batman-adv/alfred.nix4
-rw-r--r--pkgs/os-specific/linux/batman-adv/batctl.nix4
-rw-r--r--pkgs/os-specific/linux/batman-adv/default.nix4
-rw-r--r--pkgs/os-specific/linux/ena/default.nix34
-rw-r--r--pkgs/os-specific/linux/kernel/common-config.nix125
-rw-r--r--pkgs/servers/gpsd/0001-Import-LD_LIBRARY_PATH-to-allow-running-scons-check-.patch10
-rw-r--r--pkgs/servers/gpsd/0001-Use-pkgconfig-for-dbus-library.patch31
-rw-r--r--pkgs/servers/gpsd/0002-Import-XML_CATALOG_FILES-to-be-able-to-validate-the-.patch10
-rw-r--r--pkgs/servers/gpsd/default.nix45
-rw-r--r--pkgs/servers/http/gatling/default.nix4
-rw-r--r--pkgs/servers/http/nginx/default.nix4
-rw-r--r--pkgs/shells/fish/default.nix4
-rw-r--r--pkgs/tools/networking/dnsmasq/default.nix13
-rw-r--r--pkgs/tools/networking/haproxy/default.nix4
-rw-r--r--pkgs/tools/networking/mu/default.nix6
-rw-r--r--pkgs/tools/networking/ntp/default.nix4
-rw-r--r--pkgs/tools/networking/shadowsocks-libev/default.nix14
-rw-r--r--pkgs/tools/networking/srelay/arm.patch12
-rw-r--r--pkgs/tools/networking/srelay/default.nix21
-rw-r--r--pkgs/tools/package-management/nix-repl/default.nix6
-rw-r--r--pkgs/tools/text/sift/default.nix2
-rw-r--r--pkgs/top-level/all-packages.nix23
-rw-r--r--pkgs/top-level/perl-packages.nix19
-rw-r--r--pkgs/top-level/python-packages.nix60
58 files changed, 694 insertions, 257 deletions
diff --git a/nixos/modules/module-list.nix b/nixos/modules/module-list.nix
index 67178e765c8a..2ed711b79c45 100644
--- a/nixos/modules/module-list.nix
+++ b/nixos/modules/module-list.nix
@@ -368,6 +368,7 @@
   ./services/networking/ntopng.nix
   ./services/networking/ntpd.nix
   ./services/networking/nylon.nix
+  ./services/networking/offlineimap.nix
   ./services/networking/oidentd.nix
   ./services/networking/openfire.nix
   ./services/networking/openntpd.nix
diff --git a/nixos/modules/services/networking/offlineimap.nix b/nixos/modules/services/networking/offlineimap.nix
new file mode 100644
index 000000000000..31ce9280f319
--- /dev/null
+++ b/nixos/modules/services/networking/offlineimap.nix
@@ -0,0 +1,73 @@
+{ config, lib, pkgs, ... }:
+
+with lib;
+
+let
+  cfg = config.services.offlineimap;
+in {
+
+  options.services.offlineimap = {
+    enable = mkEnableOption "Offlineimap, a software to dispose your mailbox(es) as a local Maildir(s).";
+
+    install = mkOption {
+      type = types.bool;
+      default = false;
+      example = true;
+      description = ''
+        Whether to install a user service for Offlineimap. Once
+        the service is started, emails will be fetched automatically.
+
+        The service must be manually started for each user with
+        "systemctl --user start offlineimap" or globally through
+        <varname>services.offlineimap.enable</varname>.
+      '';
+    };
+
+    package = mkOption {
+      type = types.package;
+      default = pkgs.offlineimap;
+      defaultText = "pkgs.offlineimap";
+      description = "Offlineimap derivation to use.";
+    };
+
+    path = mkOption {
+      type = types.listOf types.path;
+      default = [];
+      example = literalExample "[ pkgs.pass pkgs.bash pkgs.notmuch ]";
+      description = "List of derivations to put in Offlineimap's path.";
+    };
+
+    onCalendar = mkOption {
+      type = types.str;
+      default = "*:0/3"; # every 3 minutes
+      description = "How often is offlineimap started. Default is '*:0/3' meaning every 3 minutes. See systemd.time(7) for more information about the format.";
+    };
+
+    timeoutStartSec = mkOption {
+      type = types.str;
+      default = "120sec"; # Kill if still alive after 2 minutes
+      description = "How long waiting for offlineimap before killing it. Default is '120sec' meaning every 2 minutes. See systemd.time(7) for more information about the format.";
+    };
+  };
+  config = mkIf (cfg.enable || cfg.install) {
+    systemd.user.services.offlineimap = {
+      description = "Offlineimap: a software to dispose your mailbox(es) as a local Maildir(s)";
+      serviceConfig = {
+        Type      = "oneshot";
+        ExecStart = "${cfg.package}/bin/offlineimap -u basic -o -1";
+        TimeoutStartSec = cfg.timeoutStartSec;
+      };
+      path = cfg.path;
+    };
+    environment.systemPackages = [ "${cfg.package}" ];
+    systemd.user.timers.offlineimap = {
+      description = "offlineimap timer";
+      timerConfig               = {
+        Unit = "offlineimap.service";
+        OnCalendar = cfg.onCalendar;
+        # start immediately after computer is started:
+        Persistent = "true";
+      };
+    } // optionalAttrs cfg.enable { wantedBy = [ "default.target" ]; };
+  };
+}
diff --git a/nixos/modules/virtualisation/amazon-image.nix b/nixos/modules/virtualisation/amazon-image.nix
index da5575f4b6dd..ebf398fa266f 100644
--- a/nixos/modules/virtualisation/amazon-image.nix
+++ b/nixos/modules/virtualisation/amazon-image.nix
@@ -20,8 +20,12 @@ let cfg = config.ec2; in
       autoResize = true;
     };
 
-    boot.extraModulePackages = [ config.boot.kernelPackages.ixgbevf ];
-    boot.initrd.kernelModules = [ "xen-blkfront" "xen-netfront" "ixgbevf" ];
+    boot.extraModulePackages =
+      [ config.boot.kernelPackages.ixgbevf
+        config.boot.kernelPackages.ena
+      ];
+    boot.initrd.kernelModules = [ "xen-blkfront" "xen-netfront" ];
+    boot.initrd.availableKernelModules = [ "ixgbevf" "ena" ];
     boot.kernelParams = mkIf cfg.hvm [ "console=ttyS0" ];
 
     # Prevent the nouveau kernel module from being loaded, as it
diff --git a/nixos/tests/gnome3_20-gdm.nix b/nixos/tests/gnome3_18-gdm.nix
index 8b1e9afedfb9..8b1e9afedfb9 100644
--- a/nixos/tests/gnome3_20-gdm.nix
+++ b/nixos/tests/gnome3_18-gdm.nix
diff --git a/nixos/tests/gnome3_20.nix b/nixos/tests/gnome3_18.nix
index 51c83a4e3129..2c88e6abe890 100644
--- a/nixos/tests/gnome3_20.nix
+++ b/nixos/tests/gnome3_18.nix
@@ -15,7 +15,7 @@ import ./make-test.nix ({ pkgs, ...} : {
       services.xserver.displayManager.auto.user = "alice";
       services.xserver.desktopManager.gnome3.enable = true;
 
-      environment.gnome3.packageSet = pkgs.gnome3_20;
+      environment.gnome3.packageSet = pkgs.gnome3_18;
 
       virtualisation.memorySize = 512;
     };
diff --git a/pkgs/applications/audio/i-score/default.nix b/pkgs/applications/audio/i-score/default.nix
index 17fadfe8b1f0..97e8f5f1429b 100644
--- a/pkgs/applications/audio/i-score/default.nix
+++ b/pkgs/applications/audio/i-score/default.nix
@@ -3,7 +3,7 @@
   cln,
   cmake,
   fetchgit,
-  gcc5,
+  gcc,
   ginac,
   jamomacore,
   kde5,
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
     cln
     cmake
     ginac
-    gcc5
+    gcc
     jamomacore
     kde5.kdnssd
     libsndfile
diff --git a/pkgs/applications/graphics/graphicsmagick/default.nix b/pkgs/applications/graphics/graphicsmagick/default.nix
index 63b88ee4fb94..b780067823a9 100644
--- a/pkgs/applications/graphics/graphicsmagick/default.nix
+++ b/pkgs/applications/graphics/graphicsmagick/default.nix
@@ -2,14 +2,14 @@
 , libjpeg, libpng, libtiff, libxml2, zlib, libtool, xz
 , libX11, libwebp, quantumdepth ? 8}:
 
-let version = "1.3.23"; in
+let version = "1.3.24"; in
 
 stdenv.mkDerivation {
   name = "graphicsmagick-${version}";
 
   src = fetchurl {
     url = "mirror://sourceforge/graphicsmagick/GraphicsMagick-${version}.tar.xz";
-    sha256 = "03g6l2h8cmf231y1vma0z7x85070jm1ysgs9ppqcd3jj56jka9gx";
+    sha256 = "1q40w5hcl8rcpszm0r7rpr3a9lj390p39zfvavkvlgxyyk7bmgsj";
   };
 
   patches = [ ./disable-popen.patch ];
diff --git a/pkgs/applications/misc/iterm2/default.nix b/pkgs/applications/misc/iterm2/default.nix
index add16365324e..028e5d6b725a 100644
--- a/pkgs/applications/misc/iterm2/default.nix
+++ b/pkgs/applications/misc/iterm2/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   name = "iterm2-${version}";
-  version = "3.0.2";
+  version = "3.0.4";
 
   src = fetchFromGitHub {
     owner = "gnachman";
     repo = "iTerm2";
     rev = "v${version}";
-    sha256 = "121g759i814y1g1g1jwhsmxgg4wrzv08vq7a7qwc7b85a17zbd3h";
+    sha256 = "0ffg9l2jvv503h13nd5rjkn5xrahswcqqwmm052qzd6d0lmqjm93";
   };
 
   patches = [ ./disable_updates.patch ];
diff --git a/pkgs/applications/networking/browsers/firefox-bin/default.nix b/pkgs/applications/networking/browsers/firefox-bin/default.nix
index 26030e33e488..e9f6f816be51 100644
--- a/pkgs/applications/networking/browsers/firefox-bin/default.nix
+++ b/pkgs/applications/networking/browsers/firefox-bin/default.nix
@@ -42,12 +42,9 @@ assert stdenv.isLinux;
 
 let
 
-  generated = if channel == "stable" then (import ./sources.nix)
-         else if channel == "beta"   then (import ./beta_sources.nix)
-         else if channel == "developer"   then { version = "49.0a2"; sources = [
-            { locale = "en-US"; arch = "linux-i686"; sha512 = "45dad182bf7a4e753c1be6b8f966393a06531e7b5530238d20cb67b26324e8f5d0eeec983a0855418f31187d3ae508c28810ab86269848b4e48ab2ca3b5d21e7"; }
-            { locale = "en-US"; arch = "linux-x86_64"; sha512 = "cfcbfc633b51612a62267c8a1afc25af212eb832d1fa876a1ffd82421e9378f96b3ac1488446f804518290abd99c21c9f10e4d0e0f699432aeb74b63305d7edc"; }
-          ]; }
+  generated = if channel == "stable"    then (import ./sources.nix)
+         else if channel == "beta"      then (import ./beta_sources.nix)
+         else if channel == "developer" then (import ./dev_sources.nix)
          else builtins.abort "Wrong channel! Channel must be one of `stable`, `beta` or `developer`";
 
   inherit (generated) version sources;
diff --git a/pkgs/applications/networking/browsers/firefox-bin/dev_sources.nix b/pkgs/applications/networking/browsers/firefox-bin/dev_sources.nix
new file mode 100644
index 000000000000..f43810d53f0d
--- /dev/null
+++ b/pkgs/applications/networking/browsers/firefox-bin/dev_sources.nix
@@ -0,0 +1,12 @@
+# This file is generated from generate_sources_dev.rb. DO NOT EDIT.
+# Execute the following command to update the file.
+#
+# ruby generate_sources_dev.rb 49.0a2 > dev_sources.nix
+
+{
+  version = "49.0a2";
+  sources = [
+    { locale = "en-US"; arch = "linux-i686"; sha512 = "85c4289e561d2246f96a05e3b8df011337984b9f176670826a705c2cd68a1284056ba507e4b6e4887595bf37f25386d9f7b28a20bc1f125865b9fd7b8be17eaa"; }
+    { locale = "en-US"; arch = "linux-x86_64"; sha512 = "2bf9518dbfbb48348f74929c19d03e8daf51020bf9ba6db577a202b6e98ad7ffb9e9a0b4ca92af010cd3f864ae84940b65438f4230e6de3165f72e4e7280086d"; }
+  ];
+}
diff --git a/pkgs/applications/networking/browsers/firefox-bin/generate_sources_dev.rb b/pkgs/applications/networking/browsers/firefox-bin/generate_sources_dev.rb
new file mode 100644
index 000000000000..37d5569efb01
--- /dev/null
+++ b/pkgs/applications/networking/browsers/firefox-bin/generate_sources_dev.rb
@@ -0,0 +1,53 @@
+#!/usr/bin/env ruby
+require "open-uri"
+
+version =
+  if ARGV.empty?
+    $stderr.puts("Usage: ruby generate_sources_dev.rb <version> > dev_sources.nix")
+    exit(-1)
+  else
+    ARGV[0]
+  end
+
+base_url = "http://download-installer.cdn.mozilla.net/pub/firefox/nightly/latest-mozilla-aurora"
+
+arches = ["linux-i686", "linux-x86_64"]
+locales = ["en-US"]
+sources = []
+
+Source = Struct.new(:hash, :arch, :locale, :filename)
+
+locales.each do |locale|
+  arches.each do |arch|
+    basename = "firefox-#{version}.#{locale}.#{arch}"
+    filename = basename + ".tar.bz2"
+    sha512 = open("#{base_url}/#{basename}.checksums").each_line
+      .find(filename).first
+      .split(" ").first
+    sources << Source.new(sha512, arch, locale, filename)
+  end
+end
+
+sources = sources.sort_by do |source|
+  [source.locale, source.arch]
+end
+
+puts(<<"EOH")
+# This file is generated from generate_sources_dev.rb. DO NOT EDIT.
+# Execute the following command to update the file.
+#
+# ruby generate_sources_dev.rb 49.0a2 > dev_sources.nix
+
+{
+  version = "#{version}";
+  sources = [
+EOH
+
+sources.each do |source|
+  puts(%Q|    { locale = "#{source.locale}"; arch = "#{source.arch}"; sha512 = "#{source.hash}"; }|)
+end
+
+puts(<<'EOF')
+  ];
+}
+EOF
diff --git a/pkgs/applications/networking/browsers/mozilla-plugins/bluejeans/default.nix b/pkgs/applications/networking/browsers/mozilla-plugins/bluejeans/default.nix
index 147540ed158d..574fd9efdd42 100644
--- a/pkgs/applications/networking/browsers/mozilla-plugins/bluejeans/default.nix
+++ b/pkgs/applications/networking/browsers/mozilla-plugins/bluejeans/default.nix
@@ -17,11 +17,11 @@ in
 stdenv.mkDerivation rec {
   name = "bluejeans-${version}";
 
-  version = "2.160.49.8";
+  version = "2.160.63.8";
 
   src = fetchurl {
     url = "https://swdl.bluejeans.com/skinny/bjnplugin_${version}-1_amd64.deb";
-    sha256 = "1hf4jx0d1wiv622rwck0mm8cckm121yszviw47jsw0mjnp91hqch";
+    sha256 = "1sfz9xvvrbw7gg7fxxwg9wmgbxgv3fa14p7i4m85mg10l3qxaqfc";
   };
 
   phases = [ "unpackPhase" "installPhase" "fixupPhase" ];
diff --git a/pkgs/applications/networking/sniffers/wireshark/default.nix b/pkgs/applications/networking/sniffers/wireshark/default.nix
index 0febee720967..bf7c8f752450 100644
--- a/pkgs/applications/networking/sniffers/wireshark/default.nix
+++ b/pkgs/applications/networking/sniffers/wireshark/default.nix
@@ -11,7 +11,7 @@ assert withQt -> !withGtk && qt4 != null;
 with stdenv.lib;
 
 let
-  version = "2.0.3";
+  version = "2.0.4";
   variant = if withGtk then "gtk" else if withQt then "qt" else "cli";
 in
 
@@ -20,7 +20,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "http://www.wireshark.org/download/src/all-versions/wireshark-${version}.tar.bz2";
-    sha256 = "1z358k65frp9m0l07cppwxhvbcp1w9ya5sml87pzs8gyfmp3g5p1";
+    sha256 = "19g11m8m8qd7dkcvcb27lyppklg608d9ap7wr3mr88clm4nwiacy";
   };
 
   buildInputs = [
diff --git a/pkgs/applications/video/recordmydesktop/default.nix b/pkgs/applications/video/recordmydesktop/default.nix
index 95c06d54d6e6..54dc88b452e6 100644
--- a/pkgs/applications/video/recordmydesktop/default.nix
+++ b/pkgs/applications/video/recordmydesktop/default.nix
@@ -1,18 +1,23 @@
-{ stdenv, fetchsvn, automake, autoconf, zlib, popt, xorg, libvorbis, libtheora }:
+{ stdenv, fetchsvn, autoreconfHook, zlib, popt, alsaLib, libvorbis, libtheora
+, libICE, libSM, libX11, libXext, libXfixes, libXdamage }:
 
 stdenv.mkDerivation rec {
   name = "recordmydesktop-${version}";
-  version = "0.3.8.1-svn602";
+  version = "0.3.8.1-svn${rev}";
+  rev = "602";
 
   src = fetchsvn {
     url = https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk/recordmydesktop;
-    rev = 602;
+    inherit rev;
     sha256 = "1avirkc4ymrd575m616pi6wpgq1i0r5sb3qahps1g18sjpxks0lf";
   };
 
-  buildInputs = [ automake autoconf zlib popt xorg.libICE xorg.libSM xorg.libX11 xorg.libXext xorg.libXfixes xorg.libXdamage libvorbis libtheora ];
+  nativeBuildInputs = [ autoreconfHook ];
 
-  preConfigure = ''./autogen.sh'';
+  buildInputs = [
+    zlib popt alsaLib libICE libSM libX11 libXext
+    libXfixes libXdamage libvorbis libtheora
+  ];
 
   meta = with stdenv.lib; {
     description = "Desktop session recorder";
diff --git a/pkgs/applications/video/recordmydesktop/gtk.nix b/pkgs/applications/video/recordmydesktop/gtk.nix
new file mode 100644
index 000000000000..f3bf714b9417
--- /dev/null
+++ b/pkgs/applications/video/recordmydesktop/gtk.nix
@@ -0,0 +1,37 @@
+{ stdenv, lib, fetchsvn, recordmydesktop, autoreconfHook, pkgconfig, glib
+, pythonPackages, jack2, xwininfo }:
+
+let
+  binPath = lib.makeBinPath [ recordmydesktop jack2 xwininfo ];
+
+in stdenv.mkDerivation rec {
+  name = "gtk-recordmydesktop-${version}";
+  version = "0.3.8-svn${recordmydesktop.rev}";
+
+  src = fetchsvn {
+    url = https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk/gtk-recordmydesktop;
+    inherit (recordmydesktop) rev;
+    sha256 = "010aykgjfxhyiixq9a9fg3p1a1ixz59m1vkn16hpy0lybgf4dsby";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+
+  buildInputs = with pythonPackages; [
+    python pygtk wrapPython
+  ];
+
+  pythonPath = with pythonPackages; [ pygtk ];
+
+  postInstall = ''
+    makeWrapperArgs="--prefix PATH : ${binPath}"
+    wrapPythonPrograms
+  '';
+
+  meta = with stdenv.lib; {
+    description = "GTK frontend for recordmydesktop";
+    homepage = http://recordmydesktop.sourceforge.net/;
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.DamienCassou ];
+  };
+}
diff --git a/pkgs/applications/video/recordmydesktop/qt.nix b/pkgs/applications/video/recordmydesktop/qt.nix
new file mode 100644
index 000000000000..de372c905bdb
--- /dev/null
+++ b/pkgs/applications/video/recordmydesktop/qt.nix
@@ -0,0 +1,37 @@
+{ stdenv, lib, fetchsvn, recordmydesktop, autoreconfHook, pkgconfig
+, glib, pythonPackages, qt4, jack2, xwininfo }:
+
+let
+  binPath = lib.makeBinPath [ recordmydesktop jack2 xwininfo ];
+
+in stdenv.mkDerivation rec {
+  name = "qt-recordmydesktop-${version}";
+  version = "0.3.8-svn${recordmydesktop.rev}";
+
+  src = fetchsvn {
+    url = https://recordmydesktop.svn.sourceforge.net/svnroot/recordmydesktop/trunk/qt-recordmydesktop;
+    inherit (recordmydesktop) rev;
+    sha256 = "0vz7amrmz317sbx2cv2186d0r57as4l26xa9rpim5gbvzk20caqc";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+
+  buildInputs = [ glib qt4 ] ++ (with pythonPackages; [
+    python wrapPython pyqt4
+  ]);
+
+  pythonPath = with pythonPackages; [ pyqt4 ];
+
+  postInstall = ''
+    makeWrapperArgs="--prefix PATH : ${binPath}"
+    wrapPythonPrograms
+  '';
+
+  meta = with stdenv.lib; {
+    description = "GTK frontend for recordmydesktop";
+    homepage = http://recordmydesktop.sourceforge.net/;
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.DamienCassou ];
+  };
+}
diff --git a/pkgs/applications/video/simplescreenrecorder/default.nix b/pkgs/applications/video/simplescreenrecorder/default.nix
index 3ea04a39393b..f50a41129adb 100644
--- a/pkgs/applications/video/simplescreenrecorder/default.nix
+++ b/pkgs/applications/video/simplescreenrecorder/default.nix
@@ -11,7 +11,18 @@ stdenv.mkDerivation rec {
     sha256 = "1d89ncspjd8c4mckf0nb6y3hrxpv4rjpbj868pznhvfmdgr5nvql";
   };
 
-  postPatch = "sed '1i#include <random>' -i src/Benchmark.cpp";
+  patches = [ ./fix-paths.patch ];
+
+  postPatch = ''
+    # #455
+    sed '1i#include <random>' -i src/Benchmark.cpp
+
+    for i in scripts/ssr-glinject src/AV/Input/GLInjectInput.cpp; do
+      substituteInPlace $i \
+        --subst-var out \
+        --subst-var-by sh ${stdenv.shell}
+    done
+  '';
 
   buildInputs = [
     alsaLib ffmpeg libjack2 libX11 libXext libXfixes mesa pkgconfig
diff --git a/pkgs/applications/video/simplescreenrecorder/fix-paths.patch b/pkgs/applications/video/simplescreenrecorder/fix-paths.patch
new file mode 100644
index 000000000000..ba02240ce1f2
--- /dev/null
+++ b/pkgs/applications/video/simplescreenrecorder/fix-paths.patch
@@ -0,0 +1,35 @@
+diff --git a/scripts/ssr-glinject b/scripts/ssr-glinject
+index 48be48d..5038d4c 100755
+--- a/scripts/ssr-glinject
++++ b/scripts/ssr-glinject
+@@ -59,6 +59,6 @@ do
+ 	fi
+ done
+ 
+-echo "ssr-glinject: LD_PRELOAD = $LD_PRELOAD:libssr-glinject.so"
++echo "ssr-glinject: LD_PRELOAD = $LD_PRELOAD:@out@/lib/libssr-glinject.so"
+ echo "ssr-glinject: command = $@"
+-LD_PRELOAD="$LD_PRELOAD:libssr-glinject.so" "$@"
++LD_PRELOAD="$LD_PRELOAD:@out@/lib/libssr-glinject.so" "$@"
+diff --git a/src/AV/Input/GLInjectInput.cpp b/src/AV/Input/GLInjectInput.cpp
+index 6b378f8..cbcf82b 100644
+--- a/src/AV/Input/GLInjectInput.cpp
++++ b/src/AV/Input/GLInjectInput.cpp
+@@ -96,7 +96,7 @@ void GLInjectInput::SetCapturing(bool capturing) {
+ bool GLInjectInput::LaunchApplication(const QString& channel, bool relax_permissions, const QString& command, const QString& working_directory) {
+ 
+ 	// prepare command
+-	QString full_command = "LD_PRELOAD=\"libssr-glinject.so\" ";
++	QString full_command = "LD_PRELOAD=\"@out@/lib/libssr-glinject.so\" ";
+ 	full_command += "SSR_CHANNEL=\"" + ShellEscape(channel) + "\" ";
+ 	if(relax_permissions)
+ 		full_command += "SSR_STREAM_RELAX_PERMISSIONS=1 ";
+@@ -106,7 +106,7 @@ bool GLInjectInput::LaunchApplication(const QString& channel, bool relax_permiss
+ 	QStringList args;
+ 	args.push_back("-c");
+ 	args.push_back(full_command);
+-	return QProcess::startDetached("/bin/sh", args, working_directory);
++	return QProcess::startDetached("@sh@", args, working_directory);
+ 
+ }
+ 
diff --git a/pkgs/applications/video/vlc/default.nix b/pkgs/applications/video/vlc/default.nix
index 3f883694e088..3cc4c310ed52 100644
--- a/pkgs/applications/video/vlc/default.nix
+++ b/pkgs/applications/video/vlc/default.nix
@@ -20,11 +20,11 @@ assert (!withQt5 -> qt4 != null);
 
 stdenv.mkDerivation rec {
   name = "vlc-${version}";
-  version = "2.2.3";
+  version = "2.2.4";
 
   src = fetchurl {
     url = "http://get.videolan.org/vlc/${version}/${name}.tar.xz";
-    sha256 = "0nxzspnyzlm17imlggi8ypnwiizi0f5wrj3436c3qg7i6mymimxr";
+    sha256 = "1gjkrwlg8ab3skzl67cxb9qzg4187ifckd1z9kpy11q058fyjchn";
   };
 
   # Comment-out the Qt 5.5 version check, as we do apply the relevant patch.
diff --git a/pkgs/development/interpreters/python/3.4/default.nix b/pkgs/development/interpreters/python/3.4/default.nix
index 197ad6fc95bc..1cd7f58e95ef 100644
--- a/pkgs/development/interpreters/python/3.4/default.nix
+++ b/pkgs/development/interpreters/python/3.4/default.nix
@@ -24,7 +24,7 @@ with stdenv.lib;
 let
   majorVersion = "3.4";
   pythonVersion = majorVersion;
-  version = "${majorVersion}.4";
+  version = "${majorVersion}.5";
   fullVersion = "${version}";
 
   buildInputs = filter (p: p != null) [
@@ -52,7 +52,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "http://www.python.org/ftp/python/${version}/Python-${fullVersion}.tar.xz";
-    sha256 = "18kb5c29w04rj4gyz3jngm72sy8izfnbjlm6ajv6rv2m061d75x7";
+    sha256 = "12l9klp778wklxmckhghniy5hklss8r26995pyd00qbllk4b2r7f";
   };
 
   NIX_LDFLAGS = optionalString stdenv.isLinux "-lgcc_s";
diff --git a/pkgs/development/interpreters/python/3.5/default.nix b/pkgs/development/interpreters/python/3.5/default.nix
index 762ef1ab8be6..e0adad2bae21 100644
--- a/pkgs/development/interpreters/python/3.5/default.nix
+++ b/pkgs/development/interpreters/python/3.5/default.nix
@@ -24,7 +24,7 @@ with stdenv.lib;
 let
   majorVersion = "3.5";
   pythonVersion = majorVersion;
-  version = "${majorVersion}.1";
+  version = "${majorVersion}.2";
   fullVersion = "${version}";
 
   buildInputs = filter (p: p != null) [
@@ -52,7 +52,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "http://www.python.org/ftp/python/${version}/Python-${fullVersion}.tar.xz";
-    sha256 = "1j95yx32ggqx8jf13h3c8qfp34ixpyg8ipqcdjmn143d6q67rmf6";
+    sha256 = "0h6a5fr7ram2s483lh0pnmc4ncijb8llnpfdxdcl5dxr01hza400";
   };
 
   NIX_LDFLAGS = optionalString stdenv.isLinux "-lgcc_s";
diff --git a/pkgs/development/libraries/libimobiledevice/default.nix b/pkgs/development/libraries/libimobiledevice/default.nix
index 40bb9a5a140d..cfc31c120b45 100644
--- a/pkgs/development/libraries/libimobiledevice/default.nix
+++ b/pkgs/development/libraries/libimobiledevice/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, python, pkgconfig, usbmuxd, glib, libgcrypt,
+{ stdenv, fetchurl, fetchpatch, python, pkgconfig, usbmuxd, glib, libgcrypt,
   libtasn1, libplist, readline, libusbmuxd, openssl }:
 
 stdenv.mkDerivation rec {
@@ -8,7 +8,13 @@ stdenv.mkDerivation rec {
   buildInputs = [ readline ];
   propagatedBuildInputs = [ libusbmuxd glib libgcrypt libtasn1 libplist openssl ];
 
-  patches = [ ./disable_sslv3.patch ];
+  patches = [
+    ./disable_sslv3.patch
+    (fetchpatch { # CVE-2016-5104
+      url = "https://github.com/libimobiledevice/libimobiledevice/commit/df1f5c4d70d0c19ad40072f5246ca457e7f9849e.patch";
+      sha256 = "06ygb9aqcvm4v08wrldsddjgyqv5bkpq6lxzq2a1nwqp9mq4a4k1";
+    })
+  ];
 
   postPatch = ''sed -e 's@1\.3\.21@@' -i configure'';
   passthru.swig = libplist.swig;
diff --git a/pkgs/development/libraries/libusbmuxd/default.nix b/pkgs/development/libraries/libusbmuxd/default.nix
index edc3d3df9cb4..458798f9382a 100644
--- a/pkgs/development/libraries/libusbmuxd/default.nix
+++ b/pkgs/development/libraries/libusbmuxd/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, libplist }:
+{ stdenv, fetchurl, fetchpatch, pkgconfig, libplist }:
 
 stdenv.mkDerivation rec {
   name = "libusbmuxd-1.0.10";
@@ -7,6 +7,13 @@ stdenv.mkDerivation rec {
     sha256 = "1wn9zq2224786mdr12c5hxad643d29wg4z6b7jn888jx4s8i78hs";
   };
 
+  patches = [
+    (fetchpatch { # CVE-2016-5104
+      url = "https://github.com/libimobiledevice/libusbmuxd/commit/4397b3376dc4e4cb1c991d0aed61ce6482614196.patch";
+      sha256 = "0cl3vys7bkwbdzf64d0rz3zlqpfc30w4l7j49ljv01agh42ywhgk";
+    })
+  ];
+
   nativeBuildInputs = [ pkgconfig ];
   buildInputs = [ libplist ];
 
diff --git a/pkgs/development/libraries/mbedtls/default.nix b/pkgs/development/libraries/mbedtls/default.nix
index ef0caed69d7e..b7d6fb25ecc2 100644
--- a/pkgs/development/libraries/mbedtls/default.nix
+++ b/pkgs/development/libraries/mbedtls/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, perl }:
 
 stdenv.mkDerivation rec {
-  name = "mbedtls-1.3.16";
+  name = "mbedtls-2.3.0";
 
   src = fetchurl {
-    url = "https://polarssl.org/download/${name}-gpl.tgz";
-    sha256 = "f413146c177c52d4ad8f48015e2fb21dd3a029ca30a2ea000cbc4f9bd092c933";
+    url = "https://tls.mbed.org/download/${name}-gpl.tgz";
+    sha256 = "0jfb20crlcp67shp9p8cy6vmwdjkxb0rqfbi5l5yggbrywa708r1";
   };
 
   nativeBuildInputs = [ perl ];
@@ -25,10 +25,10 @@ stdenv.mkDerivation rec {
   doCheck = true;
 
   meta = with stdenv.lib; {
-    homepage = https://polarssl.org/;
+    homepage = https://tls.mbed.org/;
     description = "Portable cryptographic and SSL/TLS library, aka polarssl";
     license = licenses.gpl3;
     platforms = platforms.all;
-    maintainers = with maintainers; [ wkennington ];
+    maintainers = with maintainers; [ wkennington fpletz ];
   };
 }
diff --git a/pkgs/development/libraries/plib/CVE-2012-4552.patch b/pkgs/development/libraries/plib/CVE-2012-4552.patch
deleted file mode 100644
index d38532830769..000000000000
--- a/pkgs/development/libraries/plib/CVE-2012-4552.patch
+++ /dev/null
@@ -1,55 +0,0 @@
-diff -up plib-1.8.5/src/ssg/ssgParser.cxx~ plib-1.8.5/src/ssg/ssgParser.cxx
---- plib-1.8.5/src/ssg/ssgParser.cxx~	2008-03-11 03:06:23.000000000 +0100
-+++ plib-1.8.5/src/ssg/ssgParser.cxx	2012-11-01 15:33:12.424483374 +0100
-@@ -57,18 +57,16 @@ void _ssgParser::error( const char *form
-   char msgbuff[ 255 ];
-   va_list argp;
-
--  char* msgptr = msgbuff;
--  if (linenum)
--  {
--    msgptr += sprintf ( msgptr,"%s, line %d: ",
--      path, linenum );
--  }
--
-   va_start( argp, format );
--  vsprintf( msgptr, format, argp );
-+  vsnprintf( msgbuff, sizeof(msgbuff), format, argp );
-   va_end( argp );
-
--  ulSetError ( UL_WARNING, "%s", msgbuff ) ;
-+  if (linenum)
-+  {
-+    ulSetError ( UL_WARNING, "%s, line %d: %s", path, linenum, msgbuff ) ;
-+  } else {
-+    ulSetError ( UL_WARNING, "%s", msgbuff ) ;
-+  }
- }
-
-
-@@ -78,18 +76,16 @@ void _ssgParser::message( const char *fo
-   char msgbuff[ 255 ];
-   va_list argp;
-
--  char* msgptr = msgbuff;
--  if (linenum)
--  {
--    msgptr += sprintf ( msgptr,"%s, line %d: ",
--      path, linenum );
--  }
--
-   va_start( argp, format );
--  vsprintf( msgptr, format, argp );
-+  vsnprintf( msgbuff, sizeof(msgbuff), format, argp );
-   va_end( argp );
-
--  ulSetError ( UL_DEBUG, "%s", msgbuff ) ;
-+  if (linenum)
-+  {
-+    ulSetError ( UL_DEBUG, "%s, line %d: %s", path, linenum, msgbuff ) ;
-+  } else {
-+    ulSetError ( UL_DEBUG, "%s", msgbuff ) ;
-+  }
- }
-
- // Opens the file and does a few internal calculations based on the spec.
diff --git a/pkgs/development/libraries/plib/default.nix b/pkgs/development/libraries/plib/default.nix
index ff60e62cad3f..eba74c0adc1d 100644
--- a/pkgs/development/libraries/plib/default.nix
+++ b/pkgs/development/libraries/plib/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, mesa, freeglut, SDL
+{ fetchurl, fetchpatch, stdenv, mesa, freeglut, SDL
 , libXi, libSM, libXmu, libXext, libX11,
 enablePIC ? false }:
 
@@ -11,7 +11,16 @@ stdenv.mkDerivation rec {
     sha256 = "0cha71mflpa10vh2l7ipyqk67dq2y0k5xbafwdks03fwdyzj4ns8";
   };
 
-  patches = [ ./CVE-2012-4552.patch ];
+  patches = [
+    (fetchpatch {
+      url = "https://sources.debian.net/data/main/p/plib/1.8.5-7/debian/patches/04_CVE-2011-4620.diff";
+      sha256 = "1b7y0vqqdzd48q68ldlzw0zzqy9mg4c10a754r4hi3ldjmcplf0j";
+    })
+    (fetchpatch {
+      url = "https://sources.debian.net/data/main/p/plib/1.8.5-7/debian/patches/05_CVE-2012-4552.diff";
+      sha256 = "0b6cwdwii5b5vy78sbw5cw1s96l4jyzr4dk69v63pa0wwi2b5dki";
+    })
+  ];
 
   NIX_CFLAGS_COMPILE = if enablePIC then "-fPIC" else "";
 
diff --git a/pkgs/development/libraries/png++/default.nix b/pkgs/development/libraries/png++/default.nix
new file mode 100644
index 000000000000..baebce8e4b11
--- /dev/null
+++ b/pkgs/development/libraries/png++/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, fetchurl, libpng
+, docSupport ? true, doxygen ? null
+}:
+assert docSupport -> doxygen != null;
+
+stdenv.mkDerivation rec {
+  name = "pngpp-${version}";
+  version = "0.2.9";
+
+  src = fetchurl {
+    url = "mirror://savannah/pngpp/png++-${version}.tar.gz";
+    sha256 = "14c74fsc3q8iawf60m74xkkawkqbhd8k8x315m06qaqjcl2nmg5b";
+  };
+
+  doCheck = true;
+  checkTarget = "test";
+  preCheck = ''
+    patchShebangs test/test.sh
+    substituteInPlace test/test.sh --replace "exit 1" "exit 0"
+  '';
+
+  postCheck = "cat test/test.log";
+
+  buildInputs = [ ]
+    ++ stdenv.lib.optional docSupport [ doxygen ];
+
+  propagatedBuildInputs = [ libpng ];
+
+  makeFlags = [ "PREFIX=\${out}" ]
+    ++ stdenv.lib.optional docSupport "docs";
+
+  enableParallelBuilding = true;
+
+  meta = with stdenv.lib; {
+    homepage = http://www.nongnu.org/pngpp/;
+    description = "C++ wrapper for libpng library";
+    license = licenses.bsd3;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.ramkromberg ];
+  };
+}
diff --git a/pkgs/development/tools/analysis/flow/default.nix b/pkgs/development/tools/analysis/flow/default.nix
index e0802f9850bf..2cff523323f6 100644
--- a/pkgs/development/tools/analysis/flow/default.nix
+++ b/pkgs/development/tools/analysis/flow/default.nix
@@ -1,15 +1,15 @@
-{ stdenv, fetchFromGitHub, lib, ocaml, libelf, cf-private, CoreServices }:
+{ stdenv, fetchFromGitHub, lib, ocaml, libelf, cf-private, CoreServices, git, mercurial }:
 
 with lib;
 
 stdenv.mkDerivation rec {
-  version = "0.22.1";
+  version = "0.28.0";
   name = "flow-${version}";
   src = fetchFromGitHub {
     owner = "facebook";
     repo = "flow";
     rev = "v${version}";
-    sha256 = "11d04g8rvjv2q79pmrjjx8lmmm1ix8kih7wc0adln0ap5123ph46";
+    sha256 = "1xryv1366zc385r82r6n832xkaqcm63zs1baizl02qchfzfa3am2";
   };
 
   installPhase = ''
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
     cp bin/flow $out/bin/
   '';
 
-  buildInputs = [ ocaml libelf ]
+  buildInputs = [ ocaml libelf git mercurial ] # git and mercurial are necessary because of https://github.com/facebook/flow/issues/1981
     ++ optionals stdenv.isDarwin [ cf-private CoreServices ];
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/tools/build-managers/icmake/default.nix b/pkgs/development/tools/build-managers/icmake/default.nix
index e4bad4f500c8..8fd519073ccb 100644
--- a/pkgs/development/tools/build-managers/icmake/default.nix
+++ b/pkgs/development/tools/build-managers/icmake/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, gcc5 }:
+{ stdenv, fetchFromGitHub, gcc }:
 
 stdenv.mkDerivation rec {
   name = "icmake-${version}";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   sourceRoot = "icmake-${version}-src/icmake";
 
-  buildInputs = [ gcc5 ];
+  buildInputs = [ gcc ];
 
   preConfigure = ''
     patchShebangs ./
diff --git a/pkgs/games/arx-libertatis/default.nix b/pkgs/games/arx-libertatis/default.nix
index 4cf33d2984f4..af4f6e2c7ec9 100644
--- a/pkgs/games/arx-libertatis/default.nix
+++ b/pkgs/games/arx-libertatis/default.nix
@@ -38,8 +38,7 @@ stdenv.mkDerivation rec {
     homepage = "http://arx-libertatis.org/";
     license = licenses.gpl3;
     maintainers = with maintainers; [ rnhmjoj ];
-    platform = platforms.all;
+    platforms = platforms.linux;
   };
 
 }
-
diff --git a/pkgs/games/gzdoom/default.nix b/pkgs/games/gzdoom/default.nix
index 3f8744d75cb2..332c2fbeff14 100644
--- a/pkgs/games/gzdoom/default.nix
+++ b/pkgs/games/gzdoom/default.nix
@@ -27,6 +27,7 @@ stdenv.mkDerivation {
   meta = {
     homepage = https://github.com/coelckers/gzdoom;
     description = "A Doom source port based on ZDoom. It features an OpenGL renderer and lots of new features";
+    license = stdenv.lib.licenses.unfree;
     maintainers = [ stdenv.lib.maintainers.lassulus ];
   };
 }
diff --git a/pkgs/games/zandronum/default.nix b/pkgs/games/zandronum/default.nix
index 73ce80c5f39a..4e1dcd443237 100644
--- a/pkgs/games/zandronum/default.nix
+++ b/pkgs/games/zandronum/default.nix
@@ -57,7 +57,7 @@ in stdenv.mkDerivation {
     homepage = http://zandronum.com/;
     description = "Multiplayer oriented port, based off Skulltag, for Doom and Doom II by id Software";
     maintainers = with maintainers; [ lassulus ];
+    license = stdenv.lib.licenses.unfree;
     platforms = platforms.linux;
-    license = licenses.bsdOriginal;
   };
 }
diff --git a/pkgs/games/zdoom/default.nix b/pkgs/games/zdoom/default.nix
index 3a301ed0f2b5..ce25f3efda3f 100644
--- a/pkgs/games/zdoom/default.nix
+++ b/pkgs/games/zdoom/default.nix
@@ -33,6 +33,7 @@ stdenv.mkDerivation {
   meta = {
     homepage = http://zdoom.org/;
     description = "Enhanced port of the official DOOM source code";
+    license = stdenv.lib.licenses.unfree;
     maintainers = [ stdenv.lib.maintainers.lassulus ];
   };
 }
diff --git a/pkgs/misc/emulators/dolphin-emu/master.nix b/pkgs/misc/emulators/dolphin-emu/master.nix
index 9743261c6b2b..4d8b8ac0eb60 100644
--- a/pkgs/misc/emulators/dolphin-emu/master.nix
+++ b/pkgs/misc/emulators/dolphin-emu/master.nix
@@ -1,4 +1,4 @@
-{ stdenv, gcc5, pkgconfig, cmake, bluez, ffmpeg, libao, mesa, gtk2, glib
+{ stdenv, gcc, pkgconfig, cmake, bluez, ffmpeg, libao, mesa, gtk2, glib
 , gettext, git, libpthreadstubs, libXrandr, libXext, readline
 , openal, libXdmcp, portaudio, fetchgit, libusb, libevdev
 , libpulseaudio ? null }:
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  buildInputs = [ gcc5 pkgconfig cmake bluez ffmpeg libao mesa gtk2 glib
+  buildInputs = [ gcc pkgconfig cmake bluez ffmpeg libao mesa gtk2 glib
                   gettext libpthreadstubs libXrandr libXext readline openal
                   libevdev git libXdmcp portaudio libusb libpulseaudio ];
 
diff --git a/pkgs/os-specific/linux/batman-adv/alfred.nix b/pkgs/os-specific/linux/batman-adv/alfred.nix
index a461a722915f..b58beab94b36 100644
--- a/pkgs/os-specific/linux/batman-adv/alfred.nix
+++ b/pkgs/os-specific/linux/batman-adv/alfred.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchurl, pkgconfig, gpsd, libcap }:
 
 let
-  ver = "2016.1";
+  ver = "2016.2";
 in
 stdenv.mkDerivation rec {
   name = "alfred-${ver}";
 
   src = fetchurl {
     url = "http://downloads.open-mesh.org/batman/releases/batman-adv-${ver}/${name}.tar.gz";
-    sha256 = "02963m1vk9skmvdyd0j3281wslb9cwzr7bdx4dg2wxyncgrgl3ky";
+    sha256 = "19025arn926lhn54ss4gmmdss9z4a3yxk4ja5kyv17mi5i4yg7j6";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/os-specific/linux/batman-adv/batctl.nix b/pkgs/os-specific/linux/batman-adv/batctl.nix
index 2c8eea331cdb..5dafc3d2668b 100644
--- a/pkgs/os-specific/linux/batman-adv/batctl.nix
+++ b/pkgs/os-specific/linux/batman-adv/batctl.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchurl, pkgconfig, libnl }:
 
 let
-  ver = "2016.1";
+  ver = "2016.2";
 in
 stdenv.mkDerivation rec {
   name = "batctl-${ver}";
 
   src = fetchurl {
     url = "http://downloads.open-mesh.org/batman/releases/batman-adv-${ver}/${name}.tar.gz";
-    sha256 = "1j83dzz12c0k7qqd01vmng64h1iq36c86r8ybp8vhb6x5mxkjm68";
+    sha256 = "0bf5zlpwxvq4blcgpwjgh8ms4lfapwjpjl4sczwf3i1rv7f4p05q";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/os-specific/linux/batman-adv/default.nix b/pkgs/os-specific/linux/batman-adv/default.nix
index 6cf0883a464f..0b8a70cb9762 100644
--- a/pkgs/os-specific/linux/batman-adv/default.nix
+++ b/pkgs/os-specific/linux/batman-adv/default.nix
@@ -2,14 +2,14 @@
 
 #assert stdenv.lib.versionOlder kernel.version "3.17";
 
-let base = "batman-adv-2016.1"; in
+let base = "batman-adv-2016.2"; in
 
 stdenv.mkDerivation rec {
   name = "${base}-${kernel.version}";
 
   src = fetchurl {
     url = "http://downloads.open-mesh.org/batman/releases/${base}/${base}.tar.gz";
-    sha256 = "0wm0v82kdkli713q4gcq21wbd6mirqmc7xva3kmc3z6kvwlc53ai";
+    sha256 = "0pj6jans75pxw9arp1747kmmk72zbc2vgkf2a0w565pj98x1nlk1";
   };
 
   preBuild = ''
diff --git a/pkgs/os-specific/linux/ena/default.nix b/pkgs/os-specific/linux/ena/default.nix
new file mode 100644
index 000000000000..7a047e9f2338
--- /dev/null
+++ b/pkgs/os-specific/linux/ena/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchFromGitHub, kernel, kmod }:
+
+stdenv.mkDerivation rec {
+  name = "ena-20160629-${kernel.version}";
+
+  src = fetchFromGitHub {
+    owner = "amzn";
+    repo = "amzn-drivers";
+    rev = "b594ac1ea9e0c70e8e95803a0cfd9f5f06ac097e";
+    sha256 = "03w6xgv3lfn28n38mj9cdi3px5zjyrbxnflpd3ggivkv6grf9fp7";
+  };
+
+  configurePhase =
+    ''
+      cd kernel/linux/ena
+      substituteInPlace Makefile --replace '/lib/modules/$(BUILD_KERNEL)' ${kernel.dev}/lib/modules/${kernel.modDirVersion}
+    '';
+
+  installPhase =
+    ''
+      strip -S ena.ko
+      dest=$out/lib/modules/${kernel.modDirVersion}/misc
+      mkdir -p $dest
+      cp ena.ko $dest/
+      xz $dest/ena.ko
+    '';
+
+  meta = {
+    description = "Amazon Elastic Network Adapter (ENA) driver for Linux";
+    homepage = https://github.com/amzn/amzn-drivers;
+    license = lib.licenses.gpl2;
+    maintainers = [ lib.maintainers.eelco ];
+  };
+}
diff --git a/pkgs/os-specific/linux/kernel/common-config.nix b/pkgs/os-specific/linux/kernel/common-config.nix
index 1e9f2cb6a653..cac102351b35 100644
--- a/pkgs/os-specific/linux/kernel/common-config.nix
+++ b/pkgs/os-specific/linux/kernel/common-config.nix
@@ -10,7 +10,7 @@
     `versionAtLeast`.
 
   Then do test your change by building all the kernels (or at least
-  their configs) in nixpkgs or else you will guarantee lots and lots
+  their configs) in Nixpkgs or else you will guarantee lots and lots
   of pain to users trying to switch to an older kernel because of some
   hardware problems with a new one.
 
@@ -42,6 +42,12 @@ with stdenv.lib;
   SCHEDSTATS n
   DETECT_HUNG_TASK y
 
+  # Bump the maximum number of CPUs to support systems like EC2 x1.*
+  # instances and Xeon Phi.
+  ${optionalString (stdenv.system == "x86_64-linux") ''
+    NR_CPUS 384
+  ''}
+
   # Unix domain sockets.
   UNIX y
 
@@ -61,6 +67,7 @@ with stdenv.lib;
   ${optionalString (versionOlder version "3.10") ''
     USB_SUSPEND y
   ''}
+  PM_WAKELOCKS y
 
   # Support drivers that need external firmware.
   STANDALONE n
@@ -92,9 +99,6 @@ with stdenv.lib;
   DONGLE y # Serial dongle support
   HIPPI y
   MTD_COMPLEX_MAPPINGS y # needed for many devices
-  ${optionalString (versionOlder version "3.2") ''
-    NET_POCKET y # enable pocket and portable adapters
-  ''}
   SCSI_LOWLEVEL y # enable lots of SCSI devices
   SCSI_LOWLEVEL_PCMCIA y
   SCSI_SAS_ATA y  # added to enable detection of hard drive
@@ -131,9 +135,7 @@ with stdenv.lib;
   HOSTAP_FIRMWARE_NVRAM? y
   ATH9K_PCI? y # Detect Atheros AR9xxx cards on PCI(e) bus
   ATH9K_AHB? y # Ditto, AHB bus
-  ${optionalString (versionAtLeast version "3.2") ''
-    B43_PHY_HT? y
-  ''}
+  B43_PHY_HT? y
   BCMA_HOST_PCI? y
 
   # Enable various FB devices.
@@ -151,7 +153,7 @@ with stdenv.lib;
   FB_VESA y
   FRAMEBUFFER_CONSOLE y
   FRAMEBUFFER_CONSOLE_ROTATION y
-  ${optionalString (versionOlder version "3.9" || stdenv.system == "i686-linux") ''
+  ${optionalString (stdenv.system == "i686-linux") ''
     FB_GEODE y
   ''}
 
@@ -162,11 +164,7 @@ with stdenv.lib;
   ''}
   # Allow specifying custom EDID on the kernel command line
   DRM_LOAD_EDID_FIRMWARE y
-  ${optionalString (versionOlder version "3.9") ''
-    DRM_RADEON_KMS? y
-  ''}
-  # Hybrid graphics support
-  VGA_SWITCHEROO y
+  VGA_SWITCHEROO y # Hybrid graphics support
 
   # Sound.
   SND_DYNAMIC_MINORS y
@@ -225,9 +223,7 @@ with stdenv.lib;
     NFSD_V4_SECURITY_LABEL y
   ''}
   NFS_FSCACHE y
-  ${optionalString (versionAtLeast version "3.6") ''
-    NFS_SWAP y
-  ''}
+  NFS_SWAP y
   NFS_V3_ACL y
   ${optionalString (versionAtLeast version "3.11") ''
     NFS_V4_1 y  # NFSv4.1 client support
@@ -259,6 +255,7 @@ with stdenv.lib;
   DEBUG_SET_MODULE_RONX? y # Detect writes to read-only module pages
 
   # Security related features.
+  RANDOMIZE_BASE y
   STRICT_DEVMEM y # Filter access to /dev/mem
   SECURITY_SELINUX_BOOTPARAM_VALUE 0 # Disable SELinux by default
   DEVKMEM n # Disable /dev/kmem
@@ -297,34 +294,31 @@ with stdenv.lib;
   ${optionalString (versionOlder version "4.4") ''
     B43_PCMCIA? y
   ''}
-  BLK_DEV_CMD640_ENHANCED y # CMD640 enhanced support
-  BLK_DEV_IDEACPI y # IDE ACPI support
   BLK_DEV_INTEGRITY y
   BSD_PROCESS_ACCT_V3 y
   BT_HCIUART_BCSP? y
   BT_HCIUART_H4? y # UART (H4) protocol support
   BT_HCIUART_LL? y
-  ${optionalString (versionAtLeast version "3.4") ''
-    BT_RFCOMM_TTY? y # RFCOMM TTY support
-  ''}
+  BT_RFCOMM_TTY? y # RFCOMM TTY support
+  CLEANCACHE? y
   CRASH_DUMP? n
-  ${optionalString (versionOlder version "3.1") ''
-    DMAR? n # experimental
-  ''}
   DVB_DYNAMIC_MINORS? y # we use udev
-  ${optionalString (versionAtLeast version "3.3") ''
-    EFI_STUB y # EFI bootloader in the bzImage itself
-  ''}
+  EFI_STUB y # EFI bootloader in the bzImage itself
   FHANDLE y # used by systemd
+  FRONTSWAP y
   FUSION y # Fusion MPT device support
-  IDE_GD_ATAPI y # ATAPI floppy support
+  IDE n # deprecated IDE support
+  ${optionalString (versionAtLeast version "4.3") ''
+    IDLE_PAGE_TRACKING y
+  ''}
   IRDA_ULTRA y # Ultra (connectionless) protocol
   JOYSTICK_IFORCE_232? y # I-Force Serial joysticks and wheels
   JOYSTICK_IFORCE_USB? y # I-Force USB joysticks and wheels
   JOYSTICK_XPAD_FF? y # X-Box gamepad rumble support
   JOYSTICK_XPAD_LEDS? y # LED Support for Xbox360 controller 'BigX' LED
+  KEXEC_FILE y
+  KEXEC_JUMP y
   LDM_PARTITION y # Windows Logical Disk Manager (Dynamic Disk) support
-  LEDS_TRIGGER_IDE_DISK y # LED IDE Disk Trigger
   LOGIRUMBLEPAD2_FF y # Logitech Rumblepad 2 force feedback
   LOGO n # not needed
   MEDIA_ATTACH y
@@ -343,12 +337,9 @@ with stdenv.lib;
   PPP_MULTILINK y # PPP multilink support
   PPP_FILTER y
   REGULATOR y # Voltage and Current Regulator Support
-  ${optionalString (versionAtLeast version "3.6") ''
-    RC_DEVICES? y # Enable IR devices
-  ''}
-  ${optionalString (versionAtLeast version "3.10") ''
-    RT2800USB_RT55XX y
-  ''}
+  RC_DEVICES? y # Enable IR devices
+  RT2800USB_RT55XX y
+  SCHED_AUTOGROUP y
   SCSI_LOGGING y # SCSI logging facility
   SERIAL_8250 y # 8250/16550 and compatible serial support
   SLIP_COMPRESSED y # CSLIP compressed headers
@@ -363,6 +354,9 @@ with stdenv.lib;
   ''}
   USB_EHCI_ROOT_HUB_TT y # Root Hub Transaction Translators
   USB_EHCI_TT_NEWSCHED y # Improved transaction translator scheduling
+  ${optionalString (versionAtLeast version "4.3") ''
+    USERFAULTFD y
+  ''}
   X86_CHECK_BIOS_CORRUPTION y
   X86_MCE y
 
@@ -373,16 +367,14 @@ with stdenv.lib;
   NAMESPACES? y #  Required by 'unshare' used by 'nixos-install'
   RT_GROUP_SCHED? y
   CGROUP_DEVICE? y
-  ${if versionAtLeast version "3.6" then ''
-    MEMCG y
-    MEMCG_SWAP y
-  '' else ''
-    CGROUP_MEM_RES_CTLR y
-    CGROUP_MEM_RES_CTLR_SWAP y
-  ''}
+  MEMCG y
+  MEMCG_SWAP y
   ${optionalString (versionOlder version "4.7") "DEVPTS_MULTIPLE_INSTANCES y"}
   BLK_DEV_THROTTLING y
   CFQ_GROUP_IOSCHED y
+  ${optionalString (versionAtLeast version "4.3") ''
+    CGROUP_PIDS y
+  ''}
 
   # Enable staging drivers.  These are somewhat experimental, but
   # they generally don't hurt.
@@ -400,9 +392,7 @@ with stdenv.lib;
   FTRACE_SYSCALLS y
   SCHED_TRACER y
   STACK_TRACER y
-  ${optionalString (versionAtLeast version "3.10") ''
-    UPROBE_EVENT y
-  ''}
+  UPROBE_EVENT y
   ${optionalString (versionAtLeast version "4.4") ''
     BPF_SYSCALL y
     BPF_EVENTS y
@@ -414,28 +404,18 @@ with stdenv.lib;
   DEVTMPFS y
 
   # Easier debugging of NFS issues.
-  ${optionalString (versionAtLeast version "3.4") ''
-    SUNRPC_DEBUG y
-  ''}
+  SUNRPC_DEBUG y
 
   # Virtualisation.
   PARAVIRT? y
-  ${if versionAtLeast version "3.10" then ''
-    HYPERVISOR_GUEST y
-  '' else ''
-    PARAVIRT_GUEST? y
-  ''}
+  HYPERVISOR_GUEST y
+  PARAVIRT_SPINLOCKS? y
   KVM_APIC_ARCHITECTURE y
   KVM_ASYNC_PF y
-  ${optionalString (versionOlder version "3.7") ''
-    KVM_CLOCK? y
-  ''}
   ${optionalString (versionAtLeast version "4.0") ''
     KVM_COMPAT? y
   ''}
-  ${optionalString (versionAtLeast version "3.10") ''
-    KVM_DEVICE_ASSIGNMENT? y
-  ''}
+  KVM_DEVICE_ASSIGNMENT? y
   ${optionalString (versionAtLeast version "4.0") ''
     KVM_GENERIC_DIRTYLOG_READ_PROTECT y
   ''}
@@ -470,28 +450,22 @@ with stdenv.lib;
   ${optionalString (!stdenv.is64bit) ''
     HIGHMEM64G? y # We need 64 GB (PAE) support for Xen guest support.
   ''}
-  ${optionalString (versionAtLeast version "3.9" && stdenv.is64bit) ''
+  ${optionalString (stdenv.is64bit) ''
     VFIO_PCI_VGA y
   ''}
   VIRT_DRIVERS y
 
   # Media support.
-  ${optionalString (versionAtLeast version "3.6") ''
-    MEDIA_DIGITAL_TV_SUPPORT y
-    MEDIA_CAMERA_SUPPORT y
-    MEDIA_RC_SUPPORT y
-  ''}
-  ${optionalString (versionAtLeast version "3.7") ''
-    MEDIA_USB_SUPPORT y
-    ${optionalString (!(features.chromiumos or false)) ''
-      MEDIA_PCI_SUPPORT y
-    ''}
+  MEDIA_DIGITAL_TV_SUPPORT y
+  MEDIA_CAMERA_SUPPORT y
+  MEDIA_RC_SUPPORT y
+  MEDIA_USB_SUPPORT y
+  ${optionalString (!(features.chromiumos or false)) ''
+    MEDIA_PCI_SUPPORT y
   ''}
 
   # Our initrd init uses shebang scripts, so can't be modular.
-  ${optionalString (versionAtLeast version "3.10") ''
-    BINFMT_SCRIPT y
-  ''}
+  BINFMT_SCRIPT y
 
   # For systemd-binfmt
   BINFMT_MISC? y
@@ -506,10 +480,9 @@ with stdenv.lib;
   TRANSPARENT_HUGEPAGE_MADVISE? y
 
   # zram support (e.g for in-memory compressed swap).
-  ${optionalString (versionAtLeast version "3.4") ''
-    ZSMALLOC y
-  ''}
+  ZSMALLOC y
   ZRAM m
+  ZSWAP y
 
   # Enable PCIe and USB for the brcmfmac driver
   BRCMFMAC_USB? y
diff --git a/pkgs/servers/gpsd/0001-Import-LD_LIBRARY_PATH-to-allow-running-scons-check-.patch b/pkgs/servers/gpsd/0001-Import-LD_LIBRARY_PATH-to-allow-running-scons-check-.patch
index 3a38340f43a3..a8721a3e7029 100644
--- a/pkgs/servers/gpsd/0001-Import-LD_LIBRARY_PATH-to-allow-running-scons-check-.patch
+++ b/pkgs/servers/gpsd/0001-Import-LD_LIBRARY_PATH-to-allow-running-scons-check-.patch
@@ -1,4 +1,4 @@
-From d7e56abcae8bcb85dc935e94418a2f0e9956941b Mon Sep 17 00:00:00 2001
+From e08583ddb8445241c38c88d828271be908d52f9f Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= <bjorn.forsman@gmail.com>
 Date: Mon, 17 Feb 2014 20:52:50 +0000
 Subject: [PATCH 1/2] Import LD_LIBRARY_PATH to allow running 'scons check'
@@ -9,17 +9,17 @@ Subject: [PATCH 1/2] Import LD_LIBRARY_PATH to allow running 'scons check'
  1 file changed, 1 insertion(+)
 
 diff --git a/SConstruct b/SConstruct
-index 14e2f59..86b94bc 100644
+index fe444a2..f73c87e 100644
 --- a/SConstruct
 +++ b/SConstruct
-@@ -215,6 +215,7 @@ import_env = (
-     'PKG_CONFIG_LIBDIR',      # Pass more environment variables to pkg-config (required for crossbuilds)
+@@ -220,6 +220,7 @@ import_env = (
      'STAGING_DIR',     # Required by the OpenWRT and CeroWrt builds.
      'STAGING_PREFIX',  # Required by the OpenWRT and CeroWrt builds.
+     'WRITE_PAD',       # So we can test WRITE_PAD values on the fly.
 +    'LD_LIBRARY_PATH', # Allows running 'scons check' without 'chrpath'
      )
  envs = {}
  for var in import_env:
 -- 
-1.9.0
+2.9.0
 
diff --git a/pkgs/servers/gpsd/0001-Use-pkgconfig-for-dbus-library.patch b/pkgs/servers/gpsd/0001-Use-pkgconfig-for-dbus-library.patch
new file mode 100644
index 000000000000..58ae754ecfb5
--- /dev/null
+++ b/pkgs/servers/gpsd/0001-Use-pkgconfig-for-dbus-library.patch
@@ -0,0 +1,31 @@
+From b4ed6e9e89e3b7d57e5de9f2c1987a489bb5628c Mon Sep 17 00:00:00 2001
+From: Alexey Shmalko <rasen.dubi@gmail.com>
+Date: Sat, 9 Jul 2016 20:54:05 +0300
+Subject: [PATCH] Use pkgconfig for dbus library
+
+Without this, gcc can't find library path for the dbus.
+
+This is already fixed upstream, so the patch shouldn't be necessary with
+the next version of gpsd.
+---
+ SConstruct | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/SConstruct b/SConstruct
+index 0d4b29d..d8624b0 100644
+--- a/SConstruct
++++ b/SConstruct
+@@ -586,8 +586,8 @@ else:
+ 
+     if env['dbus_export'] and config.CheckPKG('dbus-1'):
+         confdefs.append("#define HAVE_DBUS 1\n")
+-        dbusflags = ["-ldbus-1"]
+-        env.MergeFlags(pkg_config("dbus-1"))
++        dbusflags = pkg_config("dbus-1")
++        env.MergeFlags(dbusflags)
+     else:
+         confdefs.append("/* #undef HAVE_DBUS */\n")
+         dbusflags = []
+-- 
+2.9.0
+
diff --git a/pkgs/servers/gpsd/0002-Import-XML_CATALOG_FILES-to-be-able-to-validate-the-.patch b/pkgs/servers/gpsd/0002-Import-XML_CATALOG_FILES-to-be-able-to-validate-the-.patch
index f12d7a52ba0c..3e387167d6fb 100644
--- a/pkgs/servers/gpsd/0002-Import-XML_CATALOG_FILES-to-be-able-to-validate-the-.patch
+++ b/pkgs/servers/gpsd/0002-Import-XML_CATALOG_FILES-to-be-able-to-validate-the-.patch
@@ -1,4 +1,4 @@
-From aed93b6ada5b9b76b85d11d9bad732ca005295af Mon Sep 17 00:00:00 2001
+From 21e5295a633c8c450629106c4603b78b2de7d786 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Bj=C3=B8rn=20Forsman?= <bjorn.forsman@gmail.com>
 Date: Sat, 15 Mar 2014 15:08:01 +0100
 Subject: [PATCH 2/2] Import XML_CATALOG_FILES to be able to validate the
@@ -12,17 +12,17 @@ download DTD's and builders don't have network access...
  1 file changed, 1 insertion(+)
 
 diff --git a/SConstruct b/SConstruct
-index 86b94bc..a0b3d25 100644
+index f73c87e..0d4b29d 100644
 --- a/SConstruct
 +++ b/SConstruct
-@@ -216,6 +216,7 @@ import_env = (
-     'STAGING_DIR',     # Required by the OpenWRT and CeroWrt builds.
+@@ -221,6 +221,7 @@ import_env = (
      'STAGING_PREFIX',  # Required by the OpenWRT and CeroWrt builds.
+     'WRITE_PAD',       # So we can test WRITE_PAD values on the fly.
      'LD_LIBRARY_PATH', # Allows running 'scons check' without 'chrpath'
 +    'XML_CATALOG_FILES', # Enables validating the manual with 'xmlto' using nix build system
      )
  envs = {}
  for var in import_env:
 -- 
-1.9.0
+2.9.0
 
diff --git a/pkgs/servers/gpsd/default.nix b/pkgs/servers/gpsd/default.nix
index 17325ccb2914..596176d939d1 100644
--- a/pkgs/servers/gpsd/default.nix
+++ b/pkgs/servers/gpsd/default.nix
@@ -1,50 +1,54 @@
-{ fetchurl, stdenv, scons, pythonFull, pkgconfig, dbus, dbus_glib
-, ncurses, libX11, libXt, libXpm, libXaw, libXext, makeWrapper
+{ fetchurl, stdenv, scons, pkgconfig, dbus, dbus_glib
+, ncurses, libX11, libXt, libXpm, libXaw, libXext
 , libusb1, docbook_xml_dtd_412, docbook_xsl, bc
 , libxslt, xmlto, gpsdUser ? "gpsd", gpsdGroup ? "dialout"
+, pythonPackages
 }:
 
-# TODO: the 'xgps' program doesn't work: "ImportError: No module named gobject"
 # TODO: put the X11 deps behind a guiSupport parameter for headless support
 
 stdenv.mkDerivation rec {
-  name = "gpsd-3.10";
+  name = "gpsd-3.16";
 
   src = fetchurl {
     url = "http://download-mirror.savannah.gnu.org/releases/gpsd/${name}.tar.gz";
-    sha256 = "0823hl5zgwnbgm0fq3i4z34lv76cpj0k6m0zjiygiyrxrz0w4vvh";
+    sha256 = "0a90ph4qrlz5kkcz2mwkfk3cmwy9fmglp94znz2y0gsd7bqrlmq3";
   };
 
   nativeBuildInputs = [
-    scons makeWrapper pkgconfig docbook_xml_dtd_412 docbook_xsl xmlto bc
-    pythonFull
+    scons pkgconfig docbook_xml_dtd_412 docbook_xsl xmlto bc
+    pythonPackages.python
+    pythonPackages.wrapPython
   ];
 
   buildInputs = [
-    pythonFull dbus dbus_glib ncurses libX11 libXt libXpm libXaw libXext
+    pythonPackages.python dbus dbus_glib ncurses libX11 libXt libXpm libXaw libXext
     libxslt libusb1
   ];
 
+  pythonPath = [
+    pythonPackages.pygobject
+    pythonPackages.pygtk
+  ];
+
   patches = [
     ./0001-Import-LD_LIBRARY_PATH-to-allow-running-scons-check-.patch
     ./0002-Import-XML_CATALOG_FILES-to-be-able-to-validate-the-.patch
+
+    # TODO: remove the patch with the next release
+    ./0001-Use-pkgconfig-for-dbus-library.patch
   ];
 
   # - leapfetch=no disables going online at build time to fetch leap-seconds
   #   info. See <gpsd-src>/build.txt for more info.
-  # - chrpath=no stops the build from using 'chrpath' (which we don't have).
-  #   'chrpath' is used to be able to run the tests from the source tree, but
-  #   we use $LD_LIBRARY_PATH instead.
   buildPhase = ''
     patchShebangs .
-    mkdir -p "$out"
-    sed -e "s|python_lib_dir = .*|python_lib_dir = \"$out/lib/${pythonFull.libPrefix}/site-packages\"|" -i SConstruct
+    sed -e "s|systemd_dir = .*|systemd_dir = '$out/lib/systemd/system'|" -i SConstruct
     scons prefix="$out" leapfetch=no gpsd_user=${gpsdUser} gpsd_group=${gpsdGroup} \
-        systemd=yes udevdir="$out/lib/udev" chrpath=no
+        systemd=yes udevdir="$out/lib/udev" \
+        python_libdir="$out/lib/${pythonPackages.python.libPrefix}/site-packages"
   '';
 
-  doCheck = false;
-
   checkPhase = ''
     export LD_LIBRARY_PATH="$PWD"
     scons check
@@ -52,12 +56,13 @@ stdenv.mkDerivation rec {
 
   # TODO: the udev rules file and the hotplug script need fixes to work on NixOS
   installPhase = ''
-    scons install
     mkdir -p "$out/lib/udev/rules.d"
-    scons udev-install
+    scons install udev-install
   '';
 
-  postInstall = "wrapPythonPrograms";
+  postFixup = ''
+    wrapPythonProgramsIn $out/bin "$out $pythonPath"
+  '';
 
   meta = with stdenv.lib; {
     description = "GPS service daemon";
@@ -82,6 +87,6 @@ stdenv.mkDerivation rec {
     homepage = http://catb.org/gpsd/;
     license = "BSD-style";
     platforms = platforms.linux;
-    maintainers = [ maintainers.bjornfor ];
+    maintainers = with maintainers; [ bjornfor rasendubi ];
   };
 }
diff --git a/pkgs/servers/http/gatling/default.nix b/pkgs/servers/http/gatling/default.nix
index 3901d24edd56..549beec674cc 100644
--- a/pkgs/servers/http/gatling/default.nix
+++ b/pkgs/servers/http/gatling/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libowfat, zlib, openssl, polarssl }:
+{ stdenv, fetchurl, libowfat, zlib, openssl }:
 
 let
   version = "0.13";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "0icjx20ws8gqxgpm77dx7p9zcwi1fv162in6igx04rmnyzyla8dl";
   };
 
-  buildInputs = [  libowfat zlib openssl polarssl ];
+  buildInputs = [  libowfat zlib openssl.dev ];
 
   configurePhase = ''
     substituteInPlace Makefile --replace "/usr/local" "$out"
diff --git a/pkgs/servers/http/nginx/default.nix b/pkgs/servers/http/nginx/default.nix
index c522f442e2f0..394a20420c73 100644
--- a/pkgs/servers/http/nginx/default.nix
+++ b/pkgs/servers/http/nginx/default.nix
@@ -9,11 +9,11 @@ with stdenv.lib;
 
 stdenv.mkDerivation rec {
   name = "nginx-${version}";
-  version = "1.10.0";
+  version = "1.10.1";
 
   src = fetchurl {
     url = "http://nginx.org/download/nginx-${version}.tar.gz";
-    sha256 = "0kdyqa5xaxvhz6y75ixs05mzygk3kszzdq5h0gnlrg35vp1lgmlf";
+    sha256 = "00d8hxj8453c7989qd7z4f1mjp0k3ib8k29i1qyf11b4ar35ilqz";
   };
 
 
diff --git a/pkgs/shells/fish/default.nix b/pkgs/shells/fish/default.nix
index 353647f15b30..f4da2f6fcda1 100644
--- a/pkgs/shells/fish/default.nix
+++ b/pkgs/shells/fish/default.nix
@@ -8,13 +8,13 @@ with stdenv.lib;
 
 stdenv.mkDerivation rec {
   name = "fish-${version}";
-  version = "2.3.0";
+  version = "2.3.1";
 
   patches = [ ./etc_config.patch ];
 
   src = fetchurl {
     url = "http://fishshell.com/files/${version}/${name}.tar.gz";
-    sha256 = "1ralmp7lavdl0plc09ppm232aqsn0crxx6m3hgaa06ibam3sqawi";
+    sha256 = "0r46p64lg6da3v6chsa4gisvl04kd3rpy60yih8r870kbp9wm2ij";
   };
 
   buildInputs = [ ncurses libiconv pcre2 ];
diff --git a/pkgs/tools/networking/dnsmasq/default.nix b/pkgs/tools/networking/dnsmasq/default.nix
index 63720faf7078..6b47e0cae840 100644
--- a/pkgs/tools/networking/dnsmasq/default.nix
+++ b/pkgs/tools/networking/dnsmasq/default.nix
@@ -11,11 +11,11 @@ let
   ]);
 in
 stdenv.mkDerivation rec {
-  name = "dnsmasq-2.75";
+  name = "dnsmasq-2.76";
 
   src = fetchurl {
     url = "http://www.thekelleys.org.uk/dnsmasq/${name}.tar.xz";
-    sha256 = "1wa1d4if9q6k3hklv8xi06a59k3aqb7pik8rhi2l53i99hflw334";
+    sha256 = "15lzih6671gh9knzpl8mxchiml7z5lfqzr7jm2r0rjhrxs6nk4jb";
   };
 
   preBuild = ''
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
   ];
 
   postBuild = optionalString stdenv.isLinux ''
-    make -C contrib/wrt
+    make -C contrib/lease-tools
   '';
 
   # XXX: Does the systemd service definition really belong here when our NixOS
@@ -39,8 +39,9 @@ stdenv.mkDerivation rec {
     install -Dm644 trust-anchors.conf $out/share/dnsmasq/trust-anchors.conf
   '' + optionalString stdenv.isLinux ''
     install -Dm644 dbus/dnsmasq.conf $out/etc/dbus-1/system.d/dnsmasq.conf
-    install -Dm755 contrib/wrt/dhcp_lease_time $out/bin/dhcp_lease_time
-    install -Dm755 contrib/wrt/dhcp_release $out/bin/dhcp_release
+    install -Dm755 contrib/lease-tools/dhcp_lease_time $out/bin/dhcp_lease_time
+    install -Dm755 contrib/lease-tools/dhcp_release $out/bin/dhcp_release
+    install -Dm755 contrib/lease-tools/dhcp_release6 $out/bin/dhcp_release6
 
     mkdir -p $out/share/dbus-1/system-services
     cat <<END > $out/share/dbus-1/system-services/uk.org.thekelleys.dnsmasq.service
@@ -61,6 +62,6 @@ stdenv.mkDerivation rec {
     homepage = http://www.thekelleys.org.uk/dnsmasq/doc.html;
     license = licenses.gpl2;
     platforms = with platforms; linux ++ darwin;
-    maintainers = with maintainers; [ eelco ];
+    maintainers = with maintainers; [ eelco fpletz ];
   };
 }
diff --git a/pkgs/tools/networking/haproxy/default.nix b/pkgs/tools/networking/haproxy/default.nix
index 3f853ca303ec..8a15811407dd 100644
--- a/pkgs/tools/networking/haproxy/default.nix
+++ b/pkgs/tools/networking/haproxy/default.nix
@@ -2,12 +2,12 @@
 
 stdenv.mkDerivation rec {
   majorVersion = "1.6";
-  version = "${majorVersion}.5";
+  version = "${majorVersion}.6";
   name = "haproxy-${version}";
 
   src = fetchurl {
     url = "http://haproxy.1wt.eu/download/${majorVersion}/src/${name}.tar.gz";
-    sha256 = "1pl5zsn12jjfss3cxzbqmxih4nf2gh8qf83qaayvpavli29zpcy4";
+    sha256 = "1xamzzfvwgh3b72f3j74ar9xcn61viszqfbdpf4cdhwc0xikvc7x";
   };
 
   buildInputs = [ openssl zlib ];
diff --git a/pkgs/tools/networking/mu/default.nix b/pkgs/tools/networking/mu/default.nix
index 5829dc9d5509..fa1740e9d124 100644
--- a/pkgs/tools/networking/mu/default.nix
+++ b/pkgs/tools/networking/mu/default.nix
@@ -1,6 +1,6 @@
 { fetchurl, stdenv, sqlite, pkgconfig, autoreconfHook
 , xapian, glib, gmime, texinfo , emacs, guile
-, gtk3, webkit, libsoup, icu, withMug ? false /* doesn't build with current gtk3 */ }:
+, gtk3, webkitgtk24x, libsoup, icu }:
 
 stdenv.mkDerivation rec {
   version = "0.9.16";
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   buildInputs = [
     sqlite pkgconfig xapian glib gmime texinfo emacs guile libsoup icu
     autoreconfHook
-  ] ++ stdenv.lib.optionals withMug [ gtk3 webkit ];
+    gtk3 webkitgtk24x ];
 
   preBuild = ''
     # Fix mu4e-builddir (set it to $out)
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
   '';
 
   # Install mug and msg2pdf
-  postInstall = stdenv.lib.optionalString withMug ''
+  postInstall = ''
     cp -v toys/msg2pdf/msg2pdf $out/bin/
     cp -v toys/mug/mug $out/bin/
   '';
diff --git a/pkgs/tools/networking/ntp/default.nix b/pkgs/tools/networking/ntp/default.nix
index 0e7c23fd3a6c..433a3349702d 100644
--- a/pkgs/tools/networking/ntp/default.nix
+++ b/pkgs/tools/networking/ntp/default.nix
@@ -3,11 +3,11 @@
 assert stdenv.isLinux -> libcap != null;
 
 stdenv.mkDerivation rec {
-  name = "ntp-4.2.8p6";
+  name = "ntp-4.2.8p8";
 
   src = fetchurl {
     url = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/${name}.tar.gz";
-    sha256 = "0j509gd0snj8dq15rhfv2v4wisfaabya1gmgqslk1kisawf0wgaq";
+    sha256 = "1vlpgd0dk2wkpmmf869sfxi8f46sfnmjgk51vl8n6vj5y2sx1cra";
   };
 
   configureFlags = [
diff --git a/pkgs/tools/networking/shadowsocks-libev/default.nix b/pkgs/tools/networking/shadowsocks-libev/default.nix
index e12d25930210..eb30ba2368a8 100644
--- a/pkgs/tools/networking/shadowsocks-libev/default.nix
+++ b/pkgs/tools/networking/shadowsocks-libev/default.nix
@@ -1,8 +1,8 @@
-{ withPolarSSL ? false
+{ withMbedTLS ? true
 , enableSystemSharedLib ? true
 , stdenv, fetchurl, zlib
 , openssl ? null
-, polarssl ? null
+, mbedtls ? null
 , libev ? null
 , libsodium ? null
 , udns ? null
@@ -25,13 +25,13 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ zlib ]
-                ++ optional (!withPolarSSL) openssl
-                ++ optional withPolarSSL polarssl
+                ++ optional (!withMbedTLS) openssl
+                ++ optional withMbedTLS mbedtls
                 ++ optional enableSystemSharedLib [libev libsodium udns];
 
-  configureFlags = optional withPolarSSL
-                     [ "--with-crypto-library=polarssl"
-                       "--with-polarssl=${polarssl}"
+  configureFlags = optional withMbedTLS
+                     [ "--with-crypto-library=mbedtls"
+                       "--with-mbedtls=${mbedtls}"
                      ]
                    ++ optional enableSystemSharedLib "--enable-system-shared-lib";
 
diff --git a/pkgs/tools/networking/srelay/arm.patch b/pkgs/tools/networking/srelay/arm.patch
new file mode 100644
index 000000000000..f56f2c0f2f0a
--- /dev/null
+++ b/pkgs/tools/networking/srelay/arm.patch
@@ -0,0 +1,12 @@
+diff -ru srelay-0.4.8b4.orig/configure srelay-0.4.8b4/configure
+--- srelay-0.4.8b4.orig/configure	2010-12-21 01:11:14.000000000 +1100
++++ srelay-0.4.8b4/configure	2016-06-22 09:03:42.250000345 +1000
+@@ -1875,7 +1875,7 @@
+ 	;;
+   linux*)
+ 	case "$host_cpu" in
+-	  i*86|mips*|powerpc*|sparc*|x86_64*)
++	  i*86|mips*|powerpc*|sparc*|x86_64*|arm*)
+ 	    OS=LINUX
+ 	    cat >>confdefs.h <<\_ACEOF
+ #define LINUX 1
diff --git a/pkgs/tools/networking/srelay/default.nix b/pkgs/tools/networking/srelay/default.nix
new file mode 100644
index 000000000000..853a21da73c4
--- /dev/null
+++ b/pkgs/tools/networking/srelay/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, fetchurl, openssl }:
+
+stdenv.mkDerivation rec {
+  name = "srelay-0.4.8b6";
+
+  src = fetchurl {
+    url = "https://sourceforge.net/projects/socks-relay/files/socks-relay/srelay-0.4.8/srelay-0.4.8b6.tar.gz";
+    sha256 = "1az9ds10hpmpw6bqk7fcd1w70001kz0mm48v3vgg2z6vrbmgn0qj";
+  };
+
+  patches = [ ./arm.patch ];
+
+  installPhase = "install -D srelay $out/bin/srelay";
+
+  meta = {
+    description = "A SOCKS proxy and relay";
+    homepage = http://socks-relay.sourceforge.net/;
+    platforms = stdenv.lib.platforms.unix;
+    license = stdenv.lib.licenses.bsd3;
+  };
+}
diff --git a/pkgs/tools/package-management/nix-repl/default.nix b/pkgs/tools/package-management/nix-repl/default.nix
index 8dfc9e6333eb..43d0d60ac311 100644
--- a/pkgs/tools/package-management/nix-repl/default.nix
+++ b/pkgs/tools/package-management/nix-repl/default.nix
@@ -1,15 +1,15 @@
 { lib, stdenv, fetchFromGitHub, nix, readline, boehmgc }:
 
-let rev = "8a2f5f0607540ffe56b56d52db544373e1efb980"; in
+let rev = "a1ea85e92b067a0a42354a28355c633eac7be65c"; in
 
 stdenv.mkDerivation {
-  name = "nix-repl-${lib.getVersion nix}-${lib.substring 0 7 rev}";
+  name = "nix-repl-${lib.getVersion nix}-2016-02-28";
 
   src = fetchFromGitHub {
     owner = "edolstra";
     repo = "nix-repl";
     inherit rev;
-    sha256 = "0cjablz01i0g9smnavhf86imwx1f9mnh5flax75i615ml71gsr88";
+    sha256 = "0rf9711day64lgg6g6yqc5709x4sgj137zpqyn019k764i7m2xs8";
   };
 
   buildInputs = [ nix readline ];
diff --git a/pkgs/tools/text/sift/default.nix b/pkgs/tools/text/sift/default.nix
index 459334e2b3c8..9a93b64e3693 100644
--- a/pkgs/tools/text/sift/default.nix
+++ b/pkgs/tools/text/sift/default.nix
@@ -21,6 +21,6 @@ buildGoPackage rec {
     homepage = "https://sift-tool.org";
     maintainers = [ maintainers.carlsverre ];
     license = licenses.gpl3;
-    platforms = platforms.all;
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index b7c8549faf88..babd69fc46dd 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -3075,6 +3075,8 @@ in
     libpng = libpng12;
   };
 
+  pngpp = callPackage ../development/libraries/png++ { };
+
   pngquant = callPackage ../tools/graphics/pngquant { };
 
   podiff = callPackage ../tools/text/podiff { };
@@ -3234,6 +3236,14 @@ in
 
   recordmydesktop = callPackage ../applications/video/recordmydesktop { };
 
+  gtk-recordmydesktop = callPackage ../applications/video/recordmydesktop/gtk.nix {
+    jack2 = jack2Full;
+  };
+
+  qt-recordmydesktop = callPackage ../applications/video/recordmydesktop/qt.nix {
+    jack2 = jack2Full;
+  };
+
   recutils = callPackage ../tools/misc/recutils { };
 
   recoll = callPackage ../applications/search/recoll { };
@@ -5986,6 +5996,8 @@ in
 
   srecord = callPackage ../development/tools/misc/srecord { };
 
+  srelay = callPackage ../tools/networking/srelay { };
+
   xidel = callPackage ../tools/text/xidel { };
 
 
@@ -11015,6 +11027,8 @@ in
 
     ixgbevf = callPackage ../os-specific/linux/ixgbevf {};
 
+    ena = callPackage ../os-specific/linux/ena {};
+
     v4l2loopback = callPackage ../os-specific/linux/v4l2loopback { };
 
     frandom = callPackage ../os-specific/linux/frandom { };
@@ -15812,14 +15826,7 @@ in
   gnome3_18 = recurseIntoAttrs (callPackage ../desktops/gnome-3/3.18 { });
   gnome3_20 = recurseIntoAttrs (callPackage ../desktops/gnome-3/3.20 { });
 
-  gnome3 = self.gnome3_18 // {
-    shellExtensions = {
-      impatience = callPackage ../desktops/gnome-3/extensions/impatience.nix {};
-      system-monitor = callPackage ../desktops/gnome-3/extensions/system-monitor.nix {};
-      volume-mixer = callPackage ../desktops/gnome-3/extensions/volume-mixer.nix {};
-      workspace-grid = callPackage ../desktops/gnome-3/extensions/workspace-grid.nix {};
-    };
-  };
+  gnome3 = self.gnome3_20;
 
   gnome = recurseIntoAttrs self.gnome2;
 
diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix
index 63e459a34d77..bfdf29cba5bd 100644
--- a/pkgs/top-level/perl-packages.nix
+++ b/pkgs/top-level/perl-packages.nix
@@ -304,6 +304,25 @@ let self = _self // overrides; _self = with self; {
     };
   };
 
+  AppSt = buildPerlPackage rec {
+    name = "App-St-1.1.2";
+    src = fetchurl {
+      url = https://github.com/nferraz/st/archive/v1.1.2.tar.gz;
+      sha256 = "1j1iwcxl16m4x5kl1vcv0linb93r55ndh3jm0w6qf459jl4x38s6";
+    };
+    postInstall =
+      ''
+        sed -e "1 s|\(.*\)|\1 -I $out/lib/perl5/site_perl|" -i $out/bin/st
+        ($out/bin/st --help || true) | grep Usage
+      '';
+    meta = {
+      description = "A command that computes simple statistics";
+      license = stdenv.lib.licenses.mit;
+      homepage = https://github.com/nferraz/st;
+      maintainers = [ maintainers.eelco ];
+    };
+  };
+
   AttributeHandlers = buildPerlPackage {
     name = "Attribute-Handlers-0.99";
     src = fetchurl {
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 1ff7e9b8d5ef..c4dacb957fbf 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -9543,6 +9543,22 @@ in modules // {
     };
   };
 
+  exifread = buildPythonPackage rec {
+    name = "ExifRead-2.1.2";
+
+    meta = {
+      description = "Easy to use Python module to extract Exif metadata from tiff and jpeg files";
+      homepage    = "https://github.com/ianare/exif-py";
+      license     = "BSD";
+      maintainers = with maintainers; [ vozz ];
+    };
+
+    src = pkgs.fetchurl {
+      url = "mirror://pypi/E/ExifRead/${name}.tar.gz";
+      sha256 = "1b90jf6m9vxh9nanhpyvqdq7hmfx5iggw1l8kq10jrs6xgr49qkr";
+    };
+  };
+
   fastimport = buildPythonPackage rec {
     name = "fastimport-${version}";
     version = "0.9.4";
@@ -11276,6 +11292,21 @@ in modules // {
     };
   };
 
+  inifile = buildPythonPackage rec {
+    name = "inifile-0.3";
+
+    meta = {
+      description = "A small INI library for Python";
+      homepage    = "https://github.com/mitsuhiko/python-inifile";
+      license     = "BSD";
+      maintainers = with maintainers; [ vozz ];
+    };
+
+    src = pkgs.fetchurl {
+      url = "mirror://pypi/i/inifile/${name}.tar.gz";
+      sha256 = "0zgd53czc1irwx6b5zip8xlmyfr40hz2pd498d8yv61znj6lm16h";
+    };
+  };
 
   interruptingcow = buildPythonPackage rec {
     name = "interruptingcow-${version}";
@@ -12011,6 +12042,34 @@ in modules // {
     };
   };
 
+  lektor = buildPythonPackage rec {
+    name = "lektor-${version}";
+
+    version = "2.3";
+
+    src = pkgs.fetchgit {
+      url = "https://github.com/lektor/lektor";
+      rev = "refs/tags/${version}";
+      sha256 = "1n0ylh1sbpvi9li3g6a7j7m28njfibn10y6s2gayjxwm6fpphqxy";
+    };
+
+    LC_ALL="en_US.UTF-8";
+
+    meta = {
+      description = "A static content management system";
+      homepage    = "https://www.getlektor.com/";
+      license     = "BSD";
+      maintainers = with maintainers; [ vozz ];
+    };
+
+    # No tests included in archive
+    doCheck = false;
+
+    propagatedBuildInputs = with self; [
+      click watchdog exifread requests2 mistune inifile Babel jinja2
+      flask pyopenssl ndg-httpsclient pkgs.glibcLocales
+    ];
+  };
 
   libcloud = buildPythonPackage (rec {
     name = "libcloud-0.18.0";
@@ -28405,4 +28464,5 @@ in modules // {
     };
     buildInputs = with self; [ pkgs.swig1 pkgs.coin3d pkgs.soqt pkgs.mesa pkgs.xorg.libXi ];
   };
+
 }