summary refs log tree commit diff
diff options
context:
space:
mode:
authorTuomas Tynkkynen <tuomas@tuxera.com>2017-04-11 12:58:43 +0300
committerTuomas Tynkkynen <tuomas@tuxera.com>2017-04-11 12:58:43 +0300
commit52797fc600c9cd5c9dd8c14bfea8cc52518fe5c1 (patch)
tree78ccad3fbe7dd22d274cc1c984786aa55d0b8a5f
parent0b034797e1bde2d57d57410a95f24b19d3f4d8a8 (diff)
parentd84029f2960784938de2bf32d03be367762aec04 (diff)
downloadnixlib-52797fc600c9cd5c9dd8c14bfea8cc52518fe5c1.tar
nixlib-52797fc600c9cd5c9dd8c14bfea8cc52518fe5c1.tar.gz
nixlib-52797fc600c9cd5c9dd8c14bfea8cc52518fe5c1.tar.bz2
nixlib-52797fc600c9cd5c9dd8c14bfea8cc52518fe5c1.tar.lz
nixlib-52797fc600c9cd5c9dd8c14bfea8cc52518fe5c1.tar.xz
nixlib-52797fc600c9cd5c9dd8c14bfea8cc52518fe5c1.tar.zst
nixlib-52797fc600c9cd5c9dd8c14bfea8cc52518fe5c1.zip
Merge remote-tracking branch 'upstream/master' into staging
-rw-r--r--lib/maintainers.nix1
-rw-r--r--nixos/lib/test-driver/Machine.pm18
-rw-r--r--nixos/lib/testing.nix5
-rw-r--r--nixos/modules/services/hardware/tlp.nix3
-rw-r--r--nixos/modules/services/monitoring/prometheus/default.nix7
-rw-r--r--nixos/modules/services/web-apps/atlassian/crowd.nix2
-rw-r--r--nixos/modules/virtualisation/google-compute-image.nix9
-rw-r--r--nixos/tests/sddm.nix2
-rw-r--r--pkgs/applications/editors/texstudio/default.nix9
-rw-r--r--pkgs/applications/graphics/darktable/default.nix4
-rw-r--r--pkgs/applications/graphics/djview/default.nix6
-rw-r--r--pkgs/applications/graphics/tesseract/4.x.nix61
-rw-r--r--pkgs/applications/graphics/tesseract/default.nix38
-rw-r--r--pkgs/applications/misc/golden-cheetah/default.nix4
-rw-r--r--pkgs/applications/misc/keepassx/community.nix4
-rw-r--r--pkgs/applications/misc/polybar/default.nix6
-rw-r--r--pkgs/applications/networking/browsers/firefox/default.nix38
-rw-r--r--pkgs/applications/networking/dropbox/default.nix6
-rw-r--r--pkgs/applications/networking/mailreaders/notmuch/default.nix9
-rw-r--r--pkgs/applications/networking/mailreaders/notmuch/mutt.nix4
-rw-r--r--pkgs/applications/networking/mailreaders/thunderbird-bin/default.nix14
-rw-r--r--pkgs/applications/networking/mailreaders/thunderbird-bin/sources.nix476
-rw-r--r--pkgs/applications/networking/mailreaders/thunderbird/default.nix154
-rw-r--r--pkgs/applications/networking/mailreaders/thunderbird/gcc6.patch75
-rw-r--r--pkgs/applications/version-management/git-and-tools/tig/default.nix31
-rw-r--r--pkgs/development/libraries/botan/generic.nix4
-rw-r--r--pkgs/development/libraries/git2/default.nix4
-rw-r--r--pkgs/development/libraries/leptonica/default.nix36
-rw-r--r--pkgs/development/libraries/liblastfm/default.nix4
-rw-r--r--pkgs/development/libraries/qt-5/5.6/qtwebengine/default.nix32
-rw-r--r--pkgs/development/libraries/wxsqlite3/default.nix10
-rwxr-xr-xpkgs/development/lisp-modules/clwrapper/cl-wrapper.sh31
-rw-r--r--pkgs/development/lisp-modules/clwrapper/default.nix6
-rw-r--r--pkgs/development/lisp-modules/define-package.nix8
-rw-r--r--pkgs/development/lisp-modules/quicklisp-to-nix-overrides.nix13
-rw-r--r--pkgs/development/python-modules/pyocr-tesseract.patch316
-rw-r--r--pkgs/development/ruby-modules/gem-config/default.nix2
-rw-r--r--pkgs/development/tools/build-managers/apache-maven/default.nix4
-rw-r--r--pkgs/development/tools/build-managers/sbt/default.nix4
-rw-r--r--pkgs/development/tools/continuous-integration/jenkins/default.nix4
-rw-r--r--pkgs/development/tools/misc/cwebbin/default.nix5
-rw-r--r--pkgs/games/exult/default.nix2
-rw-r--r--pkgs/games/nethack/default.nix4
-rw-r--r--pkgs/games/steam/chrootenv.nix1
-rw-r--r--pkgs/games/steam/runtime-wrapped.nix1
-rw-r--r--pkgs/misc/emulators/wine/sources.nix6
-rw-r--r--pkgs/os-specific/linux/kernel/linux-grsecurity.nix4
-rw-r--r--pkgs/os-specific/linux/kernel/linux-testing.nix6
-rw-r--r--pkgs/os-specific/linux/kernel/patches.nix6
-rw-r--r--pkgs/os-specific/linux/sysdig/default.nix2
-rw-r--r--pkgs/os-specific/linux/wireguard/default.nix4
-rw-r--r--pkgs/tools/compression/zstdmt/default.nix4
-rw-r--r--pkgs/tools/filesystems/dosfstools/default.nix10
-rw-r--r--pkgs/tools/filesystems/f2fs-tools/default.nix15
-rw-r--r--pkgs/tools/misc/keychain/default.nix1
-rw-r--r--pkgs/tools/misc/rrdtool/default.nix4
-rw-r--r--pkgs/tools/networking/nuttcp/default.nix2
-rw-r--r--pkgs/tools/networking/openvpn/default.nix2
-rw-r--r--pkgs/tools/networking/openvpn/systemd-notify.patch22
-rwxr-xr-xpkgs/tools/typesetting/lout/builder.sh2
-rw-r--r--pkgs/top-level/all-packages.nix13
-rw-r--r--pkgs/top-level/platforms.nix631
-rw-r--r--pkgs/top-level/python-packages.nix14
-rw-r--r--pkgs/top-level/release.nix15
64 files changed, 1348 insertions, 892 deletions
diff --git a/lib/maintainers.nix b/lib/maintainers.nix
index 231574b7bb51..450d880663cb 100644
--- a/lib/maintainers.nix
+++ b/lib/maintainers.nix
@@ -477,6 +477,7 @@
   shell = "Shell Turner <cam.turn@gmail.com>";
   shlevy = "Shea Levy <shea@shealevy.com>";
   siddharthist = "Langston Barrett <langston.barrett@gmail.com>";
+  sigma = "Yann Hodique <yann.hodique@gmail.com>";
   simonvandel = "Simon Vandel Sillesen <simon.vandel@gmail.com>";
   sjagoe = "Simon Jagoe <simon@simonjagoe.com>";
   sjmackenzie = "Stewart Mackenzie <setori88@gmail.com>";
diff --git a/nixos/lib/test-driver/Machine.pm b/nixos/lib/test-driver/Machine.pm
index 30664406b26d..c619264eb949 100644
--- a/nixos/lib/test-driver/Machine.pm
+++ b/nixos/lib/test-driver/Machine.pm
@@ -542,16 +542,20 @@ sub getScreenText {
     $self->nest("performing optical character recognition", sub {
         my $tmpbase = Cwd::abs_path(".")."/ocr";
         my $tmpin = $tmpbase."in.ppm";
-        my $tmpout = "$tmpbase.ppm";
 
         $self->sendMonitorCommand("screendump $tmpin");
-        system("ppmtopgm $tmpin | pamscale 4 -filter=lanczos > $tmpout") == 0
-            or die "cannot scale screenshot";
+
+        my $magickArgs = "-filter Catrom -density 72 -resample 300 "
+                       . "-contrast -normalize -despeckle -type grayscale "
+                       . "-sharpen 1 -posterize 3 -negate -gamma 100 "
+                       . "-blur 1x65535";
+        my $tessArgs = "-c debug_file=/dev/null --psm 11 --oem 2";
+
+        $text = `convert $magickArgs $tmpin tiff:- | tesseract - - $tessArgs`;
+        my $status = $? >> 8;
         unlink $tmpin;
-        system("tesseract $tmpout $tmpbase") == 0 or die "OCR failed";
-        unlink $tmpout;
-        $text = read_file("$tmpbase.txt");
-        unlink "$tmpbase.txt";
+
+        die "OCR failed with exit code $status" if $status != 0;
     });
     return $text;
 }
diff --git a/nixos/lib/testing.nix b/nixos/lib/testing.nix
index 8539fef0a19d..58c447c76db6 100644
--- a/nixos/lib/testing.nix
+++ b/nixos/lib/testing.nix
@@ -93,7 +93,7 @@ rec {
 
       vms = map (m: m.config.system.build.vm) (lib.attrValues nodes);
 
-      ocrProg = tesseract;
+      ocrProg = tesseract_4.override { enableLanguages = [ "eng" ]; };
 
       # Generate onvenience wrappers for running the test driver
       # interactively with the specified network, and for starting the
@@ -111,7 +111,8 @@ rec {
           vms=($(for i in ${toString vms}; do echo $i/bin/run-*-vm; done))
           wrapProgram $out/bin/nixos-test-driver \
             --add-flags "''${vms[*]}" \
-            ${lib.optionalString enableOCR "--prefix PATH : '${ocrProg}/bin'"} \
+            ${lib.optionalString enableOCR
+              "--prefix PATH : '${ocrProg}/bin:${imagemagick}/bin'"} \
             --run "testScript=\"\$(cat $out/test-script)\"" \
             --set testScript '$testScript' \
             --set VLANS '${toString vlans}'
diff --git a/nixos/modules/services/hardware/tlp.nix b/nixos/modules/services/hardware/tlp.nix
index f36a9e7b4596..3b108c87edd2 100644
--- a/nixos/modules/services/hardware/tlp.nix
+++ b/nixos/modules/services/hardware/tlp.nix
@@ -58,6 +58,9 @@ in
     powerManagement.cpuFreqGovernor = null;
 
     systemd.services = {
+      "systemd-rfkill@".enable = false;
+      "systemd-rfkill".enable = false;
+
       tlp = {
         description = "TLP system startup/shutdown";
 
diff --git a/nixos/modules/services/monitoring/prometheus/default.nix b/nixos/modules/services/monitoring/prometheus/default.nix
index cf9deccbffe2..32af41cc62fc 100644
--- a/nixos/modules/services/monitoring/prometheus/default.nix
+++ b/nixos/modules/services/monitoring/prometheus/default.nix
@@ -116,6 +116,13 @@ let
           The URL scheme with which to fetch metrics from targets.
         '';
       };
+      params = mkOption {
+        type = types.attrsOf (types.listOf types.str);
+        default = {};
+        description = ''
+          Optional HTTP URL parameters.
+        '';
+      };
       basic_auth = mkOption {
         type = types.nullOr (types.submodule {
           options = {
diff --git a/nixos/modules/services/web-apps/atlassian/crowd.nix b/nixos/modules/services/web-apps/atlassian/crowd.nix
index 7ff7dc4e5748..ce41aa4f1e18 100644
--- a/nixos/modules/services/web-apps/atlassian/crowd.nix
+++ b/nixos/modules/services/web-apps/atlassian/crowd.nix
@@ -137,7 +137,7 @@ in
 
         sed -e 's,port="8095",port="${toString cfg.listenPort}" address="${cfg.listenAddress}",' \
         '' + (lib.optionalString cfg.proxy.enable ''
-          -e 's,compression="on",compression="off" protocol="HTTP/1.1" proxyName="${cfg.proxy.name}" proxyPort="${toString cfg.proxy.port}" scheme="${cfg.proxy.scheme}" secure="${toString cfg.proxy.secure}",' \
+          -e 's,compression="on",compression="off" protocol="HTTP/1.1" proxyName="${cfg.proxy.name}" proxyPort="${toString cfg.proxy.port}" scheme="${cfg.proxy.scheme}" secure="${if cfg.proxy.secure then "true" else "false"}",' \
         '') + ''
           ${pkg}/apache-tomcat/conf/server.xml.dist > ${cfg.home}/server.xml
       '';
diff --git a/nixos/modules/virtualisation/google-compute-image.nix b/nixos/modules/virtualisation/google-compute-image.nix
index a3dd3bd55d14..5673d55b3394 100644
--- a/nixos/modules/virtualisation/google-compute-image.nix
+++ b/nixos/modules/virtualisation/google-compute-image.nix
@@ -2,10 +2,10 @@
 
 with lib;
 let
-  diskSize = "100G";
+  diskSize = "1G";
 in
 {
-  imports = [ ../profiles/headless.nix ../profiles/qemu-guest.nix ];
+  imports = [ ../profiles/headless.nix ../profiles/qemu-guest.nix ./grow-partition.nix ];
 
   # https://cloud.google.com/compute/docs/tutorials/building-images
   networking.firewall.enable = mkDefault false;
@@ -94,7 +94,10 @@ in
         ''
     );
 
-  fileSystems."/".label = "nixos";
+  fileSystems."/" = {
+    device = "/dev/disk/by-label/nixos";
+    autoResize = true;
+  };
 
   boot.kernelParams = [ "console=ttyS0" "panic=1" "boot.panic_on_fail" ];
   boot.initrd.kernelModules = [ "virtio_scsi" ];
diff --git a/nixos/tests/sddm.nix b/nixos/tests/sddm.nix
index f78a77efbf06..82be9bc1d727 100644
--- a/nixos/tests/sddm.nix
+++ b/nixos/tests/sddm.nix
@@ -24,7 +24,7 @@ let
         user = nodes.machine.config.users.extraUsers.alice;
       in ''
         startAll;
-        $machine->waitForText(qr/BOB/);
+        $machine->waitForText(qr/ALICE/);
         $machine->screenshot("sddm");
         $machine->sendChars("${user.password}\n");
         $machine->waitForFile("/home/alice/.Xauthority");
diff --git a/pkgs/applications/editors/texstudio/default.nix b/pkgs/applications/editors/texstudio/default.nix
index 89ae2e04eac0..52223dafeb7f 100644
--- a/pkgs/applications/editors/texstudio/default.nix
+++ b/pkgs/applications/editors/texstudio/default.nix
@@ -2,16 +2,17 @@
 
 stdenv.mkDerivation rec {
   pname = "texstudio";
-  version = "2.11.2";
+  version = "2.12.4";
   name = "${pname}-${version}";
   altname="Texstudio";
 
   src = fetchurl {
     url = "mirror://sourceforge/texstudio/${name}.tar.gz";
-    sha256 = "1p6ja5y5902y814f3f5mafh0y8vj682ghrarx1pbm4r5ap8x9z82";
+    sha256 = "03917faqyy0a1k6b86blc2fcards5a1819ydgkc4jlhwiaym4iyw";
   };
 
-  buildInputs = [ qt4 qmake4Hook poppler_qt4 zlib pkgconfig ];
+  nativeBuildInputs = [ qmake4Hook pkgconfig ];
+  buildInputs = [ qt4 poppler_qt4 zlib ];
 
   qmakeFlags = [ "NO_APPDATA=True" ];
 
@@ -22,7 +23,7 @@ stdenv.mkDerivation rec {
 	LaTeX editing with completion, structure viewer, preview,
 	spell checking and support of any compilation chain.
 	'';
-    homepage = "http://texstudio.sourceforge.net/";
+    homepage = http://texstudio.sourceforge.net;
     license = licenses.gpl2Plus;
     platforms = platforms.linux;
     maintainers = with maintainers; [ cfouche ];
diff --git a/pkgs/applications/graphics/darktable/default.nix b/pkgs/applications/graphics/darktable/default.nix
index 1a80c1466d46..68ab287f1a65 100644
--- a/pkgs/applications/graphics/darktable/default.nix
+++ b/pkgs/applications/graphics/darktable/default.nix
@@ -11,12 +11,12 @@
 assert stdenv ? glibc;
 
 stdenv.mkDerivation rec {
-  version = "2.2.3";
+  version = "2.2.4";
   name = "darktable-${version}";
 
   src = fetchurl {
     url = "https://github.com/darktable-org/darktable/releases/download/release-${version}/darktable-${version}.tar.xz";
-    sha256 = "1b33859585bf283577680c61e3c0ea4e48214371453b9c17a86664d2fbda48a0";
+    sha256 = "1n7rddkxwcifc3kcdlnar9w562xv4h78fqkkn27jihqzp3b4am5x";
   };
 
   buildInputs =
diff --git a/pkgs/applications/graphics/djview/default.nix b/pkgs/applications/graphics/djview/default.nix
index 85c0f58174a4..2b0dde210c58 100644
--- a/pkgs/applications/graphics/djview/default.nix
+++ b/pkgs/applications/graphics/djview/default.nix
@@ -1,5 +1,6 @@
 { stdenv, fetchurl, pkgconfig
-, djvulibre, qt4, xorg, libtiff }:
+, djvulibre, qt4, xorg, libtiff
+, darwin }:
 
 stdenv.mkDerivation rec {
   name = "djview-${version}";
@@ -12,7 +13,8 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ pkgconfig ];
 
-  buildInputs = [ djvulibre qt4 xorg.libXt libtiff ];
+  buildInputs = [ djvulibre qt4 xorg.libXt libtiff ]
+  ++ stdenv.lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.AGL ];
 
   passthru = {
     mozillaPlugin = "/lib/netscape/plugins";
diff --git a/pkgs/applications/graphics/tesseract/4.x.nix b/pkgs/applications/graphics/tesseract/4.x.nix
new file mode 100644
index 000000000000..577bff91e353
--- /dev/null
+++ b/pkgs/applications/graphics/tesseract/4.x.nix
@@ -0,0 +1,61 @@
+{ stdenv, fetchFromGitHub, autoreconfHook, autoconf-archive, pkgconfig
+, leptonica, libpng, libtiff, icu, pango, opencl-headers
+
+# Supported list of languages or `null' for all available languages
+, enableLanguages ? null
+}:
+
+stdenv.mkDerivation rec {
+  name = "tesseract-${version}";
+  version = "4.00.00alpha-git-20170410";
+
+  src = fetchFromGitHub {
+    owner = "tesseract-ocr";
+    repo = "tesseract";
+    rev = "36a995bdc92eb2dd8bc5a63205708944a3f990a1";
+    sha256 = "0xz3krvap8sdm27v1dyb34lcdmx11wzvxyszpppfsfmjgkvg19bq";
+  };
+
+  tessdata = fetchFromGitHub {
+    owner = "tesseract-ocr";
+    repo = "tessdata";
+    rev = "8bf2e7ad08db9ca174ae2b0b3a7498c9f1f71d40";
+    sha256 = "0idwkv4qsmmqhrxcgyhy32yldl3vk054m7dkv4fjswfnalgsx794";
+  };
+
+  nativeBuildInputs = [ pkgconfig autoreconfHook autoconf-archive ];
+  buildInputs = [ leptonica libpng libtiff icu pango opencl-headers ];
+
+  # Copy the .traineddata files of the languages specified in enableLanguages
+  # into `$out/share/tessdata' and check afterwards if copying was successful.
+  postInstall = let
+    mkArg = lang: "-iname ${stdenv.lib.escapeShellArg "${lang}.traineddata"}";
+    mkFindArgs = stdenv.lib.concatMapStringsSep " -o " mkArg;
+    findLangArgs = if enableLanguages != null
+                   then "\\( ${mkFindArgs enableLanguages} \\)"
+                   else "-iname '*.traineddata'";
+  in ''
+    numLangs="$(find "$tessdata" -mindepth 1 -maxdepth 1 -type f \
+      ${findLangArgs} -exec cp -t "$out/share/tessdata" {} + -print | wc -l)"
+
+    ${if enableLanguages != null then ''
+      expected=${toString (builtins.length enableLanguages)}
+    '' else ''
+      expected="$(ls -1 "$tessdata/"*.traineddata | wc -l)"
+    ''}
+
+    if [ "$numLangs" -ne "$expected" ]; then
+      echo "Expected $expected languages, but $numLangs" \
+           "were copied to \`$out/share/tessdata'" >&2
+      exit 1
+    fi
+  '';
+
+  meta = {
+    description = "OCR engine";
+    homepage = http://code.google.com/p/tesseract-ocr/;
+    license = stdenv.lib.licenses.asl20;
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/applications/graphics/tesseract/default.nix b/pkgs/applications/graphics/tesseract/default.nix
index 1f1da9a389f2..14335a4c2a9d 100644
--- a/pkgs/applications/graphics/tesseract/default.nix
+++ b/pkgs/applications/graphics/tesseract/default.nix
@@ -1,16 +1,19 @@
-{ stdenv, fetchFromGitHub, pkgconfig, leptonica, libpng, libtiff
-, icu, pango, opencl-headers
+{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig
+, leptonica, libpng, libtiff, icu, pango, opencl-headers
+
+# Supported list of languages or `null' for all available languages
+, enableLanguages ? null
 }:
 
 stdenv.mkDerivation rec {
   name = "tesseract-${version}";
-  version = "3.04.01";
+  version = "3.05.00";
 
   src = fetchFromGitHub {
     owner = "tesseract-ocr";
     repo = "tesseract";
     rev = version;
-    sha256 = "0h1x4z1h86n2gwknd0wck6gykkp99bmm02lg4a47a698g4az6ybv";
+    sha256 = "11wrpcfl118wxsv2c3w2scznwb48c4547qml42s2bpdz079g8y30";
   };
 
   tessdata = fetchFromGitHub {
@@ -20,12 +23,35 @@ stdenv.mkDerivation rec {
     sha256 = "1v4b63v5nzcxr2y3635r19l7lj5smjmc9vfk0wmxlryxncb4vpg7";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkgconfig autoreconfHook ];
   buildInputs = [ leptonica libpng libtiff icu pango opencl-headers ];
 
   LIBLEPT_HEADERSDIR = "${leptonica}/include";
 
-  postInstall = "cp -Rt \"$out/share/tessdata\" \"$tessdata/\"*";
+  # Copy the .traineddata files of the languages specified in enableLanguages
+  # into `$out/share/tessdata' and check afterwards if copying was successful.
+  postInstall = let
+    mkArg = lang: "-iname ${stdenv.lib.escapeShellArg "${lang}.traineddata"}";
+    mkFindArgs = stdenv.lib.concatMapStringsSep " -o " mkArg;
+    findLangArgs = if enableLanguages != null
+                   then "\\( ${mkFindArgs enableLanguages} \\)"
+                   else "-iname '*.traineddata'";
+  in ''
+    numLangs="$(find "$tessdata" -mindepth 1 -maxdepth 1 -type f \
+      ${findLangArgs} -exec cp -t "$out/share/tessdata" {} + -print | wc -l)"
+
+    ${if enableLanguages != null then ''
+      expected=${toString (builtins.length enableLanguages)}
+    '' else ''
+      expected="$(ls -1 "$tessdata/"*.traineddata | wc -l)"
+    ''}
+
+    if [ "$numLangs" -ne "$expected" ]; then
+      echo "Expected $expected languages, but $numLangs" \
+           "were copied to \`$out/share/tessdata'" >&2
+      exit 1
+    fi
+  '';
 
   meta = {
     description = "OCR engine";
diff --git a/pkgs/applications/misc/golden-cheetah/default.nix b/pkgs/applications/misc/golden-cheetah/default.nix
index 68c9246c24b1..d6da900656cc 100644
--- a/pkgs/applications/misc/golden-cheetah/default.nix
+++ b/pkgs/applications/misc/golden-cheetah/default.nix
@@ -22,9 +22,13 @@ stdenv.mkDerivation rec {
     sed -i -e '21,23d' qwt/qwtconfig.pri # Removed forced installation to /usr/local
   '';
   installPhase = ''
+    runHook preInstall
+
     mkdir -p $out/bin
     cp src/GoldenCheetah $out/bin
     wrapQtProgram $out/bin/GoldenCheetah --set LD_LIBRARY_PATH "${zlib.out}/lib"
+
+    runHook postInstall
   '';
   meta = {
     description = "Performance software for cyclists, runners and triathletes";
diff --git a/pkgs/applications/misc/keepassx/community.nix b/pkgs/applications/misc/keepassx/community.nix
index a5defaf5c29b..e103f62fd3c9 100644
--- a/pkgs/applications/misc/keepassx/community.nix
+++ b/pkgs/applications/misc/keepassx/community.nix
@@ -7,13 +7,13 @@ with stdenv.lib;
 
 stdenv.mkDerivation rec {
   name = "keepassx-community-${version}";
-  version = "2.1.3";
+  version = "2.1.4";
 
   src = fetchFromGitHub {
     owner = "keepassxreboot";
     repo = "keepassxc";
     rev = "${version}";
-    sha256 = "1zamk3dc44fn61b880i3l1r0np2sx2hs05cvcf2x4748r3xicacf";
+    sha256 = "1znnw2xpv58x0rbpmm4y662377mbmcilhf8mhhjsz8vhahms33a8";
   };
 
   cmakeFlags = optional (withKeePassHTTP) [ "-DWITH_XC_HTTP=ON" ];
diff --git a/pkgs/applications/misc/polybar/default.nix b/pkgs/applications/misc/polybar/default.nix
index aceaf43ac976..026a1289fb61 100644
--- a/pkgs/applications/misc/polybar/default.nix
+++ b/pkgs/applications/misc/polybar/default.nix
@@ -21,11 +21,11 @@ assert i3GapsSupport -> ! i3Support     && jsoncpp != null && i3-gaps != null;
 
 stdenv.mkDerivation rec {
     name = "polybar-${version}";
-    version = "3.0.4";
+    version = "3.0.5";
     src = fetchgit {
       url = "https://github.com/jaagr/polybar";
-      rev = "1f31870d43f5cd87a5529a55b1d2d3e64105e0af";
-      sha256 = "1nhj4npqhs6zy161931sbdi52gz6163lik0wri9wr122sjf90jas";
+      rev = "4e2e2a7a5e0fe81669031ade0f60e1d379b6516d";
+      sha256 = "1iiks9q13pbkgbjhdns18a5zgr6d40ydcm4qn168m73fs6ivf1vn";
     };
 
     meta = with stdenv.lib; {
diff --git a/pkgs/applications/networking/browsers/firefox/default.nix b/pkgs/applications/networking/browsers/firefox/default.nix
index 1ca50ec8954c..86f6f995bdbd 100644
--- a/pkgs/applications/networking/browsers/firefox/default.nix
+++ b/pkgs/applications/networking/browsers/firefox/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchurl, pkgconfig, gtk2, gtk3, pango, perl, python, zip, libIDL
+{ lib, stdenv, fetchurl, pkgconfig, gtk2, pango, perl, python, zip, libIDL
 , libjpeg, zlib, dbus, dbus_glib, bzip2, xorg
 , freetype, fontconfig, file, alsaLib, nspr, nss, libnotify
 , yasm, mesa, sqlite, unzip, makeWrapper
@@ -6,10 +6,10 @@
 , cairo, gstreamer, gst-plugins-base, icu, libpng, jemalloc, libpulseaudio
 , autoconf213, which
 , writeScript, xidel, common-updater-scripts, coreutils, gnused, gnugrep, curl
-, enableGTK3 ? false
+, enableGTK3 ? false, gtk3, wrapGAppsHook
 , debugBuild ? false
 , # If you want the resulting program to call itself "Firefox" instead
-  # of "Shiretoko" or whatever, enable this option.  However, those
+  # of "Nightly" or whatever, enable this option.  However, those
   # binaries may not be distributed without permission from the
   # Mozilla Foundation, see
   # http://www.mozilla.org/foundation/trademarks/.
@@ -35,12 +35,12 @@ common = { pname, version, sha512, updateScript }: stdenv.mkDerivation rec {
   patches = lib.optional debugBuild ./fix-debug.patch;
 
   buildInputs =
-    [ pkgconfig gtk2 perl zip libIDL libjpeg zlib bzip2
-      python dbus dbus_glib pango freetype fontconfig xorg.libXi
+    [ gtk2 zip libIDL libjpeg zlib bzip2
+      dbus dbus_glib pango freetype fontconfig xorg.libXi
       xorg.libX11 xorg.libXrender xorg.libXft xorg.libXt file
       alsaLib nspr nss libnotify xorg.pixman yasm mesa
       xorg.libXScrnSaver xorg.scrnsaverproto
-      xorg.libXext xorg.xextproto sqlite unzip makeWrapper
+      xorg.libXext xorg.xextproto sqlite unzip
       hunspell libevent libstartup_notification libvpx /* cairo */
       icu libpng jemalloc
       libpulseaudio # only headers are needed
@@ -48,7 +48,7 @@ common = { pname, version, sha512, updateScript }: stdenv.mkDerivation rec {
     ++ lib.optional enableGTK3 gtk3
     ++ lib.optionals (!passthru.ffmpegSupport) [ gstreamer gst-plugins-base ];
 
-  nativeBuildInputs = [ autoconf213 which gnused ];
+  nativeBuildInputs = [ autoconf213 which gnused pkgconfig perl python ] ++ lib.optional enableGTK3 wrapGAppsHook;
 
   configureFlags =
     [ "--enable-application=browser"
@@ -75,10 +75,9 @@ common = { pname, version, sha512, updateScript }: stdenv.mkDerivation rec {
       "--disable-updater"
       "--enable-jemalloc"
       "--disable-gconf"
-      "--enable-default-toolkit=cairo-gtk2"
+      "--enable-default-toolkit=cairo-gtk${if enableGTK3 then "3" else "2"}"
       "--with-google-api-keyfile=ga"
     ]
-    ++ lib.optional enableGTK3 "--enable-default-toolkit=cairo-gtk3"
     ++ (if debugBuild then [ "--enable-debug" "--enable-profiling" ]
                       else [ "--disable-debug" "--enable-release"
                              "--enable-optimize"
@@ -112,17 +111,9 @@ common = { pname, version, sha512, updateScript }: stdenv.mkDerivation rec {
 
       # Remove SDK cruft. FIXME: move to a separate output?
       rm -rf $out/share/idl $out/include $out/lib/firefox-devel-*
-    '' + lib.optionalString enableGTK3
-      # argv[0] must point to firefox itself
-    ''
-      wrapProgram "$out/bin/firefox" \
-        --argv0 "$out/bin/.firefox-wrapped" \
-        --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH:" \
-        --suffix XDG_DATA_DIRS : "$XDG_ICON_DIRS"
-    '' +
-      # some basic testing
-    ''
-      "$out/bin/firefox" --version
+
+      # Needed to find Mozilla runtime
+      gappsWrapperArgs+=(--argv0 "$out/bin/.firefox-wrapped")
     '';
 
   postFixup =
@@ -133,6 +124,13 @@ common = { pname, version, sha512, updateScript }: stdenv.mkDerivation rec {
           "$out"/lib/firefox-*/libxul.so
     '';
 
+  doInstallCheck = true;
+  installCheckPhase =
+    ''
+      # Some basic testing
+      "$out/bin/firefox" --version
+    '';
+
   meta = {
     description = "A web browser" + lib.optionalString (pname == "firefox-esr") " (Extended Support Release)";
     homepage = http://www.mozilla.com/en-US/firefox/;
diff --git a/pkgs/applications/networking/dropbox/default.nix b/pkgs/applications/networking/dropbox/default.nix
index 44caf615205c..e6b5b8ca067b 100644
--- a/pkgs/applications/networking/dropbox/default.nix
+++ b/pkgs/applications/networking/dropbox/default.nix
@@ -23,11 +23,11 @@
 let
   # NOTE: When updating, please also update in current stable,
   # as older versions stop working
-  version = "23.4.17";
+  version = "23.4.18";
   sha256 =
     {
-      "x86_64-linux" = "047i6afghb2nphwwc8sd6dxcbfi9cdyb1w4ssvwfkmbf3mznpfrh";
-      "i686-linux"   = "186z540iv4gq2gmis3mjly070y09lsfwvk9ygmjrh6y7pd9dqa5n";
+      "x86_64-linux" = "0hil9dnhmq4d4yq277w48ql3nw8yfzjqgafb0waw6zbc6a18l7bz";
+      "i686-linux"   = "15hcmqyfyx8z7qx3val5r7b9plckh50iy0mxxh2z1wbh96l03l3a";
     }."${stdenv.system}" or (throw "system ${stdenv.system} not supported");
 
   arch =
diff --git a/pkgs/applications/networking/mailreaders/notmuch/default.nix b/pkgs/applications/networking/mailreaders/notmuch/default.nix
index 212d366facb3..7c48075704e3 100644
--- a/pkgs/applications/networking/mailreaders/notmuch/default.nix
+++ b/pkgs/applications/networking/mailreaders/notmuch/default.nix
@@ -97,10 +97,11 @@ stdenv.mkDerivation rec {
   '';
   dontGzipMan = true; # already compressed
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "Mail indexer";
-    license = stdenv.lib.licenses.gpl3;
-    maintainers = with stdenv.lib.maintainers; [ chaoflow garbas ];
-    platforms = stdenv.lib.platforms.unix;
+    homepage    = https://notmuchmail.org/;
+    license     = licenses.gpl3;
+    maintainers = with maintainers; [ chaoflow garbas ];
+    platforms   = platforms.unix;
   };
 }
diff --git a/pkgs/applications/networking/mailreaders/notmuch/mutt.nix b/pkgs/applications/networking/mailreaders/notmuch/mutt.nix
index 6d08ad724b27..410e5e10ceb6 100644
--- a/pkgs/applications/networking/mailreaders/notmuch/mutt.nix
+++ b/pkgs/applications/networking/mailreaders/notmuch/mutt.nix
@@ -38,8 +38,8 @@ stdenv.mkDerivation rec {
   meta = with lib; {
     inherit version;
     description = "Mutt support for notmuch";
-    homepage    = http://notmuchmua.org/;
-    license     = with licenses; mit;
+    homepage    = https://notmuchmail.org/;
+    license     = with licenses; gpl3;
     maintainers = with maintainers; [ peterhoeg ];
     platforms   = platforms.unix;
   };
diff --git a/pkgs/applications/networking/mailreaders/thunderbird-bin/default.nix b/pkgs/applications/networking/mailreaders/thunderbird-bin/default.nix
index 851b87374951..aba121ba7614 100644
--- a/pkgs/applications/networking/mailreaders/thunderbird-bin/default.nix
+++ b/pkgs/applications/networking/mailreaders/thunderbird-bin/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, config
+{ stdenv, fetchurl, config, makeWrapper
 , gconf
 , alsaLib
 , at_spi2_atk
@@ -16,6 +16,7 @@
 , gst-plugins-base
 , gstreamer
 , gtk2
+, gtk3
 , kerberos
 , libX11
 , libXScrnSaver
@@ -29,6 +30,7 @@
 , libcanberra_gtk2
 , libgnome
 , libgnomeui
+, defaultIconTheme
 , mesa
 , nspr
 , nss
@@ -95,6 +97,7 @@ stdenv.mkDerivation {
       gst-plugins-base
       gstreamer
       gtk2
+      gtk3
       kerberos
       libX11
       libXScrnSaver
@@ -116,6 +119,10 @@ stdenv.mkDerivation {
       stdenv.cc.cc
     ];
 
+  buildInputs = [ gtk3 defaultIconTheme ];
+
+  nativeBuildInputs = [ makeWrapper ];
+
   installPhase =
     ''
       mkdir -p "$prefix/usr/lib/thunderbird-bin-${version}"
@@ -146,6 +153,11 @@ stdenv.mkDerivation {
       GenericName=Mail Reader
       Categories=Application;Network;
       EOF
+
+      wrapProgram "$out/bin/thunderbird" \
+        --argv0 "$out/bin/.thunderbird-wrapped" \
+        --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH:" \
+        --suffix XDG_DATA_DIRS : "$XDG_ICON_DIRS"
     '';
 
   passthru.updateScript = import ./../../browsers/firefox-bin/update.nix {
diff --git a/pkgs/applications/networking/mailreaders/thunderbird-bin/sources.nix b/pkgs/applications/networking/mailreaders/thunderbird-bin/sources.nix
index 286911e05c6b..46d7aa32e8a9 100644
--- a/pkgs/applications/networking/mailreaders/thunderbird-bin/sources.nix
+++ b/pkgs/applications/networking/mailreaders/thunderbird-bin/sources.nix
@@ -1,585 +1,595 @@
 {
-  version = "45.8.0";
+  version = "52.0";
   sources = [
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/ar/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/ar/thunderbird-52.0.tar.bz2";
       locale = "ar";
       arch = "linux-x86_64";
-      sha512 = "b56803f7047547e0ffbe7491062e82a82b19dabf8d4a7483834720166b0fb913f4a0252bebb5653abfaaf526998a5af0c31ff8a62ad8f5ec7d9736a6d581a7d6";
+      sha512 = "83418f9890becd869c878f4ccb5f2ac9dc57103ac12818e4ff010b0ca1efc85b712692e81e458a59fdea8f878d8c8c77d7e11dd116d045db67a0aef278aab6f9";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/ast/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/ast/thunderbird-52.0.tar.bz2";
       locale = "ast";
       arch = "linux-x86_64";
-      sha512 = "c49d973c8b138743ea8fa0bca75f2de01ce1d051b15b5d9e6516ad7a8e489028d2198ba460abcb62a06f0738994f00885d0e26e98b5f3311dddb258622ef6f36";
+      sha512 = "7c97616d16f9ce706e878307fe11ace62f87e227c9f588bbeb6eda8c6ba51bdee280014c7c831629ca39c6fdae537506100a82ccc801887df8dfeb35ba336141";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/be/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/be/thunderbird-52.0.tar.bz2";
       locale = "be";
       arch = "linux-x86_64";
-      sha512 = "8e5463a97d93c70fd9fb3b5cda89ad916c7ae2abc89974536dbe2af0633e696c839a97e8dfbf35bb3c1efc7ccf1c588c5ab3e595a0cea519596ac2c112f8012f";
+      sha512 = "cb7a99fd462c6b685cba2f95029f7d4225c0dcc95101523a9d3d807f8abc458cc4c0a035a8111d5655e7b47baef1d3b974b4a785fe1803eb09431b7f36129429";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/bg/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/bg/thunderbird-52.0.tar.bz2";
       locale = "bg";
       arch = "linux-x86_64";
-      sha512 = "912056b19247376e3f8f4f8da493391c9e094abe2723091cf22c83017fcaefa3402e3465db99ea2a4413ea3fdecb9eb6170e8091a2ce3bc191061e9697daf0cb";
+      sha512 = "f1b2f0001359bcecd3cc1c884ec089c4386fa6679521863b449e2e1cc90a70b06e2c555e18640695c9b5d1d5bd45952bbf489ac3d65bc0adcdfb02b1bfceac4e";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/bn-BD/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/bn-BD/thunderbird-52.0.tar.bz2";
       locale = "bn-BD";
       arch = "linux-x86_64";
-      sha512 = "a221336fae5a44312b1fbf8027c9a6088152f96cf2e5ff55239c0256f6b824c92eddba4442b5efa9e4ae1ed81b3a7114d85fa08a785eb73a20aa0f2b86f73107";
+      sha512 = "b08b572359340e813b71643d3f13b755143a8481343134cbdf49ba7fda1290c48f628c445d57cb254e87650844fe04e9eabf4e4340ec30465d82872aa3eb3cbc";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/br/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/br/thunderbird-52.0.tar.bz2";
       locale = "br";
       arch = "linux-x86_64";
-      sha512 = "ba3d2a59ef9347cb1c23716bd308f62cdcf1399ea6a2c35ede563fa2af48e49a8ca9954f986f55e41c80647cceb218d664ebed0c7053e3ef4a0ea12395bd01d0";
+      sha512 = "7bc083526e8aa4a9c6b59adfe237b25d468c4bf07abfb1a7f76d419e62b887978616337efa814f125d06e6f61361ff0a79ce1c2792ddd5723d7dacbb1f54efd8";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/ca/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/ca/thunderbird-52.0.tar.bz2";
       locale = "ca";
       arch = "linux-x86_64";
-      sha512 = "f64e2eaa1208fbcc8be61e28ceedc113101fd6a9d7b2ac23299f36913b7c696b7a3fbb83934c4ea2ca8d23d632891a22e48ce3001425fea54f7669599da136cb";
+      sha512 = "06e73de3a64b80ba3fab93e08c8b8968d0e84c3f49896bec1c38b2fc35d3c52f5547f5d4ea21f9d2c335e202a078c1c18830e1ccc986823c58e351a85f4337ac";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/cs/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/cs/thunderbird-52.0.tar.bz2";
       locale = "cs";
       arch = "linux-x86_64";
-      sha512 = "130c73d25b581988fc14f734d39bdea4d777258ba35f56f421b234a79a00cc4f322912977af0feab0b3d4ac72e3fd3d13eb26465da7b2d81d8ccbf05a42b8c0e";
+      sha512 = "ec8bd4f3f2a6c0e695ab75ddb1d73723472df2a5a2e141a812860c1a20956ffac4a119de737d0adb766ba1f2c664d12cde40158fbffe555c94a77c8054e4e7cd";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/cy/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/cy/thunderbird-52.0.tar.bz2";
       locale = "cy";
       arch = "linux-x86_64";
-      sha512 = "a3894db9cef7368ee824ea7015b62d378a7e8733b86eaa5fa59645fea4fe9bd9bcb1752ed12678d6ac052b42060d2a3282f23c25c4451362a0c941001352a352";
+      sha512 = "e21599c17c21c6d425c9da5ce5998c7b6be36040e0437bd742506c8cad93fbbe15ec5dd7b840b085f3f484d4b6bb99bdcb1a6a28a2610c13411b13a18b1bcb53";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/da/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/da/thunderbird-52.0.tar.bz2";
       locale = "da";
       arch = "linux-x86_64";
-      sha512 = "ae037f835dd51fc4b140ca0165f75ff26a305715a8536929d46c487d4db1e77cb10f101faea6a612579b021db597b63045deaaa7db1cea2b3d4160d8ef423a4d";
+      sha512 = "1fff0b5ed313a1c404f86a41dcdc94a0787f01f5fda836713de5713697788274619520e40f48ad559e485e1144b898df338373f3ddc85662a95deb8c39fa66ee";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/de/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/de/thunderbird-52.0.tar.bz2";
       locale = "de";
       arch = "linux-x86_64";
-      sha512 = "71255dfb152f4f204399b6ecaa837a468bce5582fb9f358a1d7bdd073e2aecd41a7302a0096f1429d20bd67a92d012172308e8df9aebde141bb7da828b158cd5";
+      sha512 = "ee7f739d8237d7d5f5936e3f520de7d572bbfd0ff19aca140381daf4b2353a42a7b6b79680440bc2a62321c8089619114bce99bc48a88aa6346228ef8d08012a";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/dsb/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/dsb/thunderbird-52.0.tar.bz2";
       locale = "dsb";
       arch = "linux-x86_64";
-      sha512 = "39f02422d754637044fe4c75c9d677c43ff6a87229893c3eb637ff6b9c8adf541833aa929b70f2b783aa1fcf998e112645809c6256070fa746c4c95885c9232e";
+      sha512 = "9439bdeb224ee48adc0af5bc882d3dcb2fdcb988502f9ede03d2ede67261c8007336414a6935f86690e622d70ddf933efe14ca9ef3640be3de46b6c2eba090bc";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/el/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/el/thunderbird-52.0.tar.bz2";
       locale = "el";
       arch = "linux-x86_64";
-      sha512 = "3cf4cce1398e945a3cb41e5432aa0c2ed1fa386e8e553816b1478a12e1248ac709de8d21a938e6c3cd801fffb58fe6e10776b8b96bb295b5fa016492f70031e9";
+      sha512 = "aa8a94bb35c36c0913f8b76944370ac839cbe1c16021f83b3b8c317e03cc1013e35fa502af3293611f7fc89f30513bb24dfc4d89e745364e85d674afe66a0d33";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/en-GB/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/en-GB/thunderbird-52.0.tar.bz2";
       locale = "en-GB";
       arch = "linux-x86_64";
-      sha512 = "609ebe7d015af9dfd3b88ebfb04d67691314ac91d3df7cff91df3f20ba7fb12db5f44dff5c773b4b7c858cc4bc5817119fcfabff03ec550ce250a5289aaea9ab";
+      sha512 = "01b79fa4b147fc7ebc07e29582e9fb567c4b0de565d4fd13a71279ee3946b9e182e086c6c3b1b4c413688cc3dc19979e89e5dda87ce10a181be0cb252ca69f4a";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/en-US/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/en-US/thunderbird-52.0.tar.bz2";
       locale = "en-US";
       arch = "linux-x86_64";
-      sha512 = "4294c93adb8f38617b2898c91d0362b3ab327158e1810d2304f2481bdc4e0e06e1fd2a2d6748cb491cc6c732a039fa3dd83dac801b12ec7be2d7c8cf7e986286";
+      sha512 = "a7e76f80e701b8c1cb1ef190d083d463b9e806ee77a467848caf0425b65bd19c51ea4a137bb59b36334fda129816eb26c9de753b4261cbd8f7040ff63bfe9464";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/es-AR/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/es-AR/thunderbird-52.0.tar.bz2";
       locale = "es-AR";
       arch = "linux-x86_64";
-      sha512 = "ded0d52934a5b74e4eff172037c1abe9c15cb522897daee5173739f4a149c1891309a366d3aded2f1306c447970e72b1a2930a9adce07d57287f7f5f0e8eec73";
+      sha512 = "c2df311f50945e103bfa390413d8b0a4ac307f658aacb10b37e69eb6742756b8cac5221e27de5b96ec07e4f657851c17928f8e3dc0100b300ca97f9f643d05ee";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/es-ES/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/es-ES/thunderbird-52.0.tar.bz2";
       locale = "es-ES";
       arch = "linux-x86_64";
-      sha512 = "523c9b931d9ef8319c5a30463035d84946d97b07a9714b2357637f9992a3dcda4536a29933a29340d4e4951ff2bc540d587ab290a16033bfc510ac911c32d3e7";
+      sha512 = "3d54d936ce165eaf9edfe676a42eb4cb257fa8d18cdd98e4027ac8ac76d9264a2676f39ae37459915b17d7b2473057f076bea0a28a0e68570ad8d1bf8b25c520";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/et/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/et/thunderbird-52.0.tar.bz2";
       locale = "et";
       arch = "linux-x86_64";
-      sha512 = "376e5cd8f50c4b10c4f71b6410528965f256b69c17f3d0d103efe6bdd28ed96d0fc47dcfb709dce617757c3cec603c5a16ac675ae12e17b093db3d1184c8ebfb";
+      sha512 = "966d12756cea32951a38cacdcc2f9854f88f8d5bc6f07677274e5ab1e9b74c875995dfc226a6df61c8ea1901d14cc7971012a9152f6bc37e4def57166be84312";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/eu/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/eu/thunderbird-52.0.tar.bz2";
       locale = "eu";
       arch = "linux-x86_64";
-      sha512 = "8dba4439fadb14028903eb552ad08c62b0a63559ff5332fd2d5434179fe28a75d754b6769d1a171d7e580ec6d86fdfcad8ae6230c14c4e9aa981944013dc5b86";
+      sha512 = "ac1beb19aadbb0b0b15f53f8778e2b8109eb42913e8ec4b5817dcc31e8dfa8a6d40beb9e0c61a05507cde5d553c7af03587194129d20e388344c4d469a3b1b08";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/fi/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/fi/thunderbird-52.0.tar.bz2";
       locale = "fi";
       arch = "linux-x86_64";
-      sha512 = "40d579d59beae9070cf548f340d5b36d67d0456bb0f9569330dcaf4667d6cef71be1be4d32ffbb49446c8921486153e50d5c33ad87746f605e4d3a79b4b74a69";
+      sha512 = "5efda4136cc8152367e36a5c460a4f31c8287441599264aa4b5243173fc925475633529564c357385e511d2ac9faddd04c8bba5fa9c1ecfd2ff8e22fb002a025";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/fr/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/fr/thunderbird-52.0.tar.bz2";
       locale = "fr";
       arch = "linux-x86_64";
-      sha512 = "80b489cb98c0a39c641c0d49cb750cd737594e6de1c9b0559208535a41f95855afbbaf987ab0cfedf5fb5b2fa1589d538b7eada05114d7259d3789fa399e20e7";
+      sha512 = "75368ffdf22424aa919fd35f47813e13a80197345504c17b4e03673d1666431d4e455d1bc76a8f69fbc25853828d2f6a0b57b705bfd37cf12ca5a3095c075916";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/fy-NL/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/fy-NL/thunderbird-52.0.tar.bz2";
       locale = "fy-NL";
       arch = "linux-x86_64";
-      sha512 = "6bd13607375c513be19ae9f86e806ca94d4acb087700fdf85842cd2a7eecab66735b9ca5130b013d09dcaab12134d894bb991774727d67ff71ef2cef4b0f9b49";
+      sha512 = "58edaef7cb314a54feb5367a931314e5a0dc1b308f92372a815c7b1407ea783cddf84f0ebb0c8c59c217b3f6a9ad97873ba85641735db9a2503ddd76c26f7b7a";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/ga-IE/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/ga-IE/thunderbird-52.0.tar.bz2";
       locale = "ga-IE";
       arch = "linux-x86_64";
-      sha512 = "de4744accb4332e8509a1cb439f29d773d67f42d3964e11df83e790e6f720063b3368d3a120f746829d61741abb18baaf1f2afd9dc3bffde1ae2a118025d7973";
+      sha512 = "dd3aae859b04cb9b945083bbe6fb17ba11fb8b218fe8547c6cd4a0d3adb85051f72bfe2adbdf80ec07066ce1aa03e825b2eb153509a0614d98eca8b5565b2755";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/gd/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/gd/thunderbird-52.0.tar.bz2";
       locale = "gd";
       arch = "linux-x86_64";
-      sha512 = "98f73337263ea57e609bab9f8f0537c15c385448c48b84185d9c8cde8550d2d2fb6adc31735c7a45eff5d1872047f7137e168b977a5686401c1f0aa21a38effb";
+      sha512 = "4230cd99c7aa2a9024e76fe52f438574384e682807c09981db24f30cf60dd76ed907f38b212e78b6250f8ee68727e91dcd20fc3b4ce74cd3ad303b9700818091";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/gl/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/gl/thunderbird-52.0.tar.bz2";
       locale = "gl";
       arch = "linux-x86_64";
-      sha512 = "b255dcc44f33c9b8d74ba664350cb6423245a146134e64292f7bd0850ddeafedfd691d8c5e4db51c019df92283b094a8d152441512aef33971ac8959a2904656";
+      sha512 = "d393b4b18458ba2fac188c63bfdccc8e9247b860069606ce21e0533a8316bca15117086216408ae86df18fa3ccfc5605e8de51b80989beed38b55ed7b98bf6ad";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/he/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/he/thunderbird-52.0.tar.bz2";
       locale = "he";
       arch = "linux-x86_64";
-      sha512 = "4c8406c16bae204a1aeb075dd061eb3a70585e439c29f585fed4bb7ee3c1d599f8fb2f12f2ad9d0521550729d7ad1a0b097349a3a318be89a37d10b749fa4fc1";
+      sha512 = "3d41e16926d986129b1d7a717464956a8ae27c75a709789eeca4d8be4875627a740f995ca9e00072e12887e5caca4d3df8ba435a60494f84aa321a99bd15c4d2";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/hr/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/hr/thunderbird-52.0.tar.bz2";
       locale = "hr";
       arch = "linux-x86_64";
-      sha512 = "e855a5753de07b4f4435356571178149c0eb26d9b0b81bbd41de89e88bcf30c3d970514c3548a389cf719917f29899185e1bed9d18c4b467f2d31e00d271623b";
+      sha512 = "6d8698dcb0d2ced2e893aec1221086dabd7f4f351639281c521110e24c4177f5b79360a1324843c431b7535aa59d222ae52797710c7ad41143f4fb73fcc0eb5e";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/hsb/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/hsb/thunderbird-52.0.tar.bz2";
       locale = "hsb";
       arch = "linux-x86_64";
-      sha512 = "8afc5a73b43ae6b43595028213ff6e21da813f9e9a93aad498e583c4ad5fcc2c5eb90ecdf911a32a68710c36a742ca1a0cc89b987789aaeb9995716783e0fff3";
+      sha512 = "0298d90aa6cedf21002df84bf753b59addb072d187b0ea3170f85c041298591994f7f842a8d86db12374e5f00abd4178820168afee738a07ed886f27ac46e9f1";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/hu/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/hu/thunderbird-52.0.tar.bz2";
       locale = "hu";
       arch = "linux-x86_64";
-      sha512 = "da48fd9398349c6dd583391413add0b789d1500dd1481758a62121052bedaa739406011b5a3747fca810c74140c98498eb8c49a092ff3f184627bbc3469df90c";
+      sha512 = "be3dc6926a5ce25a6942a5b33c6d3604c74a0d54b5ae1b4974732cc1fbc4718100fad6f5a6ad77706055c5d9d2c8c2fa52d766bd758e59f44da9db727aadd326";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/hy-AM/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/hy-AM/thunderbird-52.0.tar.bz2";
       locale = "hy-AM";
       arch = "linux-x86_64";
-      sha512 = "588c3670d7748453e273f515255c29e5644e521f9710d1f87360a2031334f9353adba4e219b0f90c3c028102e5e02a0ffe07071a6fddea2bd2a1d972c04e1537";
+      sha512 = "001726c9b817c9b5c34778e0e6f31deca7d11d4887dfe5707e7e386bc0ef8dd9acb20f5008711d7d51902fc114590712d0264ba229934859b0089a8993deadbf";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/id/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/id/thunderbird-52.0.tar.bz2";
       locale = "id";
       arch = "linux-x86_64";
-      sha512 = "a9acd62a369249370f7c6b70bb48aaa8af06de2439b328d92ddd3092cb95fd59df679a451f42173e6901d0e9fce9159e295331479d5128fc50ca7a2c93129bbb";
+      sha512 = "df01723f6fda8f38241683972283c6d1ebf548251d5deb4f061e47d294d67271c72c05cac8aeb2e84afeb4a1af5ea29bbe6293a6a1c4654d597fff2e77b167e8";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/is/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/is/thunderbird-52.0.tar.bz2";
       locale = "is";
       arch = "linux-x86_64";
-      sha512 = "76aee81433e6d8f2f7906d754069a5aab3ff8caa2b3d503a730eefcc42ddc1ea2018049419015dd4725344dbb54d821633f10f1d0c0139ee62c230f7643c5ee9";
+      sha512 = "12112dc6a40579f16bb9d7d0628a31cdb815d7da0484983be95a1ea6aa456f8690d8c0392b164cd365c94900f0b32acdf4a9a247e795a572da9c024d5fd56470";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/it/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/it/thunderbird-52.0.tar.bz2";
       locale = "it";
       arch = "linux-x86_64";
-      sha512 = "c7912a63ab9141a32e8f9040522900b10bb56360fd387b8b47af860814fa1541ab7ec1c59eb6376b7aacc2a22faa046d05c4a1ae81ef12bf553fdf546cfc403a";
+      sha512 = "7dc5c3a52204e4c77f7cb16c40c583eb1617d952c8f887f918479ba3268a006e13cb8d3cf21379b53b217ce7cdc4295876eb9f7e6108760d6d283538fb455bf4";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/ja/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/ja/thunderbird-52.0.tar.bz2";
       locale = "ja";
       arch = "linux-x86_64";
-      sha512 = "03f414eba62f4188bb7a368653f89f0b8d48e850751cab0fb6d706912787aa098a32934bd5c7b3026e466b23df4cc6780f6b88f1f252943b2d56b53f1ea62cb6";
+      sha512 = "43d500330ca83420787adad7de1510a6acaa958f82a265e631191d1305ccb70c0ab118c78c1948cb466603b88d023268aa32900fec2e1d81ffc29050227d2c72";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/ko/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/kab/thunderbird-52.0.tar.bz2";
+      locale = "kab";
+      arch = "linux-x86_64";
+      sha512 = "609464c5c9a86b7c645049c2c3ac63a936a0670250599290d3f6676414a112f43036bd2867bff462f8c1ba89de053041cba887f5568e519d553e0adbbfc42283";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/ko/thunderbird-52.0.tar.bz2";
       locale = "ko";
       arch = "linux-x86_64";
-      sha512 = "d9c1cfba0ab167b4f3e16eb8ee37ca3acfd94477df51a2526975602882b93a4c86e7936f76263bddfc904900146b0ed570c641f4cd1d48904bd5b9f09aef91ac";
+      sha512 = "c3f3d2d5a981a8756a3b76048be1627076e6a822f1cd81c24bfc496ee6de2865744ef50715411d3ffd4db4389e72a1760130d63b421e65c8761a7bb673ce5f3d";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/lt/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/lt/thunderbird-52.0.tar.bz2";
       locale = "lt";
       arch = "linux-x86_64";
-      sha512 = "5f28db94768ba285feb1a239cfd909a588a975dea16ade7793e4e1f71f8dcee1685e7370ba23cb50b253d8252a51a38a90375e8224653bfeb37e2a1e8d969d34";
+      sha512 = "cb746e1fbf5929225c91c2989d33b260fd768348ebf6c232586bd27b46e964f94443659270a6bf6017bba48abb93f533f8428ffda52996597ec8959f8efa3026";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/nb-NO/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/nb-NO/thunderbird-52.0.tar.bz2";
       locale = "nb-NO";
       arch = "linux-x86_64";
-      sha512 = "e3078466c4a5aa5a2743c7224c279c908be05730a79bc541031efa48605e0b74fb4244e087f3cf526bab6c67c40da585815f11999ff29d6a3d0867614aa11e17";
+      sha512 = "67d93508be6d5651707ff7109b5e80fad9db5fe442d05f34834c0c05610cee9aa8b3f2b61dae8705a1ab5b5b5addc089a52928ff5655b93d4c0870dcb9dcaeb6";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/nl/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/nl/thunderbird-52.0.tar.bz2";
       locale = "nl";
       arch = "linux-x86_64";
-      sha512 = "7e2bc54b6d72fa495ef99e132dc4e476bc233c88c1652fc625ed66b504b901fcef53b4968d63d7d468e734903b38ef897282c2122e4bfca5b492e2f4d44b51b6";
+      sha512 = "6b40414449c75856280987b49cf3abe6f3725b89c2a53df3c11c942523d32e8cb3195ee49bae9dbe19d507473ac6b91588ed1e75df7aa1e1418a8ac0f69e326d";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/nn-NO/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/nn-NO/thunderbird-52.0.tar.bz2";
       locale = "nn-NO";
       arch = "linux-x86_64";
-      sha512 = "99a733996460fe3a425d7ac9d37d292ef9fdd0d1bb22aac251f592bd57f4ab2228040443ed132987cf17d971b3bb2232ba9e70aa2b6b702d73967ed55a1b3b41";
+      sha512 = "65eff88f0b0f8672bd587693c1e7d55aded95d308f624e9dfd8731b2dec948cb7ee9ffaf484b35130a63fb6d9314ef8f044363c6b41f70f3e540876b109caa41";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/pa-IN/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/pa-IN/thunderbird-52.0.tar.bz2";
       locale = "pa-IN";
       arch = "linux-x86_64";
-      sha512 = "d43dc96e3620c8ee1257243e725743e72c64f39123d2e4648eb5a31e45175b9b01b066b85ee9cc3d9765151bc2aee32f73b50579619968ff95918189d45358ca";
+      sha512 = "0d4ac412f5d64aac841a1fb0dbdecfa80ff282aa8472df3e9e65419dac486e3086d954c17d1a535904b61b7907fc55d02376fb7a4c46dbc53f48f427673bce8c";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/pl/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/pl/thunderbird-52.0.tar.bz2";
       locale = "pl";
       arch = "linux-x86_64";
-      sha512 = "32f034261425fc41ad9b2c252aa456b1526526816d9ed66e92c49fbf8fb4b077405e2ead3256dac568e1470e29971ff84466854115f57f792a254f0723278054";
+      sha512 = "6ded5f995084a9fcee1a49f3204e2342216c9e04b5b7560e52283bb33bfe15fadadecbe9cbb6bc8643a3fc114b44dbe6c53af1b8f31ad3e3a53653f1fef944a0";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/pt-BR/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/pt-BR/thunderbird-52.0.tar.bz2";
       locale = "pt-BR";
       arch = "linux-x86_64";
-      sha512 = "65f85f596241f812a548a90a1ebf3cd24733e590cbedd600ca8d1164d3d3f5db9fb9a0e152ea05025039203f192168f60fd28a03121c31cdcf14449505d57c0d";
+      sha512 = "7199ebcaf1c206fb93fa0c42118876e2e416fdeee9907c6f43ef0244a950a13ddb74282898b52b85cc2fee3f8fa7077512f3414a916fe1a839243b5823aba7f7";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/pt-PT/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/pt-PT/thunderbird-52.0.tar.bz2";
       locale = "pt-PT";
       arch = "linux-x86_64";
-      sha512 = "fab114396e6cbee135441392dfe6baa179640174edd19ec4d1854a4adb6d3310a38e162209bea0ac532e2734a9ad4c5abc1926e0a4ca2052c62697f99c374135";
+      sha512 = "e6290824e68970d66bbe1787c18062e7638989550f5303c5e42464416a74cdcd95c6005746fcb1ed1a4703fe53032eec1fda92cd0107ca244ee9b8dbc7ee6d50";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/rm/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/rm/thunderbird-52.0.tar.bz2";
       locale = "rm";
       arch = "linux-x86_64";
-      sha512 = "e03da559d75887e2418119cc946bb9ae2f11027dc2109035e533da46c859f3dcaf8fec294a6bdcb10d164866bc5c3652ccb6b8276c58a91311c2bba63117f1fc";
+      sha512 = "7a7abb88f8cf6d40adfd96c2173a8ecb1f2b4eec4e12111bd6af71837b6ed154086376164c0d3fff56eccf4039c3459e275d1fbcddb42fe6efc5c837816f1f3f";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/ro/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/ro/thunderbird-52.0.tar.bz2";
       locale = "ro";
       arch = "linux-x86_64";
-      sha512 = "f7bed7908706485e0cb26a663bdd6b0fd8ad8ad5e687a21e1c137c39d01427e3edce5ce58602bcd18a185445badefa519ecd841367f88f169591aabdf570b940";
+      sha512 = "27fd6ec6be3a876f2ef65f6cc65284609e03f07d71081c967bdd4aa789602cf3ac29885ca2fd710fd8f93491006f4d1e51e8106bae112cfe1b662e13c24b80b7";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/ru/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/ru/thunderbird-52.0.tar.bz2";
       locale = "ru";
       arch = "linux-x86_64";
-      sha512 = "7775b9054e95d373d188e496287b2cbea1ddcd12c51681123642fbc181cff258d47b900b3dbf046f3de7d75e80eef5f343a50577a9db05ab2b56867a18f3c912";
+      sha512 = "19ca3df78354d2c6dbbfdbde975608b73bb4277351fd5d19f15183fc55b8daec2e8eb86edc7f59fe27ef8871497d54b30bf468d2f4f781dc1ec51ef77047feb9";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/si/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/si/thunderbird-52.0.tar.bz2";
       locale = "si";
       arch = "linux-x86_64";
-      sha512 = "3e19c7e5b62b6d0bd3598ce6bfd23631abe381f7af91275aa8e424ff2950433fd5e58e912ad13c726185e528046d3bdccdb6b3e1fa540fc0cb69b18d37caa095";
+      sha512 = "28acca4bb30e303b063c88ebaf320799172421db9c859c3fec5b0bd1f02efd76e52cb82586d577fc73de5f2ee6464ff99dcb32351345d7d1aa28bb14fd856638";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/sk/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/sk/thunderbird-52.0.tar.bz2";
       locale = "sk";
       arch = "linux-x86_64";
-      sha512 = "35a5b23cffb7a80aaab378ac17195b727b7776a0c91e1616fe9a66708adc08d6041efa55dd5b291eee823a5420b092671a34f930276521f0d757e3b5568e7861";
+      sha512 = "f62ea125270243a9f09a2b3b57fdeca752da12788301efd89cb3a3ddb72b8bf4e8befe123ed843a6e70aa42c32b14e5fab8e323bc70383be0517082101dc5f05";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/sl/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/sl/thunderbird-52.0.tar.bz2";
       locale = "sl";
       arch = "linux-x86_64";
-      sha512 = "a7b27babbcd47b4bca6e0686aefa175fab17c4ab0d7f18793a0a3755fcaf04cd85e9bf8ddaec442ab83bafede0ad9f8211add33b6cad845f7c827e3af0982f76";
+      sha512 = "bda98cb38a8334b1612ed72a286cc5df7d4310cc0a4f2a0bad9742a66a898c11f393b3fee48bef3996680ec32d7217e5b2b216ea8201d72fac234c3fad0a0bcd";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/sq/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/sq/thunderbird-52.0.tar.bz2";
       locale = "sq";
       arch = "linux-x86_64";
-      sha512 = "796d3cd98d39fbad987387f92d23c10f4176f2e612c1fa939bbbcf86eb3de5798a9c9add31549dcae001041d0318de2186e00200190f467ebfc85e5c95797cb0";
+      sha512 = "704a118df4a6279383e62c1a7a09e24ab5073540736979ceb69f57d2d5a4de39e7ec58ddb2384cf48a2924c4424fef2a405a4b5745b54ff63ed56d93a3fc31a1";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/sr/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/sr/thunderbird-52.0.tar.bz2";
       locale = "sr";
       arch = "linux-x86_64";
-      sha512 = "8b296aaf9314a8b0381e567ff87e8ed261ebb976c0f63d3636d03fe2e416475dad8c500058e58793a7945ae620268854f99c97b93da0ab73a40f67d801b34af9";
+      sha512 = "9457f07c9a91a163927d1cd536e6b918fa7acaec4333a9b22ac1fb8d26bc528cd34346494184bc4d4172110620bd59faab3a2e036afd3a0f6bd871e4a8efdee2";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/sv-SE/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/sv-SE/thunderbird-52.0.tar.bz2";
       locale = "sv-SE";
       arch = "linux-x86_64";
-      sha512 = "59e0eb3a4e1cc65fc34369b0854d7029bfe108b3cc3550bde26628d88d82c0031bbf13ed8564c7508b2acae5ffc9a912f1cbb991bc5cecf2a210bcdb181e2a05";
+      sha512 = "d9a2e8c1f76600cd9c8e2c1992269ce6a43891e58a9d870b2e2085beadcb46d7af322fa304a99c48dea2c91a68b5adc84094e179efd39034901d1f2c68686e53";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/ta-LK/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/ta-LK/thunderbird-52.0.tar.bz2";
       locale = "ta-LK";
       arch = "linux-x86_64";
-      sha512 = "86719203c04b90e2d359ede21ef3bca7e2190b131a78ba4ccf6a7d9644bcb2971b541cb3c6432e6a12952a3a589769851277a257aeec594b6208918c17d76b32";
+      sha512 = "68f61602b4a6a277639df162cc404c4ee2f433daf7bc5b1ad51372e5ba1a469b111d66837be27db3f42e56239f2c34d632a8ccd92fdaea58a6306da822070ab0";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/tr/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/tr/thunderbird-52.0.tar.bz2";
       locale = "tr";
       arch = "linux-x86_64";
-      sha512 = "5b7fa2e0881dceeb0ac371a0d84209cb9e9c414ee617766ff898b50c2b21956919410be26cc0b1e30997931519fcc491c63c6e30144a2c57af8b7b8f61cd192d";
+      sha512 = "511eb1a4dc9629b5dc7aee5fc47ea2610e367ac871814c6746094cf0250498db59da74b4e3ac84c54a26b4647d3c08b3e5252b6546421d071e203559abe942da";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/uk/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/uk/thunderbird-52.0.tar.bz2";
       locale = "uk";
       arch = "linux-x86_64";
-      sha512 = "8be8b331dce88d3244007066036741af4794559237811ab8d45dffe3e850383de636bb75a510d4a0500a2a78aa86d06768073a5626f5bf2676eb4d8e355eddcd";
+      sha512 = "07e8b6be8081069ae6a33e30c936ea26faa1dd9018fe78bc0d8783c7e9f4aec35a7ee8ea8fa6fa0763348423f11b4a60fa34c4f64cce1cb45d470512a7b889f1";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/vi/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/vi/thunderbird-52.0.tar.bz2";
       locale = "vi";
       arch = "linux-x86_64";
-      sha512 = "60ff68fc5190679b4faf2e80f89b8061348f24c0426f632fc2e523be2d47b0477b2ca122fe4c9a77e8baa91d5c55ef0204fba74f65a1d7e77727abb9846c93df";
+      sha512 = "1fb6aa8661adeecbd3fde91e1158f102573e847a88b5ac2e2e79502c292a200edd4a93393fd5e44cccaaf2f91d7195722eb5e0df768fcabcaddb1681d85b5a48";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/zh-CN/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/zh-CN/thunderbird-52.0.tar.bz2";
       locale = "zh-CN";
       arch = "linux-x86_64";
-      sha512 = "a7da3633bb13627a81681e2539472291e0ffbef2921ae59c7fa541b0115f761295221501ea7b4e71975ba89dff559aa0f4ae1be196983854021bef823cd7c40d";
+      sha512 = "807459ac5666d19595b2095c78116921b046f0cf3c7a4958d56fce8e92e81ac34cb62137a199b7489c72aef1226d29b0c39f34fb9e30c03b1ece12668a00ce1e";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-x86_64/zh-TW/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-x86_64/zh-TW/thunderbird-52.0.tar.bz2";
       locale = "zh-TW";
       arch = "linux-x86_64";
-      sha512 = "dc16cdd23ad53baa7b0863aa889a9222a14ae8e81794efad08dfffc4a6282655fcce3ff64187ce149c06d808a0010af8a084bafc59e253f094d501ee6bebbbef";
+      sha512 = "f233f514a91b558b9b792d2c72fa725f1232786797c52d37d49974562f360b5bd94a02efad1aef751ab74d94fd18de389b6dae416497bb764b474c2dcf90fb18";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/ar/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/ar/thunderbird-52.0.tar.bz2";
       locale = "ar";
       arch = "linux-i686";
-      sha512 = "21c08dc4ae1655ddf62ab03ab68ff0d5fc3efd6c8cd3ccc6d757b0b684365a3316b4cf4fac5a51b21be27a5e3067fbc875bdac1a8bca5cceab6e048c10f0f177";
+      sha512 = "cb89eb4eb32ac39202cf651aecc963ca0a1b215f5bda3e23fbade26da7c760e3e0ff06184f963904441c8db5ce4f12b34d5d28a6f119c80a5a20305478ed8b54";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/ast/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/ast/thunderbird-52.0.tar.bz2";
       locale = "ast";
       arch = "linux-i686";
-      sha512 = "3669b524e5d5800f9ef3c1c6b5f874c29ba6fbb336cebbfc9a88f857e73f9bf90ccdb0fa2f1723d4e883947e71dc0333391b9021166b5acf2e39ca3d7bf02ff1";
+      sha512 = "4cd5cdeea7420f5cc7f1dc2aac10f8db743fcac080a3ecd2b0af33403d364ff6ed711d4307b5126686e06f7d0e759c9f2ebcc69bd21b2eb297a3052a66f483ce";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/be/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/be/thunderbird-52.0.tar.bz2";
       locale = "be";
       arch = "linux-i686";
-      sha512 = "f49f90f1998a5b7dec1e3a862b8f76bc11445d99f66cc6503675fc6629a028624e55dac5245da777b6e3acffcba24305ed199674343cb610861da9c7671c342f";
+      sha512 = "cf4306a2fee98805722391e32f11e230b6b9c400cda8e555900126f6f19e03ef8e45268fbedc81b05a1a2b408b82e740c601ec1d315d3a34257a7513d400726e";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/bg/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/bg/thunderbird-52.0.tar.bz2";
       locale = "bg";
       arch = "linux-i686";
-      sha512 = "b46e78338269dc6c65f0eb2bcd2cb4a0dffd5c100b4b1905582c8189f79abc975f55c7edf06e1f0edbb641de86f3b6aba1ca9028d11f4fa08ea8bd1c276e41f6";
+      sha512 = "0ac427d9b8967316e5b9fe434ac20d019e93fdc4a59f4f0914069d9b9b2fb4238f9f80d030df0b1d07893a0332fd400c2359fcc6dc7bfa728774adfd098fe25e";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/bn-BD/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/bn-BD/thunderbird-52.0.tar.bz2";
       locale = "bn-BD";
       arch = "linux-i686";
-      sha512 = "d349c503a13ae9b951af173a43f4f8dcbd5cab43d5a6219fe5b00e1d37efa7a0ceeeda36576f31f51bac615d6e4307611496e8036af4f9fc40dd3dfb495a6b6c";
+      sha512 = "035d95bedde2b80451c03412bc3b732f2485931421f0581c8b9d20b543fdd0237334e46e819d98762097dfe321ecd4e872495e6d7478c4632cbf793839a369ce";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/br/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/br/thunderbird-52.0.tar.bz2";
       locale = "br";
       arch = "linux-i686";
-      sha512 = "4afebf7eab2f7205a8760f04e566ba8d54bc2974cbd132262eedeaf880d29aaaba48ebd731bb8dd7ca537e6cc3fe444c1ae4168e3e08b7e17c55e70f763fbadb";
+      sha512 = "156ded085c9800dd6413950e2fa26a2de67834ff48712a3a893e284ff8ec6e18f2eef02031c3962d72b171dda432ac679e6a31b2ffa0f766af1ae8ff6d6ebd20";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/ca/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/ca/thunderbird-52.0.tar.bz2";
       locale = "ca";
       arch = "linux-i686";
-      sha512 = "6b5e9abc4fc05ed580d35baeb6c7b1462daef2352f751e318b9a7bf16d032d8a8240f83d54fa17d02a9a967e7477a36808587a9183df4274f10b59059c55fede";
+      sha512 = "7affe51b4e92dc04569affea1165bbcfeb66468d7c1c1056ce03013c924af3de6c8d979ccb898c9985b0ae076bb662d692d11d7bbbd82e59a9b3bfaf0ca8c584";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/cs/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/cs/thunderbird-52.0.tar.bz2";
       locale = "cs";
       arch = "linux-i686";
-      sha512 = "1410e7bb8ffc8a4c515b1c023ffa6eedc960632c05e5e7f4675aee9e972877dfc73d09ef14deb1c308bfcc1a6333e62b24af582410854b62acf4d889c7d54158";
+      sha512 = "0c5aaeb88985ac6167c0f28f4115eb3a95be16900677ccf0cf55fa99c7194997939f141ff2bf2d497bce9260628eb2a76083c7e3a1d81511dafb829fac2a91b4";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/cy/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/cy/thunderbird-52.0.tar.bz2";
       locale = "cy";
       arch = "linux-i686";
-      sha512 = "28b50a2fb0703f80fc9fb91d1add2305e71f2ddac99cfd086c8559f29b5a420e9e5e3d370f0b84a32f5c358661566b070844ccd0b33447ed4c5a427eec03cfa0";
+      sha512 = "0776b21cfc88061b9550ca9a0c3d77a791dcb403f7355235611d4d5861c36a1cd0f64a8ae1de3e5d76bbc560f76f2d6819ca53dc57be5d0fd2a3ebca81d7007b";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/da/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/da/thunderbird-52.0.tar.bz2";
       locale = "da";
       arch = "linux-i686";
-      sha512 = "c38cffe6416ca50c78651d24d5466d6e06b2cbaa66062eb13381c4402d39a7bd55aae10cbe3400ba0fe5983309f2d70d3058a46054911399a057679b09b451be";
+      sha512 = "f22f9601cacfcb440a8657a810ad903000b1541930df88766098e1621c883e8f320c13fd09ca7958ce134d93f7aedd22f659b27fd7c50329e67659820034ef41";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/de/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/de/thunderbird-52.0.tar.bz2";
       locale = "de";
       arch = "linux-i686";
-      sha512 = "101ee34b890f1f3f9bc3eedf4936b8ef1fc9edd2f5af79b9c8375326d430585fc564a76a0bbc81bb119ce9a638af60055d578b5e6f1f760100171696351f13c1";
+      sha512 = "6537e54372558d8a65f54e34aa5012b01d637f309ade5708ab040a345ec7c22cc07646caf0f84e68b5d926d24e9dd3d39fd121578ddd7027b2542b93005199f1";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/dsb/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/dsb/thunderbird-52.0.tar.bz2";
       locale = "dsb";
       arch = "linux-i686";
-      sha512 = "a6dd564baa36402d082d5bc2b5bc6002a5abd66b9bd545a0962fc844f4800390e527b9deaa6ca4f197d98265bd85e7d52624e32be17b2efc96b136d4a0108109";
+      sha512 = "a913816a013a3209a071c9666a92e7a876e601bf22af4f3ad6b331788b4693967d5e7a9059dfcd23fa797c7222a303e6708ec3bc39e3f4acaa9650688a2bf4fb";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/el/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/el/thunderbird-52.0.tar.bz2";
       locale = "el";
       arch = "linux-i686";
-      sha512 = "d5611f341f3322adeb5e94f9dc83dc0de26d6dbaaaa45a904fb9add1770f77b86db57693aa3c89f69c1aeb27e98793475c900643b78a70284911a63791048069";
+      sha512 = "81e8308d1911d45fc1b4da582fee526d52245e96b4935119da542f53434abcfc9d7319acf902b706d667e03e05f4e39c8fe6b5424fd2077c862bff102eab49eb";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/en-GB/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/en-GB/thunderbird-52.0.tar.bz2";
       locale = "en-GB";
       arch = "linux-i686";
-      sha512 = "b8c71ccef1793589f5cbbac8e12ad1aef833131a51a0029c75b08e26f28b3d5dfa821a84654efffae1e41c23cf5575cfb1b55de29e9c29b1a5adc1632581129f";
+      sha512 = "e93fe34674f8cb02e9fb2b2b2695c402e2a4cb35f7b4bfbe96c41cf27e6dd0130647d236a918c9595dedac0b7450aab4c8acfb9e2f18a99979b7099353447507";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/en-US/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/en-US/thunderbird-52.0.tar.bz2";
       locale = "en-US";
       arch = "linux-i686";
-      sha512 = "dbc77f7814b3a085fdf54536d77db69ad893b0230ca1930fb5fbf916cc09e421cdf8987e7f75d726f1fe31f3c7ed0afc584da1d1b1636a2750e9e0454a6de45f";
+      sha512 = "a71b372f1404b1de310494bef37b3d511318d050ce24109fc56749718cdc19a3812323529e9a4a9cb6e9d81794c600c62d5f4487595e4db3a1df444a40d97066";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/es-AR/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/es-AR/thunderbird-52.0.tar.bz2";
       locale = "es-AR";
       arch = "linux-i686";
-      sha512 = "f161bccff6692a9652568530faa89012e2a7438814fc87f816cbbf93d40425133ef24250a6d1b9990bc772e9ce86d778f905d844166527ab6020687bbede4688";
+      sha512 = "bb38d967c613da3122ee421b95d5fa633581193f4899407125403f13d754f1061f78770d342bdeff0e597e1ce813283b25ecb6556aa5bd095f40386fb4e6b563";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/es-ES/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/es-ES/thunderbird-52.0.tar.bz2";
       locale = "es-ES";
       arch = "linux-i686";
-      sha512 = "51ca5165f83366f0fd73fa900640b35d572656d123d14663b737e140c1903a816ca8e2980c2c121b1e0a512e9211ceef745c34d3fd8c04b21cbec84b868b468a";
+      sha512 = "77c8da8cd474ea74b0313efdea0bb428bfe164c243178fafe75075b71df8eaba764d7ae9258d00ce02fce3ed4648ce839c46f3f9e431e0123bd41bf313954fb4";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/et/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/et/thunderbird-52.0.tar.bz2";
       locale = "et";
       arch = "linux-i686";
-      sha512 = "a8524b1a72353ddf3d2b883b3936606b9eb3f1898aea05530c38d7d57fd03ad9c36085996fe3442f085ddf668e2fc909a704939c370ba1d2d0684253a10fa965";
+      sha512 = "323bee6b4005c78c95f1621e9a89d9faa95da44316ce01792e7488b00562d1d64ac23dcf7974d5162e52bff4b9327cfdcff0a85524869cacc4431fe6b1450436";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/eu/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/eu/thunderbird-52.0.tar.bz2";
       locale = "eu";
       arch = "linux-i686";
-      sha512 = "6c3f12ccd7dd48258ff5972163da3617f3038f4f670223617f1b7734181234eaef5be4762156650c0398c4791fc82cfb397149f62e14bc6c873d279eaca92fb3";
+      sha512 = "d90d4364e891794147ad447f3248444218422f6140e7a202554f25a494a2fdc399823f83ce85edf496753125076b83e19a28987b2dab3aff582d1e860a238d73";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/fi/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/fi/thunderbird-52.0.tar.bz2";
       locale = "fi";
       arch = "linux-i686";
-      sha512 = "2d417c63a5c5d5203bea96f88a51ac4b501dee7575bb43fcda3ea523e76e65dacaf16c3f6ad772b25a242aa8016fb36c4f3a04c86431ade23389a97b7cac25cb";
+      sha512 = "b0c9a426eb74f9a8ef3972f40d4a5d73a1eefadf402e65a137043ecdb9f4e0b79c4e84f78c03afaa3d6f0d455b62ecece1861bc289091f5c2354a226c7e10ffd";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/fr/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/fr/thunderbird-52.0.tar.bz2";
       locale = "fr";
       arch = "linux-i686";
-      sha512 = "2c64e8a21306b6129a87333ff1c29ebba10f708d67636042bf6daf40bf01e5ef954038afae8d0d76c42d83ed0c8074525b13b60791f0d0e21108053c9b81822e";
+      sha512 = "9e44644cdc545e52e230e440e2277db6b465a5b36d00c7a7fdd65bf8a141e98444682dc1ab8ce2c85d15ef82e739fe3fc7225c551643244d565a06e883227dca";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/fy-NL/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/fy-NL/thunderbird-52.0.tar.bz2";
       locale = "fy-NL";
       arch = "linux-i686";
-      sha512 = "fe444a91350d3c30e6254e526f5a506aedaebc92ed9632df6a4d2ee5c8f18246601bc8b853eadd54c0b02c2647cae21514a0c1767ff506bb3fd048aa431d5b7a";
+      sha512 = "f3885565bf6bd223494c2169655844023732207172808d8768f148416d8e56eeba3a154e4b9526bd5799cf400369c7f25e41a5a1b78d17d2fd266f6c1de6bb38";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/ga-IE/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/ga-IE/thunderbird-52.0.tar.bz2";
       locale = "ga-IE";
       arch = "linux-i686";
-      sha512 = "73979022d045433b27f71a7278d518b2ee42a7250b166327bfd2f94c2f747acf2d14a9ea55e254f6ade0ccc3ffdc898f61e8dfaa9c7e2b8450fdee195db97b5b";
+      sha512 = "f23f42508eb4f4deff3e5b7f39e5ff5e54bf2c973c56a9800036cc1add4b64b0c597babd60a045ed51cae86c025f8455dfb11ad0c1ecf1b774529810519c4ebd";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/gd/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/gd/thunderbird-52.0.tar.bz2";
       locale = "gd";
       arch = "linux-i686";
-      sha512 = "e856393fe16f57ecbcdc796dd027d8f426f9c1b39fd51c4bcea8ceb82934087ab71d87e7c04ae67b12de6d063994ee4eb607cca9889c7e500272600f80d65f6c";
+      sha512 = "05b37eddcb7d8f78c0676bf918483144d98d935736b562c9fa4b60d1bf290ead4cc9328198da86379d8ed3055d4ed36170897567b3f1273824f7242925d8f55c";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/gl/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/gl/thunderbird-52.0.tar.bz2";
       locale = "gl";
       arch = "linux-i686";
-      sha512 = "c1e8ae50ce6495e9706ff1ef4fb790c53be407eaa738e86f2a788feaa16e5e903386f59bc986497d2ae9e5dff8489007a16c0f2b8b9c37456d180794dfa82642";
+      sha512 = "59fab273843a9f1fba78c19d63bd61c0cac0fb28ecc78549dcf4d52955dc108b5e4bd963e49652c4a7e8e4b6c66ce9e62d24a8db6b67b76b234c860d889942d2";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/he/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/he/thunderbird-52.0.tar.bz2";
       locale = "he";
       arch = "linux-i686";
-      sha512 = "6caf34bd52e21809eb80ed88b104ed1a47a1c29abdc3b3f4059fb183a0b844449936362a1839d888e4d224ee987890982d37d27c32102cfe8029bea1371847cd";
+      sha512 = "63ad6fd03ce2503431d759d56f3ca92168a7eaf1d23aeaa7c9be5206c94d51813f3ddc06489f2e47d2a182e8dac425e35031b9ddafdc8de34a31f0b69d4c8771";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/hr/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/hr/thunderbird-52.0.tar.bz2";
       locale = "hr";
       arch = "linux-i686";
-      sha512 = "230f0bd3eddf99811d8fc60e988772ed107b75981beceec053d861f977e1e3c5261c0ea51475410aeff50efd0a4e378b5e666cdd4b2bfd76ad0ae465142a28a9";
+      sha512 = "3184f7e69c48ee4972aeb4ff7c59bd5db99e5afbab54c82271059c9c2a5d6d42fee1f31030ca7c92812486d9e4c457bb35984a1dc5c055ecf9f7ad9f8e34a986";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/hsb/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/hsb/thunderbird-52.0.tar.bz2";
       locale = "hsb";
       arch = "linux-i686";
-      sha512 = "389b0fab729562e09c17d7ca251675ed4d333f4a79932b5ef2ffeda9d3e683adb95b7f4e4cb192fcf9416826a8aa470b7f8ae4211165b50d7a5a21fe39ba199a";
+      sha512 = "4b8a847889b02b04e80301756e403e0c1d8c38db7ad5c74d843e25f29ffbca1e7449d9e6a4ccb55042f868e3c8018ab00f6f4cd53c86518b3b922618c34b6e7c";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/hu/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/hu/thunderbird-52.0.tar.bz2";
       locale = "hu";
       arch = "linux-i686";
-      sha512 = "2d0ec213b7cf3f875518841e0c08bc6b4134173606098cd0515e93206bf2419377041d44a2737c98b17a198998b80453763e695cabedc283ebbdfb42a60abd70";
+      sha512 = "e0887449cd5668bd06101c637a235d989c93fc831f98b09c7cee031de439d7db9b0a8bb50c1b4fce47bc6c9ef8769d84824e211c7812fa40fb962f88120b9cf1";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/hy-AM/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/hy-AM/thunderbird-52.0.tar.bz2";
       locale = "hy-AM";
       arch = "linux-i686";
-      sha512 = "f77164c2fc3a083e13a11417f77454a885fd4ac77a0b7695c0d2bf8169b54afcd06c32e7c78cb6bbb4ac447a3d690a423344cdab59bc6fdfe83d82bac5d0be0d";
+      sha512 = "f00f3d7c58eedffd39d012391c9464d8e0411fd557d1e52191e635503fa5610bb01137c062c455d9174ee83268f81218f9dff9272f4ade078c003f352a16e4d7";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/id/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/id/thunderbird-52.0.tar.bz2";
       locale = "id";
       arch = "linux-i686";
-      sha512 = "24c383b106de72a3741d7333aa4ec53c091d41ab3638c91f5f88f8d2952d25e77223e95a728611bdfd1cbe2d4418447e588069c286f90ffec0d12c7f245c07fd";
+      sha512 = "7e0fcd2d2773a8f765c21b00b1d1945113219ad6834763aa491fcc570c5c536ebe0089c0f0495794d36a2691674fdcb8b22bd95de5a5dbef2f1426024b2bbce4";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/is/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/is/thunderbird-52.0.tar.bz2";
       locale = "is";
       arch = "linux-i686";
-      sha512 = "bae6f4fa377bb76ffd8d5257f525ce43f151f44f07eaeb5c4109a3440965c36a622c41d6577113bf111335d51d211e18b1c9decac6d9c1dea6303f90b7368f94";
+      sha512 = "48d7879aef3e4528c4db7a86cc28dccf31087d171e103ed9b7bfbcab8fb07ace3353a259edd11ae20bf86ddacb31f2c11d96d460a2a2a8ca3c3935fd6d8c5df1";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/it/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/it/thunderbird-52.0.tar.bz2";
       locale = "it";
       arch = "linux-i686";
-      sha512 = "6b6082972ea030e2564bffaf4e9349d33800b840c0b185bb646c53d0578a1b6360a3d85cdf1dbc534a648d34138f1c8cd26d1c0297c99795e93b93b145a100c0";
+      sha512 = "4a3437fc5e64ac4e0ed674072ff8311548cb0da1c29bed28d7d47c935aa906905e0d153d00ae434899f281d5efac9c306b2456b58c131369ff993f405491265a";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/ja/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/ja/thunderbird-52.0.tar.bz2";
       locale = "ja";
       arch = "linux-i686";
-      sha512 = "66c8808d49986675e9049e77328cf7b1d2fad163b193b8442ca39be1b605bce0180e29b239141509cfec6302f053eaf2197513d5d482beb6c498f6a0ae8bbd9b";
+      sha512 = "d148936fce3b77cfe79c3acd195bc837eba485d6600dd2a19a9d76765435ac6fc6688473eb8572d4bf40461dbca5562cee4baefc9c98aaddb03679748ca4c36c";
+    }
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/kab/thunderbird-52.0.tar.bz2";
+      locale = "kab";
+      arch = "linux-i686";
+      sha512 = "64e1f2044f8dbb1664d8d4ba85514ed17b3c49a16770c4b64e10873e092a9424d939e7fe6bb8d6d1df5f9f3663e259206fe83149f45de16aadf6fb16a8b04755";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/ko/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/ko/thunderbird-52.0.tar.bz2";
       locale = "ko";
       arch = "linux-i686";
-      sha512 = "bdb8a9d6172b6f56d29b29043c484547c9a9dc7bd1477bd8ac4aaa4bf07c0ceffe2ae1560458acefefad66e4487d62746f60b6ec56d5d91603937b0c339d5625";
+      sha512 = "886566909754431b806bef2f314cc3fcd7330e2df5119c2bf65f5f48a9cf7bc378253c4e1f1b8b6cfa409962d6a801bd6547bf2071738ee1b20306fe64318748";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/lt/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/lt/thunderbird-52.0.tar.bz2";
       locale = "lt";
       arch = "linux-i686";
-      sha512 = "dd70d123787ef85ee1c596346bf4c40a99907c2ece2116f7fb4536cb078d162f9afe0f92b466b713d6b75bf92960de32a3b3dedd861946da5b2e946187d4ebc5";
+      sha512 = "24377735d80a0d23ceee9b5594cd37c277141b7ad33b146c7a304fa1de66326adf76443966e17fbb1995848d41374cc44137a8b2956e1254744d50a643e4db82";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/nb-NO/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/nb-NO/thunderbird-52.0.tar.bz2";
       locale = "nb-NO";
       arch = "linux-i686";
-      sha512 = "caf4d3d27db952fce1f34d5c641194d555c2443b86fbecdf68869cafeed0d532d7379212f4338401743e6e26531dd98111f75bddc5e2a3af42a3a7731ec3039b";
+      sha512 = "d53d4089bc057a66cd785e263272962765b2c02eebce6e0830c84748a17cdf09d478f329b486532fbbcfea13967060d2ea2e758b07a8a6cb0a6b56c0a95d611d";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/nl/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/nl/thunderbird-52.0.tar.bz2";
       locale = "nl";
       arch = "linux-i686";
-      sha512 = "dd5071174889bdda282c496c4aa05158887fffc652d4c557320fab2c11e16b0cbb7e5121ef20b423d703dfbf9da52983ff288b9377ecedabfdba496f9c99eb6b";
+      sha512 = "2d23cacfa1166315e5b30562e620bb8f2fedefe62b3478d12ea4bd2a3f9bd24b29022df9c14f76756cca05eae7edc134c505faae8549f701074481d7ad3bb5ae";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/nn-NO/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/nn-NO/thunderbird-52.0.tar.bz2";
       locale = "nn-NO";
       arch = "linux-i686";
-      sha512 = "edd6a1384ed0060398cffb4598a7014aa13cfe83891a4cd4972db2ed6eaae5068703944a6e14b033409eaf6b6426838a0a3d708b9d83eb08907f39469fde4435";
+      sha512 = "518f61379d62f38a1b496221bc898108a693c3378488e7b450c3fb4b133317d9ca92e17e93cf502a8e79b8a3254763aaa0f6b1513487089da514e8c153c432c1";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/pa-IN/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/pa-IN/thunderbird-52.0.tar.bz2";
       locale = "pa-IN";
       arch = "linux-i686";
-      sha512 = "9e6227d28dc844621d1d9ac6c5536505dea0cc1d1b3d161bedf13b75a3255c5c681ce5b38bb510150f8db1add7f149119a8b5ce5b98c5f4dfe2427db6ad58581";
+      sha512 = "7ede43d3c8e60529df4ffe62a1f3ebe3c6420f8601c7838afceafe0ca553ac80328f78d82fc04ba68a5af69b71671722509697e9c73ebaa9603f6de0bc42ada4";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/pl/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/pl/thunderbird-52.0.tar.bz2";
       locale = "pl";
       arch = "linux-i686";
-      sha512 = "8da6ec38d37df6202b751f112031e590777e587e23437cb7a4dcfeb958b27928e2f01cbd1682daa96c143df756b3c8f31f7516ca8cb30a884db2dc03f130f960";
+      sha512 = "18a211aa55724882f3531a8bd588bc418d5d136eef5ad027c18c5b00bac7d0bff6ebf4fef8d3a1d49cf46adfa10040b2cae1e5f039e817067319c66e5af6715a";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/pt-BR/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/pt-BR/thunderbird-52.0.tar.bz2";
       locale = "pt-BR";
       arch = "linux-i686";
-      sha512 = "00a7ffd7509d538b9fe3e801d5c2ad069edd62665a7ce045381213b78226646b1cfe6356b5c873904277330b674608711e15f18dcf4664218b9c61048cf88e40";
+      sha512 = "d5f65af63813b27454d21df094c5b709a1f590144853e9082814ca525ee75f56f1d8aeb9df09bc49c7eeb41eebab6acd46bbc086db4f70c54b8e7be3f9939fdb";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/pt-PT/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/pt-PT/thunderbird-52.0.tar.bz2";
       locale = "pt-PT";
       arch = "linux-i686";
-      sha512 = "f12f544c9eb3a33f861791af9afcc987b72607c2456d7f741046ef9ad36f12552d4e9cf2682ac3f8adc108dc9d36c9fc1b013714b50ae894f72cbe367914f14b";
+      sha512 = "66677c8d8e2c9c38b7efefad3ddb14586f6bdeef74087239c7a16e66062afeb719b928a29a516bd720a716d1b05c4e8bcf21cd84f641140acc96ec1ab85165e1";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/rm/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/rm/thunderbird-52.0.tar.bz2";
       locale = "rm";
       arch = "linux-i686";
-      sha512 = "9a8497f13a459d5dde822edeb9516d98beed220d75735a2f620c69b1f5e75e68987420aac6bb2a77775b6b34c2e0daa277c15d1491a6a02bb0f9658a40a16526";
+      sha512 = "2692412244a2153ea701cdc5d6b41caabea82440d5f9eed85ff1024973d287fd0c60066503c8f5336bfe36a9726a0a4df8e30c2181b7d66206c6b3a23a32582c";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/ro/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/ro/thunderbird-52.0.tar.bz2";
       locale = "ro";
       arch = "linux-i686";
-      sha512 = "2c9c650647079eb754e471757cae6b5844ae8e19bf01ce25d91a73832483507f90e604caf11305760cab719fe4f830cace5b9313b7e2a6f07a92427f35441c55";
+      sha512 = "3592cb39b622983758c8513a977a2acbd168699ccaee5fb8b6e7cc1714334e4cc48bb48712a764c4a6954d8fbebfa5a1156a89cf41b488026fc2713934a06319";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/ru/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/ru/thunderbird-52.0.tar.bz2";
       locale = "ru";
       arch = "linux-i686";
-      sha512 = "4cbbe88691fd265b4d98aab61c5763f6baea168ea4cae222425973023174f765e7fa6b97fdef959ac0788a632f742715eb7e565113344147d43c228ece7f08ae";
+      sha512 = "df0ad7e0248a0471130faca0fe09f28725352927f362e906365918939d19d0d18a86fa84058463f59376ffbe4f66d574a10823b5e88be3eed8ec39d17c2e2a7a";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/si/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/si/thunderbird-52.0.tar.bz2";
       locale = "si";
       arch = "linux-i686";
-      sha512 = "a270a871187dc95d05cb79d9f4df7947aa58b875c2b0c588c2646f806e7e0eaeb1a62f69d38e78d40399f1c588f043b26d06c0d77cedc9949d8e3d8b026ad4a5";
+      sha512 = "67c3c007ab101d5528613913a75f512befedb6d1cf1f105c19ffb78a5906c2fc6ab01408a290da58cd04667b6c851219aee0a0df7b9a42d1d7f82b244e046d42";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/sk/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/sk/thunderbird-52.0.tar.bz2";
       locale = "sk";
       arch = "linux-i686";
-      sha512 = "8cfd22b92789766c179dbb70739fcf68907c4b215e70d164c83e50f67f2c834f515176e30788ba1fcd58717fdf5642c9e1ef05640a06470146ee942737744c83";
+      sha512 = "9113fb1d2150c191abe647b761eed5747341ff779e1a02b724f604fe1193b845130cda9585adb8fd4e8f23f9a3f22a5c8c90f9acd5b3381d3f26eb95e5a74259";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/sl/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/sl/thunderbird-52.0.tar.bz2";
       locale = "sl";
       arch = "linux-i686";
-      sha512 = "fbf54d81b006625f526ab496e9ec7acf9698f7c95415d61aa4bd91896db07bce9d13c835ec944f164678fca9f49be16b69d6e8b728914ec84a5a8d733d3941b4";
+      sha512 = "1ae92f74625a1fc54b0cf2073c8c687fe853dbdc318cc10a2e997f4b6e8062b500f5761128a228987a81f86a2f501163e5fbce5fde05c41a3e2ce0d74c2fc14b";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/sq/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/sq/thunderbird-52.0.tar.bz2";
       locale = "sq";
       arch = "linux-i686";
-      sha512 = "f8dee08b3a4e049392f7c407e9403b972c755493fe638e7917181b8281a86d70f2d1113e69b785be756774bb9aef4cb493084bc8d0d12bda0f928f4cd468f569";
+      sha512 = "45312d0b18565df69734178eb03b58cd0ea813d7ae099edc03d871a763f715483d9d6a4c375c4f4e6a081d59809beb789c01f0efbe047a6a5d7af40f3280a517";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/sr/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/sr/thunderbird-52.0.tar.bz2";
       locale = "sr";
       arch = "linux-i686";
-      sha512 = "8c8fba2fc92d91f086679b6ba451eed1af4fef5c56747260f9907300f057aab354d7f8ebc411fa25821bc006a551f26e0ddf29b344846a30dc493cfef30c7375";
+      sha512 = "61756439561a7395b7f9bd55dbf16e73def6e55469a2e4bdc84207bb9aae5761002411900ed8e31e1a32c2f854b95c9ce0f35f17d15fba673b4e61e07a9675e9";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/sv-SE/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/sv-SE/thunderbird-52.0.tar.bz2";
       locale = "sv-SE";
       arch = "linux-i686";
-      sha512 = "caf3911023d48fc48f4834be424c01cb22bd7383582c8bfc15468401a1558351659e93955103625872b5ea3351570bf216b34e93bff9bf535eccd1789f493bca";
+      sha512 = "94cecbfb7d6f6ac060fd2b2aabdb3e049832055c969fa7d3ff518a91b3ccb39f9902910bd282c2d8796e16ea641d6443e4a87545c2328e34e6b567ce6cd2dad1";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/ta-LK/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/ta-LK/thunderbird-52.0.tar.bz2";
       locale = "ta-LK";
       arch = "linux-i686";
-      sha512 = "99a0db9f4e7d9f05e8398f76f0dcce418d0230b8a325a1289b690a87a43febd0c17f52248bb6070ad7bd2dc60d6e877a78f1c4a23c8888b105160f131b31ec1c";
+      sha512 = "05b4d35f6288944f0fc527c0338ab5cb204d5746b86265638fe66a1921297ad2a6de166782fd5948006d6d71a70c62735afd4936a87b3691d975813fc4ee0be5";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/tr/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/tr/thunderbird-52.0.tar.bz2";
       locale = "tr";
       arch = "linux-i686";
-      sha512 = "79379c3dc58d330949aa5a0338fb38e6334ca47c964842bf090a9431e5b7267f871aaa519dd35262ed9d6e042188e998e95eb7a63c77b3592db09a81bdd95267";
+      sha512 = "98e5f9e9d2f90c6d5b05555f6977bf00179fd8dab49afc2aa157f36ec1c58a5e87043de85de90ee03c7db985f00855ee83d30537b2e514518e90ab782031b426";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/uk/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/uk/thunderbird-52.0.tar.bz2";
       locale = "uk";
       arch = "linux-i686";
-      sha512 = "a2f0efb561fd84e5881bb93145f86f9445eb6cb3ce5ce0e209fc896c797e9a554d180ed1009f369bc12790b8d03d09d429dd3d52fda4ce48d7642009c1a9920a";
+      sha512 = "1495bad171ef4cb4f32e5b02c63c7cc2b8032485192adf5e5d8d8bb8fed897e98e6ead1bf1c71f131178e0059905c82296fb2ab4275c5c979cd963c4176246e6";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/vi/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/vi/thunderbird-52.0.tar.bz2";
       locale = "vi";
       arch = "linux-i686";
-      sha512 = "14a7352ac3254aa0a748e98e208f48ee0b764853b37889077f651ed1d1a401d98c35dd6cd09bb5b25a7f8c5d5c3a7b02319ddf4dcdaa7a5440aa5caae9f09a32";
+      sha512 = "23f96b086356818ee9d451651514c84212e98b0616021789e9215dee2a97cc43d06373162860def7fbe00514651b6fa0395ccebf4823a7e5622d432467dd0365";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/zh-CN/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/zh-CN/thunderbird-52.0.tar.bz2";
       locale = "zh-CN";
       arch = "linux-i686";
-      sha512 = "5b991ccc4daafe744f1fffdc51882bdc72d5fadd1e570e0ff3670f7d7201a67151797a26f0222fe8cfa0ddefff45f0741da6c04d924367705347858cc028a945";
+      sha512 = "129cf69e007ea57550ee0eafcd086050ad3c70ef6671f7e56f12679bd9fafd40916e206aa932fb339bb361c4d4894bb6aff8199334c21894d48e01bdbe2a9bd5";
     }
-    { url = "http://archive.mozilla.org/pub/thunderbird/releases/45.8.0/linux-i686/zh-TW/thunderbird-45.8.0.tar.bz2";
+    { url = "http://archive.mozilla.org/pub/thunderbird/releases/52.0/linux-i686/zh-TW/thunderbird-52.0.tar.bz2";
       locale = "zh-TW";
       arch = "linux-i686";
-      sha512 = "231abcab55934962d3b8dec164ddf48b8b7bfc0e8cd70251479351d8be5d2605e2bb823bbf6c3002bba6c431461b0bfd570f101f31b5adf7c70804610262b856";
+      sha512 = "3fcac7432ce9e1ef4edea97719628374d50173dbb0623866c9bc6aa9644a4d1cebbd640e7dae969b3a7bd067cd29a6d4ff1fb58c18f3eaf3e12c1f9d87f222ce";
     }
     ];
 }
diff --git a/pkgs/applications/networking/mailreaders/thunderbird/default.nix b/pkgs/applications/networking/mailreaders/thunderbird/default.nix
index 6990c12439d7..661d499d34e6 100644
--- a/pkgs/applications/networking/mailreaders/thunderbird/default.nix
+++ b/pkgs/applications/networking/mailreaders/thunderbird/default.nix
@@ -1,32 +1,30 @@
-{ stdenv, lib, fetchurl, pkgconfig, which, m4, gtk2, pango, perl, python2, zip, libIDL
-, libjpeg, libpng, zlib, dbus, dbus_glib, bzip2, xorg
-, freetype, fontconfig, file, alsaLib, nspr, nss, libnotify
-, yasm, mesa, sqlite, unzip, makeWrapper
-, hunspell, libevent, libstartup_notification, libvpx
-, cairo, gstreamer, gst-plugins-base, icu
+{ lib, stdenv, fetchurl, pkgconfig, gtk2, pango, perl, python, zip, libIDL
+, libjpeg, zlib, dbus, dbus_glib, bzip2, xorg
+, freetype, fontconfig, file, nspr, nss, libnotify
+, yasm, mesa, sqlite, unzip
+, hunspell, libevent, libstartup_notification
+, cairo, gstreamer, gst-plugins-base, icu, libpng, jemalloc
+, autoconf213, which, m4
 , writeScript, xidel, common-updater-scripts, coreutils, gnused, gnugrep, curl
+, enableGTK3 ? false, gtk3, wrapGAppsHook
 , debugBuild ? false
-, # If you want the resulting program to call itself "Thunderbird"
-  # instead of "Earlybird", enable this option.  However, those
+, # If you want the resulting program to call itself "Thunderbird" instead
+  # of "Earlybird" or whatever, enable this option.  However, those
   # binaries may not be distributed without permission from the
   # Mozilla Foundation, see
   # http://www.mozilla.org/foundation/trademarks/.
   enableOfficialBranding ? false
 }:
 
-let version = "45.8.0"; in
-let verName = "${version}"; in
-
 stdenv.mkDerivation rec {
-  name = "thunderbird-${verName}";
+  name = "thunderbird-${version}";
+  version = "52.0";
 
   src = fetchurl {
-    url = "mirror://mozilla/thunderbird/releases/${verName}/source/thunderbird-${verName}.source.tar.xz";
-    sha512 = "f8ba08d874fb1a09ac9ba5d4d1f46cefe801783ba4bf82eee682ac2ecc4e231d07033a80e036ad04bda7780c093fb7bc3122a23dc6e19c12f18fb7168dc78deb";
+    url = "mirror://mozilla/thunderbird/releases/${version}/source/thunderbird-${version}.source.tar.xz";
+    sha512 = "215de8ae386f6f12d7a4338bb03bac956410be0dd4de5cca218e12241e3948c8c2540756e149bfde597cd10e399b4cb4db86619a2aa50a368ba323b413c1f93c";
   };
 
-  patches = [ ./gcc6.patch ];
-
   # New sed no longer tolerates this mistake.
   postPatch = ''
     for f in mozilla/{js/src,}/configure; do
@@ -34,99 +32,95 @@ stdenv.mkDerivation rec {
     done
   '';
 
-  buildInputs = # from firefox30Pkgs.xulrunner, without gstreamer and libvpx
-    [ pkgconfig which libpng gtk2 perl zip libIDL libjpeg zlib bzip2
-      python2 dbus dbus_glib pango freetype fontconfig xorg.libXi
+  # from firefox, but without sound libraries
+  buildInputs =
+    [ gtk2 zip libIDL libjpeg zlib bzip2
+      dbus dbus_glib pango freetype fontconfig xorg.libXi
       xorg.libX11 xorg.libXrender xorg.libXft xorg.libXt file
-      alsaLib nspr nss libnotify xorg.pixman yasm mesa
+      nspr nss libnotify xorg.pixman yasm mesa
       xorg.libXScrnSaver xorg.scrnsaverproto
-      xorg.libXext xorg.xextproto sqlite unzip makeWrapper
-      hunspell libevent libstartup_notification cairo icu
-    ] ++ [ m4 ];
+      xorg.libXext xorg.xextproto sqlite unzip
+      hunspell libevent libstartup_notification /* cairo */
+      icu libpng jemalloc
+    ]
+    ++ lib.optional enableGTK3 gtk3;
+
+  # from firefox + m4
+  nativeBuildInputs = [ m4 autoconf213 which gnused pkgconfig perl python ] ++ lib.optional enableGTK3 wrapGAppsHook;
+
+  configureFlags =
+    [ # from firefox, but without sound libraries (alsa, libvpx, pulseaudio)
+      "--enable-application=mail"
+      "--disable-alsa"
+      "--disable-pulseaudio"
 
-  configurePhase = let configureFlags = [ "--enable-application=mail" ]
-    # from firefox30Pkgs.commonConfigureFlags, but without gstreamer and libvpx
-    ++ [
       "--with-system-jpeg"
       "--with-system-zlib"
       "--with-system-bz2"
       "--with-system-nspr"
       "--with-system-nss"
       "--with-system-libevent"
-      #"--with-system-libvpx"
-      "--with-system-png"
+      "--with-system-png" # needs APNG support
       "--with-system-icu"
       "--enable-system-ffi"
       "--enable-system-hunspell"
       "--enable-system-pixman"
       "--enable-system-sqlite"
-      "--enable-system-cairo"
-      "--disable-gconf"
-      "--disable-gstreamer"
+      #"--enable-system-cairo"
       "--enable-startup-notification"
-      # "--enable-content-sandbox"            # available since 26.0, but not much info available
-      # "--enable-content-sandbox-reporter"   # keeping disabled for now
+      "--enable-content-sandbox"            # available since 26.0, but not much info available
       "--disable-crashreporter"
       "--disable-tests"
       "--disable-necko-wifi" # maybe we want to enable this at some point
-      "--disable-installer"
       "--disable-updater"
-      "--disable-pulseaudio"
-    ] ++ (if debugBuild then [ "--enable-debug" "--enable-profiling"]
+      "--enable-jemalloc"
+      "--disable-gconf"
+      "--enable-default-toolkit=cairo-gtk${if enableGTK3 then "3" else "2"}"
+    ]
+      ++ (if debugBuild then [ "--enable-debug" "--enable-profiling"]
                         else [ "--disable-debug" "--enable-release"
                                "--disable-debug-symbols"
                                "--enable-optimize" "--enable-strip" ])
-    ++ [
-      "--disable-javaxpcom"
-      #"--enable-stdcxx-compat" # Avoid dependency on libstdc++ 4.7
-    ]
-    ++ stdenv.lib.optional enableOfficialBranding "--enable-official-branding";
-  in ''
-    mkdir -p objdir/mozilla
-    cd objdir
-    echo '${stdenv.lib.concatMapStrings (s : "ac_add_options ${s}\n") configureFlags}' > .mozconfig
-    echo 'ac_add_options --prefix="'"$out"'"' >> .mozconfig
-    # From version 38, we need to specify the source directory to build
-    # Thunderbird. Refer to mozilla/configure and search a line with
-    # "checking for application to build" and "# Support comm-central".
-    echo 'ac_add_options --with-external-source-dir="'`realpath ..`'"' >> .mozconfig
-    echo 'mk_add_options MOZ_MAKE_FLAGS="-j'"$NIX_BUILD_CORES"'"' >> .mozconfig
-    echo 'mk_add_options MOZ_OBJDIR="'`pwd`'"' >> .mozconfig
-
-    export MOZCONFIG=`realpath ./.mozconfig`
-
-    patchShebangs ../mozilla/mach
-    ../mozilla/mach configure
-  '';
+      ++ lib.optional enableOfficialBranding "--enable-official-branding";
 
   enableParallelBuilding = true;
-  requiredSystemFeatures = [ "big-parallel" ];
 
-  buildPhase =  "../mozilla/mach build";
+  preConfigure =
+    ''
+      configureScript="$(realpath ./configure)"
+      mkdir ../objdir
+      cd ../objdir
+    '';
+
+  preInstall =
+    ''
+      # The following is needed for startup cache creation on grsecurity kernels.
+      paxmark m ../objdir/dist/bin/xpcshell
+    '';
 
-  installPhase =
+  postInstall =
     ''
-      ../mozilla/mach install
-
-      rm -rf $out/include $out/lib/thunderbird-devel-* $out/share/idl
-
-      # Create a desktop item.
-      mkdir -p $out/share/applications
-      cat > $out/share/applications/thunderbird.desktop <<EOF
-      [Desktop Entry]
-      Type=Application
-      Exec=$out/bin/thunderbird
-      Icon=$out/lib/thunderbird-${version}/chrome/icons/default/default256.png
-      Name=Thunderbird
-      GenericName=Mail Reader
-      Categories=Application;Network;
-      EOF
+      # For grsecurity kernels
+      paxmark m $out/lib/thunderbird-[0-9]*/thunderbird
+
+      # Needed to find Mozilla runtime
+      gappsWrapperArgs+=(--argv0 "$out/bin/.thunderbird-wrapped")
     '';
 
-    postFixup =
-      ''
-        paxmark m $out/lib/thunderbird-${version}/thunderbird
-      '';
+  postFixup =
+    # Fix notifications. LibXUL uses dlopen for this, unfortunately; see #18712.
+    ''
+      patchelf --set-rpath "${lib.getLib libnotify
+        }/lib:$(patchelf --print-rpath "$out"/lib/thunderbird-*/libxul.so)" \
+          "$out"/lib/thunderbird-*/libxul.so
+    '';
+
+  doInstallCheck = true;
+  installCheckPhase =
+    ''
+      # Some basic testing
+      "$out/bin/thunderbird" --version
+    '';
 
   meta = with stdenv.lib; {
     description = "A full-featured e-mail client";
diff --git a/pkgs/applications/networking/mailreaders/thunderbird/gcc6.patch b/pkgs/applications/networking/mailreaders/thunderbird/gcc6.patch
deleted file mode 100644
index bd1022202851..000000000000
--- a/pkgs/applications/networking/mailreaders/thunderbird/gcc6.patch
+++ /dev/null
@@ -1,75 +0,0 @@
-
-# HG changeset patch
-# User Mike Hommey <mh+mozilla@glandium.org>
-# Date 1457596445 -32400
-# Node ID 55212130f19da3079167a6b0a5a0ed6689c9a71d
-# Parent  27c94617d7064d566c24a42e11cd4c7ef725923d
-Bug 1245076 - Don't include mozalloc.h from the cstdlib wrapper. r=froydnj
-
-Our STL wrappers do various different things, one of which is including
-mozalloc.h for infallible operator new. mozalloc.h includes stdlib.h,
-which, in libstdc++ >= 6 is now itself a wrapper around cstdlib, which
-circles back to our STL wrapper.
-
-But of the things our STL wrappers do, including mozalloc.h is not one
-that is necessary for cstdlib. So skip including mozalloc.h in our
-cstdlib wrapper.
-
-Additionally, some C++ sources (in media/mtransport) are including
-headers in an extern "C" block, which end up including stdlib.h, which
-ends up including cstdlib because really, this is all C++, and our
-wrapper pre-includes <new> for mozalloc.h, which fails because templates
-don't work inside extern "C". So, don't pre-include <new> when we're not
-including mozalloc.h.
-
-
-diff --git a/mozilla/config/gcc-stl-wrapper.template.h b/mozilla/config/gcc-stl-wrapper.template.h
---- a/mozilla/config/gcc-stl-wrapper.template.h
-+++ b/mozilla/config/gcc-stl-wrapper.template.h
-@@ -12,33 +12,40 @@
- // compiling ObjC.
- #if defined(__EXCEPTIONS) && __EXCEPTIONS && !(__OBJC__ && __GNUC__ && XP_IOS)
- #  error "STL code can only be used with -fno-exceptions"
- #endif
- 
- // Silence "warning: #include_next is a GCC extension"
- #pragma GCC system_header
- 
-+// Don't include mozalloc for cstdlib. See bug 1245076.
-+#ifndef moz_dont_include_mozalloc_for_cstdlib
-+#  define moz_dont_include_mozalloc_for_cstdlib
-+#endif
-+#ifndef moz_dont_include_mozalloc_for_${HEADER}
- // mozalloc.h wants <new>; break the cycle by always explicitly
- // including <new> here.  NB: this is a tad sneaky.  Sez the gcc docs:
- //
- //    `#include_next' does not distinguish between <file> and "file"
- //    inclusion, nor does it check that the file you specify has the
- //    same name as the current file. It simply looks for the file
- //    named, starting with the directory in the search path after the
- //    one where the current file was found.
--#include_next <new>
-+#  include_next <new>
- 
- // See if we're in code that can use mozalloc.  NB: this duplicates
- // code in nscore.h because nscore.h pulls in prtypes.h, and chromium
- // can't build with that being included before base/basictypes.h.
--#if !defined(XPCOM_GLUE) && !defined(NS_NO_XPCOM) && !defined(MOZ_NO_MOZALLOC)
--#  include "mozilla/mozalloc.h"
--#else
--#  error "STL code can only be used with infallible ::operator new()"
-+#  if !defined(XPCOM_GLUE) && !defined(NS_NO_XPCOM) && !defined(MOZ_NO_MOZALLOC)
-+#    include "mozilla/mozalloc.h"
-+#  else
-+#    error "STL code can only be used with infallible ::operator new()"
-+#  endif
-+
- #endif
- 
- #if defined(DEBUG) && !defined(_GLIBCXX_DEBUG)
- // Enable checked iterators and other goodies
- //
- // FIXME/bug 551254: gcc's debug STL implementation requires -frtti.
- // Figure out how to resolve this with -fno-rtti.  Maybe build with
- // -frtti in DEBUG builds?
-
diff --git a/pkgs/applications/version-management/git-and-tools/tig/default.nix b/pkgs/applications/version-management/git-and-tools/tig/default.nix
index f953bbad48ba..99c1dcb281c0 100644
--- a/pkgs/applications/version-management/git-and-tools/tig/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/tig/default.nix
@@ -1,20 +1,29 @@
-{ stdenv, fetchurl, ncurses, asciidoc, xmlto, docbook_xsl, docbook_xml_dtd_45
-, readline, makeWrapper, git, libiconv
+{ stdenv, fetchFromGitHub, ncurses, asciidoc, xmlto, docbook_xsl, docbook_xml_dtd_45
+, readline, makeWrapper, git, libiconv, autoreconfHook, findXMLCatalogs
 }:
 
 stdenv.mkDerivation rec {
-  name = "tig-2.2";
-
-  src = fetchurl {
-    url = "http://jonas.nitro.dk/tig/releases/${name}.tar.gz";
-    sha256 = "0k3m894vfkgkj7xbr0j6ph91351dl6id5f0hk2ksjp5lmg9i6llg";
+  pname = "tig";
+  version = "2.2.1";
+  name = "${pname}-${version}";
+
+  src = fetchFromGitHub {
+    owner = "jonas";
+    repo = pname;
+    rev = name;
+    sha256 = "09xiwm57df0vzk8r2hx5p1hwy5f9q8frmdf96aba2ia9837zn3av";
   };
 
-  buildInputs = [ ncurses asciidoc xmlto docbook_xsl readline git makeWrapper ]
+  nativeBuildInputs = [ makeWrapper autoreconfHook asciidoc xmlto docbook_xsl docbook_xml_dtd_45 findXMLCatalogs ];
+
+  autoreconfFlags = "-I tools -v";
+
+  buildInputs = [ ncurses readline git ]
     ++ stdenv.lib.optionals stdenv.isDarwin [ libiconv ];
 
-  preConfigure = ''
-    export XML_CATALOG_FILES='${docbook_xsl}/xml/xsl/docbook/catalog.xml ${docbook_xml_dtd_45}/xml/dtd/docbook/catalog.xml'
+  # those files are inherently impure, we'll handle the corresponding dependencies.
+  postPatch = ''
+      rm -f contrib/config.make-*
   '';
 
   enableParallelBuilding = true;
@@ -30,7 +39,7 @@ stdenv.mkDerivation rec {
   '';
 
   meta = with stdenv.lib; {
-    homepage = "http://jonas.nitro.dk/tig/";
+    homepage = "https://jonas.github.io/tig/";
     description = "Text-mode interface for git";
     maintainers = with maintainers; [ garbas bjornfor domenkozar qknight ];
     license = licenses.gpl2;
diff --git a/pkgs/development/libraries/botan/generic.nix b/pkgs/development/libraries/botan/generic.nix
index 4a4ec5d9fe9c..b37fd6079b9e 100644
--- a/pkgs/development/libraries/botan/generic.nix
+++ b/pkgs/development/libraries/botan/generic.nix
@@ -3,6 +3,7 @@
 , baseVersion, revision, sha256
 , extraConfigureFlags ? ""
 , postPatch ? null
+, darwin
 , ...
 }:
 
@@ -20,7 +21,8 @@ stdenv.mkDerivation rec {
   };
   inherit postPatch;
 
-  buildInputs = [ python bzip2 zlib gmp openssl boost ];
+  buildInputs = [ python bzip2 zlib gmp openssl boost ]
+             ++ stdenv.lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.Security;
 
   configurePhase = ''
     python configure.py --prefix=$out --with-bzip2 --with-zlib ${if openssl != null then "--with-openssl" else ""} ${extraConfigureFlags}${if stdenv.cc.isClang then " --cc=clang" else "" }
diff --git a/pkgs/development/libraries/git2/default.nix b/pkgs/development/libraries/git2/default.nix
index 51e366ba29cd..cf27249064fc 100644
--- a/pkgs/development/libraries/git2/default.nix
+++ b/pkgs/development/libraries/git2/default.nix
@@ -1,13 +1,13 @@
 { stdenv, fetchurl, pkgconfig, cmake, zlib, python, libssh2, openssl, curl, http-parser, libiconv }:
 
 stdenv.mkDerivation (rec {
-  version = "0.24.6";
+  version = "0.25.1";
   name = "libgit2-${version}";
 
   src = fetchurl {
     name = "${name}.tar.gz";
     url = "https://github.com/libgit2/libgit2/tarball/v${version}";
-    sha256 = "070jrv690bd5dq991lc32qfnai9ywvrjzsfgi3rcw6kw4l2ynxjr";
+    sha256 = "100bah8picqjzyhpw4wd7z5vyidcb8aggin50bhbpn607h8n8bml";
   };
 
   # TODO: `cargo` (rust's package manager) surfaced a serious bug in
diff --git a/pkgs/development/libraries/leptonica/default.nix b/pkgs/development/libraries/leptonica/default.nix
index eacab92d36b6..b9b6c3c7c24f 100644
--- a/pkgs/development/libraries/leptonica/default.nix
+++ b/pkgs/development/libraries/leptonica/default.nix
@@ -1,14 +1,38 @@
-{stdenv, fetchurl, libpng, libtiff, libjpeg, zlib}:
+{ stdenv, fetchurl, fetchpatch, autoreconfHook, pkgconfig
+, giflib, libjpeg, libpng, libtiff, libwebp, openjpeg, zlib
+}:
 
-stdenv.mkDerivation {
-  name = "leptonica-1.72";
+stdenv.mkDerivation rec {
+  name = "leptonica-${version}";
+  version = "1.74.1";
 
   src = fetchurl {
-    url = http://www.leptonica.org/source/leptonica-1.72.tar.gz;
-    sha256 = "0mhzvqs0im04y1cpcc1yma70hgdac1frf33h73m9z3356bfymmbr";
+    url = "http://www.leptonica.org/source/${name}.tar.gz";
+    sha256 = "0qpcidvv6igybrrhj0m6j47g642c8sk1qn4dpj82mgd38xx52skl";
   };
 
-  buildInputs = [ libpng libtiff libjpeg zlib ];
+  patches = stdenv.lib.singleton (fetchpatch {
+    # configure: Support pkg-config
+    url = "https://github.com/DanBloomberg/leptonica/commit/"
+        + "4476d162cc191a0fefb2ce434153e12bbf188664.patch";
+    sha256 = "1razzp2g49shfaravfqpxm3ivcd1r92lvqysll6nnf6d1wp9865s";
+  });
+
+  postPatch = ''
+    # Remove the AC_SUBST() macros on *_LIBS, because the *_LIBS variables will
+    # be automatically set by PKG_CHECK_MODULES() since autotools 0.24 and
+    # using the ones that are set here in Leptonica's configure.ac do not
+    # include -L linker flags.
+    sed -i -e '/PKG_CHECK_MODULES/,/^ *\])/s/AC_SUBST([^)]*)//' configure.ac
+
+    # The giflib package doesn't ship a pkg-config file, so we need to inject
+    # the linker search path.
+    substituteInPlace configure.ac --replace -lgif \
+      ${stdenv.lib.escapeShellArg "'-L${giflib}/lib -lgif'"}
+  '';
+
+  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  buildInputs = [ giflib libjpeg libpng libtiff libwebp openjpeg zlib ];
 
   meta = {
     description = "Image processing and analysis library";
diff --git a/pkgs/development/libraries/liblastfm/default.nix b/pkgs/development/libraries/liblastfm/default.nix
index 0beb689090a0..aa76505c3a07 100644
--- a/pkgs/development/libraries/liblastfm/default.nix
+++ b/pkgs/development/libraries/liblastfm/default.nix
@@ -1,4 +1,5 @@
-{ stdenv, fetchurl, qt4, pkgconfig, libsamplerate, fftwSinglePrec, which, cmake }:
+{ stdenv, fetchurl, qt4, pkgconfig, libsamplerate, fftwSinglePrec, which, cmake
+, darwin }:
 
 let version = "1.0.9"; in
 
@@ -15,6 +16,7 @@ stdenv.mkDerivation rec {
   prefixKey = "--prefix ";
   propagatedBuildInputs = [ qt4 libsamplerate fftwSinglePrec ];
   nativeBuildInputs = [ pkgconfig which cmake ];
+  buildInputs = stdenv.lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.SystemConfiguration;
 
   meta = {
     homepage = http://github.com/lastfm/liblastfm;
diff --git a/pkgs/development/libraries/qt-5/5.6/qtwebengine/default.nix b/pkgs/development/libraries/qt-5/5.6/qtwebengine/default.nix
index 13b8296dc0e3..1234c825b14d 100644
--- a/pkgs/development/libraries/qt-5/5.6/qtwebengine/default.nix
+++ b/pkgs/development/libraries/qt-5/5.6/qtwebengine/default.nix
@@ -2,7 +2,8 @@
 
 , xlibs, libXcursor, libXScrnSaver, libXrandr, libXtst
 , fontconfig, freetype, harfbuzz, icu, dbus
-, zlib, libjpeg, libpng, libtiff
+, zlib, minizip, libjpeg, libpng, libtiff, libwebp, libopus
+, jsoncpp, protobuf, libvpx, srtp, snappy, nss, libevent
 , alsaLib
 , libcap
 , pciutils
@@ -11,7 +12,7 @@
 , coreutils
 , pkgconfig, python2
 
-, stdenv # lib.optional, needsPax
+, lib, stdenv # lib.optional, needsPax
 }:
 
 qtSubmodule {
@@ -47,20 +48,33 @@ qtSubmodule {
         -docdir $out/share/doc/qt5"
   '';
   propagatedBuildInputs = [
-    dbus zlib alsaLib
-
     # Image formats
-    libjpeg libpng libtiff
+    libjpeg libpng libtiff libwebp
+
+    # Video formats
+    srtp libvpx
+
+    # Audio formats
+    libopus
 
     # Text rendering
-    fontconfig freetype harfbuzz icu
+    harfbuzz icu
+  ]
+  ++ lib.optionals (!stdenv.isDarwin) [
+    dbus zlib minizip snappy nss protobuf jsoncpp libevent
 
-    # X11 libs
-    xlibs.xrandr libXScrnSaver libXcursor libXrandr xlibs.libpciaccess libXtst
-    xlibs.libXcomposite
+    # Audio formats
+    alsaLib
+
+    # Text rendering
+    fontconfig freetype
 
     libcap
     pciutils
+
+    # X11 libs
+    xlibs.xrandr libXScrnSaver libXcursor libXrandr xlibs.libpciaccess libXtst
+    xlibs.libXcomposite
   ];
   patches = [
     ./chromium-clang-update-py.patch
diff --git a/pkgs/development/libraries/wxsqlite3/default.nix b/pkgs/development/libraries/wxsqlite3/default.nix
index 88cf92b34ef0..a06003997845 100644
--- a/pkgs/development/libraries/wxsqlite3/default.nix
+++ b/pkgs/development/libraries/wxsqlite3/default.nix
@@ -1,4 +1,5 @@
-{ stdenv, fetchFromGitHub, wxGTK, sqlite }:
+{ stdenv, fetchFromGitHub, wxGTK, sqlite
+, darwin }:
 
 stdenv.mkDerivation rec {
   name = "wxsqlite3-${version}";
@@ -11,7 +12,12 @@ stdenv.mkDerivation rec {
     sha1 = "bb8p58g88nkdcsj3h4acx7h925n2cy9g";
   };
 
-  buildInputs = [ wxGTK sqlite ];
+  preBuild = stdenv.lib.optionalString stdenv.isDarwin ''
+    cp build28/Info.plist.in build28/wxmac.icns build/
+  '';
+
+  buildInputs = [ wxGTK sqlite ]
+    ++ stdenv.lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Cocoa darwin.stubs.setfile darwin.stubs.rez darwin.stubs.derez ];
 
   meta = with stdenv.lib; {
     homepage = http://utelle.github.io/wxsqlite3/ ;
diff --git a/pkgs/development/lisp-modules/clwrapper/cl-wrapper.sh b/pkgs/development/lisp-modules/clwrapper/cl-wrapper.sh
index 97add524d176..41d40064294f 100755
--- a/pkgs/development/lisp-modules/clwrapper/cl-wrapper.sh
+++ b/pkgs/development/lisp-modules/clwrapper/cl-wrapper.sh
@@ -1,6 +1,6 @@
 #!@stdenv_shell@
 # Part of NixPkgs package collection
-# This script can be used at your option under the same license as NixPkgs or 
+# This script can be used at your option under the same license as NixPkgs or
 # under MIT/X11 license
 
 eval "$NIX_LISP_PREHOOK"
@@ -24,6 +24,7 @@ case "$NIX_LISP" in
                 NIX_LISP_QUIT="(quit)"
                 NIX_LISP_NODEBUG='--non-interactive'
 		NIX_LISP_FINAL_PARAMETERS=
+                NIX_LISP_FASL_TYPE="fasl"
 		;;
 	ecl)
 		NIX_LISP_LOAD_FILE="-load"
@@ -31,6 +32,7 @@ case "$NIX_LISP" in
                 NIX_LISP_QUIT="(quit)"
                 NIX_LISP_NODEBUG='--nodebug'
 		NIX_LISP_FINAL_PARAMETERS=
+                NIX_LISP_FASL_TYPE="fas"
 		;;
 	clisp)
 		NIX_LISP_LOAD_FILE="-c -l"
@@ -38,6 +40,31 @@ case "$NIX_LISP" in
                 NIX_LISP_QUIT="(quit)"
                 NIX_LISP_NODEBUG='-on-error exit'
 		NIX_LISP_FINAL_PARAMETERS="-repl"
+                NIX_LISP_FASL_TYPE="fas"
+		;;
+	lx86cl64)
+		NIX_LISP_LOAD_FILE="-l"
+		NIX_LISP_EXEC_CODE="-e"
+                NIX_LISP_QUIT="(quit)"
+                NIX_LISP_NODEBUG='-b'
+		NIX_LISP_FINAL_PARAMETERS=
+                NIX_LISP_FASL_TYPE="lx64fsl"
+		;;
+	lx86cl)
+		NIX_LISP_LOAD_FILE="-l"
+		NIX_LISP_EXEC_CODE="-e"
+                NIX_LISP_QUIT="(quit)"
+                NIX_LISP_NODEBUG='-b'
+		NIX_LISP_FINAL_PARAMETERS=
+                NIX_LISP_FASL_TYPE="lx32fsl"
+		;;
+	abcl)
+		NIX_LISP_LOAD_FILE="--load"
+		NIX_LISP_EXEC_CODE="--eval"
+                NIX_LISP_QUIT="(quit)"
+                NIX_LISP_NODEBUG=''
+		NIX_LISP_FINAL_PARAMETERS=
+                NIX_LISP_FASL_TYPE="abcl"
 		;;
 esac
 
@@ -59,7 +86,7 @@ nix_lisp_run_single_form(){
 eval "$NIX_LISP_PRELAUNCH_HOOK"
 
 [ -z "$NIX_LISP_SKIP_CODE" ] && "$NIX_LISP_COMMAND" $NIX_LISP_EARLY_OPTIONS \
-	$NIX_LISP_EXEC_CODE "${NIX_LISP_ASDF_LOAD:-"(load \"$NIX_LISP_ASDF/lib/common-lisp/asdf/build/asdf.lisp\")"}" \
+	$NIX_LISP_EXEC_CODE "${NIX_LISP_ASDF_LOAD:-"(load \"$NIX_LISP_ASDF/lib/common-lisp/asdf/build/asdf.$NIX_LISP_FASL_TYPE\")"}" \
 	$NIX_LISP_EXEC_CODE "$NIX_LISP_ASDF_REGISTRY_CODE" \
 	${NIX_LISP_FINAL_PARAMETERS[*]:+"${NIX_LISP_FINAL_PARAMETERS[@]}"} \
 	"$@"
diff --git a/pkgs/development/lisp-modules/clwrapper/default.nix b/pkgs/development/lisp-modules/clwrapper/default.nix
index 4599c630d83c..6e1b84eb3e99 100644
--- a/pkgs/development/lisp-modules/clwrapper/default.nix
+++ b/pkgs/development/lisp-modules/clwrapper/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation {
     substituteAll "${./build-with-lisp.sh}" "$out/bin/build-with-lisp.sh"
     substituteAll "${./cl-wrapper.sh}" "$out/bin/cl-wrapper.sh"
     chmod a+x "$out"/bin/*
-    
+
     substituteAll "${./setup-hook.sh}" "setup-hook-parsed"
     source setup-hook-parsed
     setLisp "${lisp}"
@@ -22,7 +22,9 @@ stdenv.mkDerivation {
     cp -r "${asdf}/lib/common-lisp"/* "$out/lib/common-lisp/"
     chmod u+rw -R "$out/lib/common-lisp/"
 
-    NIX_LISP_PRELAUNCH_HOOK='nix_lisp_run_single_form "(progn 
+    NIX_LISP_PRELAUNCH_HOOK='
+      NIX_LISP_FASL_TYPE=lisp
+      nix_lisp_run_single_form "(progn
         (uiop/lisp-build:compile-file* \"'"$out"'/lib/common-lisp/asdf/build/asdf.lisp\")
         (asdf:load-system :uiop :force :all)
         (asdf:load-system :asdf :force :all)
diff --git a/pkgs/development/lisp-modules/define-package.nix b/pkgs/development/lisp-modules/define-package.nix
index 520e224e6da2..1acedf4b7043 100644
--- a/pkgs/development/lisp-modules/define-package.nix
+++ b/pkgs/development/lisp-modules/define-package.nix
@@ -1,7 +1,7 @@
 args @ {stdenv, clwrapper, baseName, testSystems ? [baseName], version ? "latest"
   , src, description, deps, buildInputs ? [], meta ? {}, overrides?(x: {})
   , propagatedBuildInputs ? []}:
-let 
+let
   deployConfigScript = ''
     outhash="$out"
     outhash="''${outhash##*/}"
@@ -39,7 +39,7 @@ let
     echo "#! /bin/sh" >> "$launch_script"
     echo "source '$config_script'" >> "$launch_script"
     echo "export LD_LIBRARY_PATH=\"\$NIX_LISP_LD_LIBRARY_PATH\''${NIX_LISP_LD_LIBRARY_PATH:+:}\$LD_LIBRARY_PATH\"" >> "$launch_script"
-    echo '"${clwrapper}/bin/common-lisp.sh" "$@"' >> "$launch_script" 
+    echo '"${clwrapper}/bin/common-lisp.sh" "$@"' >> "$launch_script"
   '';
 basePackage = {
   name = "lisp-${baseName}-${version}";
@@ -66,12 +66,12 @@ basePackage = {
              (asdf:operate (quote asdf::compile-bundle-op) :${testSystem})
              (ignore-errors (asdf:operate (quote asdf::deploy-asd-op) :${testSystem}))
              )"' \
-          "$out/bin/${args.baseName}-lisp-launcher.sh" ""
+          "$out/bin/${args.baseName}-lisp-launcher.sh"
     '') testSystems}
 
     eval "$postInstall"
   '';
-  propagatedBuildInputs = (args.deps or []) ++ [clwrapper clwrapper.lisp clwrapper.asdf] 
+  propagatedBuildInputs = (args.deps or []) ++ [clwrapper clwrapper.lisp clwrapper.asdf]
     ++ (args.propagatedBuildInputs or []);
   buildInputs = buildInputs;
   dontStrip=true;
diff --git a/pkgs/development/lisp-modules/quicklisp-to-nix-overrides.nix b/pkgs/development/lisp-modules/quicklisp-to-nix-overrides.nix
index ea7e790ccaed..377f694e7a8e 100644
--- a/pkgs/development/lisp-modules/quicklisp-to-nix-overrides.nix
+++ b/pkgs/development/lisp-modules/quicklisp-to-nix-overrides.nix
@@ -2,7 +2,7 @@
 let
   addDeps = newdeps: x: {deps = x.deps ++ newdeps;};
   addNativeLibs = libs: x: { propagatedBuildInputs = libs; };
-  skipBuildPhase = x: { 
+  skipBuildPhase = x: {
     overrides = y: ((x.overrides y) // { buildPhase = "true"; });
   };
   qlnp = quicklisp-to-nix-packages;
@@ -33,8 +33,13 @@ in
   };
   hunchentoot = addNativeLibs [pkgs.openssl];
   iolib = x: {
-    propagatedBuildInputs = (x.propagatedBuildInputs or []) ++ [pkgs.libfixposix pkgs.gcc];
-    testSystems = (x.testSystems or ["iolib"]) ++ ["iolib/os" "iolib/zstreams"];
+    propagatedBuildInputs = (x.propagatedBuildInputs or []) ++
+     [pkgs.libfixposix pkgs.gcc];
+    testSystems = (x.testSystems or ["iolib"]) ++ [
+      "iolib/os" "iolib/zstreams" "iolib/common-lisp" "iolib/base" "iolib/asdf"
+      "iolib/conf" "iolib/grovel" "iolib/syscalls" "iolib/sockets"
+      "iolib/multiplex" "iolib/streams" "iolib/pathnames"
+    ];
   };
   cl-unicode = addDeps (with qlnp; [cl-ppcre flexi-streams]);
   clack =  addDeps (with qlnp;[lack bordeaux-threads prove]);
@@ -51,7 +56,7 @@ in
   wookie = multiOverride [(addDeps (with qlnp; [
       alexandria blackbird cl-async chunga fast-http quri babel cl-ppcre
       cl-fad fast-io vom do-urlencode cl-async-ssl
-    ])) 
+    ]))
     (addNativeLibs (with pkgs; [libuv openssl]))];
   woo = addDeps (with qlnp; [
     cffi lev clack swap-bytes static-vectors fast-http proc-parse quri fast-io
diff --git a/pkgs/development/python-modules/pyocr-tesseract.patch b/pkgs/development/python-modules/pyocr-tesseract.patch
new file mode 100644
index 000000000000..d09a7c57352e
--- /dev/null
+++ b/pkgs/development/python-modules/pyocr-tesseract.patch
@@ -0,0 +1,316 @@
+This patch is required for pyocr to work with Tesseract version 3.05.00
+and has been submitted upstream at the following URL:
+
+https://github.com/jflesch/pyocr/pull/62
+
+diff --git a/src/pyocr/builders.py b/src/pyocr/builders.py
+index 73c964d..20f390c 100644
+--- a/src/pyocr/builders.py
++++ b/src/pyocr/builders.py
+@@ -240,8 +240,10 @@ class BaseBuilder(object):
+         cuneiform_args : Arguments passed to the Cuneiform command line.
+     """
+ 
+-    def __init__(self, file_extensions, tesseract_configs, cuneiform_args):
++    def __init__(self, file_extensions, tesseract_flags, tesseract_configs,
++                 cuneiform_args):
+         self.file_extensions = file_extensions
++        self.tesseract_flags = tesseract_flags
+         self.tesseract_configs = tesseract_configs
+         self.cuneiform_args = cuneiform_args
+ 
+@@ -298,7 +300,7 @@ class TextBuilder(BaseBuilder):
+     def __init__(self, tesseract_layout=3, cuneiform_dotmatrix=False,
+                  cuneiform_fax=False, cuneiform_singlecolumn=False):
+         file_ext = ["txt"]
+-        tess_conf = ["-psm", str(tesseract_layout)]
++        tess_flags = ["-psm", str(tesseract_layout)]
+         cun_args = ["-f", "text"]
+         # Add custom cuneiform parameters if needed
+         for par, arg in [(cuneiform_dotmatrix, "--dotmatrix"),
+@@ -306,7 +308,7 @@ class TextBuilder(BaseBuilder):
+                          (cuneiform_singlecolumn, "--singlecolumn")]:
+             if par:
+                 cun_args.append(arg)
+-        super(TextBuilder, self).__init__(file_ext, tess_conf, cun_args)
++        super(TextBuilder, self).__init__(file_ext, tess_flags, [], cun_args)
+         self.tesseract_layout = tesseract_layout
+         self.built_text = []
+ 
+@@ -540,9 +542,11 @@ class WordBoxBuilder(BaseBuilder):
+ 
+     def __init__(self, tesseract_layout=1):
+         file_ext = ["html", "hocr"]
+-        tess_conf = ["hocr", "-psm", str(tesseract_layout)]
++        tess_flags = ["-psm", str(tesseract_layout)]
++        tess_conf = ["hocr"]
+         cun_args = ["-f", "hocr"]
+-        super(WordBoxBuilder, self).__init__(file_ext, tess_conf, cun_args)
++        super(WordBoxBuilder, self).__init__(file_ext, tess_flags, tess_conf,
++                                             cun_args)
+         self.word_boxes = []
+         self.tesseract_layout = tesseract_layout
+ 
+@@ -614,9 +618,11 @@ class LineBoxBuilder(BaseBuilder):
+ 
+     def __init__(self, tesseract_layout=1):
+         file_ext = ["html", "hocr"]
+-        tess_conf = ["hocr", "-psm", str(tesseract_layout)]
++        tess_flags = ["-psm", str(tesseract_layout)]
++        tess_conf = ["hocr"]
+         cun_args = ["-f", "hocr"]
+-        super(LineBoxBuilder, self).__init__(file_ext, tess_conf, cun_args)
++        super(LineBoxBuilder, self).__init__(file_ext, tess_flags, tess_conf,
++                                             cun_args)
+         self.lines = []
+         self.tesseract_layout = tesseract_layout
+ 
+diff --git a/src/pyocr/libtesseract/tesseract_raw.py b/src/pyocr/libtesseract/tesseract_raw.py
+index 0c2259a..f7ab309 100644
+--- a/src/pyocr/libtesseract/tesseract_raw.py
++++ b/src/pyocr/libtesseract/tesseract_raw.py
+@@ -263,11 +263,22 @@ if g_libtesseract:
+     ]
+     g_libtesseract.TessDeleteText.restype = None
+ 
+-    g_libtesseract.TessBaseAPIDetectOS.argtypes = [
+-        ctypes.c_void_p,  # TessBaseAPI*
+-        ctypes.POINTER(OSResults),
+-    ]
+-    g_libtesseract.TessBaseAPIDetectOS.restype = ctypes.c_bool
++    if hasattr(g_libtesseract, 'TessBaseAPIDetectOrientationScript'):
++        g_libtesseract.TessBaseAPIDetectOrientationScript.argtypes = [
++            ctypes.c_void_p,  # TessBaseAPI*
++            ctypes.POINTER(ctypes.c_int),  # orient_deg
++            ctypes.POINTER(ctypes.c_float),  # orient_conf
++            ctypes.POINTER(ctypes.c_char_p),  # script_name
++            ctypes.POINTER(ctypes.c_float),  # script_conf
++        ]
++        g_libtesseract.TessBaseAPIDetectOrientationScript.restype = \
++            ctypes.c_bool
++    else:
++        g_libtesseract.TessBaseAPIDetectOS.argtypes = [
++            ctypes.c_void_p,  # TessBaseAPI*
++            ctypes.POINTER(OSResults),
++        ]
++        g_libtesseract.TessBaseAPIDetectOS.restype = ctypes.c_bool
+ 
+ 
+ def init(lang=None):
+@@ -526,15 +537,37 @@ def detect_os(handle):
+     global g_libtesseract
+     assert(g_libtesseract)
+ 
+-    results = OSResults()
+-    r = g_libtesseract.TessBaseAPIDetectOS(
+-        ctypes.c_void_p(handle),
+-        ctypes.pointer(results)
+-    )
+-    if not r:
+-        raise TesseractError("detect_orientation failed",
+-                             "TessBaseAPIDetectOS() failed")
+-    return {
+-        "orientation": results.best_orientation_id,
+-        "confidence": results.best_oconfidence,
+-    }
++    # Use the new API function if it is available, because since Tesseract
++    # 3.05.00 the old API function _always_ returns False.
++    if hasattr(g_libtesseract, 'TessBaseAPIDetectOrientationScript'):
++        orientation_deg = ctypes.c_int(0)
++        orientation_confidence = ctypes.c_float(0.0)
++
++        r = g_libtesseract.TessBaseAPIDetectOrientationScript(
++            ctypes.c_void_p(handle),
++            ctypes.byref(orientation_deg),
++            ctypes.byref(orientation_confidence),
++            None,  # script_name
++            None  # script_confidence
++        )
++
++        if not r:
++            raise TesseractError("detect_orientation failed",
++                                 "TessBaseAPIDetectOrientationScript() failed")
++        return {
++            "orientation": round(orientation_deg.value / 90),
++            "confidence": orientation_confidence.value,
++        }
++    else:  # old API (before Tesseract 3.05.00)
++        results = OSResults()
++        r = g_libtesseract.TessBaseAPIDetectOS(
++            ctypes.c_void_p(handle),
++            ctypes.pointer(results)
++        )
++        if not r:
++            raise TesseractError("detect_orientation failed",
++                                 "TessBaseAPIDetectOS() failed")
++        return {
++            "orientation": results.best_orientation_id,
++            "confidence": results.best_oconfidence,
++        }
+diff --git a/src/pyocr/tesseract.py b/src/pyocr/tesseract.py
+index 99b0121..658c96b 100755
+--- a/src/pyocr/tesseract.py
++++ b/src/pyocr/tesseract.py
+@@ -22,6 +22,8 @@ import os
+ import subprocess
+ import sys
+ import tempfile
++import contextlib
++import shutil
+ 
+ from . import builders
+ from . import error
+@@ -62,9 +64,11 @@ class CharBoxBuilder(builders.BaseBuilder):
+ 
+     def __init__(self):
+         file_ext = ["box"]
++        tess_flags = []
+         tess_conf = ["batch.nochop", "makebox"]
+         cun_args = []
+-        super(CharBoxBuilder, self).__init__(file_ext, tess_conf, cun_args)
++        super(CharBoxBuilder, self).__init__(file_ext, tess_flags, tess_conf,
++                                             cun_args)
+         self.tesseract_layout = 1
+ 
+     @staticmethod
+@@ -173,18 +177,19 @@ def detect_orientation(image, lang=None):
+         TesseractError --- if no script detected on the image
+     """
+     _set_environment()
+-    with temp_file(".bmp") as input_file:
+-        command = [TESSERACT_CMD, input_file.name, 'stdout', "-psm", "0"]
++    with temp_dir() as tmpdir:
++        command = [TESSERACT_CMD, "input.bmp", 'stdout', "-psm", "0"]
+         if lang is not None:
+             command += ['-l', lang]
+ 
+         if image.mode != "RGB":
+             image = image.convert("RGB")
+-        image.save(input_file.name)
++        image.save(os.path.join(tmpdir, "input.bmp"))
+ 
+         proc = subprocess.Popen(command, stdin=subprocess.PIPE, shell=False,
+                                 startupinfo=g_subprocess_startup_info,
+                                 creationflags=g_creation_flags,
++                                cwd=tmpdir,
+                                 stdout=subprocess.PIPE,
+                                 stderr=subprocess.STDOUT)
+         proc.stdin.close()
+@@ -224,8 +229,8 @@ def get_available_builders():
+     ]
+ 
+ 
+-def run_tesseract(input_filename, output_filename_base, lang=None,
+-                  configs=None):
++def run_tesseract(input_filename, output_filename_base, cwd=None, lang=None,
++                  flags=None, configs=None):
+     '''
+     Runs Tesseract:
+         `TESSERACT_CMD` \
+@@ -238,6 +243,8 @@ def run_tesseract(input_filename, output_filename_base, lang=None,
+         input_filename --- image to read
+         output_filename_base --- file name in which must be stored the result
+             (without the extension)
++        cwd --- Run Tesseract in the specified working directory or use current
++            one if None
+         lang --- Tesseract language to use (if None, none will be specified)
+         config --- List of Tesseract configs to use (if None, none will be
+             specified)
+@@ -252,10 +259,13 @@ def run_tesseract(input_filename, output_filename_base, lang=None,
+     if lang is not None:
+         command += ['-l', lang]
+ 
++    if flags is not None:
++        command += flags
++
+     if configs is not None:
+         command += configs
+ 
+-    proc = subprocess.Popen(command,
++    proc = subprocess.Popen(command, cwd=cwd,
+                             startupinfo=g_subprocess_startup_info,
+                             creationflags=g_creation_flags,
+                             stdout=subprocess.PIPE,
+@@ -301,11 +311,18 @@ class ReOpenableTempfile(object):
+             self.name = None
+ 
+ 
+-def temp_file(suffix):
+-    ''' Returns a temporary file '''
+-    if os.name == 'nt':  # Windows
+-        return ReOpenableTempfile(suffix)
+-    return tempfile.NamedTemporaryFile(prefix='tess_', suffix=suffix)
++@contextlib.contextmanager
++def temp_dir():
++    """
++    A context manager for maintaining a temporary directory
++    """
++    # NOTE: Drop this as soon as we don't support Python 2.7 anymore, because
++    # since Python 3.2 there is a context manager called TemporaryDirectory().
++    path = tempfile.mkdtemp(prefix='tess_')
++    try:
++        yield path
++    finally:
++        shutil.rmtree(path)
+ 
+ 
+ def image_to_string(image, lang=None, builder=None):
+@@ -329,23 +346,20 @@ def image_to_string(image, lang=None, builder=None):
+ 
+     if builder is None:
+         builder = builders.TextBuilder()
+-    with temp_file(".bmp") as input_file:
+-        with temp_file('') as output_file:
+-            output_file_name_base = output_file.name
+-
++    with temp_dir() as tmpdir:
+         if image.mode != "RGB":
+             image = image.convert("RGB")
+-        image.save(input_file.name)
+-        (status, errors) = run_tesseract(input_file.name,
+-                                         output_file_name_base,
++        image.save(os.path.join(tmpdir, "input.bmp"))
++        (status, errors) = run_tesseract("input.bmp", "output", cwd=tmpdir,
+                                          lang=lang,
++                                         flags=builder.tesseract_flags,
+                                          configs=builder.tesseract_configs)
+         if status:
+             raise TesseractError(status, errors)
+ 
+         output_file_name = "ERROR"
+         for file_extension in builder.file_extensions:
+-            output_file_name = ('%s.%s' % (output_file_name_base,
++            output_file_name = ('%s.%s' % (os.path.join(tmpdir, "output"),
+                                            file_extension))
+             if not os.access(output_file_name, os.F_OK):
+                 continue
+diff --git a/tests/tests_libtesseract.py b/tests/tests_libtesseract.py
+index ccddd07..1ac2a4b 100644
+--- a/tests/tests_libtesseract.py
++++ b/tests/tests_libtesseract.py
+@@ -33,8 +33,9 @@ class TestContext(unittest.TestCase):
+             (3, 3, 0),
+             (3, 4, 0),
+             (3, 4, 1),
++            (3, 5, 0),
+         ), ("Tesseract does not have the expected version"
+-            " (3.4.0) ! Some tests will be skipped !"))
++            " (3.5.0) ! Some tests will be skipped !"))
+ 
+     def test_langs(self):
+         langs = libtesseract.get_available_languages()
+diff --git a/tests/tests_tesseract.py b/tests/tests_tesseract.py
+index e29c512..fa4d483 100644
+--- a/tests/tests_tesseract.py
++++ b/tests/tests_tesseract.py
+@@ -27,8 +27,9 @@ class TestContext(unittest.TestCase):
+             (3, 3, 0),
+             (3, 4, 0),
+             (3, 4, 1),
++            (3, 5, 0),
+         ), ("Tesseract does not have the expected version"
+-            " (3.4.0) ! Some tests will be skipped !"))
++            " (3.5.0) ! Some tests will be skipped !"))
+ 
+     def test_langs(self):
+         langs = tesseract.get_available_languages()
diff --git a/pkgs/development/ruby-modules/gem-config/default.nix b/pkgs/development/ruby-modules/gem-config/default.nix
index 02fe9f50558e..e115b2c679d9 100644
--- a/pkgs/development/ruby-modules/gem-config/default.nix
+++ b/pkgs/development/ruby-modules/gem-config/default.nix
@@ -211,7 +211,7 @@ in
     buildInputs = [ curl ];
   };
 
-  tzinfo = attrs: {
+  tzinfo = attrs: lib.optionalAttrs (lib.versionAtLeast attrs.version "1.0") {
     dontBuild = false;
     postPatch = ''
       substituteInPlace lib/tzinfo/zoneinfo_data_source.rb \
diff --git a/pkgs/development/tools/build-managers/apache-maven/default.nix b/pkgs/development/tools/build-managers/apache-maven/default.nix
index bdd50421c1f7..5490790fe385 100644
--- a/pkgs/development/tools/build-managers/apache-maven/default.nix
+++ b/pkgs/development/tools/build-managers/apache-maven/default.nix
@@ -2,7 +2,7 @@
 
 assert jdk != null;
 
-let version = "3.3.9"; in
+let version = "3.5.0"; in
 stdenv.mkDerivation rec {
   name = "apache-maven-${version}";
 
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "mirror://apache/maven/maven-3/${version}/binaries/${name}-bin.tar.gz";
-    sha256 = "6e3e9c949ab4695a204f74038717aa7b2689b1be94875899ac1b3fe42800ff82";
+    sha256 = "0d7hjnj77hc7qqnnfmqlwij8n6pcldfavvd6lilvv5ak4hci9fdy";
   };
 
   buildInputs = [ makeWrapper ];
diff --git a/pkgs/development/tools/build-managers/sbt/default.nix b/pkgs/development/tools/build-managers/sbt/default.nix
index 309a6e13606a..cf9b42abefd2 100644
--- a/pkgs/development/tools/build-managers/sbt/default.nix
+++ b/pkgs/development/tools/build-managers/sbt/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "sbt-${version}";
-  version = "0.13.14";
+  version = "0.13.15";
 
   src = fetchurl {
     url = "https://dl.bintray.com/sbt/native-packages/sbt/${version}/${name}.tgz";
-    sha256 = "1q4jnrva21s0rhcn561ayfp5yhd6rpxidgx6f4i5n3dla3p9zkr9";
+    sha256 = "1vvsxpg1fwfzv3mcin69gnj44v6p7kfx3z9cm761sx01qbbp7q5n";
   };
 
   patchPhase = ''
diff --git a/pkgs/development/tools/continuous-integration/jenkins/default.nix b/pkgs/development/tools/continuous-integration/jenkins/default.nix
index 7b42e5877520..5a0cb4911e10 100644
--- a/pkgs/development/tools/continuous-integration/jenkins/default.nix
+++ b/pkgs/development/tools/continuous-integration/jenkins/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "jenkins-${version}";
-  version = "2.49";
+  version = "2.53";
 
   src = fetchurl {
     url = "http://mirrors.jenkins-ci.org/war/${version}/jenkins.war";
-    sha256 = "0c7qnrx87wrgxgh4im1i6sqlxq3hsrs119krh5vwjzx5wp6daa93";
+    sha256 = "16lgwgp4n161j4vjwkzzdz4v2d6vv62rrqmcfmb6zalyvp6wpj9r";
   };
 
   buildCommand = ''
diff --git a/pkgs/development/tools/misc/cwebbin/default.nix b/pkgs/development/tools/misc/cwebbin/default.nix
index 75a06291b021..a952475b9673 100644
--- a/pkgs/development/tools/misc/cwebbin/default.nix
+++ b/pkgs/development/tools/misc/cwebbin/default.nix
@@ -7,12 +7,12 @@ stdenv.mkDerivation rec {
   src = fetchFromGitHub {
     owner = "ascherer";
     repo = "cwebbin";
-    rev = name;
+    rev = "2016-05-20-22p";
     sha256 = "0zf93016hm9i74i2v384rwzcw16y3hg5vc2mibzkx1rzvqa50yfr";
   };
 
   cweb = fetchurl {
-    url = https://www.ctan.org/tex-archive/web/c_cpp/cweb/cweb.tar.gz;
+    url = https://www.ctan.org/tex-archive/web/c_cpp/cweb/cweb-3.64ah.tgz;
     sha256 = "1hdzxfzaibnjxjzgp6d2zay8nsarnfy9hfq55hz1bxzzl23n35aj";
   };
 
@@ -27,6 +27,7 @@ stdenv.mkDerivation rec {
     "CP=cp"
     "RM=rm"
     "PDFTEX=echo"
+    "CC=c++"
   ];
 
   buildPhase = ''
diff --git a/pkgs/games/exult/default.nix b/pkgs/games/exult/default.nix
index 27ffcf2e742e..649d69c6fe67 100644
--- a/pkgs/games/exult/default.nix
+++ b/pkgs/games/exult/default.nix
@@ -30,6 +30,8 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
+  makeFlags = [ "DESTDIR=$(out)" ];
+
   postInstall =
     ''
       mkdir -p $out/share/exult/music
diff --git a/pkgs/games/nethack/default.nix b/pkgs/games/nethack/default.nix
index 735065ca18e0..bf9d01800f33 100644
--- a/pkgs/games/nethack/default.nix
+++ b/pkgs/games/nethack/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchurl, writeScript, ncurses, gzip, flex, bison }:
+{ stdenv, lib, fetchurl, writeScript, coreutils, ncurses, gzip, flex, bison, less }:
 
 let
   platform =
@@ -10,6 +10,7 @@ let
     # We probably want something different for Darwin
     else "unix";
   userDir = "~/.config/nethack";
+  binPath = lib.makeBinPath [ coreutils less ];
 
 in stdenv.mkDerivation {
   name = "nethack-3.6.0";
@@ -60,6 +61,7 @@ in stdenv.mkDerivation {
     mkdir -p $out/bin
     cat <<EOF >$out/bin/nethack
     #! ${stdenv.shell} -e
+    PATH=${binPath}:\$PATH
 
     if [ ! -d ${userDir} ]; then
       mkdir -p ${userDir}
diff --git a/pkgs/games/steam/chrootenv.nix b/pkgs/games/steam/chrootenv.nix
index 125566b8428c..1fbf5a9dd1aa 100644
--- a/pkgs/games/steam/chrootenv.nix
+++ b/pkgs/games/steam/chrootenv.nix
@@ -63,6 +63,7 @@ in buildFHSUserEnv rec {
     libdrm
     mono
     xorg.xkeyboardconfig
+    xlibs.libpciaccess
 
     (steamPackages.steam-runtime-wrapped.override {
       inherit nativeOnly runtimeOnly newStdcpp;
diff --git a/pkgs/games/steam/runtime-wrapped.nix b/pkgs/games/steam/runtime-wrapped.nix
index 5cf55535db1b..6274a91625fa 100644
--- a/pkgs/games/steam/runtime-wrapped.nix
+++ b/pkgs/games/steam/runtime-wrapped.nix
@@ -50,7 +50,6 @@ let
     # Verified games requirements
     xlibs.libXmu
     xlibs.libxcb
-    xlibs.libpciaccess
     mesa_glu
     libuuid
     libogg
diff --git a/pkgs/misc/emulators/wine/sources.nix b/pkgs/misc/emulators/wine/sources.nix
index 4419d8025a87..c38756bc48a3 100644
--- a/pkgs/misc/emulators/wine/sources.nix
+++ b/pkgs/misc/emulators/wine/sources.nix
@@ -31,15 +31,15 @@ in rec {
   };
 
   unstable = fetchurl rec {
-    version = "2.4";
+    version = "2.5";
     url = "https://dl.winehq.org/wine/source/2.x/wine-${version}.tar.xz";
-    sha256 = "13klfadvd44zdfrzh38al99s53i02x3mlhcj5z7fq7vqwh3xzdc7";
+    sha256 = "1lnc7dnhvm1ir1hrjmihx9r47bc8wr8rhlf6pfm3lcl3nix2py8k";
     inherit (stable) mono gecko32 gecko64;
   };
 
   staging = fetchFromGitHub rec {
     inherit (unstable) version;
-    sha256 = "052s4y7d8lw2k0hk17zwz9bgbsl013g8953ad001y2kqjxwcnilh";
+    sha256 = "1l0sjbsajr4m7w3ar2ljwr3ffmwyv57g85a068ard3v8fv4nil22";
     owner = "wine-compholio";
     repo = "wine-staging";
     rev = "v${version}";
diff --git a/pkgs/os-specific/linux/kernel/linux-grsecurity.nix b/pkgs/os-specific/linux/kernel/linux-grsecurity.nix
index b32dfbc4b351..7df48850fd12 100644
--- a/pkgs/os-specific/linux/kernel/linux-grsecurity.nix
+++ b/pkgs/os-specific/linux/kernel/linux-grsecurity.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, perl, buildLinux, ... } @ args:
 
 import ./generic.nix (args // rec {
-  version = "4.9.20";
+  version = "4.9.21";
   extraMeta.branch = "4.9";
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v4.x/linux-${version}.tar.xz";
-    sha512 = "3israf7zhq92wi0py8y299f7cz6z6xr0y4i5b1xvb46ljyx39jwrrdjrf5nxngz6c1641l9qalwzg5r15pp4gqyr09ilmwn8i7kbqwi";
+    sha512 = "1l1m23qdcz4pqnawq2xxiw8pwapgf84ggvb16696qfsh36dhwr62hmg0k5vip2c7yp74dls2gw9qcwhgv9dp7ki74xhzbhpv3148fjd";
   };
 
   kernelPatches = args.kernelPatches;
diff --git a/pkgs/os-specific/linux/kernel/linux-testing.nix b/pkgs/os-specific/linux/kernel/linux-testing.nix
index f56b1df61841..491e006378bb 100644
--- a/pkgs/os-specific/linux/kernel/linux-testing.nix
+++ b/pkgs/os-specific/linux/kernel/linux-testing.nix
@@ -1,13 +1,13 @@
 { stdenv, fetchurl, perl, buildLinux, ... } @ args:
 
 import ./generic.nix (args // rec {
-  version = "4.11-rc5";
-  modDirVersion = "4.11.0-rc5";
+  version = "4.11-rc6";
+  modDirVersion = "4.11.0-rc6";
   extraMeta.branch = "4.11";
 
   src = fetchurl {
     url = "mirror://kernel/linux/kernel/v4.x/testing/linux-${version}.tar.xz";
-    sha256 = "0qmb8sssh4f4zhvasy20k30r8cwc03qm5ql3b25cj16cn3frp0q7";
+    sha256 = "1lrljxlx6s9rfwbzsl9ixhihf53rm7bwwah9756ar2siimrncvmr";
   };
 
   features.iwlwifi = true;
diff --git a/pkgs/os-specific/linux/kernel/patches.nix b/pkgs/os-specific/linux/kernel/patches.nix
index d8676413e82e..0a3b51a4e6e9 100644
--- a/pkgs/os-specific/linux/kernel/patches.nix
+++ b/pkgs/os-specific/linux/kernel/patches.nix
@@ -100,9 +100,9 @@ rec {
   };
 
   grsecurity_testing = grsecPatch
-    { kver   = "4.9.20";
-      grrev  = "201703310823";
-      sha512 = "0pm3wmcip73imjjx13yar5l5bhpii45mjac5vb1snypmbwqmywmikiixqslq84i1yqw0c8pi822znkz7650dhxrmdmagy0yirwfdrhf";
+    { kver   = "4.9.21";
+      grrev  = "201704091948";
+      sha512 = "1pa9vchnii319w3jarp4aclyjpwpk2s3ddi9facvy0r148xxqsl30hk2l0ihb9wwr9pz5a8l2z85skkkp65hpaz6fr9wmy9d1lb1hwh";
     };
 
   # This patch relaxes grsec constraints on the location of usermode helpers,
diff --git a/pkgs/os-specific/linux/sysdig/default.nix b/pkgs/os-specific/linux/sysdig/default.nix
index b23da5451d1c..27a0d301acf9 100644
--- a/pkgs/os-specific/linux/sysdig/default.nix
+++ b/pkgs/os-specific/linux/sysdig/default.nix
@@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
     stdenv.cc.cc
   ];
 
-  postInstall = ''
+  postInstall = optionalString (!stdenv.isDarwin) ''
     patchelf --set-rpath "$libPath" "$out/bin/sysdig"
     patchelf --set-rpath "$libPath" "$out/bin/csysdig"
   '' + optionalString (kernel != null) ''
diff --git a/pkgs/os-specific/linux/wireguard/default.nix b/pkgs/os-specific/linux/wireguard/default.nix
index 68966dd03998..641fb046c6d0 100644
--- a/pkgs/os-specific/linux/wireguard/default.nix
+++ b/pkgs/os-specific/linux/wireguard/default.nix
@@ -6,11 +6,11 @@ assert kernel != null -> stdenv.lib.versionAtLeast kernel.version "3.18";
 let
   name = "wireguard-${version}";
 
-  version = "0.0.20170324";
+  version = "0.0.20170409";
 
   src = fetchurl {
     url    = "https://git.zx2c4.com/WireGuard/snapshot/WireGuard-${version}.tar.xz";
-    sha256 = "2ec08a5d74cb3a63576f06d3cae695b6b8995acd9665e2fa4da91927b467ca51";
+    sha256 = "065vxxvdsnxk9paqbafi0c622b4qayfh3ps6zzb853qp2i6kniri";
   };
 
   meta = with stdenv.lib; {
diff --git a/pkgs/tools/compression/zstdmt/default.nix b/pkgs/tools/compression/zstdmt/default.nix
index 14dd4f21b2dc..5cf88e68c64b 100644
--- a/pkgs/tools/compression/zstdmt/default.nix
+++ b/pkgs/tools/compression/zstdmt/default.nix
@@ -17,9 +17,7 @@ stdenv.mkDerivation rec {
     zstd lz4
   ];
 
-  buildPhase = ''
-    make zstdmt lz4mt
-  '';
+  makeFlags = [ "CC=cc" "zstdmt" "lz4mt" ];
 
   installPhase = ''
     mkdir -p $out/bin/
diff --git a/pkgs/tools/filesystems/dosfstools/default.nix b/pkgs/tools/filesystems/dosfstools/default.nix
index 76df4f41257b..d6a4e83a533b 100644
--- a/pkgs/tools/filesystems/dosfstools/default.nix
+++ b/pkgs/tools/filesystems/dosfstools/default.nix
@@ -1,17 +1,19 @@
-{ stdenv, fetchFromGitHub }:
+{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig }:
 
 stdenv.mkDerivation rec {
   name = "dosfstools-${version}";
-  version = "3.0.28";
+  version = "4.1";
 
   src = fetchFromGitHub {
     owner = "dosfstools";
     repo = "dosfstools";
     rev = "v${version}";
-    sha256 = "0lqirpxcn8ml0anq8aqmaljfsji9h6mdzz0jrs0yqqfhgg90bkg2";
+    sha256 = "1a2zn1655d5f1m6jp9vpn3bp8yfxhcmxx3mx23ai9hmxiydiykr1";
   };
 
-  makeFlags = "PREFIX=$(out)";
+  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+
+  configureFlags = [ "--enable-compat-symlinks" ];
 
   meta = {
     description = "Utilities for creating and checking FAT and VFAT file systems";
diff --git a/pkgs/tools/filesystems/f2fs-tools/default.nix b/pkgs/tools/filesystems/f2fs-tools/default.nix
index acc3b5183fe1..d56c5e2ed9a7 100644
--- a/pkgs/tools/filesystems/f2fs-tools/default.nix
+++ b/pkgs/tools/filesystems/f2fs-tools/default.nix
@@ -1,16 +1,17 @@
-{ stdenv, fetchurl, autoreconfHook, libselinux, libuuid, pkgconfig }:
+{ stdenv, fetchgit, autoreconfHook, libselinux, libuuid, pkgconfig }:
 
 stdenv.mkDerivation rec {
   name = "f2fs-tools-${version}";
-  version = "1.7.0";
+  version = "1.8.0";
 
-  src = fetchurl {
-    url = "http://git.kernel.org/cgit/linux/kernel/git/jaegeuk/f2fs-tools.git/snapshot/${name}.tar.gz";
-    sha256 = "1m6bn1ibq0p53m0n97il91xqgjgn2pzlz74lb5bfzassx7159m1k";
+  src = fetchgit {
+    url = "git://git.kernel.org/pub/scm/linux/kernel/git/jaegeuk/f2fs-tools.git";
+    rev = "refs/tags/v${version}";
+    sha256 = "0mbpg6mng6jcm5vxq0ivhklgpkwvjbhjwgkhzxr50ln46h5kbd2f";
   };
 
-  nativeBuildInputs = [ autoreconfHook ];
-  buildInputs = [ libselinux libuuid pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  buildInputs = [ libselinux libuuid ];
 
   meta = with stdenv.lib; {
     homepage = "http://git.kernel.org/cgit/linux/kernel/git/jaegeuk/f2fs-tools.git/";
diff --git a/pkgs/tools/misc/keychain/default.nix b/pkgs/tools/misc/keychain/default.nix
index d32ed0b0d837..9abfdea5f7b9 100644
--- a/pkgs/tools/misc/keychain/default.nix
+++ b/pkgs/tools/misc/keychain/default.nix
@@ -38,5 +38,6 @@ stdenv.mkDerivation rec {
     platforms =
       with stdenv.lib;
       platforms.linux ++ platforms.darwin;
+    maintainers = with stdenv.lib.maintainers; [ sigma ];
   };
 }
diff --git a/pkgs/tools/misc/rrdtool/default.nix b/pkgs/tools/misc/rrdtool/default.nix
index de4c97731ef5..3d2666add420 100644
--- a/pkgs/tools/misc/rrdtool/default.nix
+++ b/pkgs/tools/misc/rrdtool/default.nix
@@ -1,5 +1,5 @@
 { fetchurl, stdenv, gettext, perl, pkgconfig, libxml2, pango, cairo, groff
-, tcl-8_5 }:
+, tcl-8_5, darwin }:
 
 stdenv.mkDerivation rec {
   name = "rrdtool-1.6.0";
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ pkgconfig ];
 
   buildInputs = [ gettext perl libxml2 pango cairo groff ]
-    ++ stdenv.lib.optional stdenv.isDarwin tcl-8_5;
+    ++ stdenv.lib.optionals stdenv.isDarwin [ tcl-8_5 darwin.apple_sdk.frameworks.ApplicationServices ];
 
   postInstall = ''
     # for munin and rrdtool support
diff --git a/pkgs/tools/networking/nuttcp/default.nix b/pkgs/tools/networking/nuttcp/default.nix
index 70f3d7e9c70a..23cce602875a 100644
--- a/pkgs/tools/networking/nuttcp/default.nix
+++ b/pkgs/tools/networking/nuttcp/default.nix
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
   unpackPhase = ":";
 
   buildPhase = ''
-    gcc -O2 -o nuttcp $src
+    cc -O2 -o nuttcp $src
   '';
 
   installPhase = ''
diff --git a/pkgs/tools/networking/openvpn/default.nix b/pkgs/tools/networking/openvpn/default.nix
index f609c90ad504..a8f3a5a19ae7 100644
--- a/pkgs/tools/networking/openvpn/default.nix
+++ b/pkgs/tools/networking/openvpn/default.nix
@@ -15,8 +15,6 @@ stdenv.mkDerivation rec {
     sha256 = "0zpqnbhjaifdalyxwmvk5kcyd7cpxbcigbn7967nbsyvl54vl8vg";
   };
 
-  patches = optional stdenv.isLinux ./systemd-notify.patch;
-
   buildInputs = [ lzo openssl pkgconfig ]
                   ++ optionals stdenv.isLinux [ pam systemd iproute ]
                   ++ optional pkcs11Support pkcs11helper;
diff --git a/pkgs/tools/networking/openvpn/systemd-notify.patch b/pkgs/tools/networking/openvpn/systemd-notify.patch
deleted file mode 100644
index c0ac8ae89d3c..000000000000
--- a/pkgs/tools/networking/openvpn/systemd-notify.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff -ru -x '*~' openvpn-2.3.1-orig/src/openvpn/init.c openvpn-2.3.1/src/openvpn/init.c
---- openvpn-2.3.1-orig/src/openvpn/init.c	2013-03-20 09:28:14.000000000 +0100
-+++ openvpn-2.3.1/src/openvpn/init.c	2014-04-22 13:02:21.351026640 +0200
-@@ -48,6 +48,8 @@
- 
- #include "occ-inline.h"
- 
-+#include <systemd/sd-daemon.h>
-+
- static struct context *static_context; /* GLOBAL */
- 
- /*
-@@ -1375,6 +1375,9 @@
-     /* Reset the unsuccessful connection counter on complete initialisation */
-     c->options.unsuccessful_attempts = 0;
- 
-+    /* Tell systemd we're ready. */
-+    sd_notify(0, "READY=1");
-+
-     /* If we delayed UID/GID downgrade or chroot, do it now */
-     do_uid_gid_chroot (c, true);
- 
diff --git a/pkgs/tools/typesetting/lout/builder.sh b/pkgs/tools/typesetting/lout/builder.sh
index ec52adc225bc..cd3b9c67e3c9 100755
--- a/pkgs/tools/typesetting/lout/builder.sh
+++ b/pkgs/tools/typesetting/lout/builder.sh
@@ -39,6 +39,6 @@ cat makefile |									\
   > "$nixMakefile" &&								\
 mkdir -p "$out/bin" && mkdir -p "$out/lib"					\
 mkdir -p "$out/man" && mkdir -p "$out/doc/lout" &&				\
-make -f "$nixMakefile" install installman &&					\
+make -f "$nixMakefile" CC=cc install installman &&					\
 installDoc &&									\
 fixupPhase
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index 3de941891586..29caabbda57f 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -325,7 +325,7 @@ with pkgs;
   findXMLCatalogs = makeSetupHook { } ../build-support/setup-hooks/find-xml-catalogs.sh;
 
   wrapGAppsHook = makeSetupHook {
-    deps = [ gnome3.dconf.lib gnome3.gtk makeWrapper ];
+    deps = [ gnome3.dconf.lib gnome3.gtk librsvg makeWrapper ];
   } ../build-support/setup-hooks/wrap-gapps-hook.sh;
 
   separateDebugInfo = makeSetupHook { } ../build-support/setup-hooks/separate-debug-info.sh;
@@ -8059,9 +8059,7 @@ with pkgs;
 
   levmar = callPackage ../development/libraries/levmar { };
 
-  leptonica = callPackage ../development/libraries/leptonica {
-    libpng = libpng12;
-  };
+  leptonica = callPackage ../development/libraries/leptonica { };
 
   lib3ds = callPackage ../development/libraries/lib3ds { };
 
@@ -13714,7 +13712,7 @@ with pkgs;
   inherit (callPackages ../applications/networking/browsers/firefox {
     inherit (gnome2) libIDL;
     libpng = libpng_apng;
-    enableGTK3 = false;
+    enableGTK3 = true;
     python = python2;
     gnused = gnused_422;
   }) firefox-unwrapped firefox-esr-unwrapped;
@@ -15689,6 +15687,7 @@ with pkgs;
   };
 
   tesseract = callPackage ../applications/graphics/tesseract { };
+  tesseract_4 = lowPrio (callPackage ../applications/graphics/tesseract/4.x.nix { });
 
   tetraproc = callPackage ../applications/audio/tetraproc { };
 
@@ -15697,11 +15696,13 @@ with pkgs;
   thunderbird = callPackage ../applications/networking/mailreaders/thunderbird {
     inherit (gnome2) libIDL;
     libpng = libpng_apng;
+    enableGTK3 = true;
   };
 
   thunderbird-bin = callPackage ../applications/networking/mailreaders/thunderbird-bin {
     gconf = pkgs.gnome2.GConf;
     inherit (pkgs.gnome2) libgnome libgnomeui;
+    inherit (pkgs.gnome3) defaultIconTheme;
   };
 
   tig = gitAndTools.tig;
@@ -18432,7 +18433,7 @@ with pkgs;
 
   discord = callPackage ../applications/networking/instant-messengers/discord { };
 
-  golden-cheetah = libsForQt5.callPackage ../applications/misc/golden-cheetah {};
+  golden-cheetah = libsForQt56.callPackage ../applications/misc/golden-cheetah {};
 
   linkchecker = callPackage ../tools/networking/linkchecker { };
 
diff --git a/pkgs/top-level/platforms.nix b/pkgs/top-level/platforms.nix
index 19cb0da58d91..665950766f7e 100644
--- a/pkgs/top-level/platforms.nix
+++ b/pkgs/top-level/platforms.nix
@@ -28,105 +28,104 @@ rec {
     kernelBaseConfig = "multi_v5_defconfig";
     kernelArch = "arm";
     kernelAutoModules = false;
-    kernelExtraConfig =
-      ''
-        BLK_DEV_RAM y
-        BLK_DEV_INITRD y
-        BLK_DEV_CRYPTOLOOP m
-        BLK_DEV_DM m
-        DM_CRYPT m
-        MD y
-        REISERFS_FS m
-        BTRFS_FS m
-        XFS_FS m
-        JFS_FS m
-        EXT4_FS m
-        USB_STORAGE_CYPRESS_ATACB m
-
-        # mv cesa requires this sw fallback, for mv-sha1
-        CRYPTO_SHA1 y
-        # Fast crypto
-        CRYPTO_TWOFISH y
-        CRYPTO_TWOFISH_COMMON y
-        CRYPTO_BLOWFISH y
-        CRYPTO_BLOWFISH_COMMON y
-
-        IP_PNP y
-        IP_PNP_DHCP y
-        NFS_FS y
-        ROOT_NFS y
-        TUN m
-        NFS_V4 y
-        NFS_V4_1 y
-        NFS_FSCACHE y
-        NFSD m
-        NFSD_V2_ACL y
-        NFSD_V3 y
-        NFSD_V3_ACL y
-        NFSD_V4 y
-        NETFILTER y
-        IP_NF_IPTABLES y
-        IP_NF_FILTER y
-        IP_NF_MATCH_ADDRTYPE y
-        IP_NF_TARGET_LOG y
-        IP_NF_MANGLE y
-        IPV6 m
-        VLAN_8021Q m
-
-        CIFS y
-        CIFS_XATTR y
-        CIFS_POSIX y
-        CIFS_FSCACHE y
-        CIFS_ACL y
-
-        WATCHDOG y
-        WATCHDOG_CORE y
-        ORION_WATCHDOG m
-
-        ZRAM m
-        NETCONSOLE m
-
-        # Disable OABI to have seccomp_filter (required for systemd)
-        # https://github.com/raspberrypi/firmware/issues/651
-        OABI_COMPAT n
-
-        # Fail to build
-        DRM n
-        SCSI_ADVANSYS n
-        USB_ISP1362_HCD n
-        SND_SOC n
-        SND_ALI5451 n
-        FB_SAVAGE n
-        SCSI_NSP32 n
-        ATA_SFF n
-        SUNGEM n
-        IRDA n
-        ATM_HE n
-        SCSI_ACARD n
-        BLK_DEV_CMD640_ENHANCED n
-
-        FUSE_FS m
-
-        # systemd uses cgroups
-        CGROUPS y
-
-        # Latencytop 
-        LATENCYTOP y
-
-        # Ubi for the mtd
-        MTD_UBI y
-        UBIFS_FS y
-        UBIFS_FS_XATTR y
-        UBIFS_FS_ADVANCED_COMPR y
-        UBIFS_FS_LZO y
-        UBIFS_FS_ZLIB y
-        UBIFS_FS_DEBUG n
-
-        # Kdb, for kernel troubles
-        KGDB y
-        KGDB_SERIAL_CONSOLE y
-        KGDB_KDB y
-      '';
+    kernelExtraConfig = ''
+      BLK_DEV_RAM y
+      BLK_DEV_INITRD y
+      BLK_DEV_CRYPTOLOOP m
+      BLK_DEV_DM m
+      DM_CRYPT m
+      MD y
+      REISERFS_FS m
+      BTRFS_FS m
+      XFS_FS m
+      JFS_FS m
+      EXT4_FS m
+      USB_STORAGE_CYPRESS_ATACB m
+
+      # mv cesa requires this sw fallback, for mv-sha1
+      CRYPTO_SHA1 y
+      # Fast crypto
+      CRYPTO_TWOFISH y
+      CRYPTO_TWOFISH_COMMON y
+      CRYPTO_BLOWFISH y
+      CRYPTO_BLOWFISH_COMMON y
+
+      IP_PNP y
+      IP_PNP_DHCP y
+      NFS_FS y
+      ROOT_NFS y
+      TUN m
+      NFS_V4 y
+      NFS_V4_1 y
+      NFS_FSCACHE y
+      NFSD m
+      NFSD_V2_ACL y
+      NFSD_V3 y
+      NFSD_V3_ACL y
+      NFSD_V4 y
+      NETFILTER y
+      IP_NF_IPTABLES y
+      IP_NF_FILTER y
+      IP_NF_MATCH_ADDRTYPE y
+      IP_NF_TARGET_LOG y
+      IP_NF_MANGLE y
+      IPV6 m
+      VLAN_8021Q m
+
+      CIFS y
+      CIFS_XATTR y
+      CIFS_POSIX y
+      CIFS_FSCACHE y
+      CIFS_ACL y
+
+      WATCHDOG y
+      WATCHDOG_CORE y
+      ORION_WATCHDOG m
+
+      ZRAM m
+      NETCONSOLE m
+
+      # Disable OABI to have seccomp_filter (required for systemd)
+      # https://github.com/raspberrypi/firmware/issues/651
+      OABI_COMPAT n
+
+      # Fail to build
+      DRM n
+      SCSI_ADVANSYS n
+      USB_ISP1362_HCD n
+      SND_SOC n
+      SND_ALI5451 n
+      FB_SAVAGE n
+      SCSI_NSP32 n
+      ATA_SFF n
+      SUNGEM n
+      IRDA n
+      ATM_HE n
+      SCSI_ACARD n
+      BLK_DEV_CMD640_ENHANCED n
+
+      FUSE_FS m
+
+      # systemd uses cgroups
+      CGROUPS y
+
+      # Latencytop
+      LATENCYTOP y
+
+      # Ubi for the mtd
+      MTD_UBI y
+      UBIFS_FS y
+      UBIFS_FS_XATTR y
+      UBIFS_FS_ADVANCED_COMPR y
+      UBIFS_FS_LZO y
+      UBIFS_FS_ZLIB y
+      UBIFS_FS_DEBUG n
+
+      # Kdb, for kernel troubles
+      KGDB y
+      KGDB_SERIAL_CONSOLE y
+      KGDB_KDB y
+    '';
     kernelMakeFlags = [ "LOADADDR=0x0200000" ];
     kernelTarget = "uImage";
     uboot = "sheevaplug";
@@ -147,77 +146,76 @@ rec {
     kernelDTB = true;
     kernelArch = "arm";
     kernelAutoModules = false;
-    kernelExtraConfig =
-      ''
-        BLK_DEV_RAM y
-        BLK_DEV_INITRD y
-        BLK_DEV_CRYPTOLOOP m
-        BLK_DEV_DM m
-        DM_CRYPT m
-        MD y
-        REISERFS_FS m
-        BTRFS_FS y
-        XFS_FS m
-        JFS_FS y
-        EXT4_FS y
-
-        IP_PNP y
-        IP_PNP_DHCP y
-        NFS_FS y
-        ROOT_NFS y
-        TUN m
-        NFS_V4 y
-        NFS_V4_1 y
-        NFS_FSCACHE y
-        NFSD m
-        NFSD_V2_ACL y
-        NFSD_V3 y
-        NFSD_V3_ACL y
-        NFSD_V4 y
-        NETFILTER y
-        IP_NF_IPTABLES y
-        IP_NF_FILTER y
-        IP_NF_MATCH_ADDRTYPE y
-        IP_NF_TARGET_LOG y
-        IP_NF_MANGLE y
-        IPV6 m
-        VLAN_8021Q m
-
-        CIFS y
-        CIFS_XATTR y
-        CIFS_POSIX y
-        CIFS_FSCACHE y
-        CIFS_ACL y
-
-        ZRAM m
-
-        # Disable OABI to have seccomp_filter (required for systemd)
-        # https://github.com/raspberrypi/firmware/issues/651
-        OABI_COMPAT n
-
-        # Fail to build
-        DRM n
-        SCSI_ADVANSYS n
-        USB_ISP1362_HCD n
-        SND_SOC n
-        SND_ALI5451 n
-        FB_SAVAGE n
-        SCSI_NSP32 n
-        ATA_SFF n
-        SUNGEM n
-        IRDA n
-        ATM_HE n
-        SCSI_ACARD n
-        BLK_DEV_CMD640_ENHANCED n
-
-        FUSE_FS m
-
-        # nixos mounts some cgroup
-        CGROUPS y
-
-        # Latencytop 
-        LATENCYTOP y
-      '';
+    kernelExtraConfig = ''
+      BLK_DEV_RAM y
+      BLK_DEV_INITRD y
+      BLK_DEV_CRYPTOLOOP m
+      BLK_DEV_DM m
+      DM_CRYPT m
+      MD y
+      REISERFS_FS m
+      BTRFS_FS y
+      XFS_FS m
+      JFS_FS y
+      EXT4_FS y
+
+      IP_PNP y
+      IP_PNP_DHCP y
+      NFS_FS y
+      ROOT_NFS y
+      TUN m
+      NFS_V4 y
+      NFS_V4_1 y
+      NFS_FSCACHE y
+      NFSD m
+      NFSD_V2_ACL y
+      NFSD_V3 y
+      NFSD_V3_ACL y
+      NFSD_V4 y
+      NETFILTER y
+      IP_NF_IPTABLES y
+      IP_NF_FILTER y
+      IP_NF_MATCH_ADDRTYPE y
+      IP_NF_TARGET_LOG y
+      IP_NF_MANGLE y
+      IPV6 m
+      VLAN_8021Q m
+
+      CIFS y
+      CIFS_XATTR y
+      CIFS_POSIX y
+      CIFS_FSCACHE y
+      CIFS_ACL y
+
+      ZRAM m
+
+      # Disable OABI to have seccomp_filter (required for systemd)
+      # https://github.com/raspberrypi/firmware/issues/651
+      OABI_COMPAT n
+
+      # Fail to build
+      DRM n
+      SCSI_ADVANSYS n
+      USB_ISP1362_HCD n
+      SND_SOC n
+      SND_ALI5451 n
+      FB_SAVAGE n
+      SCSI_NSP32 n
+      ATA_SFF n
+      SUNGEM n
+      IRDA n
+      ATM_HE n
+      SCSI_ACARD n
+      BLK_DEV_CMD640_ENHANCED n
+
+      FUSE_FS m
+
+      # nixos mounts some cgroup
+      CGROUPS y
+
+      # Latencytop
+      LATENCYTOP y
+    '';
     kernelTarget = "zImage";
     uboot = null;
     gcc = {
@@ -232,80 +230,79 @@ rec {
     kernelBaseConfig = "bcm2709_defconfig";
     kernelDTB = true;
     kernelAutoModules = false;
-    kernelExtraConfig =
-      ''
-        BLK_DEV_RAM y
-        BLK_DEV_INITRD y
-        BLK_DEV_CRYPTOLOOP m
-        BLK_DEV_DM m
-        DM_CRYPT m
-        MD y
-        REISERFS_FS m
-        BTRFS_FS y
-        XFS_FS m
-        JFS_FS y
-        EXT4_FS y
-
-        IP_PNP y
-        IP_PNP_DHCP y
-        NFS_FS y
-        ROOT_NFS y
-        TUN m
-        NFS_V4 y
-        NFS_V4_1 y
-        NFS_FSCACHE y
-        NFSD m
-        NFSD_V2_ACL y
-        NFSD_V3 y
-        NFSD_V3_ACL y
-        NFSD_V4 y
-        NETFILTER y
-        IP_NF_IPTABLES y
-        IP_NF_FILTER y
-        IP_NF_MATCH_ADDRTYPE y
-        IP_NF_TARGET_LOG y
-        IP_NF_MANGLE y
-        IPV6 m
-        VLAN_8021Q m
-
-        CIFS y
-        CIFS_XATTR y
-        CIFS_POSIX y
-        CIFS_FSCACHE y
-        CIFS_ACL y
-
-        ZRAM m
-
-        # Disable OABI to have seccomp_filter (required for systemd)
-        # https://github.com/raspberrypi/firmware/issues/651
-        OABI_COMPAT n
-
-        # Fail to build
-        DRM n
-        SCSI_ADVANSYS n
-        USB_ISP1362_HCD n
-        SND_SOC n
-        SND_ALI5451 n
-        FB_SAVAGE n
-        SCSI_NSP32 n
-        ATA_SFF n
-        SUNGEM n
-        IRDA n
-        ATM_HE n
-        SCSI_ACARD n
-        BLK_DEV_CMD640_ENHANCED n
-
-        FUSE_FS m
-
-        # nixos mounts some cgroup
-        CGROUPS y
-
-        # Latencytop 
-        LATENCYTOP y
-
-        # Disable the common config Xen, it doesn't build on ARM
-	XEN? n
-      '';
+    kernelExtraConfig = ''
+      BLK_DEV_RAM y
+      BLK_DEV_INITRD y
+      BLK_DEV_CRYPTOLOOP m
+      BLK_DEV_DM m
+      DM_CRYPT m
+      MD y
+      REISERFS_FS m
+      BTRFS_FS y
+      XFS_FS m
+      JFS_FS y
+      EXT4_FS y
+
+      IP_PNP y
+      IP_PNP_DHCP y
+      NFS_FS y
+      ROOT_NFS y
+      TUN m
+      NFS_V4 y
+      NFS_V4_1 y
+      NFS_FSCACHE y
+      NFSD m
+      NFSD_V2_ACL y
+      NFSD_V3 y
+      NFSD_V3_ACL y
+      NFSD_V4 y
+      NETFILTER y
+      IP_NF_IPTABLES y
+      IP_NF_FILTER y
+      IP_NF_MATCH_ADDRTYPE y
+      IP_NF_TARGET_LOG y
+      IP_NF_MANGLE y
+      IPV6 m
+      VLAN_8021Q m
+
+      CIFS y
+      CIFS_XATTR y
+      CIFS_POSIX y
+      CIFS_FSCACHE y
+      CIFS_ACL y
+
+      ZRAM m
+
+      # Disable OABI to have seccomp_filter (required for systemd)
+      # https://github.com/raspberrypi/firmware/issues/651
+      OABI_COMPAT n
+
+      # Fail to build
+      DRM n
+      SCSI_ADVANSYS n
+      USB_ISP1362_HCD n
+      SND_SOC n
+      SND_ALI5451 n
+      FB_SAVAGE n
+      SCSI_NSP32 n
+      ATA_SFF n
+      SUNGEM n
+      IRDA n
+      ATM_HE n
+      SCSI_ACARD n
+      BLK_DEV_CMD640_ENHANCED n
+
+      FUSE_FS m
+
+      # nixos mounts some cgroup
+      CGROUPS y
+
+      # Latencytop
+      LATENCYTOP y
+
+      # Disable the common config Xen, it doesn't build on ARM
+      XEN? n
+    '';
     kernelTarget = "zImage";
     uboot = null;
   };
@@ -327,76 +324,75 @@ rec {
     kernelBaseConfig = "lemote2f_defconfig";
     kernelArch = "mips";
     kernelAutoModules = false;
-    kernelExtraConfig =
-      ''
-        MIGRATION n
-        COMPACTION n
-
-        # nixos mounts some cgroup
-        CGROUPS y
-
-        BLK_DEV_RAM y
-        BLK_DEV_INITRD y
-        BLK_DEV_CRYPTOLOOP m
-        BLK_DEV_DM m
-        DM_CRYPT m
-        MD y
-        REISERFS_FS m
-        EXT4_FS m
-        USB_STORAGE_CYPRESS_ATACB m
-
-        IP_PNP y
-        IP_PNP_DHCP y
-        IP_PNP_BOOTP y
-        NFS_FS y
-        ROOT_NFS y
-        TUN m
-        NFS_V4 y
-        NFS_V4_1 y
-        NFS_FSCACHE y
-        NFSD m
-        NFSD_V2_ACL y
-        NFSD_V3 y
-        NFSD_V3_ACL y
-        NFSD_V4 y
-
-        # Fail to build
-        DRM n
-        SCSI_ADVANSYS n
-        USB_ISP1362_HCD n
-        SND_SOC n
-        SND_ALI5451 n
-        FB_SAVAGE n
-        SCSI_NSP32 n
-        ATA_SFF n
-        SUNGEM n
-        IRDA n
-        ATM_HE n
-        SCSI_ACARD n
-        BLK_DEV_CMD640_ENHANCED n
-
-        FUSE_FS m
-
-        # Needed for udev >= 150
-        SYSFS_DEPRECATED_V2 n
-
-        VGA_CONSOLE n
-        VT_HW_CONSOLE_BINDING y
-        SERIAL_8250_CONSOLE y
-        FRAMEBUFFER_CONSOLE y
-        EXT2_FS y
-        EXT3_FS y
-        REISERFS_FS y
-        MAGIC_SYSRQ y
-
-        # The kernel doesn't boot at all, with FTRACE
-        FTRACE n
-      '';
+    kernelExtraConfig = ''
+      MIGRATION n
+      COMPACTION n
+
+      # nixos mounts some cgroup
+      CGROUPS y
+
+      BLK_DEV_RAM y
+      BLK_DEV_INITRD y
+      BLK_DEV_CRYPTOLOOP m
+      BLK_DEV_DM m
+      DM_CRYPT m
+      MD y
+      REISERFS_FS m
+      EXT4_FS m
+      USB_STORAGE_CYPRESS_ATACB m
+
+      IP_PNP y
+      IP_PNP_DHCP y
+      IP_PNP_BOOTP y
+      NFS_FS y
+      ROOT_NFS y
+      TUN m
+      NFS_V4 y
+      NFS_V4_1 y
+      NFS_FSCACHE y
+      NFSD m
+      NFSD_V2_ACL y
+      NFSD_V3 y
+      NFSD_V3_ACL y
+      NFSD_V4 y
+
+      # Fail to build
+      DRM n
+      SCSI_ADVANSYS n
+      USB_ISP1362_HCD n
+      SND_SOC n
+      SND_ALI5451 n
+      FB_SAVAGE n
+      SCSI_NSP32 n
+      ATA_SFF n
+      SUNGEM n
+      IRDA n
+      ATM_HE n
+      SCSI_ACARD n
+      BLK_DEV_CMD640_ENHANCED n
+
+      FUSE_FS m
+
+      # Needed for udev >= 150
+      SYSFS_DEPRECATED_V2 n
+
+      VGA_CONSOLE n
+      VT_HW_CONSOLE_BINDING y
+      SERIAL_8250_CONSOLE y
+      FRAMEBUFFER_CONSOLE y
+      EXT2_FS y
+      EXT3_FS y
+      REISERFS_FS y
+      MAGIC_SYSRQ y
+
+      # The kernel doesn't boot at all, with FTRACE
+      FTRACE n
+    '';
     kernelTarget = "vmlinux";
     uboot = null;
     gcc.arch = "loongson2f";
   };
-  
+
   beaglebone = armv7l-hf-multiplatform // {
     name = "beaglebone";
     kernelBaseConfig = "omap2plus_defconfig";
@@ -417,14 +413,13 @@ rec {
     kernelPreferBuiltin = true;
     uboot = null;
     kernelTarget = "zImage";
-    kernelExtraConfig =
-      ''
-        # Fix broken sunxi-sid nvmem driver.
-        TI_CPTS y
-
-        # Hangs ODROID-XU4
-        ARM_BIG_LITTLE_CPUIDLE n
-      '';
+    kernelExtraConfig = ''
+      # Fix broken sunxi-sid nvmem driver.
+      TI_CPTS y
+
+      # Hangs ODROID-XU4
+      ARM_BIG_LITTLE_CPUIDLE n
+    '';
     gcc = {
       # Some table about fpu flags:
       # http://community.arm.com/servlet/JiveServlet/showImage/38-1981-3827/blogentry-103749-004812900+1365712953_thumb.png
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index 74b00ad6ff2c..9f65ef80b149 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -1625,11 +1625,11 @@ in {
 
   awscli = buildPythonPackage rec {
     name = "awscli-${version}";
-    version = "1.11.45";
+    version = "1.11.75";
       namePrefix = "";
       src = pkgs.fetchurl {
       url = "mirror://pypi/a/awscli/${name}.tar.gz";
-      sha256 = "0sv9dw4zsra8fm7ddbnwhlh80w534z4h8llz2p8asssaaj5nq2ya";
+      sha256 = "0bkjyrgb78f29vvr8j2id0386d30w340wrl7krwiha725c9y3pz1";
     };
 
     # No tests included
@@ -3200,11 +3200,11 @@ in {
   };
 
   botocore = buildPythonPackage rec {
-    version = "1.5.8"; # This version is required by awscli
+    version = "1.5.38"; # This version is required by awscli
     name = "botocore-${version}";
     src = pkgs.fetchurl {
       url = "mirror://pypi/b/botocore/${name}.tar.gz";
-      sha256 = "1qhrq2l9kvhi3gnrgwqhvy42aqbsk93j8mfr4ixqx18yqgbnylvz";
+      sha256 = "04cvsi8g8p3r5vr3vr2nb5ldyrsm0y4c2phimabbpk33wv718qyx";
     };
 
     propagatedBuildInputs =
@@ -20873,16 +20873,18 @@ in {
 
   pyocr = buildPythonPackage rec {
     name = "pyocr-${version}";
-    version = "0.4.4";
+    version = "0.4.6";
 
     # Don't fetch from PYPI because it doesn't contain tests.
     src = pkgs.fetchFromGitHub {
       owner = "jflesch";
       repo = "pyocr";
       rev = version;
-      sha256 = "09s7dxin8ams0f3xab60f45l3nn236a8win9yfyq9aqy9mm946ak";
+      sha256 = "0amyhkkm400qzbw65ivyzrzxl2r7vxqgsgqm7ml95m7gwkwhnzz0";
     };
 
+    patches = [ ../development/python-modules/pyocr-tesseract.patch ];
+
     postPatch = ''
       sed -i \
         -e 's,^\(TESSERACT_CMD *= *\).*,\1"${pkgs.tesseract}/bin/tesseract",' \
diff --git a/pkgs/top-level/release.nix b/pkgs/top-level/release.nix
index b5207879a5e6..7c6954564d0b 100644
--- a/pkgs/top-level/release.nix
+++ b/pkgs/top-level/release.nix
@@ -31,6 +31,21 @@ let
       manual = import ../../doc;
       lib-tests = import ../../lib/tests/release.nix { inherit nixpkgs; };
 
+      darwin-tested = pkgs.releaseTools.aggregate
+        { name = "nixpkgs-darwin-${jobs.tarball.version}";
+          meta.description = "Release-critical builds for the Nixpkgs darwin channel";
+          constituents =
+            [ jobs.tarball
+              jobs.stdenv.x86_64-darwin
+              jobs.ghc.x86_64-darwin
+              jobs.cabal2nix.x86_64-darwin
+              jobs.ruby.x86_64-darwin
+              jobs.python.x86_64-darwin
+              jobs.rustc.x86_64-darwin
+              jobs.go.x86_64-darwin
+            ];
+        };
+
       unstable = pkgs.releaseTools.aggregate
         { name = "nixpkgs-${jobs.tarball.version}";
           meta.description = "Release-critical builds for the Nixpkgs unstable channel";