summary refs log tree commit diff
path: root/pkgs/applications
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications')
-rw-r--r--pkgs/applications/audio/amarok/default.nix19
-rw-r--r--pkgs/applications/audio/audacious/default.nix4
-rw-r--r--pkgs/applications/audio/bristol/default.nix6
-rw-r--r--pkgs/applications/audio/cantata/default.nix8
-rw-r--r--pkgs/applications/audio/dfasma/default.nix8
-rw-r--r--pkgs/applications/audio/distrho/default.nix6
-rw-r--r--pkgs/applications/audio/eq10q/default.nix4
-rw-r--r--pkgs/applications/audio/fmit/default.nix10
-rw-r--r--pkgs/applications/audio/jaaa/default.nix2
-rw-r--r--pkgs/applications/audio/keyfinder/default.nix4
-rw-r--r--pkgs/applications/audio/musescore/default.nix7
-rw-r--r--pkgs/applications/audio/pithos/default.nix42
-rw-r--r--pkgs/applications/audio/qmmp/default.nix4
-rw-r--r--pkgs/applications/audio/rkrlv2/default.nix4
-rw-r--r--pkgs/applications/audio/sonic-visualiser/default.nix5
-rw-r--r--pkgs/applications/audio/spotify/default.nix22
-rw-r--r--pkgs/applications/audio/tetraproc/default.nix4
-rw-r--r--pkgs/applications/audio/vorbis-tools/default.nix25
-rw-r--r--pkgs/applications/audio/yoshimi/default.nix4
-rw-r--r--pkgs/applications/display-managers/lightdm/default.nix9
-rw-r--r--pkgs/applications/display-managers/sddm/default.nix14
-rw-r--r--pkgs/applications/editors/atom/default.nix8
-rw-r--r--pkgs/applications/editors/eclipse/plugins.nix4
-rw-r--r--pkgs/applications/editors/emacs-24/default.nix12
-rw-r--r--pkgs/applications/editors/idea/default.nix12
-rw-r--r--pkgs/applications/editors/joe/default.nix5
-rw-r--r--pkgs/applications/editors/kile/default.nix8
-rw-r--r--pkgs/applications/editors/lighttable/default.nix6
-rw-r--r--pkgs/applications/editors/nedit/default.nix4
-rw-r--r--pkgs/applications/editors/netbeans/default.nix27
-rw-r--r--pkgs/applications/editors/netbeans/path.patch11
-rw-r--r--pkgs/applications/editors/sublime/default.nix4
-rw-r--r--pkgs/applications/editors/sublime3/default.nix4
-rw-r--r--pkgs/applications/editors/vim/python_framework.patch15
-rw-r--r--pkgs/applications/gis/qgis/default.nix4
-rw-r--r--pkgs/applications/graphics/digikam/2.nix32
-rw-r--r--pkgs/applications/graphics/digikam/default.nix18
-rw-r--r--pkgs/applications/graphics/feh/default.nix4
-rw-r--r--pkgs/applications/graphics/gimp/2.8.nix6
-rw-r--r--pkgs/applications/graphics/kgraphviewer/default.nix7
-rw-r--r--pkgs/applications/graphics/kuickshow/default.nix4
-rw-r--r--pkgs/applications/graphics/xfig/default.nix4
-rw-r--r--pkgs/applications/inferno/default.nix4
-rw-r--r--pkgs/applications/kde-apps-15.04/default.nix13
-rw-r--r--pkgs/applications/kde-apps-15.04/kde-workspace/ksysguard-0001-disable-signalplottertest.patch36
-rw-r--r--pkgs/applications/kde-apps-15.08/ark.nix43
-rw-r--r--pkgs/applications/kde-apps-15.08/baloo-widgets.nix33
-rw-r--r--pkgs/applications/kde-apps-15.08/default.nix68
-rw-r--r--pkgs/applications/kde-apps-15.08/dolphin-plugins.nix29
-rw-r--r--pkgs/applications/kde-apps-15.08/dolphin.nix63
-rwxr-xr-xpkgs/applications/kde-apps-15.08/fetchsrcs.sh47
-rw-r--r--pkgs/applications/kde-apps-15.08/ffmpegthumbs.nix27
-rw-r--r--pkgs/applications/kde-apps-15.08/gpgmepp.nix21
-rw-r--r--pkgs/applications/kde-apps-15.08/gwenview.nix37
-rw-r--r--pkgs/applications/kde-apps-15.08/kate.nix63
-rw-r--r--pkgs/applications/kde-apps-15.08/kdegraphics-thumbnailers.nix29
-rw-r--r--pkgs/applications/kde-apps-15.08/kdelibs/0001-old-kde4-cmake-policies.patch56
-rw-r--r--pkgs/applications/kde-apps-15.08/kdelibs/0002-polkit-install-path.patch25
-rw-r--r--pkgs/applications/kde-apps-15.08/kdelibs/default.nix43
-rw-r--r--pkgs/applications/kde-apps-15.08/kdelibs/polkit-install.patch12
-rw-r--r--pkgs/applications/kde-apps-15.08/kdelibs/setup-hook.sh10
-rw-r--r--pkgs/applications/kde-apps-15.08/kgpg.nix31
-rw-r--r--pkgs/applications/kde-apps-15.08/konsole.nix61
-rw-r--r--pkgs/applications/kde-apps-15.08/ksnapshot.nix29
-rw-r--r--pkgs/applications/kde-apps-15.08/libkdcraw.nix27
-rw-r--r--pkgs/applications/kde-apps-15.08/libkexiv2.nix27
-rw-r--r--pkgs/applications/kde-apps-15.08/libkipi.nix25
-rw-r--r--pkgs/applications/kde-apps-15.08/okular.nix41
-rw-r--r--pkgs/applications/kde-apps-15.08/print-manager.nix45
-rw-r--r--pkgs/applications/kde-apps-15.08/srcs.nix1981
-rw-r--r--pkgs/applications/misc/audio/soxr/default.nix6
-rw-r--r--pkgs/applications/misc/cool-retro-term/default.nix7
-rw-r--r--pkgs/applications/misc/evilvte/default.nix6
-rw-r--r--pkgs/applications/misc/finalterm/default.nix4
-rw-r--r--pkgs/applications/misc/goldendict/default.nix28
-rw-r--r--pkgs/applications/misc/goldendict/gcc47.patch40
-rw-r--r--pkgs/applications/misc/goldendict/goldendict-paths.diff10
-rw-r--r--pkgs/applications/misc/hello/default.nix (renamed from pkgs/applications/misc/hello/ex-2/default.nix)2
-rw-r--r--pkgs/applications/misc/jekyll/Gemfile1
-rw-r--r--pkgs/applications/misc/jekyll/Gemfile.lock5
-rw-r--r--pkgs/applications/misc/jekyll/gemset.nix7
-rw-r--r--pkgs/applications/misc/k3b/default.nix27
-rw-r--r--pkgs/applications/misc/kde-wacomtablet/default.nix5
-rw-r--r--pkgs/applications/misc/kdeconnect/default.nix8
-rw-r--r--pkgs/applications/misc/keepassx/2.0.nix4
-rw-r--r--pkgs/applications/misc/kiwix/default.nix110
-rw-r--r--pkgs/applications/misc/krename/default.nix7
-rw-r--r--pkgs/applications/misc/krusader/default.nix7
-rw-r--r--pkgs/applications/misc/orpie/default.nix21
-rw-r--r--pkgs/applications/misc/redshift/default.nix28
-rw-r--r--pkgs/applications/misc/rsibreak/default.nix5
-rw-r--r--pkgs/applications/misc/synergy/default.nix4
-rw-r--r--pkgs/applications/misc/wordnet/default.nix4
-rw-r--r--pkgs/applications/misc/xcruiser/default.nix4
-rw-r--r--pkgs/applications/misc/xfe/default.nix4
-rw-r--r--pkgs/applications/misc/xpdf/default.nix6
-rw-r--r--pkgs/applications/misc/yakuake/default.nix5
-rw-r--r--pkgs/applications/networking/browsers/chromium/source/sources.nix8
-rw-r--r--pkgs/applications/networking/browsers/elinks/default.nix4
-rw-r--r--pkgs/applications/networking/browsers/firefox-bin/sources.nix358
-rw-r--r--pkgs/applications/networking/browsers/firefox/default.nix38
-rw-r--r--pkgs/applications/networking/browsers/kwebkitpart/default.nix4
-rw-r--r--pkgs/applications/networking/browsers/mozilla-plugins/gecko-mediaplayer/default.nix4
-rw-r--r--pkgs/applications/networking/browsers/qutebrowser/default.nix9
-rw-r--r--pkgs/applications/networking/browsers/rekonq/default.nix7
-rw-r--r--pkgs/applications/networking/browsers/w3m/default.nix6
-rw-r--r--pkgs/applications/networking/dropbox/default.nix84
-rw-r--r--pkgs/applications/networking/instant-messengers/amsn/default.nix4
-rw-r--r--pkgs/applications/networking/instant-messengers/hipchat/default.nix26
-rw-r--r--pkgs/applications/networking/instant-messengers/jitsi/default.nix20
-rw-r--r--pkgs/applications/networking/instant-messengers/qtox/default.nix18
-rw-r--r--pkgs/applications/networking/instant-messengers/teamspeak/client.nix4
-rw-r--r--pkgs/applications/networking/instant-messengers/telepathy/kde/default.nix17
-rw-r--r--pkgs/applications/networking/instant-messengers/tkabber/default.nix4
-rw-r--r--pkgs/applications/networking/instant-messengers/viber/default.nix10
-rw-r--r--pkgs/applications/networking/irc/quassel/default.nix32
-rw-r--r--pkgs/applications/networking/irc/quassel/qt-5.nix91
-rw-r--r--pkgs/applications/networking/mailreaders/mutt/default.nix21
-rw-r--r--pkgs/applications/networking/mailreaders/mutt/sidebar-compose.patch40
-rw-r--r--pkgs/applications/networking/mailreaders/mutt/sidebar-delimnullwide.patch38
-rw-r--r--pkgs/applications/networking/mailreaders/mutt/sidebar-dotpathsep.patch98
-rw-r--r--pkgs/applications/networking/mailreaders/mutt/sidebar-new.patch97
-rw-r--r--pkgs/applications/networking/mailreaders/mutt/sidebar-newonly.patch198
-rw-r--r--pkgs/applications/networking/mailreaders/mutt/sidebar-utf8.patch132
-rw-r--r--pkgs/applications/networking/mailreaders/mutt/sidebar.patch1477
-rw-r--r--pkgs/applications/networking/mailreaders/mutt/trash-folder.patch316
-rw-r--r--pkgs/applications/networking/mailreaders/thunderbird/default.nix16
-rw-r--r--pkgs/applications/networking/newsreaders/kwooty/0001-search-paths.patch33
-rw-r--r--pkgs/applications/networking/newsreaders/kwooty/default.nix12
-rw-r--r--pkgs/applications/networking/newsreaders/kwooty/searchPath.patch19
-rw-r--r--pkgs/applications/office/basket/default.nix8
-rw-r--r--pkgs/applications/office/calligra/default.nix9
-rw-r--r--pkgs/applications/office/eventlist/default.nix6
-rw-r--r--pkgs/applications/office/kbibtex/default.nix5
-rw-r--r--pkgs/applications/office/mendeley/default.nix4
-rw-r--r--pkgs/applications/office/skrooge/default.nix5
-rw-r--r--pkgs/applications/office/zanshin/default.nix5
-rw-r--r--pkgs/applications/office/zotero/default.nix2
-rw-r--r--pkgs/applications/science/logic/hol_light/Makefile.patch13
-rw-r--r--pkgs/applications/science/logic/hol_light/default.nix2
-rw-r--r--pkgs/applications/science/math/mathematica/9.nix4
-rw-r--r--pkgs/applications/science/math/mathematica/default.nix4
-rw-r--r--pkgs/applications/science/math/scilab/default.nix10
-rw-r--r--pkgs/applications/science/misc/openmodelica/default.nix4
-rw-r--r--pkgs/applications/version-management/git-and-tools/default.nix4
-rw-r--r--pkgs/applications/version-management/git-and-tools/git-extras/default.nix4
-rw-r--r--pkgs/applications/version-management/git-and-tools/git/default.nix4
-rw-r--r--pkgs/applications/version-management/gitinspector/default.nix21
-rw-r--r--pkgs/applications/version-management/kdesvn/default.nix6
-rw-r--r--pkgs/applications/version-management/mercurial/default.nix9
-rw-r--r--pkgs/applications/version-management/smartgithg/default.nix7
-rwxr-xr-xpkgs/applications/version-management/smartgithg/install_freedesktop_items.sh11
-rw-r--r--pkgs/applications/version-management/subversion/default.nix4
-rw-r--r--pkgs/applications/video/bangarang/default.nix14
-rw-r--r--pkgs/applications/video/gnash/default.nix4
-rw-r--r--pkgs/applications/video/k9copy/default.nix19
-rw-r--r--pkgs/applications/video/kdenlive/default.nix9
-rw-r--r--pkgs/applications/video/kmplayer/default.nix10
-rw-r--r--pkgs/applications/video/mythtv/default.nix4
-rw-r--r--pkgs/applications/video/tvtime/default.nix6
-rw-r--r--pkgs/applications/video/vlc/default.nix11
-rw-r--r--pkgs/applications/video/xine-ui/default.nix6
-rw-r--r--pkgs/applications/virtualization/open-vm-tools/default.nix4
-rw-r--r--pkgs/applications/virtualization/xen/generic.nix4
-rw-r--r--pkgs/applications/window-managers/awesome/default.nix20
-rw-r--r--pkgs/applications/window-managers/ion-3/default.nix4
-rw-r--r--pkgs/applications/window-managers/notion/default.nix4
-rw-r--r--pkgs/applications/window-managers/qtile/default.nix8
-rw-r--r--pkgs/applications/window-managers/weston/default.nix4
169 files changed, 6443 insertions, 785 deletions
diff --git a/pkgs/applications/audio/amarok/default.nix b/pkgs/applications/audio/amarok/default.nix
index 6ecdc1f98d44..d99e1b7a150f 100644
--- a/pkgs/applications/audio/amarok/default.nix
+++ b/pkgs/applications/audio/amarok/default.nix
@@ -1,7 +1,8 @@
-{ stdenv, fetchurl, lib, qtscriptgenerator, perl, gettext, curl
-, libxml2, mysql, taglib, taglib_extras, loudmouth , kdelibs
-, qca2, libmtp, liblastfm, libgpod, pkgconfig, automoc4, phonon
-, strigi, soprano, qjson, ffmpeg, libofa, nepomuk_core ? null }:
+{ stdenv, fetchurl, lib, automoc4, cmake, perl, pkgconfig
+, qtscriptgenerator, gettext, curl , libxml2, mysql, taglib
+, taglib_extras, loudmouth , kdelibs , qca2, libmtp, liblastfm, libgpod
+, phonon , strigi, soprano, qjson, ffmpeg, libofa, nepomuk_core ? null
+}:
 
 stdenv.mkDerivation rec {
   name = "${pname}-${version}";
@@ -16,9 +17,13 @@ stdenv.mkDerivation rec {
 
   QT_PLUGIN_PATH="${qtscriptgenerator}/lib/qt4/plugins";
 
-  buildInputs = [ qtscriptgenerator stdenv.cc.libc gettext curl
-    libxml2 mysql.lib taglib taglib_extras loudmouth kdelibs automoc4 phonon strigi
-    soprano qca2 libmtp liblastfm libgpod pkgconfig qjson ffmpeg libofa nepomuk_core ];
+  nativeBuildInputs = [ automoc4 cmake perl pkgconfig ];
+
+  buildInputs = [
+    qtscriptgenerator stdenv.cc.libc gettext curl libxml2 mysql.lib
+    taglib taglib_extras loudmouth kdelibs phonon strigi soprano qca2
+    libmtp liblastfm libgpod qjson ffmpeg libofa nepomuk_core
+  ];
 
   cmakeFlags = "-DKDE4_BUILD_TESTS=OFF";
 
diff --git a/pkgs/applications/audio/audacious/default.nix b/pkgs/applications/audio/audacious/default.nix
index 3ab113c92e89..9476fbaf3359 100644
--- a/pkgs/applications/audio/audacious/default.nix
+++ b/pkgs/applications/audio/audacious/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, pkgconfig, glib, gtk3, libmowgli, libmcs
-, gettext, dbus_glib, libxml2, libmad, xlibs, alsaLib, libogg
+, gettext, dbus_glib, libxml2, libmad, xorg, alsaLib, libogg
 , libvorbis, libcdio, libcddb, flac, ffmpeg, makeWrapper
 , mpg123, neon, faad2
 }:
@@ -21,7 +21,7 @@ stdenv.mkDerivation {
 
   buildInputs =
     [ gettext pkgconfig glib gtk3 libmowgli libmcs libxml2 dbus_glib
-      libmad xlibs.libXcomposite libogg libvorbis flac alsaLib libcdio
+      libmad xorg.libXcomposite libogg libvorbis flac alsaLib libcdio
       libcddb ffmpeg makeWrapper mpg123 neon faad2
     ];
 
diff --git a/pkgs/applications/audio/bristol/default.nix b/pkgs/applications/audio/bristol/default.nix
index db1f7895f4b9..e19acab36b5a 100644
--- a/pkgs/applications/audio/bristol/default.nix
+++ b/pkgs/applications/audio/bristol/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, alsaLib, libjack2, pkgconfig, libpulseaudio, xlibs }:
+{ stdenv, fetchurl, alsaLib, libjack2, pkgconfig, libpulseaudio, xorg }:
 
 stdenv.mkDerivation  rec {
   name = "bristol-${version}";
@@ -10,8 +10,8 @@ stdenv.mkDerivation  rec {
   };
 
   buildInputs = [
-    alsaLib libjack2 pkgconfig libpulseaudio xlibs.libX11 xlibs.libXext
-    xlibs.xproto
+    alsaLib libjack2 pkgconfig libpulseaudio xorg.libX11 xorg.libXext
+    xorg.xproto
   ];
 
   preInstall = ''
diff --git a/pkgs/applications/audio/cantata/default.nix b/pkgs/applications/audio/cantata/default.nix
index b23384e92935..fa0fe73ebae3 100644
--- a/pkgs/applications/audio/cantata/default.nix
+++ b/pkgs/applications/audio/cantata/default.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchurl, cmake
 , withQt4 ? false, qt4
-, withQt5 ? true, qt5
+, withQt5 ? true, qtbase, qtsvg, qttools
 
 # I'm unable to make KDE work here, crashes at runtime so I simply
 # make Qt4 the default until someone who wants KDE can figure it out.
@@ -57,7 +57,7 @@ stdenv.mkDerivation rec {
   buildInputs =
     [ cmake ]
     ++ stdenv.lib.optional withQt4 qt4
-    ++ stdenv.lib.optionals withQt5 (with qt5; [ base svg tools ])
+    ++ stdenv.lib.optionals withQt5 [ qtbase qtsvg qttools ]
     ++ stdenv.lib.optional withKDE4 kde4.kdelibs
     ++ stdenv.lib.optionals withTaglib [ taglib taglib_extras ]
     ++ stdenv.lib.optionals withReplaygain [ ffmpeg speex mpg123 ]
@@ -91,6 +91,10 @@ stdenv.mkDerivation rec {
     "-DENABLE_UDISKS2=ON"
   ];
 
+  postInstall = ''
+    wrapQtProgram "$out/bin/cantata"
+  '';
+
   meta = with stdenv.lib; {
     homepage = http://code.google.com/p/cantata/;
     description = "A graphical client for MPD";
diff --git a/pkgs/applications/audio/dfasma/default.nix b/pkgs/applications/audio/dfasma/default.nix
index fcd30e476cf3..d439f344f5ba 100644
--- a/pkgs/applications/audio/dfasma/default.nix
+++ b/pkgs/applications/audio/dfasma/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, fftw, libsndfile, qt5 }:
+{ stdenv, fetchFromGitHub, fftw, libsndfile, qtbase, qtmultimedia }:
 
 let
 
@@ -39,7 +39,7 @@ in stdenv.mkDerivation {
     owner = "gillesdegottex";
   };
 
-  buildInputs = [ fftw libsndfile qt5.base qt5.multimedia ];
+  buildInputs = [ fftw libsndfile qtbase qtmultimedia ];
 
   postPatch = ''
     substituteInPlace dfasma.pro --replace '$$DFASMAVERSIONGITPRO' '${version}'
@@ -53,6 +53,10 @@ in stdenv.mkDerivation {
 
   enableParallelBuilding = true;
 
+  postInstall = ''
+    wrapQtProgram "$out/bin/dfasma"
+  '';
+
   meta = with stdenv.lib; {
     inherit version;
     description = "Analyse and compare audio files in time and frequency";
diff --git a/pkgs/applications/audio/distrho/default.nix b/pkgs/applications/audio/distrho/default.nix
index a590716537bc..72893dfb19a1 100644
--- a/pkgs/applications/audio/distrho/default.nix
+++ b/pkgs/applications/audio/distrho/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchgit, alsaLib, fftwSinglePrec, freetype, libjack2
-, libxslt, lv2, pkgconfig, premake3, xlibs, ladspa-sdk }:
+, libxslt, lv2, pkgconfig, premake3, xorg, ladspa-sdk }:
 
 stdenv.mkDerivation rec {
   name = "distrho-ports-git-2015-07-18";
@@ -16,8 +16,8 @@ stdenv.mkDerivation rec {
 
   buildInputs = [
     alsaLib fftwSinglePrec freetype libjack2 pkgconfig premake3
-    xlibs.libX11 xlibs.libXcomposite xlibs.libXcursor xlibs.libXext
-    xlibs.libXinerama xlibs.libXrender ladspa-sdk
+    xorg.libX11 xorg.libXcomposite xorg.libXcursor xorg.libXext
+    xorg.libXinerama xorg.libXrender ladspa-sdk
   ];
 
   buildPhase = ''
diff --git a/pkgs/applications/audio/eq10q/default.nix b/pkgs/applications/audio/eq10q/default.nix
index 61c979534229..5d5b70a58985 100644
--- a/pkgs/applications/audio/eq10q/default.nix
+++ b/pkgs/applications/audio/eq10q/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, fftw, gtkmm, libxcb, lv2, pkgconfig, xlibs }:
+{ stdenv, fetchurl, cmake, fftw, gtkmm, libxcb, lv2, pkgconfig, xorg }:
 stdenv.mkDerivation rec {
   name = "eq10q-2-${version}";
   version = "beta7.1";
@@ -7,7 +7,7 @@ stdenv.mkDerivation rec {
     sha256 = "1jmrcx4jlx8kgsy5n4jcxa6qkjqvx7d8l2p7dsmw4hj20s39lgyi";
   };
 
-  buildInputs = [ cmake fftw gtkmm libxcb lv2 pkgconfig xlibs.libpthreadstubs xlibs.libXdmcp xlibs.libxshmfence ];
+  buildInputs = [ cmake fftw gtkmm libxcb lv2 pkgconfig xorg.libpthreadstubs xorg.libXdmcp xorg.libxshmfence ];
 
   installFlags = ''
     DESTDIR=$(out)
diff --git a/pkgs/applications/audio/fmit/default.nix b/pkgs/applications/audio/fmit/default.nix
index fe1f4c85c30a..36988c980917 100644
--- a/pkgs/applications/audio/fmit/default.nix
+++ b/pkgs/applications/audio/fmit/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, fftw, freeglut, qt5
+{ stdenv, fetchFromGitHub, fftw, freeglut, qtbase, qtmultimedia
 , alsaSupport ? true, alsaLib ? null
 , jackSupport ? false, libjack2 ? null
 , portaudioSupport ? false, portaudio ? null }:
@@ -18,10 +18,10 @@ stdenv.mkDerivation {
     owner = "gillesdegottex";
   };
 
-  buildInputs = [ fftw freeglut qt5.base qt5.multimedia ]
-    ++ stdenv.lib.optional alsaSupport [ alsaLib ]
-    ++ stdenv.lib.optional jackSupport [ libjack2 ]
-    ++ stdenv.lib.optional portaudioSupport [ portaudio ];
+  buildInputs = [ fftw freeglut qtbase qtmultimedia ]
+    ++ stdenv.lib.optionals alsaSupport [ alsaLib ]
+    ++ stdenv.lib.optionals jackSupport [ libjack2 ]
+    ++ stdenv.lib.optionals portaudioSupport [ portaudio ];
 
   configurePhase = ''
     mkdir build
diff --git a/pkgs/applications/audio/jaaa/default.nix b/pkgs/applications/audio/jaaa/default.nix
index 0427283d54df..b0fbced22113 100644
--- a/pkgs/applications/audio/jaaa/default.nix
+++ b/pkgs/applications/audio/jaaa/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, alsaLib, libclthreads, libclxclient, libX11, libXft, libXrender, fftwFloat, freetype, fontconfig, libjack2, xlibs, zita-alsa-pcmi }:
+{ stdenv, fetchurl, alsaLib, libclthreads, libclxclient, libX11, libXft, libXrender, fftwFloat, freetype, fontconfig, libjack2, xorg, zita-alsa-pcmi }:
 
 stdenv.mkDerivation rec {
   name = "jaaa-${version}";
diff --git a/pkgs/applications/audio/keyfinder/default.nix b/pkgs/applications/audio/keyfinder/default.nix
index edbedb1c013f..ffd8d071ab21 100644
--- a/pkgs/applications/audio/keyfinder/default.nix
+++ b/pkgs/applications/audio/keyfinder/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, libav_0_8, libkeyfinder, qt5, taglib }:
+{ stdenv, fetchFromGitHub, libav_0_8, libkeyfinder, qtbase, qtxmlpatterns, taglib }:
 
 let version = "2.00"; in
 stdenv.mkDerivation {
@@ -30,7 +30,7 @@ stdenv.mkDerivation {
   };
 
   # TODO: upgrade libav when "Audio sample format conversion failed" is fixed
-  buildInputs = [ libav_0_8 libkeyfinder qt5.base qt5.xmlpatterns taglib ];
+  buildInputs = [ libav_0_8 libkeyfinder qtbase qtxmlpatterns taglib ];
 
   postPatch = ''
     substituteInPlace is_KeyFinder.pro \
diff --git a/pkgs/applications/audio/musescore/default.nix b/pkgs/applications/audio/musescore/default.nix
index 7f34d5df550e..9dbfc96d5717 100644
--- a/pkgs/applications/audio/musescore/default.nix
+++ b/pkgs/applications/audio/musescore/default.nix
@@ -1,6 +1,7 @@
 { stdenv, fetchurl, cmake, pkgconfig
 , alsaLib, freetype, libjack2, lame, libogg, libpulseaudio, libsndfile, libvorbis
-, portaudio, qt5 #, tesseract
+, portaudio, qtbase, qtdeclarative, qtenginio, qtscript, qtsvg, qttools
+, qtwebkit, qtxmlpatterns
 }:
 
 stdenv.mkDerivation rec {
@@ -36,8 +37,8 @@ stdenv.mkDerivation rec {
 
   buildInputs = [
     alsaLib libjack2 freetype lame libogg libpulseaudio libsndfile libvorbis
-    portaudio qt5.base qt5.declarative qt5.enginio qt5.script qt5.svg qt5.tools
-    qt5.webkit qt5.xmlpatterns #tesseract
+    portaudio qtbase qtdeclarative qtenginio qtscript qtsvg qttools
+    qtwebkit qtxmlpatterns #tesseract
   ];
 
   meta = with stdenv.lib; {
diff --git a/pkgs/applications/audio/pithos/default.nix b/pkgs/applications/audio/pithos/default.nix
index bb863d2501ce..955c776d9044 100644
--- a/pkgs/applications/audio/pithos/default.nix
+++ b/pkgs/applications/audio/pithos/default.nix
@@ -1,40 +1,34 @@
-# Based on Richard Wallace's post here: http://comments.gmane.org/gmane.linux.distributions.nixos/14734
+{ fetchFromGitHub, stdenv, pythonPackages, gtk3, gobjectIntrospection, libnotify
+, gst_all_1, wrapGAppsHook }:
 
-{ fetchurl, stdenv, pythonPackages, gtk3, libnotify, gst_all_1 }:
 pythonPackages.buildPythonPackage rec {
   name = "pithos-${version}";
-  version = "1.0.1";
+  version = "1.1.1";
 
-  src = fetchurl {
-    url = "https://github.com/pithos/pithos/archive/${version}.tar.gz";
-    sha256 = "67b83927d5111067aefbf034d23880f96b1a2d300464e8491efa80e97e67f50f";
+  namePrefix = "";
+
+  src = fetchFromGitHub {
+    owner = "pithos";
+    repo  = "pithos";
+    rev = version;
+    sha256 = "0373z7g1wd3g1xl8m4ipx5n2ka67a2wcn387nyk8yvgdikm14jm3";
   };
 
   postPatch = ''
     substituteInPlace setup.py --replace "/usr/share" "$out/share"
   '';
 
-  buildInputs = with gst_all_1; [ gstreamer gst-plugins-base gst-plugins-good gst-plugins-ugly gst-plugins-bad libnotify ];
-
-  pythonPath = with pythonPackages; [ pygobject3 dbus pylast ];
+  buildInputs = [ wrapGAppsHook ];
 
-  propogatedBuildInputs = pythonPath;
-
-  postInstall = ''
-    wrapProgram "$out/bin/pithos" --prefix GST_PLUGIN_SYSTEM_PATH_1_0 ":" "$GST_PLUGIN_SYSTEM_PATH_1_0"
-  '';
+  propagatedBuildInputs =
+    [ gtk3 gobjectIntrospection libnotify ] ++
+    (with gst_all_1; [ gstreamer gst-plugins-base gst-plugins-good gst-plugins-ugly gst-plugins-bad ]) ++
+    (with pythonPackages; [ pygobject3 pylast ]);
 
   meta = with stdenv.lib; {
-    description = "Pandora player";
-
-    longDescription = ''
-      Pandora Internet Radio player for GNOME
-    '';
-
-    homepage = http://pithos.github.io/ ;
-
+    description = "Pandora Internet Radio player for GNOME";
+    homepage = https://pithos.github.io/;
     license = licenses.gpl3;
-
-    maintainers = with maintainers; [ obadz ];
+    maintainers = with maintainers; [ obadz jgeerds ];
   };
 }
diff --git a/pkgs/applications/audio/qmmp/default.nix b/pkgs/applications/audio/qmmp/default.nix
index 1b9323c1a7ba..5bec7aa6dd04 100644
--- a/pkgs/applications/audio/qmmp/default.nix
+++ b/pkgs/applications/audio/qmmp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, qt4, pkgconfig, x11
+{ stdenv, fetchurl, cmake, qt4, pkgconfig, xlibsWrapper
 # transports
 , curl, libmms
 # input plugins
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
 
   buildInputs =
     [ # basic requirements
-      cmake qt4 pkgconfig x11
+      cmake qt4 pkgconfig xlibsWrapper
       # transports
       curl libmms
       # input plugins
diff --git a/pkgs/applications/audio/rkrlv2/default.nix b/pkgs/applications/audio/rkrlv2/default.nix
index 9c41c88b0123..084d187c347c 100644
--- a/pkgs/applications/audio/rkrlv2/default.nix
+++ b/pkgs/applications/audio/rkrlv2/default.nix
@@ -1,5 +1,5 @@
 { stdenv, pkgs, fetchFromGitHub,
-automake, pkgconfig, lv2, fftw, cmake, xlibs, libjack2, libsamplerate, libsndfile
+automake, pkgconfig, lv2, fftw, cmake, xorg, libjack2, libsamplerate, libsndfile
 }:
 
 stdenv.mkDerivation rec {
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
     sha256 = "0kr3rvq7n1bh47qryyarcpiibms601qd8l1vypmm61969l4d4bn8";
   };
 
-  buildInputs = with xlibs; [ automake pkgconfig lv2 fftw cmake libXpm libjack2 libsamplerate libsndfile libXft ];
+  buildInputs = with xorg; [ automake pkgconfig lv2 fftw cmake libXpm libjack2 libsamplerate libsndfile libXft ];
 
   meta = {
     description = "Rakarrak effects ported to LV2";
diff --git a/pkgs/applications/audio/sonic-visualiser/default.nix b/pkgs/applications/audio/sonic-visualiser/default.nix
index e0aa6e00a460..bef2006d60b2 100644
--- a/pkgs/applications/audio/sonic-visualiser/default.nix
+++ b/pkgs/applications/audio/sonic-visualiser/default.nix
@@ -2,7 +2,7 @@
 
 { stdenv, fetchurl, alsaLib, bzip2, fftw, libjack2, libX11, liblo
 , libmad, libogg, librdf, librdf_raptor, librdf_rasqal, libsamplerate
-, libsndfile, pkgconfig, libpulseaudio, qt5, redland
+, libsndfile, pkgconfig, libpulseaudio, qtbase, redland
 , rubberband, serd, sord, vampSDK, fftwFloat
 }:
 
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs =
-    [ libsndfile qt5.base fftw fftwFloat bzip2 librdf rubberband
+    [ libsndfile qtbase fftw fftwFloat bzip2 librdf rubberband
       libsamplerate vampSDK alsaLib librdf_raptor librdf_rasqal redland
       serd
       sord
@@ -43,6 +43,7 @@ stdenv.mkDerivation rec {
     mkdir -p $out/{bin,share/sonic-visualiser}
     cp sonic-visualiser $out/bin/
     cp -r samples $out/share/sonic-visualiser/
+    wrapQtProgram "$out/bin/sonic-visualiser"
   '';
 
   meta = with stdenv.lib; {
diff --git a/pkgs/applications/audio/spotify/default.nix b/pkgs/applications/audio/spotify/default.nix
index 005b3e1b60d3..2868d7609738 100644
--- a/pkgs/applications/audio/spotify/default.nix
+++ b/pkgs/applications/audio/spotify/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, dpkg, xlibs, qt4, alsaLib, makeWrapper, openssl, freetype
+{ fetchurl, stdenv, dpkg, xorg, qt4, alsaLib, makeWrapper, openssl, freetype
 , glib, pango, cairo, atk, gdk_pixbuf, gtk, cups, nspr, nss, libpng, GConf
 , libgcrypt, chromium, udev, fontconfig
 , dbus, expat }:
@@ -28,16 +28,16 @@ let
     qt4
     stdenv.cc.cc
     udev
-    xlibs.libX11
-    xlibs.libXcomposite
-    xlibs.libXdamage
-    xlibs.libXext
-    xlibs.libXfixes
-    xlibs.libXi
-    xlibs.libXrandr
-    xlibs.libXrender
-    xlibs.libXrender
-    xlibs.libXScrnSaver
+    xorg.libX11
+    xorg.libXcomposite
+    xorg.libXdamage
+    xorg.libXext
+    xorg.libXfixes
+    xorg.libXi
+    xorg.libXrandr
+    xorg.libXrender
+    xorg.libXrender
+    xorg.libXScrnSaver
   ];
 
 in
diff --git a/pkgs/applications/audio/tetraproc/default.nix b/pkgs/applications/audio/tetraproc/default.nix
index a107dd9794b1..d450cce7b86f 100644
--- a/pkgs/applications/audio/tetraproc/default.nix
+++ b/pkgs/applications/audio/tetraproc/default.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchurl, makeWrapper
 , expat, fftwFloat, fontconfig, freetype, libjack2, jack2Full, libclthreads, libclxclient
-, libsndfile, libxcb, xlibs
+, libsndfile, libxcb, xorg
 }:
 
 stdenv.mkDerivation rec {
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [
     expat libjack2 libclthreads libclxclient fftwFloat fontconfig libsndfile freetype
-    libxcb xlibs.libX11 xlibs.libXau xlibs.libXdmcp xlibs.libXft xlibs.libXrender
+    libxcb xorg.libX11 xorg.libXau xorg.libXdmcp xorg.libXft xorg.libXrender
   ];
 
   makeFlags = [
diff --git a/pkgs/applications/audio/vorbis-tools/default.nix b/pkgs/applications/audio/vorbis-tools/default.nix
index e4e5b7ff81a3..1f85f4423548 100644
--- a/pkgs/applications/audio/vorbis-tools/default.nix
+++ b/pkgs/applications/audio/vorbis-tools/default.nix
@@ -1,6 +1,12 @@
-{stdenv, fetchurl, libogg, libvorbis, libao, pkgconfig, curl, glibc
-, speex, flac}:
+{ stdenv, fetchurl, fetchzip, libogg, libvorbis, libao, pkgconfig, curl
+, speex, flac }:
 
+let
+  debPatch = fetchzip {
+    url = "mirror://debian/pool/main/v/vorbis-tools/vorbis-tools_1.4.0-6.debian.tar.xz";
+    sha256 = "1xmmpdvxyr84lazlg23c6ck5ic97ga2rkiqabb1d98ix2zdzyqz5";
+  };
+in
 stdenv.mkDerivation {
   name = "vorbis-tools-1.4.0";
   src = fetchurl {
@@ -8,14 +14,23 @@ stdenv.mkDerivation {
     sha256 = "1g12bnh5ah08v529y72kfdz5lhvy75iaz7f9jskyby23m9dkk2d3";
   };
 
-  buildInputs = [ libogg libvorbis libao pkgconfig curl speex glibc flac ];
+  postPatch = ''
+    for patch in $(ls "${debPatch}"/patches/*.{diff,patch} | grep -v debian_subdir)
+    do patch -p1 < "$patch"
+    done
+  '';
+
+  buildInputs = [ libogg libvorbis libao pkgconfig curl speex flac ];
 
-  meta = {
+  meta = with stdenv.lib; {
+    description = "Extra tools for Ogg-Vorbis audio codec";
     longDescription = ''
       A set of command-line tools to manipulate Ogg Vorbis audio
       files, notably the `ogg123' player and the `oggenc' encoder.
     '';
     homepage = http://xiph.org/vorbis/;
-    license = stdenv.lib.licenses.gpl2;
+    license = licenses.gpl2;
+    platforms = platforms.all;
   };
 }
+
diff --git a/pkgs/applications/audio/yoshimi/default.nix b/pkgs/applications/audio/yoshimi/default.nix
index 9aafae7a5f45..cd334c4254ff 100644
--- a/pkgs/applications/audio/yoshimi/default.nix
+++ b/pkgs/applications/audio/yoshimi/default.nix
@@ -6,11 +6,11 @@ assert stdenv ? glibc;
 
 stdenv.mkDerivation  rec {
   name = "yoshimi-${version}";
-  version = "1.3.5.1";
+  version = "1.3.5.2";
 
   src = fetchurl {
     url = "mirror://sourceforge/yoshimi/${name}.tar.bz2";
-    sha256 = "1c7049pnvadxndk1rbja77kyr0rwnqca2546pxjnxksg923s5l8n";
+    sha256 = "001xvwknsm1sv5lvwz7f6dgf57b8djbpwbyk2gfxjy9rzl5q53qr";
   };
 
   buildInputs = [
diff --git a/pkgs/applications/display-managers/lightdm/default.nix b/pkgs/applications/display-managers/lightdm/default.nix
index 457d8c4b0caa..dc50ced1a606 100644
--- a/pkgs/applications/display-managers/lightdm/default.nix
+++ b/pkgs/applications/display-managers/lightdm/default.nix
@@ -1,6 +1,7 @@
 { stdenv, fetchurl, pam, pkgconfig, libxcb, glib, libXdmcp, itstool, libxml2
-, intltool, x11, libxklavier, libgcrypt, libaudit
-, qt4 ? null, qt5 ? null
+, intltool, xlibsWrapper, libxklavier, libgcrypt, libaudit
+, qt4 ? null
+, withQt5 ? false, qtbase
 }:
 
 let
@@ -20,14 +21,14 @@ stdenv.mkDerivation rec {
   buildInputs = [
     pkgconfig pam libxcb glib libXdmcp itstool libxml2 intltool libxklavier libgcrypt
     qt4 libaudit
-  ] ++ stdenv.lib.optional (qt5 != null) qt5.base;
+  ] ++ stdenv.lib.optional withQt5 qtbase;
 
   configureFlags = [
     "--localstatedir=/var"
     "--sysconfdir=/etc"
     "--disable-tests"
   ] ++ stdenv.lib.optional (qt4 != null) "--enable-liblightdm-qt"
-    ++ stdenv.lib.optional ((qt5.base or null) != null) "--enable-liblightdm-qt5";
+    ++ stdenv.lib.optional withQt5 "--enable-liblightdm-qt5";
 
   installFlags = [
     "sysconfdir=\${out}/etc"
diff --git a/pkgs/applications/display-managers/sddm/default.nix b/pkgs/applications/display-managers/sddm/default.nix
index ad2c885e4966..82cd8bd3091e 100644
--- a/pkgs/applications/display-managers/sddm/default.nix
+++ b/pkgs/applications/display-managers/sddm/default.nix
@@ -1,5 +1,7 @@
-{ stdenv, fetchpatch, makeWrapper, fetchFromGitHub, cmake, pkgconfig, libxcb, libpthreadstubs
-, libXdmcp, libXau, qt5, pam, systemd }:
+{ stdenv, fetchpatch, fetchFromGitHub, cmake, pkgconfig, libxcb
+, libpthreadstubs, libXdmcp, libXau, qtbase, qtdeclarative, qttools, pam
+, systemd
+}:
 
 let
   version = "0.11.0";
@@ -14,9 +16,9 @@ stdenv.mkDerivation rec {
     sha256 = "1s1gm0xvgwzrpxgni3ngdj8phzg21gkk1jyiv2l2i5ayl0jdm7ig";
   };
 
-  nativeBuildInputs = [ cmake pkgconfig qt5.tools makeWrapper ];
+  nativeBuildInputs = [ cmake pkgconfig qttools ];
 
-  buildInputs = [ libxcb libpthreadstubs libXdmcp libXau qt5.base pam systemd ];
+  buildInputs = [ libxcb libpthreadstubs libXdmcp libXau qtbase qtdeclarative pam systemd ];
 
   patches = [ (fetchpatch {
                 url = "https://github.com/sddm/sddm/commit/9bc21ee7da5de6b2531d47d1af4d7b0a169990b9.patch";
@@ -32,8 +34,8 @@ stdenv.mkDerivation rec {
   '';
 
   postInstall = ''
-    wrapProgram $out/bin/sddm-greeter \
-      --set QML2_IMPORT_PATH "${qt5.declarative}/lib/qt5/qml/"
+    wrapQtProgram $out/bin/sddm
+    wrapQtProgram $out/bin/sddm-greeter
   '';
 
   enableParallelBuilding = true;
diff --git a/pkgs/applications/editors/atom/default.nix b/pkgs/applications/editors/atom/default.nix
index 4de862b0254b..9bcad5b7649d 100644
--- a/pkgs/applications/editors/atom/default.nix
+++ b/pkgs/applications/editors/atom/default.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchurl, buildEnv, makeDesktopItem, makeWrapper, zlib, glib, alsaLib
 , dbus, gtk, atk, pango, freetype, fontconfig, libgnome_keyring3, gdk_pixbuf
-, cairo, cups, expat, libgpgerror, nspr, gconf, nss, xlibs, libcap, systemd
+, cairo, cups, expat, libgpgerror, nspr, gconf, nss, xorg, libcap, systemd
 }:
 
 let
@@ -9,9 +9,9 @@ let
     paths = [
       stdenv.cc.cc zlib glib dbus gtk atk pango freetype libgnome_keyring3
       fontconfig gdk_pixbuf cairo cups expat libgpgerror alsaLib nspr gconf nss
-      xlibs.libXrender xlibs.libX11 xlibs.libXext xlibs.libXdamage xlibs.libXtst
-      xlibs.libXcomposite xlibs.libXi xlibs.libXfixes xlibs.libXrandr
-      xlibs.libXcursor libcap systemd
+      xorg.libXrender xorg.libX11 xorg.libXext xorg.libXdamage xorg.libXtst
+      xorg.libXcomposite xorg.libXi xorg.libXfixes xorg.libXrandr
+      xorg.libXcursor libcap systemd
     ];
   };
 in stdenv.mkDerivation rec {
diff --git a/pkgs/applications/editors/eclipse/plugins.nix b/pkgs/applications/editors/eclipse/plugins.nix
index 9d85c05206a8..b80d63f69d34 100644
--- a/pkgs/applications/editors/eclipse/plugins.nix
+++ b/pkgs/applications/editors/eclipse/plugins.nix
@@ -317,11 +317,11 @@ rec {
 
   scala = buildEclipseUpdateSite rec {
     name = "scala-${version}";
-    version = "4.1.1";
+    version = "4.1.1.20150911";
 
     src = fetchzip {
       url = "http://download.scala-ide.org/sdk/lithium/e44/scala211/stable/update-site.zip";
-      sha256 = "0x5cdcm7p2ynz5ryw041gb150sripf9i4m1yrfqklnn581yqm6y8";
+      sha256 = "03g24sjivm7kzy64wwjs4ihf9vrb6703lb7bx3jafxzcwqm0pj1i";
     };
 
     meta = with stdenv.lib; {
diff --git a/pkgs/applications/editors/emacs-24/default.nix b/pkgs/applications/editors/emacs-24/default.nix
index 6c52a8991089..e0d74afabcd3 100644
--- a/pkgs/applications/editors/emacs-24/default.nix
+++ b/pkgs/applications/editors/emacs-24/default.nix
@@ -1,7 +1,7 @@
-{ stdenv, fetchurl, ncurses, x11, libXaw, libXpm, Xaw3d
+{ stdenv, fetchurl, ncurses, xlibsWrapper, libXaw, libXpm, Xaw3d
 , pkgconfig, gettext, libXft, dbus, libpng, libjpeg, libungif
 , libtiff, librsvg, texinfo, gconf, libxml2, imagemagick, gnutls
-, alsaLib, cairo, acl, gpm
+, alsaLib, cairo, acl, gpm, AppKit, Foundation, libobjc
 , withX ? !stdenv.isDarwin
 , withGTK3 ? false, gtk3 ? null
 , withGTK2 ? true, gtk2
@@ -43,12 +43,18 @@ stdenv.mkDerivation rec {
     [ ncurses gconf libxml2 gnutls alsaLib pkgconfig texinfo acl gpm gettext ]
     ++ stdenv.lib.optional stdenv.isLinux dbus
     ++ stdenv.lib.optionals withX
-      [ x11 libXaw Xaw3d libXpm libpng libjpeg libungif libtiff librsvg libXft
+      [ xlibsWrapper libXaw Xaw3d libXpm libpng libjpeg libungif libtiff librsvg libXft
         imagemagick gconf ]
     ++ stdenv.lib.optional (withX && withGTK2) gtk2
     ++ stdenv.lib.optional (withX && withGTK3) gtk3
     ++ stdenv.lib.optional (stdenv.isDarwin && withX) cairo;
 
+  propagatedBuildInputs = stdenv.lib.optionals stdenv.isDarwin [ AppKit Foundation libobjc
+  ];
+
+  NIX_LDFLAGS = stdenv.lib.optional stdenv.isDarwin
+    "/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation";
+
   configureFlags =
     if stdenv.isDarwin
       then [ "--with-ns" "--disable-ns-self-contained" ]
diff --git a/pkgs/applications/editors/idea/default.nix b/pkgs/applications/editors/idea/default.nix
index e2889abb913d..8824711fec65 100644
--- a/pkgs/applications/editors/idea/default.nix
+++ b/pkgs/applications/editors/idea/default.nix
@@ -237,25 +237,25 @@ in
 
   idea-community = buildIdea rec {
     name = "idea-community-${version}";
-    version = "14.1.4";
-    build = "IC-141.1532.4";
+    version = "14.1.5";
+    build = "IC-141.2735.5";
     description = "Integrated Development Environment (IDE) by Jetbrains, community edition";
     license = stdenv.lib.licenses.asl20;
     src = fetchurl {
       url = "https://download.jetbrains.com/idea/ideaIC-${version}.tar.gz";
-      sha256 = "1yx93dfbajk2icm2jkfp5s5jnr1czyk179va3n5zndzzhzags4xx";
+      sha256 = "196rijl2k24ysjihdsisfy8hjl21wcn98fn8wagvxsvjf7anyg9k";
     };
   };
 
   idea-ultimate = buildIdea rec {
     name = "idea-ultimate-${version}";
-    version = "14.1.4";
-    build = "IU-141.1532.4";
+    version = "14.1.5";
+    build = "IU-141.2735.5";
     description = "Integrated Development Environment (IDE) by Jetbrains, requires paid license";
     license = stdenv.lib.licenses.unfree;
     src = fetchurl {
       url = "https://download.jetbrains.com/idea/ideaIU-${version}.tar.gz";
-      sha256 = "1hxs0mh35r43iqd1i1s2g1ha91q2wnb6xs95w572khzjm5dznvaw";
+      sha256 = "0wxb7m0k3kbjnr42rwzsk4g09qxqsmnpsdj769azamvsr4p904k9";
     };
   };
 
diff --git a/pkgs/applications/editors/joe/default.nix b/pkgs/applications/editors/joe/default.nix
index 9f4d56bf8ad4..b08f98a054c2 100644
--- a/pkgs/applications/editors/joe/default.nix
+++ b/pkgs/applications/editors/joe/default.nix
@@ -1,11 +1,12 @@
 { stdenv, fetchurl } :
 
 stdenv.mkDerivation rec {
-  name = "joe-4.0";
+  version = "4.1";
+  name = "joe-${version}";
 
   src = fetchurl {
     url = "mirror://sourceforge/joe-editor/${name}.tar.gz";
-    sha256 = "0599xp90idl3dkplz72p33d2rfg0hb5yd38rhqdvz5zxfzzssmn5";
+    sha256 = "1nznzr9h0rh8g15c56yxzwpn2labx9sgsak0wcnpj7wmpnr12ql1";
   };
 
   meta = with stdenv.lib; {
diff --git a/pkgs/applications/editors/kile/default.nix b/pkgs/applications/editors/kile/default.nix
index b428289b95d9..7f7b22dfa134 100644
--- a/pkgs/applications/editors/kile/default.nix
+++ b/pkgs/applications/editors/kile/default.nix
@@ -1,4 +1,6 @@
-{stdenv, fetchurl, kdelibs, cmake, gettext }:
+{ stdenv, fetchurl, automoc4, cmake, gettext, perl, pkgconfig
+, shared_mime_info, kdelibs
+}:
 
 stdenv.mkDerivation rec {
   name = "kile-2.1.3";
@@ -8,7 +10,9 @@ stdenv.mkDerivation rec {
     sha256 = "18nfi37s46v9xav7vyki3phasddgcy4m7nywzxis198vr97yqqx0";
   };
 
-  nativeBuildInputs = [ cmake gettext ];
+  nativeBuildInputs = [
+    automoc4 cmake gettext perl pkgconfig shared_mime_info
+  ];
   buildInputs = [ kdelibs ];
 
   # for KDE 4.7 the nl translations fail since kile-2.1.2
diff --git a/pkgs/applications/editors/lighttable/default.nix b/pkgs/applications/editors/lighttable/default.nix
index 6db7130896f5..6dbeff55063c 100644
--- a/pkgs/applications/editors/lighttable/default.nix
+++ b/pkgs/applications/editors/lighttable/default.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchurl, buildEnv, makeDesktopItem, makeWrapper, zlib, glib, alsaLib
 , dbus, gtk, atk, pango, freetype, fontconfig, libgnome_keyring3, gdk_pixbuf
-, cairo, cups, expat, libgpgerror, nspr, gnome3, nss, xlibs, udev
+, cairo, cups, expat, libgpgerror, nspr, gnome3, nss, xorg, udev
 }:
 
 let
   libPath = stdenv.lib.makeLibraryPath [
       stdenv.cc.cc zlib glib dbus gtk atk pango freetype libgnome_keyring3 nss
       fontconfig gdk_pixbuf cairo cups expat libgpgerror alsaLib nspr gnome3.gconf
-      xlibs.libXrender xlibs.libX11 xlibs.libXext xlibs.libXdamage xlibs.libXtst
-      xlibs.libXcomposite xlibs.libXi xlibs.libXfixes
+      xorg.libXrender xorg.libX11 xorg.libXext xorg.libXdamage xorg.libXtst
+      xorg.libXcomposite xorg.libXi xorg.libXfixes
 ];
 in
 assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
diff --git a/pkgs/applications/editors/nedit/default.nix b/pkgs/applications/editors/nedit/default.nix
index a4dfc4719dc4..56a8ac62025f 100644
--- a/pkgs/applications/editors/nedit/default.nix
+++ b/pkgs/applications/editors/nedit/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, x11, motif, libXpm }:
+{ stdenv, fetchurl, xlibsWrapper, motif, libXpm }:
 
 assert stdenv.isLinux;
 
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     sha256 = "023hwpqc57mnzvg6p7jda6193afgjzxzajlhwhqvk3jq2kdv6zna";
   };
 
-  buildInputs = [ x11 motif libXpm ];
+  buildInputs = [ xlibsWrapper motif libXpm ];
 
   buildFlags = if stdenv.isLinux then "linux" else "";
 
diff --git a/pkgs/applications/editors/netbeans/default.nix b/pkgs/applications/editors/netbeans/default.nix
index 79dbb589d236..3ea0c71f125a 100644
--- a/pkgs/applications/editors/netbeans/default.nix
+++ b/pkgs/applications/editors/netbeans/default.nix
@@ -1,4 +1,6 @@
-{stdenv, fetchurl, jdk, unzip, which, makeWrapper, makeDesktopItem}:
+{ stdenv, fetchurl, makeWrapper, makeDesktopItem
+, gawk, jdk, perl, python, unzip, which
+}:
 
 let
   desktopItem = makeDesktopItem {
@@ -11,19 +13,24 @@ let
   };
 in
 stdenv.mkDerivation {
-  name = "netbeans-7.4";
+  name = "netbeans-8.0.2";
   src = fetchurl {
-    url = http://download.netbeans.org/netbeans/7.4/final/zip/netbeans-7.4-201310111528.zip;
-    sha256 = "0nrnghnsdix5cmp86xi1gmvarhjk2k8mlbld3dfa9impm8gpv6mx";
+    url = http://download.netbeans.org/netbeans/8.0.2/final/zip/netbeans-8.0.2-201411181905.zip;
+    sha256 = "1h9cqpwsnrhcnn4fqz3rr4s5jln8cfwki8af9zikq9j6aza337xv";
   };
+
   buildCommand = ''
-    # Unpack and copy the stuff
+    # Unpack and perform some path patching.
     unzip $src
-    mkdir -p $out
-    cp -a netbeans $out
-    
-    # Create a wrapper capable of starting it
+    patch -p1 <${./path.patch}
+    substituteInPlace netbeans/platform/lib/nbexec \
+        --subst-var-by AWK ${gawk}/bin/awk
+    patchShebangs .
+
+    # Copy to installation directory and create a wrapper capable of starting
+    # it.
     mkdir -p $out/bin
+    cp -a netbeans $out
     makeWrapper $out/netbeans/bin/netbeans $out/bin/netbeans \
       --prefix PATH : ${jdk}/bin:${which}/bin \
       --prefix JAVA_HOME : ${jdk.home} \
@@ -34,7 +41,7 @@ stdenv.mkDerivation {
     cp ${desktopItem}/share/applications/* $out/share/applications
   '';
   
-  buildInputs = [ unzip makeWrapper ];
+  buildInputs = [ makeWrapper perl python unzip ];
   
   meta = {
     description = "An integrated development environment for Java, C, C++ and PHP";
diff --git a/pkgs/applications/editors/netbeans/path.patch b/pkgs/applications/editors/netbeans/path.patch
new file mode 100644
index 000000000000..57b5730e137c
--- /dev/null
+++ b/pkgs/applications/editors/netbeans/path.patch
@@ -0,0 +1,11 @@
+--- a/netbeans/platform/lib/nbexec	2015-09-29 21:26:39.282600903 -0700
++++ b/netbeans/platform/lib/nbexec	2015-09-29 21:26:58.977697858 -0700
+@@ -198,7 +198,7 @@
+         SunOS*) awk=nawk ;;
+         *) awk=awk ;;
+     esac
+-    jdk_version=$("${jdkhome}/bin/java" -version 2>&1 | "/usr/bin/${awk}" -F '"' '/version/ {print substr($2, 1, 3)}')    
++    jdk_version=$("${jdkhome}/bin/java" -version 2>&1 | "@AWK@" -F '"' '/version/ {print substr($2, 1, 3)}')    
+     if [ "$jdk_version" = "1.7" ] ; then   
+         jargs="$jargs $launcher_args"
+     fi
diff --git a/pkgs/applications/editors/sublime/default.nix b/pkgs/applications/editors/sublime/default.nix
index ffa1c4eed34b..c7b0f9864c9a 100644
--- a/pkgs/applications/editors/sublime/default.nix
+++ b/pkgs/applications/editors/sublime/default.nix
@@ -1,6 +1,6 @@
-{ fetchurl, stdenv, glib, xlibs, cairo, gtk}:
+{ fetchurl, stdenv, glib, xorg, cairo, gtk}:
 let
-  libPath = stdenv.lib.makeLibraryPath [glib xlibs.libX11 gtk cairo];
+  libPath = stdenv.lib.makeLibraryPath [glib xorg.libX11 gtk cairo];
 in
 assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
 
diff --git a/pkgs/applications/editors/sublime3/default.nix b/pkgs/applications/editors/sublime3/default.nix
index 1764c85ca7dd..b26d27a8bc51 100644
--- a/pkgs/applications/editors/sublime3/default.nix
+++ b/pkgs/applications/editors/sublime3/default.nix
@@ -1,10 +1,10 @@
-{ fetchurl, stdenv, glib, xlibs, cairo, gtk, pango, makeWrapper, openssl, bzip2 }:
+{ fetchurl, stdenv, glib, xorg, cairo, gtk, pango, makeWrapper, openssl, bzip2 }:
 
 assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
 
 let
   build = "3083";
-  libPath = stdenv.lib.makeLibraryPath [glib xlibs.libX11 gtk cairo pango];
+  libPath = stdenv.lib.makeLibraryPath [glib xorg.libX11 gtk cairo pango];
 in let
   # package with just the binaries
   sublime = stdenv.mkDerivation {
diff --git a/pkgs/applications/editors/vim/python_framework.patch b/pkgs/applications/editors/vim/python_framework.patch
index b7c7cee6cd93..ba4ddef889f6 100644
--- a/pkgs/applications/editors/vim/python_framework.patch
+++ b/pkgs/applications/editors/vim/python_framework.patch
@@ -1,23 +1,24 @@
-diff --git a/src/auto/configure b/src/auto/configure
-index a9755a0..4a0e2a4 100755
 --- a/auto/configure
 +++ b/auto/configure
-@@ -5638,10 +5638,6 @@ __:
+@@ -5895,13 +5895,6 @@
  eof
  	    	    eval "`cd ${PYTHON_CONFDIR} && make -f "${tmp_mkf}" __ | sed '/ directory /d'`"
  	    rm -f -- "${tmp_mkf}"
 -	    if test "x$MACOSX" = "xyes" && ${vi_cv_path_python} -c \
 -		"import sys; sys.exit(${vi_cv_var_python_version} < 2.3)"; then
 -	      vi_cv_path_python_plibs="-framework Python"
+-	      if test "x${vi_cv_path_python}" != "x/usr/bin/python" && test -n "${python_PYTHONFRAMEWORKPREFIX}"; then
+-		  vi_cv_path_python_plibs="-F${python_PYTHONFRAMEWORKPREFIX} -framework Python"
+-	      fi
 -	    else
  	      if test "${vi_cv_var_python_version}" = "1.4"; then
  		  vi_cv_path_python_plibs="${PYTHON_CONFDIR}/libModules.a ${PYTHON_CONFDIR}/libPython.a ${PYTHON_CONFDIR}/libObjects.a ${PYTHON_CONFDIR}/libParser.a"
  	      else
-@@ -5649,7 +5645,6 @@ eof
- 	      fi
+@@ -5921,7 +5914,6 @@
  	      vi_cv_path_python_plibs="${vi_cv_path_python_plibs} ${python_BASEMODLIBS} ${python_LIBS} ${python_SYSLIBS} ${python_LINKFORSHARED}"
  	      	      vi_cv_path_python_plibs=`echo $vi_cv_path_python_plibs | sed s/-ltermcap//`
--	    fi
  
- fi
+-fi
  
+ 	if ${vi_cv_dll_name_python+:} false; then :
+   $as_echo_n "(cached) " >&6
diff --git a/pkgs/applications/gis/qgis/default.nix b/pkgs/applications/gis/qgis/default.nix
index 98663a946ae5..8d9771c91348 100644
--- a/pkgs/applications/gis/qgis/default.nix
+++ b/pkgs/applications/gis/qgis/default.nix
@@ -1,10 +1,10 @@
-{ stdenv, fetchurl, gdal, cmake, qt4, flex, bison, proj, geos, x11, sqlite, gsl,
+{ stdenv, fetchurl, gdal, cmake, qt4, flex, bison, proj, geos, xlibsWrapper, sqlite, gsl,
   qwt, fcgi, pythonPackages, libspatialindex, libspatialite, qscintilla, postgresql, makeWrapper }:
 
 stdenv.mkDerivation rec {
   name = "qgis-2.10.1";
 
-  buildInputs = [ gdal qt4 flex bison proj geos x11 sqlite gsl qwt qscintilla
+  buildInputs = [ gdal qt4 flex bison proj geos xlibsWrapper sqlite gsl qwt qscintilla
     fcgi libspatialindex libspatialite postgresql ] ++
     (with pythonPackages; [ numpy psycopg2 ]) ++ [ pythonPackages.qscintilla ];
 
diff --git a/pkgs/applications/graphics/digikam/2.nix b/pkgs/applications/graphics/digikam/2.nix
deleted file mode 100644
index e2ca03fe044e..000000000000
--- a/pkgs/applications/graphics/digikam/2.nix
+++ /dev/null
@@ -1,32 +0,0 @@
-{ stdenv, fetchurl, cmake, qt4, kdelibs, automoc4, phonon, qimageblitz, qca2, eigen,
-lcms, jasper, libgphoto2, kdepimlibs, gettext, soprano, libjpeg, libtiff,
-liblqr1, lensfun, pkgconfig, qjson, libkdcraw, opencv, libkexiv2, libkipi, boost,
-shared_desktop_ontologies, marble, libmysql }:
-
-stdenv.mkDerivation rec {
-  name = "digikam-2.9.0";
-
-  src = fetchurl {
-    url = "mirror://sourceforge/digikam/${name}.tar.bz2";
-    sha256 = "181vf065j1zz26zahkb7hy3fk4837nvwm61cnykvni7w40w0zpbk";
-  };
-
-  nativeBuildInputs = [ cmake automoc4 pkgconfig ];
-
-  buildInputs = [ qt4 kdelibs phonon qimageblitz qca2 eigen lcms libjpeg libtiff
-    jasper libgphoto2 kdepimlibs gettext soprano liblqr1 lensfun qjson libkdcraw
-    opencv libkexiv2 libkipi boost shared_desktop_ontologies marble libmysql ];
-
-  # Make digikam find some FindXXXX.cmake
-  KDEDIRS="${marble}:${qjson}";
-
-  enableParallelBuilding = true;
-
-  meta = {
-    description = "Photo Management Program";
-    license = "GPL";
-    homepage = http://www.digikam.org;
-    maintainers = with stdenv.lib.maintainers; [ viric urkud ];
-    inherit (kdelibs.meta) platforms;
-  };
-}
diff --git a/pkgs/applications/graphics/digikam/default.nix b/pkgs/applications/graphics/digikam/default.nix
index b07b889ca13e..bdf8077624db 100644
--- a/pkgs/applications/graphics/digikam/default.nix
+++ b/pkgs/applications/graphics/digikam/default.nix
@@ -1,8 +1,8 @@
 { stdenv, fetchurl, automoc4, boost, shared_desktop_ontologies, cmake
 , eigen, lcms, gettext, jasper, kdelibs, kdepimlibs, lensfun
 , libgphoto2, libjpeg, libkdcraw, libkexiv2, libkipi, libpgf, libtiff
-, libusb1, liblqr1, marble, mysql, opencv, phonon, pkgconfig, qca2
-, qimageblitz, qjson, qt4, soprano
+, libusb1, liblqr1, marble, mysql, opencv, perl, phonon, pkgconfig
+, qca2, qimageblitz, qjson, qt4, soprano
 }:
 
 stdenv.mkDerivation rec {
@@ -13,12 +13,12 @@ stdenv.mkDerivation rec {
     sha256 = "081ldsaf3frf5khznjd3sxkjmi4dyp6w6nqnc2a0agkk0kxkl10m";
   };
 
-  nativeBuildInputs = [ cmake automoc4 pkgconfig ];
+  nativeBuildInputs = [ automoc4 cmake gettext perl pkgconfig ];
 
   buildInputs = [
-    boost eigen gettext jasper kdelibs kdepimlibs lcms lensfun
-    libgphoto2 libjpeg libkdcraw libkexiv2 libkipi liblqr1 libpgf
-    libtiff marble mysql.lib opencv phonon qca2 qimageblitz qjson qt4
+    boost eigen jasper kdelibs kdepimlibs lcms lensfun libgphoto2
+    libjpeg libkdcraw libkexiv2 libkipi liblqr1 libpgf libtiff marble
+    mysql.lib opencv phonon qca2 qimageblitz qjson qt4
     shared_desktop_ontologies soprano
   ];
 
@@ -26,7 +26,11 @@ stdenv.mkDerivation rec {
   KDEDIRS="${marble}:${qjson}";
 
   # Help digiKam find libusb, otherwise gphoto2 support is disabled
-  cmakeFlags = "-DLIBUSB_LIBRARIES=${libusb1}/lib -DLIBUSB_INCLUDE_DIR=${libusb1}/include/libusb-1.0 -DDIGIKAMSC_COMPILE_LIBKFACE=ON";
+  cmakeFlags = [
+    "-DLIBUSB_LIBRARIES=${libusb1}/lib"
+    "-DLIBUSB_INCLUDE_DIR=${libusb1}/include/libusb-1.0"
+    "-DDIGIKAMSC_COMPILE_LIBKFACE=ON"
+  ];
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/applications/graphics/feh/default.nix b/pkgs/applications/graphics/feh/default.nix
index ac0a2ec0d4c9..266f70e3008f 100644
--- a/pkgs/applications/graphics/feh/default.nix
+++ b/pkgs/applications/graphics/feh/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, makeWrapper, fetchurl, x11, imlib2, libjpeg, libpng
+{ stdenv, makeWrapper, fetchurl, xlibsWrapper, imlib2, libjpeg, libpng
 , libXinerama, curl, libexif }:
 
 stdenv.mkDerivation rec {
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "1059mflgw8hl398lwy55fj50a98xryvdf23wkpbn4s0z9388hl46";
   };
 
-  buildInputs = [ makeWrapper x11 imlib2 libjpeg libpng libXinerama curl libexif ];
+  buildInputs = [ makeWrapper xlibsWrapper imlib2 libjpeg libpng libXinerama curl libexif ];
 
   preBuild = ''
     makeFlags="PREFIX=$out exif=1"
diff --git a/pkgs/applications/graphics/gimp/2.8.nix b/pkgs/applications/graphics/gimp/2.8.nix
index 83f409457fbb..7c394ae11c6f 100644
--- a/pkgs/applications/graphics/gimp/2.8.nix
+++ b/pkgs/applications/graphics/gimp/2.8.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl, pkgconfig, intltool, babl, gegl, gtk, glib, gdk_pixbuf
 , pango, cairo, freetype, fontconfig, lcms, libpng, libjpeg, poppler, libtiff
 , webkit, libmng, librsvg, libwmf, zlib, libzip, ghostscript, aalib, jasper
-, python, pygtk, libart_lgpl, libexif, gettext, xlibs, wrapPython }:
+, python, pygtk, libart_lgpl, libexif, gettext, xorg, wrapPython }:
 
 stdenv.mkDerivation rec {
   name = "gimp-2.8.14";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
     [ pkgconfig intltool babl gegl gtk glib gdk_pixbuf pango cairo
       freetype fontconfig lcms libpng libjpeg poppler libtiff webkit
       libmng librsvg libwmf zlib libzip ghostscript aalib jasper
-      python pygtk libart_lgpl libexif gettext xlibs.libXpm
+      python pygtk libart_lgpl libexif gettext xorg.libXpm
       wrapPython
     ];
 
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
   #configureFlags = [ "--disable-print" ];
 
   # "screenshot" needs this.
-  NIX_LDFLAGS = "-rpath ${xlibs.libX11}/lib"
+  NIX_LDFLAGS = "-rpath ${xorg.libX11}/lib"
     + stdenv.lib.optionalString stdenv.isDarwin " -lintl";
 
   meta = {
diff --git a/pkgs/applications/graphics/kgraphviewer/default.nix b/pkgs/applications/graphics/kgraphviewer/default.nix
index 21caf8f80028..6eb57c3dd5f1 100644
--- a/pkgs/applications/graphics/kgraphviewer/default.nix
+++ b/pkgs/applications/graphics/kgraphviewer/default.nix
@@ -1,4 +1,6 @@
-{ stdenv, fetchurl, kdelibs, automoc4, boost, pkgconfig, graphviz, gettext }:
+{ stdenv, fetchurl, automoc4, cmake, gettext, perl, pkgconfig
+, kdelibs, boost, graphviz
+}:
 
 stdenv.mkDerivation rec {
   name = "kgraphviewer-${version}";
@@ -9,7 +11,8 @@ stdenv.mkDerivation rec {
     sha256 = "13zhjs57xavzrj4nrlqs35n35ihvzij7hgbszf5fhlp2a4d4rrqs";
   };
 
-  buildInputs = [ kdelibs automoc4 boost pkgconfig graphviz gettext ];
+  buildInputs = [ kdelibs boost graphviz ];
+  nativeBuildInputs = [ automoc4 cmake gettext perl pkgconfig ];
 
   meta = with stdenv.lib; {
     description = "A Graphviz dot graph viewer for KDE";
diff --git a/pkgs/applications/graphics/kuickshow/default.nix b/pkgs/applications/graphics/kuickshow/default.nix
index 7a4106429585..cfecd19df46d 100644
--- a/pkgs/applications/graphics/kuickshow/default.nix
+++ b/pkgs/applications/graphics/kuickshow/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, kdelibs, imlib, cmake, pkgconfig, gettext }:
+{ stdenv, fetchurl, automoc4, kdelibs, imlib, cmake, pkgconfig, gettext }:
 
 stdenv.mkDerivation rec {
   name = "kuickshow-0.9.1";
@@ -10,5 +10,5 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ kdelibs imlib ];
 
-  nativeBuildInputs = [ cmake gettext pkgconfig ];
+  nativeBuildInputs = [ automoc4 cmake gettext pkgconfig ];
 }
diff --git a/pkgs/applications/graphics/xfig/default.nix b/pkgs/applications/graphics/xfig/default.nix
index 88183c5e5a3b..9e53fe3efe2c 100644
--- a/pkgs/applications/graphics/xfig/default.nix
+++ b/pkgs/applications/graphics/xfig/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, makeWrapper, imake
-, x11, libXpm, libXmu, libXi, libXp, Xaw3d, libpng, libjpeg}:
+, xlibsWrapper, libXpm, libXmu, libXi, libXp, Xaw3d, libpng, libjpeg}:
 
 let version = "3.2.5b"; in
 stdenv.mkDerivation {
@@ -12,7 +12,7 @@ stdenv.mkDerivation {
 
   builder = ./builder.sh;
 
-  buildInputs = [x11 libXpm libXmu libXi libXp Xaw3d libpng libjpeg];
+  buildInputs = [xlibsWrapper libXpm libXmu libXi libXp Xaw3d libpng libjpeg];
 
   nativeBuildInputs = [ imake makeWrapper ];
 
diff --git a/pkgs/applications/inferno/default.nix b/pkgs/applications/inferno/default.nix
index 0d61d5635a51..a0e2796a3025 100644
--- a/pkgs/applications/inferno/default.nix
+++ b/pkgs/applications/inferno/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, fetchhg, stdenv, xlibs, gcc46, makeWrapper }:
+{ fetchurl, fetchhg, stdenv, xorg, gcc46, makeWrapper }:
 
 stdenv.mkDerivation rec {
   # Inferno is a rolling release from a mercurial repository. For the verison number
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
   };
 
   # Fails with gcc48 due to inferno triggering an optimisation issue with floating point.
-  buildInputs = [ gcc46 xlibs.libX11 xlibs.libXpm xlibs.libXext xlibs.xextproto makeWrapper ];
+  buildInputs = [ gcc46 xorg.libX11 xorg.libXpm xorg.libXext xorg.xextproto makeWrapper ];
 
   infernoWrapper = ./inferno;
 
diff --git a/pkgs/applications/kde-apps-15.04/default.nix b/pkgs/applications/kde-apps-15.04/default.nix
index 83aca36bc003..4bae82976af2 100644
--- a/pkgs/applications/kde-apps-15.04/default.nix
+++ b/pkgs/applications/kde-apps-15.04/default.nix
@@ -174,10 +174,10 @@ let
               libvncserver libical networkmanager openal opencv
               openexr perl phonon pkgconfig polkit_qt4 prison python qca2
               qimageblitz qjson qt4 samba saneBackends soprano speechd
-              strigi taglib udev xlibs xplanet xscreensaver xz;
+              strigi taglib udev xorg xplanet xscreensaver xz;
       alsa = alsaLib;
       assuan = libassuan;
-      boost = boost156;
+      boost = boost155;
       canberra = libcanberra;
       eigen3 = eigen;
       epub = ebook_tools;
@@ -289,7 +289,8 @@ let
       kde-wallpapers = kde4Package super.kde-wallpapers;
 
       kde-workspace = extendDerivation (kde4Package super.kde-workspace) {
-        buildInputs = with scope.xlibs; [
+        patches = [ ./kde-workspace/ksysguard-0001-disable-signalplottertest.patch ];
+        buildInputs = with scope.xorg; [
             libxkbfile libXcomposite xcbutilimage xcbutilkeysyms xcbutilrenderutil
         ];
         nativeBuildInputs = [ scope.pkgconfig ];
@@ -385,7 +386,7 @@ let
       };
 
       kmousetool = extendDerivation (kde4Package super.kmousetool) {
-        buildInputs = with scope.xlibs; [ libXtst libXt ];
+        buildInputs = with scope.xorg; [ libXtst libXt ];
       };
 
       kmouth = kde4Package super.kmouth;
@@ -407,13 +408,13 @@ let
       krdc = kde4Package super.krdc;
 
       kremotecontrol = extendDerivation (kde4Package super.kremotecontrol) {
-        buildInputs = [ scope.xlibs.libXtst ];
+        buildInputs = [ scope.xorg.libXtst ];
       };
 
       kreversi = kde4Package super.kreversi;
 
       krfb = extendDerivation (kde4Package super.krfb) {
-        buildInputs = with scope; [ xlibs.libXtst ktp-common-internals ];
+        buildInputs = with scope; [ xorg.libXtst ktp-common-internals ];
       };
 
       ksaneplugin = kde4Package super.ksaneplugin;
diff --git a/pkgs/applications/kde-apps-15.04/kde-workspace/ksysguard-0001-disable-signalplottertest.patch b/pkgs/applications/kde-apps-15.04/kde-workspace/ksysguard-0001-disable-signalplottertest.patch
new file mode 100644
index 000000000000..cd19b7e2d72a
--- /dev/null
+++ b/pkgs/applications/kde-apps-15.04/kde-workspace/ksysguard-0001-disable-signalplottertest.patch
@@ -0,0 +1,36 @@
+From 38f35dcec38458f7192424b3d63bc0c614bb86e0 Mon Sep 17 00:00:00 2001
+From: Thomas Tuegel <ttuegel@gmail.com>
+Date: Mon, 7 Sep 2015 18:55:44 -0500
+Subject: [PATCH] ksysguard disable signalplottertest
+
+---
+ libs/ksysguard/tests/CMakeLists.txt | 16 ----------------
+ 1 file changed, 16 deletions(-)
+
+diff --git a/libs/ksysguard/tests/CMakeLists.txt b/libs/ksysguard/tests/CMakeLists.txt
+index d472fd7..f178b71 100644
+--- a/libs/ksysguard/tests/CMakeLists.txt
++++ b/libs/ksysguard/tests/CMakeLists.txt
+@@ -14,19 +14,3 @@ target_link_libraries(processtest processui ${KDE4_KDECORE_LIBS} ${QT_QTTEST_LIB
+ set( signalplotterbenchmark_SRCS signalplotterbenchmark.cpp ../signalplotter/ksignalplotter.cpp)
+ kde4_add_unit_test( signalplotterbenchmark TESTNAME ksysguard-signalplottertest ${signalplotterbenchmark_SRCS} )
+ target_link_libraries( signalplotterbenchmark ${KDE4_KDEUI_LIBS} ${QT_QTTEST_LIBRARY} ${QT_QTBENCHMARK_LIBRARY} )
+-
+-
+-# KGraphicsSignalPlotter benchmark
+-set( graphicssignalplotterbenchmark_SRCS graphicssignalplotterbenchmark.cpp ../signalplotter/kgraphicssignalplotter.cpp)
+-kde4_add_unit_test( graphicssignalplotterbenchmark TESTNAME ksysguard-signalplottertest ${graphicssignalplotterbenchmark_SRCS} )
+-target_link_libraries( graphicssignalplotterbenchmark ${KDE4_KDEUI_LIBS} ${QT_QTTEST_LIBRARY} ${QT_QTBENCHMARK_LIBRARY} )
+-
+-
+-# KSignalPlotter unit test
+-set( signalplottertest_SRCS signalplottertest.cpp ../signalplotter/ksignalplotter.cpp)
+-kde4_add_unit_test( signalplottertest TESTNAME ksysguard-signalplottertest ${signalplottertest_SRCS} )
+-target_link_libraries( signalplottertest ${KDE4_KDEUI_LIBS} ${QT_QTTEST_LIBRARY} )
+-
+-
+-
+-
+-- 
+2.5.0
+
diff --git a/pkgs/applications/kde-apps-15.08/ark.nix b/pkgs/applications/kde-apps-15.08/ark.nix
new file mode 100644
index 000000000000..b0bf81e0b5bb
--- /dev/null
+++ b/pkgs/applications/kde-apps-15.08/ark.nix
@@ -0,0 +1,43 @@
+{ kdeApp
+, lib
+, extra-cmake-modules
+, kdoctools
+, karchive
+, kconfig
+, kcrash
+, kdbusaddons
+, ki18n
+, kiconthemes
+, khtml
+, kio
+, kservice
+, kpty
+, kwidgetsaddons
+, libarchive
+}:
+
+kdeApp {
+  name = "ark";
+  nativeBuildInputs = [
+    extra-cmake-modules
+    kdoctools
+  ];
+  buildInputs = [
+    karchive
+    kconfig
+    kcrash
+    kdbusaddons
+    ki18n
+    kiconthemes
+    khtml
+    kio
+    kservice
+    kpty
+    kwidgetsaddons
+    libarchive
+  ];
+  meta = {
+    license = with lib.licenses; [ gpl2 lgpl3 ];
+    maintainers = [ lib.maintainers.ttuegel ];
+  };
+}
diff --git a/pkgs/applications/kde-apps-15.08/baloo-widgets.nix b/pkgs/applications/kde-apps-15.08/baloo-widgets.nix
new file mode 100644
index 000000000000..d38eea96c599
--- /dev/null
+++ b/pkgs/applications/kde-apps-15.08/baloo-widgets.nix
@@ -0,0 +1,33 @@
+{ kdeApp
+, lib
+, extra-cmake-modules
+, kdoctools
+, kconfig
+, kio
+, ki18n
+, kservice
+, kfilemetadata
+, baloo
+, kdelibs4support
+}:
+
+kdeApp {
+  name = "baloo-widgets";
+  nativeBuildInputs = [
+    extra-cmake-modules
+    kdoctools
+  ];
+  buildInputs = [
+    kconfig
+    kio
+    ki18n
+    kservice
+    kfilemetadata
+    baloo
+    kdelibs4support
+  ];
+  meta = {
+    license = [ lib.licenses.lgpl21 ];
+    maintainers = [ lib.maintainers.ttuegel ];
+  };
+}
diff --git a/pkgs/applications/kde-apps-15.08/default.nix b/pkgs/applications/kde-apps-15.08/default.nix
new file mode 100644
index 000000000000..45484964ff92
--- /dev/null
+++ b/pkgs/applications/kde-apps-15.08/default.nix
@@ -0,0 +1,68 @@
+# Maintainer's Notes:
+#
+# Minor updates:
+#  1. Edit ./manifest.sh to point to the updated URL. Upstream sometimes
+#     releases updates that include only the changed packages; in this case,
+#     multiple URLs can be provided and the results will be merged.
+#  2. Run ./manifest.sh and ./dependencies.sh.
+#  3. Build and enjoy.
+#
+# Major updates:
+#  We prefer not to immediately overwrite older versions with major updates, so
+#  make a copy of this directory first. After copying, be sure to delete ./tmp
+#  if it exists. Then follow the minor update instructions.
+
+{ pkgs, debug ? false }:
+
+let
+
+  inherit (pkgs) lib stdenv;
+
+  srcs = import ./srcs.nix { inherit (pkgs) fetchurl; inherit mirror; };
+  mirror = "mirror://kde";
+
+  kdeApp = args:
+    let
+      inherit (args) name;
+      sname = args.sname or name;
+      inherit (srcs."${sname}") src version;
+    in stdenv.mkDerivation (args // {
+      name = "${name}-${version}";
+      inherit src;
+
+      cmakeFlags =
+        (args.cmakeFlags or [])
+        ++ [ "-DBUILD_TESTING=OFF" ]
+        ++ lib.optional debug "-DCMAKE_BUILD_TYPE=Debug";
+
+      meta = {
+        platforms = lib.platforms.linux;
+        homepage = "http://www.kde.org";
+      } // (args.meta or {});
+    });
+
+  packages = self: with self; {
+    kdelibs = callPackage ./kdelibs { inherit (pkgs) attica phonon; };
+
+    ark = callPackage ./ark.nix {};
+    baloo-widgets = callPackage ./baloo-widgets.nix {};
+    dolphin = callPackage ./dolphin.nix {};
+    dolphin-plugins = callPackage ./dolphin-plugins.nix {};
+    ffmpegthumbs = callPackage ./ffmpegthumbs.nix {};
+    gpgmepp = callPackage ./gpgmepp.nix {};
+    gwenview = callPackage ./gwenview.nix {};
+    kate = callPackage ./kate.nix {};
+    kdegraphics-thumbnailers = callPackage ./kdegraphics-thumbnailers.nix {};
+    kgpg = callPackage ./kgpg.nix { inherit (pkgs.kde4) kdepimlibs; };
+    konsole = callPackage ./konsole.nix {};
+    ksnapshot = callPackage ./ksnapshot.nix {};
+    libkdcraw = callPackage ./libkdcraw.nix {};
+    libkexiv2 = callPackage ./libkexiv2.nix {};
+    libkipi = callPackage ./libkipi.nix {};
+    okular = callPackage ./okular.nix {};
+    print-manager = callPackage ./print-manager.nix {};
+  };
+
+  newScope = scope: pkgs.kf513.newScope ({ inherit kdeApp; } // scope);
+
+in lib.makeScope newScope packages
diff --git a/pkgs/applications/kde-apps-15.08/dolphin-plugins.nix b/pkgs/applications/kde-apps-15.08/dolphin-plugins.nix
new file mode 100644
index 000000000000..4eeec1c17e5b
--- /dev/null
+++ b/pkgs/applications/kde-apps-15.08/dolphin-plugins.nix
@@ -0,0 +1,29 @@
+{ kdeApp
+, lib
+, extra-cmake-modules
+, kdoctools
+, kxmlgui
+, ki18n
+, kio
+, kdelibs4support
+, dolphin
+}:
+
+kdeApp {
+  name = "dolphin-plugins";
+  nativeBuildInputs = [
+    extra-cmake-modules
+    kdoctools
+  ];
+  buildInputs = [
+    kxmlgui
+    ki18n
+    kio
+    kdelibs4support
+    dolphin
+  ];
+  meta = {
+    license = [ lib.licenses.gpl2 ];
+    maintainers = [ lib.maintainers.ttuegel ];
+  };
+}
diff --git a/pkgs/applications/kde-apps-15.08/dolphin.nix b/pkgs/applications/kde-apps-15.08/dolphin.nix
new file mode 100644
index 000000000000..1704e9ae2722
--- /dev/null
+++ b/pkgs/applications/kde-apps-15.08/dolphin.nix
@@ -0,0 +1,63 @@
+{ kdeApp
+, lib
+, extra-cmake-modules
+, kdoctools
+, kinit
+, kcmutils
+, kcoreaddons
+, knewstuff
+, ki18n
+, kdbusaddons
+, kbookmarks
+, kconfig
+, kio
+, kparts
+, solid
+, kiconthemes
+, kcompletion
+, ktexteditor
+, kwindowsystem
+, knotifications
+, kactivities
+, phonon
+, baloo
+, baloo-widgets
+, kfilemetadata
+, kdelibs4support
+}:
+
+kdeApp {
+  name = "dolphin";
+  nativeBuildInputs = [
+    extra-cmake-modules
+    kdoctools
+  ];
+  buildInputs = [
+    kinit
+    kcmutils
+    kcoreaddons
+    knewstuff
+    ki18n
+    kdbusaddons
+    kbookmarks
+    kconfig
+    kio
+    kparts
+    solid
+    kiconthemes
+    kcompletion
+    ktexteditor
+    kwindowsystem
+    knotifications
+    kactivities
+    phonon
+    baloo
+    baloo-widgets
+    kfilemetadata
+    kdelibs4support
+  ];
+  meta = {
+    license = with lib.licenses; [ gpl2 fdl12 ];
+    maintainers = [ lib.maintainers.ttuegel ];
+  };
+}
diff --git a/pkgs/applications/kde-apps-15.08/fetchsrcs.sh b/pkgs/applications/kde-apps-15.08/fetchsrcs.sh
new file mode 100755
index 000000000000..e696bb11d93b
--- /dev/null
+++ b/pkgs/applications/kde-apps-15.08/fetchsrcs.sh
@@ -0,0 +1,47 @@
+#! /usr/bin/env nix-shell
+#! nix-shell -i bash -p coreutils findutils gnused nix wget
+
+set -x
+
+# The trailing slash at the end is necessary!
+RELEASE_URL="http://download.kde.org/stable/applications/15.08.1/"
+EXTRA_WGET_ARGS='-A *.tar.xz'
+
+mkdir tmp; cd tmp
+
+wget -nH -r -c --no-parent $RELEASE_URL $EXTRA_WGET_ARGS
+
+cat >../srcs.nix <<EOF
+# DO NOT EDIT! This file is generated automatically by manifest.sh
+{ fetchurl, mirror }:
+
+{
+EOF
+
+workdir=$(pwd)
+
+find . | while read src; do
+    if [[ -f "${src}" ]]; then
+        url="${src:2}"
+        # Sanitize file name
+        filename=$(basename "$src" | tr '@' '_')
+        nameversion="${filename%.tar.*}"
+        name=$(echo "$nameversion" | sed -e 's,-[[:digit:]].*,,' | sed -e 's,-opensource-src$,,')
+        version=$(echo "$nameversion" | sed -e 's,^\([[:alpha:]][[:alnum:]]*-\)\+,,')
+        sha256=$(nix-hash --type sha256 --base32 --flat "$src")
+        cat >>../srcs.nix <<EOF
+  $name = {
+    version = "$version";
+    src = fetchurl {
+      url = "\${mirror}/$url";
+      sha256 = "$sha256";
+      name = "$filename";
+    };
+  };
+EOF
+    fi
+done
+
+echo "}" >>../srcs.nix
+
+cd ..
diff --git a/pkgs/applications/kde-apps-15.08/ffmpegthumbs.nix b/pkgs/applications/kde-apps-15.08/ffmpegthumbs.nix
new file mode 100644
index 000000000000..64f7961e7c7f
--- /dev/null
+++ b/pkgs/applications/kde-apps-15.08/ffmpegthumbs.nix
@@ -0,0 +1,27 @@
+{ kdeApp
+, lib
+, automoc4
+, cmake
+, perl
+, pkgconfig
+, kdelibs
+, ffmpeg
+}:
+
+kdeApp {
+  name = "ffmpegthumbs";
+  nativeBuildInputs = [
+    automoc4
+    cmake
+    perl
+    pkgconfig
+  ];
+  buildInputs = [
+    kdelibs
+    ffmpeg
+  ];
+  meta = {
+    license = with lib.licenses; [ gpl2 bsd3 ];
+    maintainers = [ lib.maintainers.ttuegel ];
+  };
+}
diff --git a/pkgs/applications/kde-apps-15.08/gpgmepp.nix b/pkgs/applications/kde-apps-15.08/gpgmepp.nix
new file mode 100644
index 000000000000..ac14573dcaa3
--- /dev/null
+++ b/pkgs/applications/kde-apps-15.08/gpgmepp.nix
@@ -0,0 +1,21 @@
+{ kdeApp
+, lib
+, extra-cmake-modules
+, boost
+, gpgme
+}:
+
+kdeApp {
+  name = "gpgmepp";
+  nativeBuildInputs = [
+    extra-cmake-modules
+  ];
+  buildInputs = [
+    boost
+    gpgme
+  ];
+  meta = {
+    license = with lib.licenses; [ lgpl21 bsd3 ];
+    maintainers = [ lib.maintainers.ttuegel ];
+  };
+}
diff --git a/pkgs/applications/kde-apps-15.08/gwenview.nix b/pkgs/applications/kde-apps-15.08/gwenview.nix
new file mode 100644
index 000000000000..27d20369128a
--- /dev/null
+++ b/pkgs/applications/kde-apps-15.08/gwenview.nix
@@ -0,0 +1,37 @@
+{ kdeApp
+, lib
+, extra-cmake-modules
+, kdoctools
+, baloo
+, exiv2
+, kactivities
+, kdelibs4support
+, kio
+, lcms2
+, phonon
+, qtsvg
+, qtx11extras
+}:
+
+kdeApp {
+  name = "gwenview";
+  nativeBuildInputs = [
+    extra-cmake-modules
+    kdoctools
+  ];
+  buildInputs = [
+    baloo
+    exiv2
+    kactivities
+    kdelibs4support
+    kio
+    lcms2
+    phonon
+    qtsvg
+    qtx11extras
+  ];
+  meta = {
+    license = with lib.licenses; [ gpl2 fdl12 ];
+    maintainers = [ lib.maintainers.ttuegel ];
+  };
+}
diff --git a/pkgs/applications/kde-apps-15.08/kate.nix b/pkgs/applications/kde-apps-15.08/kate.nix
new file mode 100644
index 000000000000..b24ef0b863f6
--- /dev/null
+++ b/pkgs/applications/kde-apps-15.08/kate.nix
@@ -0,0 +1,63 @@
+{ kdeApp
+, lib
+, extra-cmake-modules
+, kdoctools
+, qtscript
+, kactivities
+, kconfig
+, kcrash
+, kguiaddons
+, kiconthemes
+, ki18n
+, kinit
+, kjobwidgets
+, kio
+, kparts
+, ktexteditor
+, kwindowsystem
+, kxmlgui
+, kdbusaddons
+, kwallet
+, plasma-framework
+, kitemmodels
+, knotifications
+, threadweaver
+, knewstuff
+, libgit2
+}:
+
+kdeApp {
+  name = "kate";
+  nativeBuildInputs = [
+    extra-cmake-modules
+    kdoctools
+  ];
+  buildInputs = [
+    qtscript
+    kactivities
+    kconfig
+    kcrash
+    kguiaddons
+    kiconthemes
+    ki18n
+    kinit
+    kjobwidgets
+    kio
+    kparts
+    ktexteditor
+    kwindowsystem
+    kxmlgui
+    kdbusaddons
+    kwallet
+    plasma-framework
+    kitemmodels
+    knotifications
+    threadweaver
+    knewstuff
+    libgit2
+  ];
+  meta = {
+    license = with lib.licenses; [ gpl3 lgpl3 lgpl2 ];
+    maintainers = [ lib.maintainers.ttuegel ];
+  };
+}
diff --git a/pkgs/applications/kde-apps-15.08/kdegraphics-thumbnailers.nix b/pkgs/applications/kde-apps-15.08/kdegraphics-thumbnailers.nix
new file mode 100644
index 000000000000..027b8248c5cd
--- /dev/null
+++ b/pkgs/applications/kde-apps-15.08/kdegraphics-thumbnailers.nix
@@ -0,0 +1,29 @@
+{ kdeApp
+, lib
+, automoc4
+, cmake
+, perl
+, pkgconfig
+, kdelibs
+, libkexiv2
+, libkdcraw
+}:
+
+kdeApp {
+  name = "kdegraphics-thumbnailers";
+  nativeBuildInputs = [
+    automoc4
+    cmake
+    perl
+    pkgconfig
+  ];
+  buildInputs = [
+    kdelibs
+    libkexiv2
+    libkdcraw
+  ];
+  meta = {
+    license = [ lib.licenses.lgpl21 ];
+    maintainers = [ lib.maintainers.ttuegel ];
+  };
+}
diff --git a/pkgs/applications/kde-apps-15.08/kdelibs/0001-old-kde4-cmake-policies.patch b/pkgs/applications/kde-apps-15.08/kdelibs/0001-old-kde4-cmake-policies.patch
new file mode 100644
index 000000000000..b7d7300e9a84
--- /dev/null
+++ b/pkgs/applications/kde-apps-15.08/kdelibs/0001-old-kde4-cmake-policies.patch
@@ -0,0 +1,56 @@
+From b43c49109694940f0a26240753e879eb629dd02d Mon Sep 17 00:00:00 2001
+From: Thomas Tuegel <ttuegel@gmail.com>
+Date: Mon, 7 Sep 2015 13:54:57 -0500
+Subject: [PATCH 1/2] old kde4 cmake policies
+
+---
+ cmake/modules/FindKDE4Internal.cmake | 33 +++++++++++++++++++++++++++++++++
+ 1 file changed, 33 insertions(+)
+
+diff --git a/cmake/modules/FindKDE4Internal.cmake b/cmake/modules/FindKDE4Internal.cmake
+index 7d54b9b..c435571 100644
+--- a/cmake/modules/FindKDE4Internal.cmake
++++ b/cmake/modules/FindKDE4Internal.cmake
+@@ -345,6 +345,39 @@
+ # Redistribution and use is allowed according to the terms of the BSD license.
+ # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+ 
++# this is required now by cmake 2.6 and so must not be skipped by if(KDE4_FOUND) below
++cmake_minimum_required(VERSION 2.8.9 FATAL_ERROR)
++# set the cmake policies to the 2.4.x compatibility settings (may change for KDE 4.3)
++cmake_policy(VERSION 2.4.5)
++
++# CMake 2.6, set compatibility behaviour to cmake 2.4
++# this must be executed always, because the CMAKE_MINIMUM_REQUIRED() command above
++# resets the policy settings, so we get a lot of warnings
++
++# CMP0000: don't require cmake_minimum_version() directly in the top level CMakeLists.txt, FindKDE4Internal.cmake is good enough
++cmake_policy(SET CMP0000 OLD)
++# CMP0002: in KDE4 we have multiple targets with the same name for the unit tests
++cmake_policy(SET CMP0002 OLD)
++# CMP0003: add the link paths to the link command as with cmake 2.4
++cmake_policy(SET CMP0003 OLD)
++# CMP0005: keep escaping behaviour for definitions added via add_definitions()
++cmake_policy(SET CMP0005 OLD)
++# since cmake 2.6.3: NEW behaviour is that setting policies doesn't "escape" the file
++# where this is done, macros and functions are executed with the policies as they
++# were when the were defined. Keep the OLD behaviour so we can set the policies here
++# for all KDE software without the big warning
++cmake_policy(SET CMP0011 OLD)
++
++# since cmake 2.8.4: when include()ing from inside cmake's module dir, prefer the files
++# in this directory over those from CMAKE_MODULE_PATH
++cmake_policy(SET CMP0017 NEW)
++
++# since cmake 3.0: use of the LOCATION target property is disallowed while it is used in KDE4Macros.cmake
++if (POLICY CMP0026)
++  cmake_policy(SET CMP0026 OLD)
++endif (POLICY CMP0026)
++
++
+ # Only do something if it hasn't been found yet
+ if(NOT KDE4_FOUND)
+ 
+-- 
+2.5.0
+
diff --git a/pkgs/applications/kde-apps-15.08/kdelibs/0002-polkit-install-path.patch b/pkgs/applications/kde-apps-15.08/kdelibs/0002-polkit-install-path.patch
new file mode 100644
index 000000000000..ff0306ea1488
--- /dev/null
+++ b/pkgs/applications/kde-apps-15.08/kdelibs/0002-polkit-install-path.patch
@@ -0,0 +1,25 @@
+From fab35bac146a817f3af80f45531355fd70cd226b Mon Sep 17 00:00:00 2001
+From: Thomas Tuegel <ttuegel@gmail.com>
+Date: Mon, 7 Sep 2015 13:56:03 -0500
+Subject: [PATCH 2/2] polkit install path
+
+---
+ kdecore/auth/ConfigureChecks.cmake | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/kdecore/auth/ConfigureChecks.cmake b/kdecore/auth/ConfigureChecks.cmake
+index 7cf9cb5..c8334ae 100644
+--- a/kdecore/auth/ConfigureChecks.cmake
++++ b/kdecore/auth/ConfigureChecks.cmake
+@@ -150,7 +150,7 @@ elseif(KDE4_AUTH_BACKEND_NAME STREQUAL "POLKITQT-1")
+         ${CMAKE_INSTALL_PREFIX} _KDE4_AUTH_POLICY_FILES_INSTALL_DIR
+         ${POLKITQT-1_POLICY_FILES_INSTALL_DIR})
+ 
+-    set(KDE4_AUTH_POLICY_FILES_INSTALL_DIR ${_KDE4_AUTH_POLICY_FILES_INSTALL_DIR} CACHE STRING 
++    set(KDE4_AUTH_POLICY_FILES_INSTALL_DIR "\${CMAKE_INSTALL_PREFIX}/share/polkit-1/actions" CACHE STRING 
+         "Where policy files generated by KAuth will be installed" FORCE)
+ elseif(KDE4_AUTH_BACKEND_NAME STREQUAL "FAKE")
+     set (KAUTH_COMPILING_FAKE_BACKEND TRUE)
+-- 
+2.5.0
+
diff --git a/pkgs/applications/kde-apps-15.08/kdelibs/default.nix b/pkgs/applications/kde-apps-15.08/kdelibs/default.nix
new file mode 100644
index 000000000000..06788006f61e
--- /dev/null
+++ b/pkgs/applications/kde-apps-15.08/kdelibs/default.nix
@@ -0,0 +1,43 @@
+{ kdeApp, attica, attr, automoc4, avahi, bison, cmake
+, docbook_xml_dtd_42, docbook_xsl, flex, giflib, herqq, ilmbase
+, libdbusmenu_qt, libjpeg, libxml2, libxslt, perl, phonon, pkgconfig
+, polkit_qt4, qca2, qt4, shared_desktop_ontologies, shared_mime_info
+, soprano, strigi, udev, xz
+, lib
+}:
+
+kdeApp {
+  name = "kdelibs";
+
+  buildInputs = [
+    attica attr avahi giflib herqq libdbusmenu_qt libjpeg libxml2
+    polkit_qt4 qca2 shared_desktop_ontologies udev xz
+  ];
+  propagatedBuildInputs = [ qt4 soprano phonon strigi ];
+  nativeBuildInputs = [
+    automoc4 bison cmake flex libxslt perl pkgconfig shared_mime_info
+  ];
+
+  patches = [
+    ./0001-old-kde4-cmake-policies.patch
+    ./0002-polkit-install-path.patch
+  ];
+
+  # cmake does not detect path to `ilmbase`
+  NIX_CFLAGS_COMPILE = "-I${ilmbase}/include/OpenEXR";
+
+  cmakeFlags = [
+    "-DDOCBOOKXML_CURRENTDTD_DIR=${docbook_xml_dtd_42}/xml/dtd/docbook"
+    "-DDOCBOOKXSL_DIR=${docbook_xsl}/xml/xsl/docbook"
+    "-DHUPNP_ENABLED=ON"
+    "-DWITH_SOLID_UDISKS2=ON"
+    "-DKDE_DEFAULT_HOME=.kde"
+  ];
+
+  setupHook = ./setup-hook.sh;
+
+  meta = {
+    licenses = with lib.licenses; [ gpl2 fdl12 lgpl21 ];
+    maintainers = [ lib.maintainers.ttuegel ];
+  };
+}
diff --git a/pkgs/applications/kde-apps-15.08/kdelibs/polkit-install.patch b/pkgs/applications/kde-apps-15.08/kdelibs/polkit-install.patch
new file mode 100644
index 000000000000..d2ecac663ec5
--- /dev/null
+++ b/pkgs/applications/kde-apps-15.08/kdelibs/polkit-install.patch
@@ -0,0 +1,12 @@
+diff -ru -x '*~' kdelibs-4.6.90-orig/kdecore/auth/ConfigureChecks.cmake kdelibs-4.6.90/kdecore/auth/ConfigureChecks.cmake
+--- kdelibs-4.6.90-orig/kdecore/auth/ConfigureChecks.cmake	2011-05-20 22:24:54.000000000 +0200
++++ kdelibs-4.6.90/kdecore/auth/ConfigureChecks.cmake	2011-07-12 14:03:00.000000000 +0200
+@@ -139,7 +139,7 @@
+         ${CMAKE_INSTALL_PREFIX} _KDE4_AUTH_POLICY_FILES_INSTALL_DIR
+         ${POLKITQT-1_POLICY_FILES_INSTALL_DIR})
+ 
+-    set(KDE4_AUTH_POLICY_FILES_INSTALL_DIR ${_KDE4_AUTH_POLICY_FILES_INSTALL_DIR} CACHE STRING 
++    set(KDE4_AUTH_POLICY_FILES_INSTALL_DIR "\${CMAKE_INSTALL_PREFIX}/share/polkit-1/actions" CACHE STRING 
+         "Where policy files generated by KAuth will be installed" FORCE)
+ elseif(KDE4_AUTH_BACKEND_NAME STREQUAL "FAKE")
+     set (KAUTH_COMPILING_FAKE_BACKEND TRUE)
diff --git a/pkgs/applications/kde-apps-15.08/kdelibs/setup-hook.sh b/pkgs/applications/kde-apps-15.08/kdelibs/setup-hook.sh
new file mode 100644
index 000000000000..e0a75dc8acd0
--- /dev/null
+++ b/pkgs/applications/kde-apps-15.08/kdelibs/setup-hook.sh
@@ -0,0 +1,10 @@
+addQt4Plugins() {
+  if [[ -d "$1/lib/qt4/plugins" ]]; then
+      propagatedUserEnvPkgs+=" $1"
+  fi
+
+  if [[ -d "$1/lib/kde4/plugins" ]]; then
+      propagatedUserEnvPkgs+=" $1"
+  fi
+}
+envHooks+=(addQt4Plugins)
diff --git a/pkgs/applications/kde-apps-15.08/kgpg.nix b/pkgs/applications/kde-apps-15.08/kgpg.nix
new file mode 100644
index 000000000000..cf3fe20d5d7e
--- /dev/null
+++ b/pkgs/applications/kde-apps-15.08/kgpg.nix
@@ -0,0 +1,31 @@
+{ kdeApp
+, lib
+, automoc4
+, cmake
+, perl
+, pkgconfig
+, boost
+, gpgme
+, kdelibs
+, kdepimlibs
+}:
+
+kdeApp {
+  name = "kgpg";
+  nativeBuildInputs = [
+    automoc4
+    cmake
+    perl
+    pkgconfig
+  ];
+  buildInputs = [
+    boost
+    gpgme
+    kdelibs
+    kdepimlibs
+  ];
+  meta = {
+    license = [ lib.licenses.gpl2 ];
+    maintainers = [ lib.maintainers.ttuegel ];
+  };
+}
diff --git a/pkgs/applications/kde-apps-15.08/konsole.nix b/pkgs/applications/kde-apps-15.08/konsole.nix
new file mode 100644
index 000000000000..05cac334348e
--- /dev/null
+++ b/pkgs/applications/kde-apps-15.08/konsole.nix
@@ -0,0 +1,61 @@
+{ kdeApp
+, lib
+, extra-cmake-modules
+, kdoctools
+, qtscript
+, kbookmarks
+, kcompletion
+, kconfig
+, kconfigwidgets
+, kcoreaddons
+, kguiaddons
+, ki18n
+, kiconthemes
+, kinit
+, kdelibs4support
+, kio
+, knotifications
+, knotifyconfig
+, kparts
+, kpty
+, kservice
+, ktextwidgets
+, kwidgetsaddons
+, kwindowsystem
+, kxmlgui
+}:
+
+kdeApp {
+  name = "konsole";
+  nativeBuildInputs = [
+    extra-cmake-modules
+    kdoctools
+  ];
+  buildInputs = [
+    qtscript
+    kbookmarks
+    kcompletion
+    kconfig
+    kconfigwidgets
+    kcoreaddons
+    kguiaddons
+    ki18n
+    kiconthemes
+    kinit
+    kdelibs4support
+    kio
+    knotifications
+    knotifyconfig
+    kparts
+    kpty
+    kservice
+    ktextwidgets
+    kwidgetsaddons
+    kwindowsystem
+    kxmlgui
+  ];
+  meta = {
+    license = with lib.licenses; [ gpl2 lgpl21 fdl12 ];
+    maintainers = [ lib.maintainers.ttuegel ];
+  };
+}
diff --git a/pkgs/applications/kde-apps-15.08/ksnapshot.nix b/pkgs/applications/kde-apps-15.08/ksnapshot.nix
new file mode 100644
index 000000000000..b757f4f04037
--- /dev/null
+++ b/pkgs/applications/kde-apps-15.08/ksnapshot.nix
@@ -0,0 +1,29 @@
+{ kdeApp
+, lib
+, automoc4
+, cmake
+, perl
+, pkgconfig
+, kdelibs
+, libkipi
+, libXfixes
+}:
+
+kdeApp {
+  name = "ksnapshot";
+  nativeBuildInputs = [
+    automoc4
+    cmake
+    perl
+    pkgconfig
+  ];
+  buildInputs = [
+    kdelibs
+    libkipi
+    libXfixes
+  ];
+  meta = {
+    license = with lib.licenses; [ gpl2 lgpl21 fdl12 ];
+    maintainers = [ lib.maintainers.ttuegel ];
+  };
+}
diff --git a/pkgs/applications/kde-apps-15.08/libkdcraw.nix b/pkgs/applications/kde-apps-15.08/libkdcraw.nix
new file mode 100644
index 000000000000..8b19e9f90c64
--- /dev/null
+++ b/pkgs/applications/kde-apps-15.08/libkdcraw.nix
@@ -0,0 +1,27 @@
+{ kdeApp
+, lib
+, automoc4
+, cmake
+, perl
+, pkgconfig
+, libraw
+, kdelibs
+}:
+
+kdeApp {
+  name = "libkdcraw";
+  nativeBuildInputs = [
+    automoc4
+    cmake
+    perl
+    pkgconfig
+  ];
+  buildInputs = [
+    kdelibs
+    libraw
+  ];
+  meta = {
+    license = with lib.licenses; [ gpl2 lgpl21 bsd3 ];
+    maintainers = [ lib.maintainers.ttuegel ];
+  };
+}
diff --git a/pkgs/applications/kde-apps-15.08/libkexiv2.nix b/pkgs/applications/kde-apps-15.08/libkexiv2.nix
new file mode 100644
index 000000000000..8ed842369556
--- /dev/null
+++ b/pkgs/applications/kde-apps-15.08/libkexiv2.nix
@@ -0,0 +1,27 @@
+{ kdeApp
+, lib
+, automoc4
+, cmake
+, perl
+, pkgconfig
+, exiv2
+, kdelibs
+}:
+
+kdeApp {
+  name = "libkexiv2";
+  nativeBuildInputs = [
+    automoc4
+    cmake
+    perl
+    pkgconfig
+  ];
+  buildInputs = [
+    exiv2
+    kdelibs
+  ];
+  meta = {
+    license = with lib.licenses; [ gpl2 lgpl21 bsd3 ];
+    maintainers = [ lib.maintainers.ttuegel ];
+  };
+}
diff --git a/pkgs/applications/kde-apps-15.08/libkipi.nix b/pkgs/applications/kde-apps-15.08/libkipi.nix
new file mode 100644
index 000000000000..a9053b467f93
--- /dev/null
+++ b/pkgs/applications/kde-apps-15.08/libkipi.nix
@@ -0,0 +1,25 @@
+{ kdeApp
+, lib
+, automoc4
+, cmake
+, perl
+, pkgconfig
+, kdelibs
+}:
+
+kdeApp {
+  name = "libkipi";
+  nativeBuildInputs = [
+    automoc4
+    cmake
+    perl
+    pkgconfig
+  ];
+  buildInputs = [
+    kdelibs
+  ];
+  meta = {
+    license = with lib.licenses; [ gpl2 lgpl21 bsd3 ];
+    maintainers = [ lib.maintainers.ttuegel ];
+  };
+}
diff --git a/pkgs/applications/kde-apps-15.08/okular.nix b/pkgs/applications/kde-apps-15.08/okular.nix
new file mode 100644
index 000000000000..0691325d7a52
--- /dev/null
+++ b/pkgs/applications/kde-apps-15.08/okular.nix
@@ -0,0 +1,41 @@
+{ kdeApp
+, lib
+, automoc4
+, cmake
+, perl
+, pkgconfig
+, kdelibs
+, qimageblitz
+, poppler_qt4
+, libspectre
+, libkexiv2
+, djvulibre
+, libtiff
+, freetype
+, ebook_tools
+}:
+
+kdeApp {
+  name = "okular";
+  nativeBuildInputs = [
+    automoc4
+    cmake
+    perl
+    pkgconfig
+  ];
+  buildInputs = [
+    kdelibs
+    qimageblitz
+    poppler_qt4
+    libspectre
+    libkexiv2
+    djvulibre
+    libtiff
+    freetype
+    ebook_tools
+  ];
+  meta = {
+    license = with lib.licenses; [ gpl2 lgpl21 fdl12 bsd3 ];
+    maintainers = [ lib.maintainers.ttuegel ];
+  };
+}
diff --git a/pkgs/applications/kde-apps-15.08/print-manager.nix b/pkgs/applications/kde-apps-15.08/print-manager.nix
new file mode 100644
index 000000000000..909aea8e716c
--- /dev/null
+++ b/pkgs/applications/kde-apps-15.08/print-manager.nix
@@ -0,0 +1,45 @@
+{ kdeApp
+, lib
+, extra-cmake-modules
+, qtdeclarative
+, cups
+, kconfig
+, kconfigwidgets
+, kdbusaddons
+, kiconthemes
+, ki18n
+, kcmutils
+, kio
+, knotifications
+, plasma-framework
+, kwidgetsaddons
+, kwindowsystem
+, kitemviews
+}:
+
+kdeApp {
+  name = "print-manager";
+  nativeBuildInputs = [
+    extra-cmake-modules
+  ];
+  buildInputs = [
+    qtdeclarative
+    cups
+    kconfig
+    kconfigwidgets
+    kdbusaddons
+    kiconthemes
+    ki18n
+    kcmutils
+    kio
+    knotifications
+    plasma-framework
+    kwidgetsaddons
+    kwindowsystem
+    kitemviews
+  ];
+  meta = {
+    license = [ lib.licenses.gpl2 ];
+    maintainers = [ lib.maintainers.ttuegel ];
+  };
+}
diff --git a/pkgs/applications/kde-apps-15.08/srcs.nix b/pkgs/applications/kde-apps-15.08/srcs.nix
new file mode 100644
index 000000000000..97e1e774303a
--- /dev/null
+++ b/pkgs/applications/kde-apps-15.08/srcs.nix
@@ -0,0 +1,1981 @@
+# DO NOT EDIT! This file is generated automatically by manifest.sh
+{ fetchurl, mirror }:
+
+{
+  libkcompactdisc = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/libkcompactdisc-15.08.1.tar.xz";
+      sha256 = "19b6zjzdmjagz9d9x1bb46cc59r92qm9g0pbvim9br603crwsasd";
+      name = "libkcompactdisc-15.08.1.tar.xz";
+    };
+  };
+  kollision = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kollision-15.08.1.tar.xz";
+      sha256 = "03bm9ydrfq0kicf7j2bmrvjgcffciq7ys0fz0xpcllkwglidsnar";
+      name = "kollision-15.08.1.tar.xz";
+    };
+  };
+  libkmahjongg = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/libkmahjongg-15.08.1.tar.xz";
+      sha256 = "1jpcj2kj9wn6988gzz4csrwy4c2pwbnyi184iq6c39fmbvrv4f2r";
+      name = "libkmahjongg-15.08.1.tar.xz";
+    };
+  };
+  superkaramba = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/superkaramba-15.08.1.tar.xz";
+      sha256 = "0pk7kr2bcj2yasf9af3bdqg207pidkg5m2yafmvp83dz2anyxad9";
+      name = "superkaramba-15.08.1.tar.xz";
+    };
+  };
+  kcharselect = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kcharselect-15.08.1.tar.xz";
+      sha256 = "0g785ab5iclv1db2dwwlzf14a2l6n9yznw6pb8hx589za7yc46v2";
+      name = "kcharselect-15.08.1.tar.xz";
+    };
+  };
+  umbrello = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/umbrello-15.08.1.tar.xz";
+      sha256 = "0pq2d4iz1dmxb7cdmcja65703qlsakp590v5yjvhjsnlasnk8anj";
+      name = "umbrello-15.08.1.tar.xz";
+    };
+  };
+  kde-runtime = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-runtime-15.08.1.tar.xz";
+      sha256 = "04vx2v9m5dz5jihvmqvcd6pvk312hdhgj7pkzv8q0lg3z81fqgyi";
+      name = "kde-runtime-15.08.1.tar.xz";
+    };
+  };
+  kcontacts = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kcontacts-15.08.1.tar.xz";
+      sha256 = "1a9ww08m3k7sdqnkb2dpi2c0fpfihjschyzwx82kcp1z613agx1c";
+      name = "kcontacts-15.08.1.tar.xz";
+    };
+  };
+  kontactinterface = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kontactinterface-15.08.1.tar.xz";
+      sha256 = "1axsixl5yvawrczpgfbrcyax9d9mmc8yjvkxi0hi26mq8zzxkxnm";
+      name = "kontactinterface-15.08.1.tar.xz";
+    };
+  };
+  ktp-desktop-applets = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/ktp-desktop-applets-15.08.1.tar.xz";
+      sha256 = "16nan7vb2gzpll2fnc4li23sjjxhgy7ijzfp6zcp5gc1bxn86jj4";
+      name = "ktp-desktop-applets-15.08.1.tar.xz";
+    };
+  };
+  kldap = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kldap-15.08.1.tar.xz";
+      sha256 = "13mn0zkyd8qkp2rlcd75g821k3xpvwrj6xwjwvllfn25zsng32yw";
+      name = "kldap-15.08.1.tar.xz";
+    };
+  };
+  kaccounts-providers = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kaccounts-providers-15.08.1.tar.xz";
+      sha256 = "15sl3rwwpshqvzjrkfiray3gg3ja84awsyk3y5n9jbf97rw47v3k";
+      name = "kaccounts-providers-15.08.1.tar.xz";
+    };
+  };
+  signon-kwallet-extension = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/signon-kwallet-extension-15.08.1.tar.xz";
+      sha256 = "1pb73zqs34kygvaphgrvvl08hj882znsws1nzwbyyskyn6gjsw2n";
+      name = "signon-kwallet-extension-15.08.1.tar.xz";
+    };
+  };
+  klines = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/klines-15.08.1.tar.xz";
+      sha256 = "17vnbk0qbiynyjycj5nda9w38ija5cvhlfhji1f580hq156qzsgl";
+      name = "klines-15.08.1.tar.xz";
+    };
+  };
+  kompare = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kompare-15.08.1.tar.xz";
+      sha256 = "0n474f1nvbkxj1ryyv2x0yqm9qg3crdzmr30l2fbagi2fxmjxkli";
+      name = "kompare-15.08.1.tar.xz";
+    };
+  };
+  analitza = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/analitza-15.08.1.tar.xz";
+      sha256 = "0zxkpsccnp0m8r7z1p243h5vh4fz4dzq2dz932vfac8hs45lcaki";
+      name = "analitza-15.08.1.tar.xz";
+    };
+  };
+  kalzium = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kalzium-15.08.1.tar.xz";
+      sha256 = "0jhfv5cw5vhgy13ld5km664r7ydqv52nwd4k450x2d62rvq63nfp";
+      name = "kalzium-15.08.1.tar.xz";
+    };
+  };
+  kcachegrind = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kcachegrind-15.08.1.tar.xz";
+      sha256 = "1nmyw0nld1qasd2zz8dg854br8nqn3kby2xd2afr9a8frhzzmiv2";
+      name = "kcachegrind-15.08.1.tar.xz";
+    };
+  };
+  kuser = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kuser-15.08.1.tar.xz";
+      sha256 = "0qgvjfh1r4ri227zbcb2v9dg7njg1wq3pi189y0l3jzgfa4h1aph";
+      name = "kuser-15.08.1.tar.xz";
+    };
+  };
+  libkgeomap = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/libkgeomap-15.08.1.tar.xz";
+      sha256 = "18y3pas4bx16ykf50jlwry7fbrx34cz1s0qflirxyrx6n8kh9lgm";
+      name = "libkgeomap-15.08.1.tar.xz";
+    };
+  };
+  artikulate = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/artikulate-15.08.1.tar.xz";
+      sha256 = "0pz66hrnd89519ivk1cw8gzddjv6043x59nbkhmnlk8f5hvvkk2k";
+      name = "artikulate-15.08.1.tar.xz";
+    };
+  };
+  kscd = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kscd-15.08.1.tar.xz";
+      sha256 = "0alf1088p32spwlpjjj91wpgk48ahzqphvag8adgvh9cp8ij7m7j";
+      name = "kscd-15.08.1.tar.xz";
+    };
+  };
+  akonadi-calendar = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/akonadi-calendar-15.08.1.tar.xz";
+      sha256 = "00iyv123s18157v46y3xdg56lyfr0w6f0zz8qsp6js7vn0fa468j";
+      name = "akonadi-calendar-15.08.1.tar.xz";
+    };
+  };
+  kdesdk-strigi-analyzers = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kdesdk-strigi-analyzers-15.08.1.tar.xz";
+      sha256 = "1g2c511ba42mxg955yyh8w45ga5313mvvpkdl7yvbz7ikb2z6ji5";
+      name = "kdesdk-strigi-analyzers-15.08.1.tar.xz";
+    };
+  };
+  killbots = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/killbots-15.08.1.tar.xz";
+      sha256 = "1p7lxi3rh8ghashy04252wc086kxz1crdxgnisfw4dv4kr17qmb2";
+      name = "killbots-15.08.1.tar.xz";
+    };
+  };
+  ksirk = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/ksirk-15.08.1.tar.xz";
+      sha256 = "00zlmjyxf31hl910kickgxcc3sh5g2j9grg2mlps8qxdv9m4g1d5";
+      name = "ksirk-15.08.1.tar.xz";
+    };
+  };
+  ark = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/ark-15.08.1.tar.xz";
+      sha256 = "0lmqi9qdf46v9yap6f7s5favx4y66w3sixhplby4q1cm085yg5hl";
+      name = "ark-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-el = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-el-15.08.1.tar.xz";
+      sha256 = "0qznnbk6mgbdjz4mm7rpmr04b6i9fya1yjhnmv8hpwlicl8n9sd6";
+      name = "kde-l10n-el-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-ug = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-ug-15.08.1.tar.xz";
+      sha256 = "1brnbjnpwqhh52g058s2hqh77a6p2c81sygdfsjgngc0griahl4q";
+      name = "kde-l10n-ug-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-sl = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-sl-15.08.1.tar.xz";
+      sha256 = "12gg889lhq6l1h5bv6hlcwsq2zkqdfxgicxhkjnm3i7ly5laij4f";
+      name = "kde-l10n-sl-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-ar = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-ar-15.08.1.tar.xz";
+      sha256 = "101c1316wwxl3pf38fb9ch2h5nyra8h2cf79w9l1krdcp6s4776w";
+      name = "kde-l10n-ar-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-wa = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-wa-15.08.1.tar.xz";
+      sha256 = "0z9s118fc0wj2dg2ha7mv0rldvsa3rr8mhwjdgawkmfr9ns82w64";
+      name = "kde-l10n-wa-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-ro = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-ro-15.08.1.tar.xz";
+      sha256 = "0j3qccfwarb9azsvm2pf0ikc12dsbywzfi7hv2xd244qcnjpp289";
+      name = "kde-l10n-ro-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-it = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-it-15.08.1.tar.xz";
+      sha256 = "04blm19llvm2n885p9in4iicaj81ap9vvxsqmfnz7rwb93bsy4wl";
+      name = "kde-l10n-it-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-he = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-he-15.08.1.tar.xz";
+      sha256 = "1fgxnm6l45kcjrgjg19z2fg6fnsbpdy0agllj6rw0ffbcp68l863";
+      name = "kde-l10n-he-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-et = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-et-15.08.1.tar.xz";
+      sha256 = "027vpybfrm6zdmglwlhmyrh6157gmv8i5x1hx5d8f57m8jnh3nfq";
+      name = "kde-l10n-et-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-pa = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-pa-15.08.1.tar.xz";
+      sha256 = "05n9kaalsdx8nvn0p29wf33barhkhb64xxr3xg8cc0d3x21kmhx1";
+      name = "kde-l10n-pa-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-ja = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-ja-15.08.1.tar.xz";
+      sha256 = "0ir82yc2jmy7ijn02y9f2vxnv1cd5a92pjji3fzriqfg6dlgyiw9";
+      name = "kde-l10n-ja-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-bg = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-bg-15.08.1.tar.xz";
+      sha256 = "1r515r3c03328ivwqkm7ijj2264l21liblzllgvjy6zmg7n8ilsp";
+      name = "kde-l10n-bg-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-ko = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-ko-15.08.1.tar.xz";
+      sha256 = "19w7z4j7463lg0yzkf8ndfvf3664hk524qfcrdygf61f03hkp22l";
+      name = "kde-l10n-ko-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-tr = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-tr-15.08.1.tar.xz";
+      sha256 = "1bca3scdg4ma6k6957pq45dmjxgp8hx3bm9jql2rqp0knqf9dwl8";
+      name = "kde-l10n-tr-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-mr = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-mr-15.08.1.tar.xz";
+      sha256 = "0ga55szsi9kbvjdcc2cjl8m15jzcfrpiryak1m78s46p056lfs7n";
+      name = "kde-l10n-mr-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-es = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-es-15.08.1.tar.xz";
+      sha256 = "1bb1vp8k6f323q2rjclxpja9yykfgm2di6wn0qhr787swr6qrxjb";
+      name = "kde-l10n-es-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-hu = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-hu-15.08.1.tar.xz";
+      sha256 = "0jysfqb9pmhcw2kd48n6asmkci56mgk1jcsx8gxn9lcfrqnpc52g";
+      name = "kde-l10n-hu-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-km = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-km-15.08.1.tar.xz";
+      sha256 = "1yjckfma9dj8li9whwfa6bid289z05vllxqigbsjfy12721ahrc6";
+      name = "kde-l10n-km-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-eo = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-eo-15.08.1.tar.xz";
+      sha256 = "07rns0a5bb2sq13hcndvq79zg451lc3rj2cldmdxdyj5axl0c955";
+      name = "kde-l10n-eo-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-pt = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-pt-15.08.1.tar.xz";
+      sha256 = "0z5lginm78i6wrxhcdarv660sszybjih02ra3j4wghflzhwrgrhw";
+      name = "kde-l10n-pt-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-pl = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-pl-15.08.1.tar.xz";
+      sha256 = "0ifjvbvzm5qks35z54i5mdz151347690zg4rn8y033lag81c7ir1";
+      name = "kde-l10n-pl-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-lv = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-lv-15.08.1.tar.xz";
+      sha256 = "105lq8q97dg9y9j5p5zqf78gvk28qn4axr3ppk1j698576l1ihxl";
+      name = "kde-l10n-lv-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-en_GB = {
+    version = "en_GB-15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-en_GB-15.08.1.tar.xz";
+      sha256 = "0rb4pjxds75x84ylc71ci2sj75l5p8vr2hmnrlddmj39j22c3mcj";
+      name = "kde-l10n-en_GB-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-nn = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-nn-15.08.1.tar.xz";
+      sha256 = "01h9xysa8vghaghqpfp7gvps3rymiypb52ffz50srhrhjyh1zq0y";
+      name = "kde-l10n-nn-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-hr = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-hr-15.08.1.tar.xz";
+      sha256 = "0jlnig5rsmdxv3ng352hd8n0vqd020bf00xnjbdihcnvdwq625lv";
+      name = "kde-l10n-hr-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-fi = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-fi-15.08.1.tar.xz";
+      sha256 = "0ajgy01p22h1c2dsarsq7ximwp3blvmxnf9217szikkf5yky2w9m";
+      name = "kde-l10n-fi-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-ia = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-ia-15.08.1.tar.xz";
+      sha256 = "1mgzpzy1s45v6nf2wbqgsam7bdg1x0fkmggnwy8k8f7kx5yxfcw4";
+      name = "kde-l10n-ia-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-ga = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-ga-15.08.1.tar.xz";
+      sha256 = "06l39s9d6y33f4vvcxvry7cxw2m431xgvcz1wcmf6zhlpi5wwlmr";
+      name = "kde-l10n-ga-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-ca = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-ca-15.08.1.tar.xz";
+      sha256 = "0ql4b550wasf31vkvha1kjyv7d0svyxk7wc77v39fbly0agxwbap";
+      name = "kde-l10n-ca-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-de = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-de-15.08.1.tar.xz";
+      sha256 = "11ayw3n392qz1dyblw4gsw4pbdp3wll11z76cawhbmj2jscjd1yb";
+      name = "kde-l10n-de-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-fr = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-fr-15.08.1.tar.xz";
+      sha256 = "1mclsk410ir9y6xvy8j8dswpa3k7hmjng232annq05fzapw7bda6";
+      name = "kde-l10n-fr-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-id = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-id-15.08.1.tar.xz";
+      sha256 = "13lls8w18c8zrfrqfaz2yjn7jcjrv6dsax09l8wda5144xhbsxw3";
+      name = "kde-l10n-id-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-ca_valencia = {
+    version = "ca_valencia-15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-ca@valencia-15.08.1.tar.xz";
+      sha256 = "075j5zbn9fy510bf278j3184niwf8dkdpzihvjsram8xrggl4whl";
+      name = "kde-l10n-ca_valencia-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-nds = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-nds-15.08.1.tar.xz";
+      sha256 = "0ifndqj0d58g6k71qw9n4xhd0a90fqba3xsk2qyd6yhnmygd48xd";
+      name = "kde-l10n-nds-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-nl = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-nl-15.08.1.tar.xz";
+      sha256 = "11jzaf5dbyl52s61031lygn8xf6qjjqaldlyqgljz1scpp13f75b";
+      name = "kde-l10n-nl-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-fa = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-fa-15.08.1.tar.xz";
+      sha256 = "1bai66j03khb6f6y8v72axan6aggdlbwgv3bi91mxwlzhy8ycjxx";
+      name = "kde-l10n-fa-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-da = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-da-15.08.1.tar.xz";
+      sha256 = "10sxs45bvs5qw02pj2qhykymm3ddl6ij3gvwgxj7r1kl84lfkil6";
+      name = "kde-l10n-da-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-uk = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-uk-15.08.1.tar.xz";
+      sha256 = "00f6mjs7nalg8q87ix7h66kqicy7xb9pgkghldbhpal0rqgzscph";
+      name = "kde-l10n-uk-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-eu = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-eu-15.08.1.tar.xz";
+      sha256 = "01jcykc8d7nzlsfjp2xcbf7bkld7skf7mmrig7dllgl0igdkx1qm";
+      name = "kde-l10n-eu-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-sk = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-sk-15.08.1.tar.xz";
+      sha256 = "13fcfrsdn0q7z0p2cxkcl54g597ix17327lyxz0ns4xn9ada198s";
+      name = "kde-l10n-sk-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-kk = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-kk-15.08.1.tar.xz";
+      sha256 = "13zi7yh9hsxmb8v6x2jqlyh4wdb4waj653py27g91rbznsp1fjzp";
+      name = "kde-l10n-kk-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-zh_CN = {
+    version = "zh_CN-15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-zh_CN-15.08.1.tar.xz";
+      sha256 = "0j88zjxihddgi4a53034i5br3jf8v61wp5mcbclci59i4p4cwrh7";
+      name = "kde-l10n-zh_CN-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-lt = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-lt-15.08.1.tar.xz";
+      sha256 = "03g7l9yyw6wajjpkqss16kfyg6piv50xjrzdy8611asdfabhccjs";
+      name = "kde-l10n-lt-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-sv = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-sv-15.08.1.tar.xz";
+      sha256 = "0dvgqf39xiz1fkfxvfn9232j454377d92c72dd0h3yl7mf9nndd7";
+      name = "kde-l10n-sv-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-nb = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-nb-15.08.1.tar.xz";
+      sha256 = "1y51kdmgnirfjsc5ka75rjvbqjbxxchqj2j4430h8jncjgvjvw6d";
+      name = "kde-l10n-nb-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-gl = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-gl-15.08.1.tar.xz";
+      sha256 = "0fapj4gmm4pp5bf3gj6xwnzjxw9094mal7njb0nisshvdfbpgr37";
+      name = "kde-l10n-gl-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-hi = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-hi-15.08.1.tar.xz";
+      sha256 = "0ys05gxcj6vkx4a8xjhwfym6faz6ifh50i5si175rynb6igyydnh";
+      name = "kde-l10n-hi-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-ru = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-ru-15.08.1.tar.xz";
+      sha256 = "1qdgh3y8q7hnkhjfbid35fxy4xjl1hj800kljhif7q4kg4ish86m";
+      name = "kde-l10n-ru-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-sr = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-sr-15.08.1.tar.xz";
+      sha256 = "1ag5fj3iy5kycwgwhxiwcp4xl19j1q1lbk07b6nz69jm12kpsy6i";
+      name = "kde-l10n-sr-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-cs = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-cs-15.08.1.tar.xz";
+      sha256 = "1lmln0q9r7cvkvs0qz2ky01rj8rjbrwl7g3vkz2zyr64gxgnjilz";
+      name = "kde-l10n-cs-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-bs = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-bs-15.08.1.tar.xz";
+      sha256 = "0wyk547g8k3j6lcl1wipw4jwd0wqi8zrnb2h59g55il9rj7782q3";
+      name = "kde-l10n-bs-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-is = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-is-15.08.1.tar.xz";
+      sha256 = "0n3ws9imns4jzvnnrkrm8dk8yzlfjcbxl7ip36m7a09lnnskc4zw";
+      name = "kde-l10n-is-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-zh_TW = {
+    version = "zh_TW-15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-zh_TW-15.08.1.tar.xz";
+      sha256 = "1w4f8wr9c132z4kmqcjknrgp1hh33s08qvyjxysns6ncj6izpaaz";
+      name = "kde-l10n-zh_TW-15.08.1.tar.xz";
+    };
+  };
+  kde-l10n-pt_BR = {
+    version = "pt_BR-15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-l10n/kde-l10n-pt_BR-15.08.1.tar.xz";
+      sha256 = "0dr0h5bxw462mpirzsnvxcy3s14nlk3a2gh5h9r2wis5fii364da";
+      name = "kde-l10n-pt_BR-15.08.1.tar.xz";
+    };
+  };
+  kmix = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kmix-15.08.1.tar.xz";
+      sha256 = "1lpzghasljw07kq9a94lw61l4qlvhif6cd7jypg0vici65lz8k7d";
+      name = "kmix-15.08.1.tar.xz";
+    };
+  };
+  kjumpingcube = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kjumpingcube-15.08.1.tar.xz";
+      sha256 = "1b0mqf9rhbdz4dfd0gbps59zzjqdif30zz642v4yi6mqnc002yv9";
+      name = "kjumpingcube-15.08.1.tar.xz";
+    };
+  };
+  kruler = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kruler-15.08.1.tar.xz";
+      sha256 = "06qlvdyd1cbw8vr2qcqs7q8jylj7kl0y218agp8b60h03nri9psj";
+      name = "kruler-15.08.1.tar.xz";
+    };
+  };
+  poxml = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/poxml-15.08.1.tar.xz";
+      sha256 = "076ksfa9pdjbs8xk38j5z1ysryqcq68fgk5zw157cmxjaxv4ahqm";
+      name = "poxml-15.08.1.tar.xz";
+    };
+  };
+  knavalbattle = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/knavalbattle-15.08.1.tar.xz";
+      sha256 = "1j235kdnb0qx1dkq89gqcwk0qjj16m0iyf502d6p1mz8cskz7fkp";
+      name = "knavalbattle-15.08.1.tar.xz";
+    };
+  };
+  libkexiv2 = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/libkexiv2-15.08.1.tar.xz";
+      sha256 = "0cgbh6g5kqi8lzlnidd19yxlyzid71pncpxikmhqfmnwhdgrqq2f";
+      name = "libkexiv2-15.08.1.tar.xz";
+    };
+  };
+  kcalutils = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kcalutils-15.08.1.tar.xz";
+      sha256 = "0l8kzz092wz93j58h52q4icpvhvl2djgagdbx12yl7qlwin7wnd3";
+      name = "kcalutils-15.08.1.tar.xz";
+    };
+  };
+  palapeli = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/palapeli-15.08.1.tar.xz";
+      sha256 = "09sbyw25ngvcg6inhh7ig0x5yyhsi3gw2il1p98sfdabjk2f8736";
+      name = "palapeli-15.08.1.tar.xz";
+    };
+  };
+  ksudoku = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/ksudoku-15.08.1.tar.xz";
+      sha256 = "1l6dgackab9k1rnzbwwz3rfpxlqvydp5q632ibpqs449c6pk3kww";
+      name = "ksudoku-15.08.1.tar.xz";
+    };
+  };
+  kdebugsettings = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kdebugsettings-15.08.1.tar.xz";
+      sha256 = "1h5wn6ilhkrygjacb592nmdv31791y9r0rx6m3l7xx3nbj9hy12c";
+      name = "kdebugsettings-15.08.1.tar.xz";
+    };
+  };
+  kdegraphics-strigi-analyzer = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kdegraphics-strigi-analyzer-15.08.1.tar.xz";
+      sha256 = "12yby24k5crsyz6mhm2r0wnl306gp7422yj1nrl6yqi16wd37rbs";
+      name = "kdegraphics-strigi-analyzer-15.08.1.tar.xz";
+    };
+  };
+  kturtle = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kturtle-15.08.1.tar.xz";
+      sha256 = "0n6vbj2kvcby62cn8i65dq2rl5jv1zfp9xbg827s6vz681an2sqk";
+      name = "kturtle-15.08.1.tar.xz";
+    };
+  };
+  libkcddb = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/libkcddb-15.08.1.tar.xz";
+      sha256 = "1x26dpr26d6xc73203dbk3vni7hcn1w6jdk94ffs0aaf3bmifal2";
+      name = "libkcddb-15.08.1.tar.xz";
+    };
+  };
+  bomber = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/bomber-15.08.1.tar.xz";
+      sha256 = "08l8ksqzap8hyza7mmf1wwddj8xkl03hsrc0mwvxsvyp7h7v3rxq";
+      name = "bomber-15.08.1.tar.xz";
+    };
+  };
+  ksquares = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/ksquares-15.08.1.tar.xz";
+      sha256 = "17qx89q594w22nd2qhqcmb1wc291b89zs22jh62xrm62yr6h9ijj";
+      name = "ksquares-15.08.1.tar.xz";
+    };
+  };
+  konquest = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/konquest-15.08.1.tar.xz";
+      sha256 = "0ss7gvr8ihk7ip4dhxyps8h1137i5m20m6sf0rv10c2h0y9cy0zk";
+      name = "konquest-15.08.1.tar.xz";
+    };
+  };
+  parley = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/parley-15.08.1.tar.xz";
+      sha256 = "0f88ia58f9lw8rpz1mgr21hslkmwnwwf2ac0affm81b17nxx8zpc";
+      name = "parley-15.08.1.tar.xz";
+    };
+  };
+  kate = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kate-15.08.1.tar.xz";
+      sha256 = "0hrbr4lnmz0hgs856kfb966k85p8ccdzva8h4f6ifvacgxppb5iz";
+      name = "kate-15.08.1.tar.xz";
+    };
+  };
+  baloo-widgets = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/baloo-widgets-15.08.1.tar.xz";
+      sha256 = "021lgivqmahad2b5mwdg4vngyyfi6gcsk3xgn9rbzkxg67k2ivbc";
+      name = "baloo-widgets-15.08.1.tar.xz";
+    };
+  };
+  kbreakout = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kbreakout-15.08.1.tar.xz";
+      sha256 = "1l83iy6iad6npykl4dyh45s5z8pgamdp7aqi2r5c9r4awg16iq48";
+      name = "kbreakout-15.08.1.tar.xz";
+    };
+  };
+  kshisen = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kshisen-15.08.1.tar.xz";
+      sha256 = "1lrn5l4jscbn0ppppshpkh62plskzwy2km9dqp1hp5czpq5zvwk8";
+      name = "kshisen-15.08.1.tar.xz";
+    };
+  };
+  dragon = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/dragon-15.08.1.tar.xz";
+      sha256 = "0ffb0jspckwp8alis70akhrv7kkjq69zba34y61axm67f65izh9l";
+      name = "dragon-15.08.1.tar.xz";
+    };
+  };
+  ktp-common-internals = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/ktp-common-internals-15.08.1.tar.xz";
+      sha256 = "13alrk7zn3vq6khackdbyqbk209ivvcfza9mpqaxxll8sg9r3i3k";
+      name = "ktp-common-internals-15.08.1.tar.xz";
+    };
+  };
+  ktp-text-ui = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/ktp-text-ui-15.08.1.tar.xz";
+      sha256 = "1f7r47rbcciq12c5531qb9wr7xqz7nvsy04jk8gaxwdsr9a97ayf";
+      name = "ktp-text-ui-15.08.1.tar.xz";
+    };
+  };
+  kcalcore = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kcalcore-15.08.1.tar.xz";
+      sha256 = "0dpip8hbc5fb8yw876lig19kp2wi71dkwcb1mj8k49lph09k3460";
+      name = "kcalcore-15.08.1.tar.xz";
+    };
+  };
+  kremotecontrol = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kremotecontrol-15.08.1.tar.xz";
+      sha256 = "01fck27b3ilni2h78lmhq27aq4sw89060bh69xhw8z80iad2bxyy";
+      name = "kremotecontrol-15.08.1.tar.xz";
+    };
+  };
+  ktp-kded-module = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/ktp-kded-module-15.08.1.tar.xz";
+      sha256 = "0l2s07z87q2j92q4w6n16rbvd7xm8k4zgchlk06djb5d9gwdgvl0";
+      name = "ktp-kded-module-15.08.1.tar.xz";
+    };
+  };
+  kapptemplate = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kapptemplate-15.08.1.tar.xz";
+      sha256 = "1pc3dq3h30lx7d51zan52mnz5zwb70g6r84cskkgc2dmws7mrl0k";
+      name = "kapptemplate-15.08.1.tar.xz";
+    };
+  };
+  dolphin-plugins = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/dolphin-plugins-15.08.1.tar.xz";
+      sha256 = "1fpsbxcds2wzivcpc6vf6bqwi658mw4jrlpwd52w2nlsjpmgr31x";
+      name = "dolphin-plugins-15.08.1.tar.xz";
+    };
+  };
+  kpat = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kpat-15.08.1.tar.xz";
+      sha256 = "0cw17agpx23fsmnnvwkjn3xvq59d6hpppgydalnhrqka9321qy2d";
+      name = "kpat-15.08.1.tar.xz";
+    };
+  };
+  akonadi = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/akonadi-15.08.1.tar.xz";
+      sha256 = "19222mzvi34lqdaxavcpx0d1mxfnfynvhv5562rw3d7iqmhvbms6";
+      name = "akonadi-15.08.1.tar.xz";
+    };
+  };
+  kcalc = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kcalc-15.08.1.tar.xz";
+      sha256 = "02xj9n6zv3f3m35g38gsmqnrshbswqkya930sc5nqc0mlyflli6m";
+      name = "kcalc-15.08.1.tar.xz";
+    };
+  };
+  sweeper = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/sweeper-15.08.1.tar.xz";
+      sha256 = "08vk9yq7py576irkg34d3rzkdrzi6bb6zhynbyziyx097sqj5khj";
+      name = "sweeper-15.08.1.tar.xz";
+    };
+  };
+  lokalize = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/lokalize-15.08.1.tar.xz";
+      sha256 = "15xsx430a9w3kr1abvlh4h3spn063992mc76rq17c7a8n1n7zr4b";
+      name = "lokalize-15.08.1.tar.xz";
+    };
+  };
+  step = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/step-15.08.1.tar.xz";
+      sha256 = "15capfa297s4shrr6xwbpg62rn8pimwpmjm11p160g6lqdspwacm";
+      name = "step-15.08.1.tar.xz";
+    };
+  };
+  picmi = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/picmi-15.08.1.tar.xz";
+      sha256 = "16sa0w3bhxbj8f8nl0wh5b639gzi6y45167g3mh62a7di6llw1rm";
+      name = "picmi-15.08.1.tar.xz";
+    };
+  };
+  kig = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kig-15.08.1.tar.xz";
+      sha256 = "0wyvqfsgr1101vmzmsixribvd9plys91dvrx6cj9ji7mf4k5875g";
+      name = "kig-15.08.1.tar.xz";
+    };
+  };
+  ktp-contact-runner = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/ktp-contact-runner-15.08.1.tar.xz";
+      sha256 = "1m8jc39l9d394x3hqlqvc5msy7wi1aki9q8nd4bg6nmdz8v5dxz9";
+      name = "ktp-contact-runner-15.08.1.tar.xz";
+    };
+  };
+  kimap = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kimap-15.08.1.tar.xz";
+      sha256 = "07q4z16jfddh17khdd39dzasjfmnvd2zgdnph24s171815c2x2ps";
+      name = "kimap-15.08.1.tar.xz";
+    };
+  };
+  ksystemlog = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/ksystemlog-15.08.1.tar.xz";
+      sha256 = "1v18f6dcirr6rayaxy8h85swj04g5giafs67h64g9flq5gacykji";
+      name = "ksystemlog-15.08.1.tar.xz";
+    };
+  };
+  kio-extras = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kio-extras-15.08.1.tar.xz";
+      sha256 = "06vnr10a3m4gs5bjz3dqx1bv1sqz3q69ihq1hlih4c8lyy9wd26q";
+      name = "kio-extras-15.08.1.tar.xz";
+    };
+  };
+  blinken = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/blinken-15.08.1.tar.xz";
+      sha256 = "0yh5ay2cpgb45y4any6sanzpwcngfxl98x3gnc5n81zl2kzb9y8m";
+      name = "blinken-15.08.1.tar.xz";
+    };
+  };
+  ktp-send-file = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/ktp-send-file-15.08.1.tar.xz";
+      sha256 = "07pk6d1rzz0hwfsw7nk4grixvvjja219jvr56j50vpnlmlza29xs";
+      name = "ktp-send-file-15.08.1.tar.xz";
+    };
+  };
+  kdiamond = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kdiamond-15.08.1.tar.xz";
+      sha256 = "1f81l6pnwrpirb5v0npcd2452dkdh0llpmzh57gfd8cik0n1agzm";
+      name = "kdiamond-15.08.1.tar.xz";
+    };
+  };
+  kholidays = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kholidays-15.08.1.tar.xz";
+      sha256 = "1i875c7wpp5vlzjyw78bsxgyhmhv2y9846xbv6xi5y4b211iw6lf";
+      name = "kholidays-15.08.1.tar.xz";
+    };
+  };
+  kbounce = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kbounce-15.08.1.tar.xz";
+      sha256 = "127b7c4rpkz04nihqyl7d594k9vwjcvlq0758jfmkxijsgpjc334";
+      name = "kbounce-15.08.1.tar.xz";
+    };
+  };
+  kaccounts-integration = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kaccounts-integration-15.08.1.tar.xz";
+      sha256 = "07kryp71xq2zwfdm05g8mcmkmxhlj2wb2l9fi2sxbhsr360z33mx";
+      name = "kaccounts-integration-15.08.1.tar.xz";
+    };
+  };
+  lskat = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/lskat-15.08.1.tar.xz";
+      sha256 = "13vhfpi34qcv6q56qaxwk89apss8l921a59qvlmadmw999h7ms0s";
+      name = "lskat-15.08.1.tar.xz";
+    };
+  };
+  libkdeedu = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/libkdeedu-15.08.1.tar.xz";
+      sha256 = "09fv1fbxlf6n4k0fyiy49avykpnxbmvi833i6ibm90v9csrfv6hf";
+      name = "libkdeedu-15.08.1.tar.xz";
+    };
+  };
+  libkeduvocdocument = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/libkeduvocdocument-15.08.1.tar.xz";
+      sha256 = "0fz8fkcai1zdmqhvcic689sbwm07zg69z7jw4m6wgk7yqls8mkvq";
+      name = "libkeduvocdocument-15.08.1.tar.xz";
+    };
+  };
+  akonadi-search = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/akonadi-search-15.08.1.tar.xz";
+      sha256 = "0mzhil4ihs2b7k6dg29d5igpwsiwiv6awzvj6b5xn76i4xax1jk1";
+      name = "akonadi-search-15.08.1.tar.xz";
+    };
+  };
+  katomic = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/katomic-15.08.1.tar.xz";
+      sha256 = "0rj6sgh8v8x57fqbjvhik9xcw563nx0dvv8rin05nr22hlid8l9y";
+      name = "katomic-15.08.1.tar.xz";
+    };
+  };
+  kross-interpreters = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kross-interpreters-15.08.1.tar.xz";
+      sha256 = "1lqkmxxw1kz23q4pmmvrwqgi9vkxp0pw6g3zpr0x4zkzsj62q2ff";
+      name = "kross-interpreters-15.08.1.tar.xz";
+    };
+  };
+  audiocd-kio = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/audiocd-kio-15.08.1.tar.xz";
+      sha256 = "0sqh21x12za743xqmyfyd8h4z0wz0nzd2zjp6fzga76xfcryci5j";
+      name = "audiocd-kio-15.08.1.tar.xz";
+    };
+  };
+  mplayerthumbs = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/mplayerthumbs-15.08.1.tar.xz";
+      sha256 = "01l063iply1d4bfdb04agj11imha4fpnv131dcfd39ixi1icv8yb";
+      name = "mplayerthumbs-15.08.1.tar.xz";
+    };
+  };
+  syndication = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/syndication-15.08.1.tar.xz";
+      sha256 = "1kklbw77iiiqfcv8sydy9jkc8g630xw551y6r1jp1wbvrdkjwq47";
+      name = "syndication-15.08.1.tar.xz";
+    };
+  };
+  kqtquickcharts = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kqtquickcharts-15.08.1.tar.xz";
+      sha256 = "0jjn8nrxqjpsg9cwfazqz7v4lacl99wxhdh9mclqxk4xy54ydxqc";
+      name = "kqtquickcharts-15.08.1.tar.xz";
+    };
+  };
+  kmouth = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kmouth-15.08.1.tar.xz";
+      sha256 = "1w6jgs9skis1y8g07hdzwpdsa7dmzfi5dw82wx0wnnmdm076vg41";
+      name = "kmouth-15.08.1.tar.xz";
+    };
+  };
+  dolphin = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/dolphin-15.08.1.tar.xz";
+      sha256 = "09mr54zbyyq4kd3ddi054c86ji63b0k5fjd3y8x44vnd3id8jpjs";
+      name = "dolphin-15.08.1.tar.xz";
+    };
+  };
+  libkdcraw = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/libkdcraw-15.08.1.tar.xz";
+      sha256 = "0kshhch81sqjlashbh3ww3nz9ahv99f1bsxlrly39rvfa8yg6vpv";
+      name = "libkdcraw-15.08.1.tar.xz";
+    };
+  };
+  libksane = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/libksane-15.08.1.tar.xz";
+      sha256 = "0ih4axq0pcpvmgs8x12ad22bxixcccqpkqs160vxl7a29327rbdm";
+      name = "libksane-15.08.1.tar.xz";
+    };
+  };
+  kmines = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kmines-15.08.1.tar.xz";
+      sha256 = "12n4im9vqyym5jr0chs4g3wjlr2d2a3i35jhm52j8ibdx7fnpmw6";
+      name = "kmines-15.08.1.tar.xz";
+    };
+  };
+  kiriki = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kiriki-15.08.1.tar.xz";
+      sha256 = "1ighd4bmvgn84misb7zldjg5z75k1i7z8l7yjb0qybh1cc2bw3b3";
+      name = "kiriki-15.08.1.tar.xz";
+    };
+  };
+  kaccessible = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kaccessible-15.08.1.tar.xz";
+      sha256 = "10crgqpiqkbrb0hil1660cy4dcywiljicqhnhr3nns0ncllvw2vi";
+      name = "kaccessible-15.08.1.tar.xz";
+    };
+  };
+  ksnapshot = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/ksnapshot-15.08.1.tar.xz";
+      sha256 = "19z3rbvkn55waig6dm1lvan6wlndshhjbiqwwdlc9nh2wng8dcd0";
+      name = "ksnapshot-15.08.1.tar.xz";
+    };
+  };
+  kamera = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kamera-15.08.1.tar.xz";
+      sha256 = "0czpr3wb3irlbczrx0dczph6l9dwhz3wv9amrz2lvb8p9c8j4nmd";
+      name = "kamera-15.08.1.tar.xz";
+    };
+  };
+  kdenetwork-filesharing = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kdenetwork-filesharing-15.08.1.tar.xz";
+      sha256 = "03w78qf8sgwypzgwpyl5cfb5441787j6vzzhlddsbmkrl4vnhnff";
+      name = "kdenetwork-filesharing-15.08.1.tar.xz";
+    };
+  };
+  kmag = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kmag-15.08.1.tar.xz";
+      sha256 = "02bhjmmqb28qyacqzikrkxgh1zf4v1012kdjpdczsmnrgb1nmpgl";
+      name = "kmag-15.08.1.tar.xz";
+    };
+  };
+  kalarmcal = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kalarmcal-15.08.1.tar.xz";
+      sha256 = "02m2fd98jdacr7hm71dl6hsshil152c09p1daaa9b58yrgb9dqd9";
+      name = "kalarmcal-15.08.1.tar.xz";
+    };
+  };
+  kstars = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kstars-15.08.1.tar.xz";
+      sha256 = "049pnbqn1ddmqd663vc181yh5z204klbs255w41k7p1z1vl5zszr";
+      name = "kstars-15.08.1.tar.xz";
+    };
+  };
+  ktp-approver = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/ktp-approver-15.08.1.tar.xz";
+      sha256 = "0qdax2zby93xc694s3s6s21y4bfjbfxsd292ag544cwazcjz8zp5";
+      name = "ktp-approver-15.08.1.tar.xz";
+    };
+  };
+  kdesdk-kioslaves = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kdesdk-kioslaves-15.08.1.tar.xz";
+      sha256 = "161885bzayf804pdci5n1xh1n4zw3pddk2j53icn573gzpvczwla";
+      name = "kdesdk-kioslaves-15.08.1.tar.xz";
+    };
+  };
+  kdenetwork-strigi-analyzers = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kdenetwork-strigi-analyzers-15.08.1.tar.xz";
+      sha256 = "0w3jlg9idsxi1pwxh97s9iawjyq8m2z51kz5mm0d0irwslkwaygk";
+      name = "kdenetwork-strigi-analyzers-15.08.1.tar.xz";
+    };
+  };
+  juk = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/juk-15.08.1.tar.xz";
+      sha256 = "0l6zq90jvhkhppjq0djmj1ij1c1yjjvhh5ss4czqn39bay33r2a7";
+      name = "juk-15.08.1.tar.xz";
+    };
+  };
+  kolf = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kolf-15.08.1.tar.xz";
+      sha256 = "05xldbfkbbvmq743029cksgdcsfn20xadn91sw1yp9146k0bd97h";
+      name = "kolf-15.08.1.tar.xz";
+    };
+  };
+  print-manager = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/print-manager-15.08.1.tar.xz";
+      sha256 = "0cy5ga11kk11ca4nzpr6wjb4a342ziaflilc9pz6l3b7r8vhjv09";
+      name = "print-manager-15.08.1.tar.xz";
+    };
+  };
+  kppp = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kppp-15.08.1.tar.xz";
+      sha256 = "1v2dqb9bdi1yl4fpyn98iq8pg69r9pfy7z1wbq6b37nwlhlapva8";
+      name = "kppp-15.08.1.tar.xz";
+    };
+  };
+  bovo = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/bovo-15.08.1.tar.xz";
+      sha256 = "1lj2hwjdwkn70gfgyk3v0r8wdrdlpqkx9n17fd15x0jm8xjxc7wj";
+      name = "bovo-15.08.1.tar.xz";
+    };
+  };
+  ktimer = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/ktimer-15.08.1.tar.xz";
+      sha256 = "07882zpgalf2yzqplg3mzl6sxh84zfkbk1jwlw8kwkr7pr7lmfvv";
+      name = "ktimer-15.08.1.tar.xz";
+    };
+  };
+  kpimtextedit = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kpimtextedit-15.08.1.tar.xz";
+      sha256 = "1djk0gyfdxsqjwhrqf4rnkjvy7hz1rysdm3idjqrnjhnlrjwsiwc";
+      name = "kpimtextedit-15.08.1.tar.xz";
+    };
+  };
+  filelight = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/filelight-15.08.1.tar.xz";
+      sha256 = "085n071j5mpzh2yr4035bdxgfay782g4zx386lr2s03ywc5icsw2";
+      name = "filelight-15.08.1.tar.xz";
+    };
+  };
+  khangman = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/khangman-15.08.1.tar.xz";
+      sha256 = "1g60s028b08vd34l7n8m4sd7d9zl419kz8f1hvdgs2z9zacd5zqg";
+      name = "khangman-15.08.1.tar.xz";
+    };
+  };
+  kteatime = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kteatime-15.08.1.tar.xz";
+      sha256 = "0bsy22dgfpsibkpi0nv4245mxaf0xnh8rpaia8mzrh0d72gf2syb";
+      name = "kteatime-15.08.1.tar.xz";
+    };
+  };
+  gpgmepp = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/gpgmepp-15.08.1.tar.xz";
+      sha256 = "1nr4k3k34cmmvn4mznnr4kgvbi4raan96phbiqzgh6mzkq2rc8yr";
+      name = "gpgmepp-15.08.1.tar.xz";
+    };
+  };
+  ktp-contact-list = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/ktp-contact-list-15.08.1.tar.xz";
+      sha256 = "0x8fvfqjjrhdnfaa9ybagf33lv1r21bywkipvkp2f81dalsd1sv0";
+      name = "ktp-contact-list-15.08.1.tar.xz";
+    };
+  };
+  klettres = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/klettres-15.08.1.tar.xz";
+      sha256 = "0ykb5pfawiyby2xshfdq2gy7w66dw5vhqdd4vjkix6nyb87n703z";
+      name = "klettres-15.08.1.tar.xz";
+    };
+  };
+  kidentitymanagement = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kidentitymanagement-15.08.1.tar.xz";
+      sha256 = "0aslniqzp8bgayvvrxkdfb9ihvz57n6zf3rh99dsv34z20mfyc59";
+      name = "kidentitymanagement-15.08.1.tar.xz";
+    };
+  };
+  libkdegames = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/libkdegames-15.08.1.tar.xz";
+      sha256 = "0khr3rih3yv2vh9q2dkvdc2r1lpxhky5hmh7gachhyjh0296i9nq";
+      name = "libkdegames-15.08.1.tar.xz";
+    };
+  };
+  kmailtransport = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kmailtransport-15.08.1.tar.xz";
+      sha256 = "18gnhw49df0f7j0n0nzfnr5v6wvl37mf82slwbsrjqvhj60b2xsg";
+      name = "kmailtransport-15.08.1.tar.xz";
+    };
+  };
+  kbruch = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kbruch-15.08.1.tar.xz";
+      sha256 = "1mdbrfj7g92v5yzpdi0cccmhf5vdy7y5blbnk50p56qaq8w8avm2";
+      name = "kbruch-15.08.1.tar.xz";
+    };
+  };
+  zeroconf-ioslave = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/zeroconf-ioslave-15.08.1.tar.xz";
+      sha256 = "1h8v78b6fb82brpxkhlwyphb830ndzlq4z5llgav1dy7i0v8pd7r";
+      name = "zeroconf-ioslave-15.08.1.tar.xz";
+    };
+  };
+  kdegraphics-thumbnailers = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kdegraphics-thumbnailers-15.08.1.tar.xz";
+      sha256 = "1qavbvczjikad4kg28lq6zbb7dvllfw5nggilrs0s2qar7jqlrkw";
+      name = "kdegraphics-thumbnailers-15.08.1.tar.xz";
+    };
+  };
+  kreversi = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kreversi-15.08.1.tar.xz";
+      sha256 = "0clxm23a0m5j8aj3cp1va5s38y0y5wr7akwmigpk37xjylzp1xdd";
+      name = "kreversi-15.08.1.tar.xz";
+    };
+  };
+  kdewebdev = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kdewebdev-15.08.1.tar.xz";
+      sha256 = "00q25xp28m9sfgs7h4g89gyh34v36zwmliz1jvsq18aja45f5hpm";
+      name = "kdewebdev-15.08.1.tar.xz";
+    };
+  };
+  kgoldrunner = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kgoldrunner-15.08.1.tar.xz";
+      sha256 = "18xs36g9gmhzlwyg2gl9cc3842dzwc196dpfp0xshja2f1rlr6fp";
+      name = "kgoldrunner-15.08.1.tar.xz";
+    };
+  };
+  kde-base-artwork = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-base-artwork-15.08.1.tar.xz";
+      sha256 = "081mrc0s2lnbzwmmy9hwqas28cl6jzdycwxx3vfn4rvsgw4cgrp2";
+      name = "kde-base-artwork-15.08.1.tar.xz";
+    };
+  };
+  kiten = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kiten-15.08.1.tar.xz";
+      sha256 = "1pz9frvf23hi2hy7g040prcgjvjssgv3yya2kvapafpmbwnd38dv";
+      name = "kiten-15.08.1.tar.xz";
+    };
+  };
+  kmahjongg = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kmahjongg-15.08.1.tar.xz";
+      sha256 = "193ynx3da2nyaf2ixq7gc93nv8p9djslh8m666kdnqcxarlxd2qn";
+      name = "kmahjongg-15.08.1.tar.xz";
+    };
+  };
+  kcolorchooser = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kcolorchooser-15.08.1.tar.xz";
+      sha256 = "1ig03dg4baf29hhim1m77bzwnm6mqqyzbmyhk6g92mj5883nnfb7";
+      name = "kcolorchooser-15.08.1.tar.xz";
+    };
+  };
+  kapman = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kapman-15.08.1.tar.xz";
+      sha256 = "070zckasm7bm1g01rvp55gbilyzxqs5gsrp56zp3lyids0ycjfgz";
+      name = "kapman-15.08.1.tar.xz";
+    };
+  };
+  gwenview = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/gwenview-15.08.1.tar.xz";
+      sha256 = "0lks7chyd8bylz1m3nv3bfch5jcffkv52aawxv9r5www9wd7jq69";
+      name = "gwenview-15.08.1.tar.xz";
+    };
+  };
+  kcron = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kcron-15.08.1.tar.xz";
+      sha256 = "1s90bmlfbhcfiq6iizp4sq0z3ds8nrqghckcx9zrbyyj852llh0f";
+      name = "kcron-15.08.1.tar.xz";
+    };
+  };
+  kdeartwork = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kdeartwork-15.08.1.tar.xz";
+      sha256 = "0j37pzih616fv1k6i3hll6qkxh42v9gkhy5vl57ancx7a5kxikyc";
+      name = "kdeartwork-15.08.1.tar.xz";
+    };
+  };
+  ktp-accounts-kcm = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/ktp-accounts-kcm-15.08.1.tar.xz";
+      sha256 = "1qk25v0ivxkv8cyq4y44ixz9rx28djfxk06zcvn2m1rwjqhrx204";
+      name = "ktp-accounts-kcm-15.08.1.tar.xz";
+    };
+  };
+  kdepim-runtime = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kdepim-runtime-15.08.1.tar.xz";
+      sha256 = "1hcg900bnjryxii3f1c2yjj2nr3z4pn7yigdxclmwpfk6gvlkqm4";
+      name = "kdepim-runtime-15.08.1.tar.xz";
+    };
+  };
+  kfloppy = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kfloppy-15.08.1.tar.xz";
+      sha256 = "0yg94p5gj9xazl9kk503mblawyndv2j6m0scf6na68xksgx0yplv";
+      name = "kfloppy-15.08.1.tar.xz";
+    };
+  };
+  kopete = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kopete-15.08.1.tar.xz";
+      sha256 = "0949m4xw94hnw79c6ar8m9qjcx7r14qs6jww3pcnab7r0ax4xahb";
+      name = "kopete-15.08.1.tar.xz";
+    };
+  };
+  okular = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/okular-15.08.1.tar.xz";
+      sha256 = "0nicpz25srpn9zmwjxrnz8h2ba597ixsqcyhymki465dv5hgx5x7";
+      name = "okular-15.08.1.tar.xz";
+    };
+  };
+  kdf = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kdf-15.08.1.tar.xz";
+      sha256 = "062rz8syp7kxc9xyl4ldcqx66fdrjh5fhgdqgdjdgpn273n5v447";
+      name = "kdf-15.08.1.tar.xz";
+    };
+  };
+  kfourinline = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kfourinline-15.08.1.tar.xz";
+      sha256 = "19rssc5mf8hn6fv9pm91pbhdcxp123z9c1wrmay1wmja7fmnyv9s";
+      name = "kfourinline-15.08.1.tar.xz";
+    };
+  };
+  kdeedu-data = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kdeedu-data-15.08.1.tar.xz";
+      sha256 = "1yfx8526i753ifmcyh9r481cqiqzs4wh3xm1ys5x8pspg9rpn0wi";
+      name = "kdeedu-data-15.08.1.tar.xz";
+    };
+  };
+  kubrick = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kubrick-15.08.1.tar.xz";
+      sha256 = "1sanlaz70m1jpaxjwlx2gljh57gg4gdcz7y9g2w191667yk0kq8g";
+      name = "kubrick-15.08.1.tar.xz";
+    };
+  };
+  svgpart = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/svgpart-15.08.1.tar.xz";
+      sha256 = "10vvnsm7xlgy5fia8l8cz6cgj4xsjshiqkiiwkzlmyzzx081zi57";
+      name = "svgpart-15.08.1.tar.xz";
+    };
+  };
+  kanagram = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kanagram-15.08.1.tar.xz";
+      sha256 = "0bchwvr87wj9p82v1vgdmfw0a8d1gax08ccq24lzigrny6ljlizr";
+      name = "kanagram-15.08.1.tar.xz";
+    };
+  };
+  klickety = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/klickety-15.08.1.tar.xz";
+      sha256 = "1prbr2401jy4pifcyn8dy6q34f1nrhvhh8gm8p5jbr1jkzxmm1k1";
+      name = "klickety-15.08.1.tar.xz";
+    };
+  };
+  kgpg = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kgpg-15.08.1.tar.xz";
+      sha256 = "0728pb6d70qfrbmd1d16lwxshy3ifb8snx5bi8vp9rrs7ncy8r4a";
+      name = "kgpg-15.08.1.tar.xz";
+    };
+  };
+  kdepim = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kdepim-15.08.1.tar.xz";
+      sha256 = "06j6zmizkc8yg59dvnbcla82jb4csrwrvzzk3al18j6js0sdjnqr";
+      name = "kdepim-15.08.1.tar.xz";
+    };
+  };
+  granatier = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/granatier-15.08.1.tar.xz";
+      sha256 = "1ngdjgf3imdbv1hmp88fhnpvpspjgl2zpaig3d96fjlhxh0bgng1";
+      name = "granatier-15.08.1.tar.xz";
+    };
+  };
+  knetwalk = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/knetwalk-15.08.1.tar.xz";
+      sha256 = "0biis3gz943s09dzdxxdpkpizy3qzp9csi72njbm3bapxwmcflr2";
+      name = "knetwalk-15.08.1.tar.xz";
+    };
+  };
+  rocs = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/rocs-15.08.1.tar.xz";
+      sha256 = "1s3mdi9hqhajryax4yg074dn0h5yq9fq4a8j6ksgg7a2ggl4l8kv";
+      name = "rocs-15.08.1.tar.xz";
+    };
+  };
+  kde-dev-utils = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-dev-utils-15.08.1.tar.xz";
+      sha256 = "0jashpk1gjcf74b4vpkyrab2izp18ddwi0xky4v47micicl7wm5n";
+      name = "kde-dev-utils-15.08.1.tar.xz";
+    };
+  };
+  kdesdk-thumbnailers = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kdesdk-thumbnailers-15.08.1.tar.xz";
+      sha256 = "0719qaw9whp1aa15cxcz7axfhmcm30iwwrr78xypzcy097f63q4v";
+      name = "kdesdk-thumbnailers-15.08.1.tar.xz";
+    };
+  };
+  kigo = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kigo-15.08.1.tar.xz";
+      sha256 = "1vwkan7zlafisx4kap4bby4d2ndqnqbj7jrc00xgbw43l81kn4ix";
+      name = "kigo-15.08.1.tar.xz";
+    };
+  };
+  jovie = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/jovie-15.08.1.tar.xz";
+      sha256 = "021j7rxbbv5p2jjp4d7m7vsdy5117myng2min42bn6vfz4g6s5rx";
+      name = "jovie-15.08.1.tar.xz";
+    };
+  };
+  amor = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/amor-15.08.1.tar.xz";
+      sha256 = "125s9hsj4s3h21khgri9p52abkaa78a9yz7fnw5ij4i0ivhbks6a";
+      name = "amor-15.08.1.tar.xz";
+    };
+  };
+  kspaceduel = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kspaceduel-15.08.1.tar.xz";
+      sha256 = "0anviqhcmyfnyq9zz6hh8cka75hy5ydxq5yvz7q0g6c3flj34fq2";
+      name = "kspaceduel-15.08.1.tar.xz";
+    };
+  };
+  libkipi = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/libkipi-15.08.1.tar.xz";
+      sha256 = "0mmk8zfwffns7gacdjhjh45ki762wpd21nwvgbjclf3rjzgbyxz8";
+      name = "libkipi-15.08.1.tar.xz";
+    };
+  };
+  kgeography = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kgeography-15.08.1.tar.xz";
+      sha256 = "1ilb9l6v8pf7aq9dzs29bbdqb60fzf7a0dwjjdfvjq8jbnhcxa9v";
+      name = "kgeography-15.08.1.tar.xz";
+    };
+  };
+  kajongg = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kajongg-15.08.1.tar.xz";
+      sha256 = "1ialza77fc0a6541yg71b8qbjvq78sww7l0g3s1rn30pj1j1r3rx";
+      name = "kajongg-15.08.1.tar.xz";
+    };
+  };
+  kolourpaint = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kolourpaint-15.08.1.tar.xz";
+      sha256 = "1m0dwv2wxf5nsisg4zc6h1cqbnzv4187il7y45rbkxli430jh43d";
+      name = "kolourpaint-15.08.1.tar.xz";
+    };
+  };
+  marble = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/marble-15.08.1.tar.xz";
+      sha256 = "0dx0r1hjcfn3mvmsw0wgaw57jkn42166aj97ky0zdhdavkqv4j3j";
+      name = "marble-15.08.1.tar.xz";
+    };
+  };
+  kblog = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kblog-15.08.1.tar.xz";
+      sha256 = "0a5ycnk0ljw8k4m5pm7cn37ijjq9x1p2hxf4k77jb7aw1apyqv15";
+      name = "kblog-15.08.1.tar.xz";
+    };
+  };
+  kget = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kget-15.08.1.tar.xz";
+      sha256 = "02npfzdk283930jywhjch6sscnj16w2n3nn4ik04bx8hxv74br74";
+      name = "kget-15.08.1.tar.xz";
+    };
+  };
+  ktuberling = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/ktuberling-15.08.1.tar.xz";
+      sha256 = "1y9ifgg2086zz45pj32xxjrgnbsgiq7ajbjl8cybjxcx624j66ic";
+      name = "ktuberling-15.08.1.tar.xz";
+    };
+  };
+  krfb = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/krfb-15.08.1.tar.xz";
+      sha256 = "0cpypajr483iwch385240zi5l0vf4j28k0sng0kszhizspkhvp35";
+      name = "krfb-15.08.1.tar.xz";
+    };
+  };
+  ktp-filetransfer-handler = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/ktp-filetransfer-handler-15.08.1.tar.xz";
+      sha256 = "135zpcl0g81xd9hljch05cjngs6x05cnzngzx5h5hsjf13fgz9cn";
+      name = "ktp-filetransfer-handler-15.08.1.tar.xz";
+    };
+  };
+  ktouch = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/ktouch-15.08.1.tar.xz";
+      sha256 = "1hlg1l1xpmpwvzz47vmif395pw9szjy93p8yxhqsdhkh1f4mdssq";
+      name = "ktouch-15.08.1.tar.xz";
+    };
+  };
+  kmplot = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kmplot-15.08.1.tar.xz";
+      sha256 = "1a1b6vcxp1wkp6qfidwj42vqkh6wm4m64q0hm7zv6h01l10fzdm2";
+      name = "kmplot-15.08.1.tar.xz";
+    };
+  };
+  okteta = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/okteta-15.08.1.tar.xz";
+      sha256 = "14mbfqc61rw2g89shh0ad38ph24c6nrj76qx9g1diazvr3p9sf1j";
+      name = "okteta-15.08.1.tar.xz";
+    };
+  };
+  kdepimlibs = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kdepimlibs-15.08.1.tar.xz";
+      sha256 = "0sjh4n2hgcfd3ngbvzk051yzglkchcjhx0nnn12li0lw2bg7l9w3";
+      name = "kdepimlibs-15.08.1.tar.xz";
+    };
+  };
+  kwalletmanager = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kwalletmanager-15.08.1.tar.xz";
+      sha256 = "1ibfiaglwgqxnsmx1f8pcylv0kzywpd2mvyawcdhcl3yqdpyw4v7";
+      name = "kwalletmanager-15.08.1.tar.xz";
+    };
+  };
+  kmime = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kmime-15.08.1.tar.xz";
+      sha256 = "1rz9nmx01rd4asv8iggh47m7snm0fdvlc9f59jpkbch1wxf70vqc";
+      name = "kmime-15.08.1.tar.xz";
+    };
+  };
+  ktp-auth-handler = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/ktp-auth-handler-15.08.1.tar.xz";
+      sha256 = "0dwpaw2pvigc0lyqa29gxq49fp6rp5hh2wg6ysr1d00s54lr2qgw";
+      name = "ktp-auth-handler-15.08.1.tar.xz";
+    };
+  };
+  ktux = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/ktux-15.08.1.tar.xz";
+      sha256 = "1vw0ybkvrcqcng6sz0hw12bhsspig98m0wjn8phlyljfd5d8p4h3";
+      name = "ktux-15.08.1.tar.xz";
+    };
+  };
+  ffmpegthumbs = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/ffmpegthumbs-15.08.1.tar.xz";
+      sha256 = "00bk11zq5hkdkwxj7d4fydslh2gybhzxz2gyldjfdd8agjcl1rfm";
+      name = "ffmpegthumbs-15.08.1.tar.xz";
+    };
+  };
+  libkomparediff2 = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/libkomparediff2-15.08.1.tar.xz";
+      sha256 = "1g8j5idy18a4fnc2m9cjg3xzq6kck070yq5ki4l9lbjinrhl3jpr";
+      name = "libkomparediff2-15.08.1.tar.xz";
+    };
+  };
+  kalgebra = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kalgebra-15.08.1.tar.xz";
+      sha256 = "1an9lc9h1178d94pq2a60pnw9wadxdni3drbx40w1l1kfaa38ghy";
+      name = "kalgebra-15.08.1.tar.xz";
+    };
+  };
+  kblocks = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kblocks-15.08.1.tar.xz";
+      sha256 = "1vvlxna5dmnf7igr53p3m5z224zj1ni92qifjnnblwr55gqqwsva";
+      name = "kblocks-15.08.1.tar.xz";
+    };
+  };
+  kblackbox = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kblackbox-15.08.1.tar.xz";
+      sha256 = "1hnxsjdp9gbjc0049jx7bnzx0cykyc7qf6f2z3mrir8knin0fmi5";
+      name = "kblackbox-15.08.1.tar.xz";
+    };
+  };
+  kdegraphics-mobipocket = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kdegraphics-mobipocket-15.08.1.tar.xz";
+      sha256 = "0fnrd2za98plc8aw2gmn83yar0m7ix5rg84lpfm0vnshkhrslqg6";
+      name = "kdegraphics-mobipocket-15.08.1.tar.xz";
+    };
+  };
+  ksnakeduel = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/ksnakeduel-15.08.1.tar.xz";
+      sha256 = "1q0hcya6dl2lfahqnwx18hl6cwmibsvlyf25x41d42669f7vm1zz";
+      name = "ksnakeduel-15.08.1.tar.xz";
+    };
+  };
+  kde-wallpapers = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-wallpapers-15.08.1.tar.xz";
+      sha256 = "01q5yh4q7kjjryab3jc8g4qwi4w18la6na0ra2mf0cf637xnlh83";
+      name = "kde-wallpapers-15.08.1.tar.xz";
+    };
+  };
+  konsole = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/konsole-15.08.1.tar.xz";
+      sha256 = "15d401xxqhd8sfjc6gpn7f1zcs5w8l6y2bjvjvidmpzmr24xky1j";
+      name = "konsole-15.08.1.tar.xz";
+    };
+  };
+  kdelibs = {
+    version = "4.14.12";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kdelibs-4.14.12.tar.xz";
+      sha256 = "1s4p3x5si0mx64rhfqplgpyqm04c84wj4mpmbmi86wxwyr5d65rg";
+      name = "kdelibs-4.14.12.tar.xz";
+    };
+  };
+  cantor = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/cantor-15.08.1.tar.xz";
+      sha256 = "0qcx077khzzjs8gaz2m1dph1r4ql3gpfsq536626fd94cb5is83x";
+      name = "cantor-15.08.1.tar.xz";
+    };
+  };
+  kmbox = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kmbox-15.08.1.tar.xz";
+      sha256 = "1b4b9kk99kvcz4krixnzwvwf7ydkpbsrzza74f8ljbl40ldn94jn";
+      name = "kmbox-15.08.1.tar.xz";
+    };
+  };
+  kde-dev-scripts = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-dev-scripts-15.08.1.tar.xz";
+      sha256 = "01s13qwji4d2sgbg85kj0ggg4mnl2vggangi8fpvaps03fpq7571";
+      name = "kde-dev-scripts-15.08.1.tar.xz";
+    };
+  };
+  krdc = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/krdc-15.08.1.tar.xz";
+      sha256 = "1gx3vhl8w64ya71894lgy2i3kkggr84r1c5sx8nbwvapw5v4ngiz";
+      name = "krdc-15.08.1.tar.xz";
+    };
+  };
+  ktnef = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/ktnef-15.08.1.tar.xz";
+      sha256 = "04jq60qpbgaclscgpwx3sj0l67sqzk9zr01zr6fx127apqzc2xmh";
+      name = "ktnef-15.08.1.tar.xz";
+    };
+  };
+  kdenlive = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kdenlive-15.08.1.tar.xz";
+      sha256 = "03rbkl3jblzprwb6sd7wycizpnpk65551ji53i2h7rxwsns53hig";
+      name = "kdenlive-15.08.1.tar.xz";
+    };
+  };
+  kwordquiz = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kwordquiz-15.08.1.tar.xz";
+      sha256 = "0b20n7k8ging2gw6l0k09r71ww1dg0fh5y5lqzlzcl8vqhdwkwpp";
+      name = "kwordquiz-15.08.1.tar.xz";
+    };
+  };
+  libkface = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/libkface-15.08.1.tar.xz";
+      sha256 = "0k2rsmnzfyab1x1nyirlhs48c19b2i2f0x60w1igp7b66n6819kd";
+      name = "libkface-15.08.1.tar.xz";
+    };
+  };
+  kde-baseapps = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kde-baseapps-15.08.1.tar.xz";
+      sha256 = "1ngi571gs62qnpz1ph106ard13pfh9f1ljg4y4cyv77nv90x4a2k";
+      name = "kde-baseapps-15.08.1.tar.xz";
+    };
+  };
+  cervisia = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/cervisia-15.08.1.tar.xz";
+      sha256 = "0cha7j0769ib8hc2jjgdxm1pv81cqwii721ww94dd4d614isv4pk";
+      name = "cervisia-15.08.1.tar.xz";
+    };
+  };
+  kmousetool = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/kmousetool-15.08.1.tar.xz";
+      sha256 = "0snyqp2410bjkc5krxhkk08i3lyd5724513vs48lxdasv24jc0nz";
+      name = "kmousetool-15.08.1.tar.xz";
+    };
+  };
+  ksaneplugin = {
+    version = "15.08.1";
+    src = fetchurl {
+      url = "${mirror}/stable/applications/15.08.1/src/ksaneplugin-15.08.1.tar.xz";
+      sha256 = "0fx0y4js4nbbky342ly3aw59rbzz25mjb1da0hkykky9kxrcwnxk";
+      name = "ksaneplugin-15.08.1.tar.xz";
+    };
+  };
+}
diff --git a/pkgs/applications/misc/audio/soxr/default.nix b/pkgs/applications/misc/audio/soxr/default.nix
index 084a95b962ad..135ae47aa846 100644
--- a/pkgs/applications/misc/audio/soxr/default.nix
+++ b/pkgs/applications/misc/audio/soxr/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, cmake }:
 
 stdenv.mkDerivation rec {
-  name = "soxr-0.1.1";
+  name = "soxr-0.1.2";
 
   src = fetchurl {
     url = "mirror://sourceforge/soxr/${name}-Source.tar.xz";
-    sha256 = "1hmadwqfpg15vhwq9pa1sl5xslibrjpk6hpq2s9hfmx1s5l6ihfw";
+    sha256 = "0xf2w3piwz9gfr1xqyrj4k685q5dy53kq3igv663i4f4y4sg9rjl";
   };
 
   preConfigure = if stdenv.isDarwin then ''
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
     export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:"`pwd`/build/src
   '';
 
-  buildInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 
   meta = {
     description = "An audio resampling library";
diff --git a/pkgs/applications/misc/cool-retro-term/default.nix b/pkgs/applications/misc/cool-retro-term/default.nix
index 455d33860fb6..9f97e1eccee6 100644
--- a/pkgs/applications/misc/cool-retro-term/default.nix
+++ b/pkgs/applications/misc/cool-retro-term/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, makeWrapper, qt5, qmltermwidget }:
+{ stdenv, fetchgit, makeWrapper, qtbase, qtquick1, qmltermwidget }:
 
 stdenv.mkDerivation rec {
   version = "1.0.0";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
     sed -i -e '/qmltermwidget/d' cool-retro-term.pro
   '';
 
-  buildInputs = [ makeWrapper qt5.base qt5.quick1 qmltermwidget ];
+  buildInputs = [ makeWrapper qtbase qtquick1 qmltermwidget ];
 
   configurePhase = "qmake PREFIX=$out";
 
@@ -26,8 +26,7 @@ stdenv.mkDerivation rec {
     mv $out/usr/bin $out/bin
     rmdir $out/usr
 
-    wrapProgram $out/bin/cool-retro-term \
-      --prefix QML2_IMPORT_PATH : "${qmltermwidget}/lib/qml/"
+    wrapQtProgram $out/bin/cool-retro-term
   '';
 
   enableParallelBuilding = true;
diff --git a/pkgs/applications/misc/evilvte/default.nix b/pkgs/applications/misc/evilvte/default.nix
index 5921cc308b5b..f7a8fe4eafc2 100644
--- a/pkgs/applications/misc/evilvte/default.nix
+++ b/pkgs/applications/misc/evilvte/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchgit, makeWrapper, pkgconfig,
-  gnome, glib, pango, cairo, gdk_pixbuf, atk, freetype, xlibs,
+  gnome, glib, pango, cairo, gdk_pixbuf, atk, freetype, xorg,
   configH
 }:
 
@@ -14,8 +14,8 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [
-    gnome.vte glib pango gnome.gtk cairo gdk_pixbuf atk freetype xlibs.libX11
-    xlibs.xproto xlibs.kbproto xlibs.libXext xlibs.xextproto makeWrapper pkgconfig
+    gnome.vte glib pango gnome.gtk cairo gdk_pixbuf atk freetype xorg.libX11
+    xorg.xproto xorg.kbproto xorg.libXext xorg.xextproto makeWrapper pkgconfig
   ];
 
   buildPhase = ''
diff --git a/pkgs/applications/misc/finalterm/default.nix b/pkgs/applications/misc/finalterm/default.nix
index bdd1a9e8e28e..c8e8bb01e5d6 100644
--- a/pkgs/applications/misc/finalterm/default.nix
+++ b/pkgs/applications/misc/finalterm/default.nix
@@ -1,7 +1,7 @@
 { stdenv, lib, fetchgit, makeWrapper
 , pkgconfig, cmake, libxml2, vala, intltool, libmx, gnome3, gtk3, gtk_doc
 , keybinder3, clutter_gtk, libnotify
-, libxkbcommon, xlibs, udev
+, libxkbcommon, xorg, udev
 , bashInteractive
 }:
 
@@ -17,7 +17,7 @@ stdenv.mkDerivation {
   buildInputs = [
     pkgconfig cmake vala intltool gtk3 gnome3.gnome_common gnome3.libgee
     gtk_doc clutter_gtk libmx keybinder3 libxml2 libnotify makeWrapper
-    xlibs.libpthreadstubs xlibs.libXdmcp xlibs.libxshmfence
+    xorg.libpthreadstubs xorg.libXdmcp xorg.libxshmfence
     libxkbcommon
   ] ++ lib.optionals stdenv.isLinux [
     udev
diff --git a/pkgs/applications/misc/goldendict/default.nix b/pkgs/applications/misc/goldendict/default.nix
index 717d0a012a2c..32a16e79c21e 100644
--- a/pkgs/applications/misc/goldendict/default.nix
+++ b/pkgs/applications/misc/goldendict/default.nix
@@ -1,24 +1,16 @@
-{ stdenv, fetchurl, pkgconfig, qt4, libXtst, libvorbis, phonon, hunspell }:
+{ stdenv, fetchFromGitHub, pkgconfig, qt4, libXtst, libvorbis, hunspell, libao, ffmpeg, libeb, lzo, xz, libtiff }:
 stdenv.mkDerivation rec {
-  name = "goldendict-1.0.1";
-  src = fetchurl {
-    url = "mirror://sourceforge/goldendict/${name}-src.tar.bz2";
-    sha256 = "19p99dd5jgs0k66sy30vck7ymqj6dv1lh6w8xw18zczdll2h9yxk";
+  name = "goldendict-1.5.0.20150801";
+  src = fetchFromGitHub {
+    owner = "goldendict";
+    repo = "goldendict";
+    rev = "b4bb1e9635c764aa602fbeaeee661f35e461d062";
+    sha256 = "0dhaa0nii226541al3i2d8x8h7cfh96w5vkw3pa3l74llgrj7yx2";
   };
-  buildInputs = [ pkgconfig qt4 libXtst libvorbis phonon hunspell ];
-  unpackPhase = ''
-    mkdir ${name}-src
-    cd ${name}-src
-    tar xf ${src}
-  '';
-  patches = [ ./goldendict-paths.diff ./gcc47.patch ];
-  patchFlags = "-p 0";
+
+  buildInputs = [ pkgconfig qt4 libXtst libvorbis hunspell libao ffmpeg libeb lzo xz libtiff ];
   configurePhase = ''
-    qmake
-  '';
-  installPhase = ''
-    make INSTALL_ROOT="$out" install
-    rm -rf "$out/share/app-install"
+    qmake PREFIX=$out 'CONFIG+=zim_support'
   '';
 
   meta = {
diff --git a/pkgs/applications/misc/goldendict/gcc47.patch b/pkgs/applications/misc/goldendict/gcc47.patch
deleted file mode 100644
index 311dad4f6487..000000000000
--- a/pkgs/applications/misc/goldendict/gcc47.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-From b00d081da20b9a6b257573c6b23a6bc640c4dab1 Mon Sep 17 00:00:00 2001
-From: Michael Palimaka <kensington@gentoo.org>
-Date: Fri, 20 Jul 2012 03:27:38 +1000
-Subject: [PATCH] Fix build with GCC 4.7 by adding missing includes.
-
----
- processwrapper.cc                       | 4 ++++
- qtsingleapplication/src/qtlocalpeer.cpp | 1 +
- 2 files changed, 5 insertions(+)
-
-diff --git processwrapper.cc processwrapper.cc
-index f7f3f19..86b985d 100644
---- processwrapper.cc
-+++ processwrapper.cc
-@@ -2,6 +2,10 @@
- 

- #include <QtCore>

- 

-+#if defined(Q_OS_UNIX)

-+#include <unistd.h>

-+#endif

-+

- #ifdef Q_OS_WIN32

- 

- #include <windows.h>

-diff --git qtsingleapplication/src/qtlocalpeer.cpp qtsingleapplication/src/qtlocalpeer.cpp
-index 382d182..506c142 100644
---- qtsingleapplication/src/qtlocalpeer.cpp
-+++ qtsingleapplication/src/qtlocalpeer.cpp
-@@ -50,6 +50,7 @@ static PProcessIdToSessionId pProcessIdToSessionId = 0;
- #endif
- #if defined(Q_OS_UNIX)
- #include <time.h>
-+#include <unistd.h>
- #endif
- 
- namespace QtLP_Private {
--- 
-1.7.11.1
-
diff --git a/pkgs/applications/misc/goldendict/goldendict-paths.diff b/pkgs/applications/misc/goldendict/goldendict-paths.diff
deleted file mode 100644
index 6682911dbe42..000000000000
--- a/pkgs/applications/misc/goldendict/goldendict-paths.diff
+++ /dev/null
@@ -1,10 +0,0 @@
---- goldendict.pro~	2010-12-27 22:52:21.000000000 +0100
-+++ goldendict.pro	2010-12-27 22:52:21.000000000 +0100
-@@ -63,2 +63,2 @@
--    isEmpty( PREFIX ):PREFIX = /usr/local
--    DEFINES += PROGRAM_DATA_DIR=\\\"$$PREFIX/share/apps/goldendict/\\\"
-+    isEmpty( PREFIX ):PREFIX = /
-+    DEFINES += PROGRAM_DATA_DIR=\\\"$$PREFIX/share/goldendict/\\\"
-@@ -66 +66 @@
--    locale.path = $$PREFIX/share/apps/goldendict/locale/
-+    locale.path = $$PREFIX/share/goldendict/locale/
diff --git a/pkgs/applications/misc/hello/ex-2/default.nix b/pkgs/applications/misc/hello/default.nix
index bb91c90e2fcf..bf63df4d154e 100644
--- a/pkgs/applications/misc/hello/ex-2/default.nix
+++ b/pkgs/applications/misc/hello/default.nix
@@ -10,8 +10,6 @@ stdenv.mkDerivation rec {
 
   doCheck = false;
 
-  separateDebugInfo = true;
-
   meta = {
     description = "A program that produces a familiar, friendly greeting";
     longDescription = ''
diff --git a/pkgs/applications/misc/jekyll/Gemfile b/pkgs/applications/misc/jekyll/Gemfile
index 0788a359116d..0a5688503cac 100644
--- a/pkgs/applications/misc/jekyll/Gemfile
+++ b/pkgs/applications/misc/jekyll/Gemfile
@@ -2,3 +2,4 @@ source "https://rubygems.org"
 
 gem 'jekyll'
 gem 'rdiscount'
+gem 'RedCloth'
diff --git a/pkgs/applications/misc/jekyll/Gemfile.lock b/pkgs/applications/misc/jekyll/Gemfile.lock
index 76bddef5869e..ec81bc703c68 100644
--- a/pkgs/applications/misc/jekyll/Gemfile.lock
+++ b/pkgs/applications/misc/jekyll/Gemfile.lock
@@ -1,6 +1,7 @@
 GEM
   remote: https://rubygems.org/
   specs:
+    RedCloth (4.2.9)
     blankslate (2.1.2.4)
     celluloid (0.16.0)
       timers (~> 4.0.0)
@@ -68,5 +69,9 @@ PLATFORMS
   ruby
 
 DEPENDENCIES
+  RedCloth
   jekyll
   rdiscount
+
+BUNDLED WITH
+   1.10.6
diff --git a/pkgs/applications/misc/jekyll/gemset.nix b/pkgs/applications/misc/jekyll/gemset.nix
index 0ceb095b4c82..f6ad34fcad98 100644
--- a/pkgs/applications/misc/jekyll/gemset.nix
+++ b/pkgs/applications/misc/jekyll/gemset.nix
@@ -1,4 +1,11 @@
 {
+  "RedCloth" = {
+    version = "4.2.9";
+    source = {
+      type = "gem";
+      sha256 = "06pahxyrckhgb7alsxwhhlx1ib2xsx33793finj01jk8i054bkxl";
+    };
+  };
   "blankslate" = {
     version = "2.1.2.4";
     source = {
diff --git a/pkgs/applications/misc/k3b/default.nix b/pkgs/applications/misc/k3b/default.nix
index 7730402a7959..f48912aeb1e7 100644
--- a/pkgs/applications/misc/k3b/default.nix
+++ b/pkgs/applications/misc/k3b/default.nix
@@ -1,24 +1,25 @@
-{ stdenv, fetchurl, makeWrapper, cmake, qt4, perl, shared_mime_info, libvorbis, taglib
-, flac, libsamplerate, libdvdread, lame, libsndfile, libmad, gettext
-, transcode, cdrdao, cdrtools, dvdplusrwtools, vcdimager, cdparanoia
-, kdelibs, kdemultimedia, automoc4, phonon, libkcddb ? null
+{ stdenv, fetchurl, makeWrapper, automoc4, cmake, perl, pkgconfig
+, shared_mime_info, libvorbis, taglib , flac, libsamplerate
+, libdvdread, lame, libsndfile, libmad, gettext , transcode, cdrdao
+, cdrtools, dvdplusrwtools, vcdimager, cdparanoia , kdelibs
+, kdemultimedia, phonon, libkcddb ? null
 }:
 
 stdenv.mkDerivation rec {
   name = "k3b-2.0.3a";
-  
+
   src = fetchurl {
     url = "http://download.kde.org/stable/k3b/${name}.tar.xz";
     sha256 = "10f07465g9860chfnvrp9w3m686g6j9f446xgnnx7h82d1sb42rd";
   };
 
-  buildInputs =
-    [ cmake qt4 perl shared_mime_info libvorbis taglib
-      flac libsamplerate libdvdread lame libsndfile
-      libmad gettext stdenv.cc.libc
-      kdelibs kdemultimedia automoc4 phonon
-      libkcddb makeWrapper cdparanoia
-    ];
+  nativeBuildInputs = [ automoc4 cmake gettext perl pkgconfig ];
+
+  buildInputs = [
+    shared_mime_info libvorbis taglib flac libsamplerate libdvdread
+    lame libsndfile libmad stdenv.cc.libc kdelibs
+    kdemultimedia phonon libkcddb makeWrapper cdparanoia
+  ];
 
   enableParallelBuilding = true;
 
@@ -31,7 +32,7 @@ stdenv.mkDerivation rec {
     wrapProgram $out/bin/k3b \
       --prefix LD_LIBRARY_PATH ":" "${cdparanoia}/lib"
   '';
-                  
+
   meta = with stdenv.lib; {
     description = "CD/DVD Burning Application for KDE";
     license = licenses.gpl2Plus;
diff --git a/pkgs/applications/misc/kde-wacomtablet/default.nix b/pkgs/applications/misc/kde-wacomtablet/default.nix
index 1b71989f8b6b..013efee8ec91 100644
--- a/pkgs/applications/misc/kde-wacomtablet/default.nix
+++ b/pkgs/applications/misc/kde-wacomtablet/default.nix
@@ -1,4 +1,5 @@
-{ stdenv, fetchurl, kdelibs, gettext, xf86_input_wacom }:
+{ stdenv, fetchurl, automoc4, cmake, gettext, perl, pkgconfig
+, kdelibs, xf86_input_wacom }:
 
 stdenv.mkDerivation rec {
   name = "wacomtablet-2.1.0";
@@ -10,7 +11,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ kdelibs xf86_input_wacom ];
 
-  nativeBuildInputs = [ gettext ];
+  nativeBuildInputs = [ automoc4 cmake gettext perl pkgconfig ];
 
   meta = with stdenv.lib; {
     description = "KDE Wacom graphic tablet configuration tool";
diff --git a/pkgs/applications/misc/kdeconnect/default.nix b/pkgs/applications/misc/kdeconnect/default.nix
index 51b7b90ca4ef..551d7c06468a 100644
--- a/pkgs/applications/misc/kdeconnect/default.nix
+++ b/pkgs/applications/misc/kdeconnect/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl, gettext, kdelibs, libXtst, libfakekey, makeWrapper, pkgconfig, qca2
-, qjson
+{ stdenv, fetchurl, automoc4, cmake, perl, pkgconfig
+, gettext, kdelibs, libXtst, libfakekey, makeWrapper, qca2, qjson
 }:
 
 stdenv.mkDerivation rec {
@@ -11,7 +11,9 @@ stdenv.mkDerivation rec {
     sha256 = "1vrr047bq5skxvibv5pb9ch9dxh005zmar017jzbyb9hilxr8kg4";
   };
 
-  buildInputs = [ gettext kdelibs libXtst libfakekey makeWrapper pkgconfig qca2 qjson ];
+  buildInputs = [ gettext kdelibs libXtst libfakekey makeWrapper qca2 qjson ];
+
+  nativeBuildInputs = [ automoc4 cmake perl pkgconfig ];
 
   meta = with stdenv.lib; {
     description = "A tool to connect and sync your devices with KDE";
diff --git a/pkgs/applications/misc/keepassx/2.0.nix b/pkgs/applications/misc/keepassx/2.0.nix
index 6a5ce9fd6043..acdd91aaf68a 100644
--- a/pkgs/applications/misc/keepassx/2.0.nix
+++ b/pkgs/applications/misc/keepassx/2.0.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, libgcrypt, qt4, xlibs, ... }:
+{ stdenv, fetchurl, cmake, libgcrypt, qt4, xorg, ... }:
 
 stdenv.mkDerivation {
   name = "keepassx2-2.0beta2";
@@ -7,7 +7,7 @@ stdenv.mkDerivation {
     sha256 = "0ljf9ws3wh62zd0gyb0vk2qw6pqsmxrlybrfs5mqahf44q92ca2q";
   };
 
-  buildInputs = [ cmake libgcrypt qt4 xlibs.libXtst ];
+  buildInputs = [ cmake libgcrypt qt4 xorg.libXtst ];
 
   meta = {
     description = "Qt password manager compatible with its Win32 and Pocket PC versions";
diff --git a/pkgs/applications/misc/kiwix/default.nix b/pkgs/applications/misc/kiwix/default.nix
new file mode 100644
index 000000000000..30db6a45ea1b
--- /dev/null
+++ b/pkgs/applications/misc/kiwix/default.nix
@@ -0,0 +1,110 @@
+{ stdenv, fetchurl, makeWrapper, pkgconfig, zip, python
+, zlib, xapian, which , icu, libmicrohttpd , lzma, zimlib
+, ctpp2, aria2, wget , bc, libuuid , glibc, libX11
+, libXext, libXt, libXrender , glib, dbus, dbus_glib, gtk
+, gdk_pixbuf, pango, cairo , freetype, fontconfig, alsaLib
+, atk
+}:
+
+let
+  xulrunner64_tar = fetchurl {
+    url = http://download.kiwix.org/dev/xulrunner-29.0.en-US.linux-x86_64.tar.bz2;
+    sha256 = "0i3m30gm5z7qmas14id6ypvbmnb2k7jhz8aby2wz5vvv49zqmx3s";
+  };
+  xulrunnersdk64_tar = fetchurl {
+    url = http://download.kiwix.org/dev/xulrunner-29.0.en-US.linux-x86_64.sdk.tar.bz2;
+    sha256 = "0z90v7c4mq15g5klmsj8vs2r10fbygj3qzynx4952hkv8ihw8n3a";
+  };
+  xulrunner32_tar = fetchurl {
+    url = http://download.kiwix.org/dev/xulrunner-29.0.en-US.linux-i686.tar.bz2;
+    sha256 = "0yln6pxz8f6b9wm9124sx049z8mgi17lgd63rcv2hnix825y8gjb";
+  };
+  xulrunnersdk32_tar = fetchurl {
+    url = http://download.kiwix.org/dev/xulrunner-29.0.en-US.linux-i686.sdk.tar.bz2;
+    sha256 = "1h9vcbvf8wgds6i2z20y7krpys0mqsqhv1ijyfljanp6vyll9fvi";
+  };
+
+  xulrunner_tar = if stdenv.system == "x86_64-linux" then xulrunner64_tar else xulrunner32_tar;
+  xulrunnersdk_tar = if stdenv.system == "x86_64-linux" then xulrunnersdk64_tar else xulrunnersdk32_tar;
+  pugixml_tar = fetchurl {
+    url = http://download.kiwix.org/dev/pugixml-1.2.tar.gz;
+    sha256 = "0sqk0vdwjq44jxbbkj1cy8qykrmafs1sickzldb2w2nshsnjshhg";
+  };
+
+in
+with stdenv.lib;
+stdenv.mkDerivation rec {
+  name = "kiwix-${version}";
+  version = "0.9";
+
+  src = fetchurl {
+    url = "http://download.kiwix.org/src/kiwix-${version}-src.tar.xz";
+    sha256 = "0577phhy2na59cpcqjgldvksp0jwczyg0l6c9ghnr19i375l7yqc";
+  };
+
+  buildInputs = [
+    zip
+    pkgconfig
+    python
+    zlib
+    xapian
+    which
+    icu
+    libmicrohttpd
+    lzma
+    zimlib
+    ctpp2
+    aria2
+    wget
+    bc
+    libuuid
+    makeWrapper
+  ];
+
+  postUnpack = ''
+    cd kiwix-*
+    mkdir static
+    cp Makefile.in static/
+
+    cd src/dependencies
+    cp ${pugixml_tar} pugixml-1.2.tar.gz
+
+    tar -xf ${xulrunner_tar}
+    tar -xf ${xulrunnersdk_tar}
+
+    cd ../../..
+  '';
+
+  configurePhase = ''
+    bash ./configure --disable-static --disable-dependency-tracking --prefix=$out --with-libpugixml=SELF
+  '';
+
+  buildPhase = ''
+    cd src/dependencies
+    make pugixml-1.2/libpugixml.a
+
+    cd ../..
+    bash ./configure --disable-static --disable-dependency-tracking --prefix=$out --with-libpugixml=SELF
+
+    make
+  '';
+
+  installPhase = ''
+    make install
+    cp -r src/dependencies/xulrunner $out/lib/kiwix
+
+    patchelf --set-interpreter ${glibc}/lib/ld-linux${optionalString (stdenv.system == "x86_64-linux") "-x86-64"}.so.2 $out/lib/kiwix/xulrunner/xulrunner
+
+    rm $out/bin/kiwix
+    makeWrapper $out/lib/kiwix/kiwix-launcher $out/bin/kiwix \
+      --suffix LD_LIBRARY_PATH : `cat ${stdenv.cc}/nix-support/orig-cc`/lib:${makeLibraryPath [libX11 libXext libXt libXrender glib dbus dbus_glib gtk gdk_pixbuf pango cairo freetype fontconfig alsaLib atk]} \
+      --suffix PATH : ${aria2}/bin
+  '';
+
+  meta = {
+    description = "An offline reader for Web content";
+    homepage = http://kiwix.org;
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ robbinch ];
+  };
+}
diff --git a/pkgs/applications/misc/krename/default.nix b/pkgs/applications/misc/krename/default.nix
index ff98bb5186a7..1e4da7fa11f7 100644
--- a/pkgs/applications/misc/krename/default.nix
+++ b/pkgs/applications/misc/krename/default.nix
@@ -1,4 +1,6 @@
-{ stdenv, fetchurl, cmake, automoc4, kdelibs, taglib, exiv2, podofo, gettext, qt4, phonon }:
+{ stdenv, fetchurl, automoc4, cmake, gettext, perl, pkgconfig
+, kdelibs, taglib, exiv2, podofo, qt4, phonon
+}:
 
 stdenv.mkDerivation rec {
   name = "krename-4.0.9";
@@ -8,7 +10,8 @@ stdenv.mkDerivation rec {
     sha256 = "11bdg5vdcs393n0aibhm3jh3wxlk5kz78jhkwf7cj9086qkg9wds";
   };
 
-  buildInputs = [ cmake automoc4 kdelibs taglib exiv2 podofo gettext qt4 phonon ];
+  buildInputs = [ kdelibs taglib exiv2 podofo qt4 phonon ];
+  nativeBuildInputs = [ automoc4 cmake gettext perl pkgconfig ];
 
   meta = {
     homepage = http://www.krename.net;
diff --git a/pkgs/applications/misc/krusader/default.nix b/pkgs/applications/misc/krusader/default.nix
index 83c21da0e542..2a9c6305d42e 100644
--- a/pkgs/applications/misc/krusader/default.nix
+++ b/pkgs/applications/misc/krusader/default.nix
@@ -1,4 +1,6 @@
-{stdenv, fetchurl, gettext, kdelibs, kde_baseapps}:
+{ stdenv, fetchurl, automoc4, cmake, gettext, perl, pkgconfig
+, kdelibs, kde_baseapps
+}:
 
 stdenv.mkDerivation rec {
   name = "krusader-2.4.0-beta1";
@@ -6,7 +8,8 @@ stdenv.mkDerivation rec {
     url = "mirror://sourceforge/krusader/${name}.tar.bz2";
     sha256 = "1q1m4cjzz2m41pdpxnwrsiczc7990785b700lv64midjjgjnr7j6";
   };
-  buildInputs = [ gettext kdelibs kde_baseapps ];
+  buildInputs = [ kdelibs kde_baseapps ];
+  nativeBuildInputs = [ automoc4 cmake gettext perl pkgconfig ];
   NIX_CFLAGS_COMPILE = "-fpermissive"; # fix build with newer gcc versions
   meta = {
     description = "Norton/Total Commander clone for KDE";
diff --git a/pkgs/applications/misc/orpie/default.nix b/pkgs/applications/misc/orpie/default.nix
new file mode 100644
index 000000000000..b04f0f265000
--- /dev/null
+++ b/pkgs/applications/misc/orpie/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, fetchurl, ocamlPackages, ncurses, gsl }:
+
+stdenv.mkDerivation rec {
+  name = "orpie-${version}";
+  version = "1.5.2";
+
+  src = fetchurl {
+    url = "http://pessimization.com/software/orpie/${name}.tar.gz";
+    sha256 = "0v9xgpcf186ni55rkmx008msyszw0ypd6rd98hgwpih8yv3pymfy";
+  };
+
+  buildInputs = [ ncurses gsl ] ++ (with ocamlPackages; [ ocaml ]);
+
+  meta = {
+    homepage = http://pessimization.com/software/orpie/;
+    description = "A fullscreen RPN calculator for the console";
+    license = stdenv.lib.licenses.gpl2;
+    platforms = stdenv.lib.platforms.all;
+    maintainers = with stdenv.lib.maintainers; [ obadz ];
+  };
+}
diff --git a/pkgs/applications/misc/redshift/default.nix b/pkgs/applications/misc/redshift/default.nix
index dc799bd6ff52..6e5404eb6861 100644
--- a/pkgs/applications/misc/redshift/default.nix
+++ b/pkgs/applications/misc/redshift/default.nix
@@ -1,10 +1,9 @@
-{ fetchurl, stdenv, gettext, intltool, pkgconfig, makeWrapper
-, geoclue, python, pygobject3, pyxdg
-, libdrm, libX11, libxcb, libXxf86vm
-, guiSupport ? true
-, drmSupport ? true
-, randrSupport ? true
-, vidModeSupport ? true
+{ fetchurl, stdenv, gettext, intltool, makeWrapper, pkgconfig
+, geoclue
+, guiSupport ? true, hicolor_icon_theme, gtk3, python, pygobject3, pyxdg
+, drmSupport ? true, libdrm
+, randrSupport ? true, libxcb
+, vidModeSupport ? true, libX11, libXxf86vm
 }:
 
 let
@@ -19,10 +18,10 @@ stdenv.mkDerivation {
   };
 
   buildInputs = [ geoclue ]
-    ++ stdenv.lib.optional guiSupport [ python pygobject3 pyxdg ]
-    ++ stdenv.lib.optional drmSupport [ libdrm ]
-    ++ stdenv.lib.optional randrSupport [ libxcb ]
-    ++ stdenv.lib.optional vidModeSupport [ libX11 libXxf86vm ];
+    ++ stdenv.lib.optionals guiSupport [ hicolor_icon_theme gtk3 python pygobject3 pyxdg ]
+    ++ stdenv.lib.optionals drmSupport [ libdrm ]
+    ++ stdenv.lib.optionals randrSupport [ libxcb ]
+    ++ stdenv.lib.optionals vidModeSupport [ libX11 libXxf86vm ];
   nativeBuildInputs = [ gettext intltool makeWrapper pkgconfig ];
 
   configureFlags = [
@@ -33,12 +32,15 @@ stdenv.mkDerivation {
   ];
 
   preInstall = stdenv.lib.optionalString guiSupport ''
-    substituteInPlace src/redshift-gtk/redshift-gtk python \
+    substituteInPlace src/redshift-gtk/redshift-gtk \
       --replace "/usr/bin/env python3" "${python}/bin/${python.executable}"
   '';
 
   postInstall = stdenv.lib.optionalString guiSupport ''
-    wrapProgram "$out/bin/redshift-gtk" --prefix PYTHONPATH : "$PYTHONPATH"
+    wrapProgram "$out/bin/redshift-gtk" \
+      --prefix PYTHONPATH : "$PYTHONPATH" \
+      --prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH" \
+      --prefix XDG_DATA_DIRS : "$out/share:${hicolor_icon_theme}/share"
   '';
 
   meta = with stdenv.lib; {
diff --git a/pkgs/applications/misc/rsibreak/default.nix b/pkgs/applications/misc/rsibreak/default.nix
index 6587fb2debf2..42247572c246 100644
--- a/pkgs/applications/misc/rsibreak/default.nix
+++ b/pkgs/applications/misc/rsibreak/default.nix
@@ -1,4 +1,5 @@
-{ stdenv, fetchurl, kdelibs, kdebase_workspace, gettext }:
+{ stdenv, fetchurl, automoc4, cmake, gettext, perl, pkgconfig
+, kdelibs, kdebase_workspace }:
 
 let version = "0.11";
 in
@@ -10,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "0g27aswh8iz5v67v1wkjny4p100vs2gm0lw0qzfkg6sw1pb4i519";
   };
 
-  nativeBuildInputs = [ gettext ];
+  nativeBuildInputs = [ automoc4 cmake gettext perl pkgconfig ];
 
   buildInputs = [ kdelibs kdebase_workspace ];
 
diff --git a/pkgs/applications/misc/synergy/default.nix b/pkgs/applications/misc/synergy/default.nix
index c010047845fc..ac60d9285876 100644
--- a/pkgs/applications/misc/synergy/default.nix
+++ b/pkgs/applications/misc/synergy/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, x11, libX11, libXi, libXtst, libXrandr
+{ stdenv, fetchFromGitHub, cmake, xlibsWrapper, libX11, libXi, libXtst, libXrandr
 , xinput, curl, openssl, unzip }:
 
 with stdenv.lib;
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
   '';
 
   buildInputs = [
-    cmake x11 libX11 libXi libXtst libXrandr xinput curl openssl
+    cmake xlibsWrapper libX11 libXi libXtst libXrandr xinput curl openssl
   ];
 
   installPhase = ''
diff --git a/pkgs/applications/misc/wordnet/default.nix b/pkgs/applications/misc/wordnet/default.nix
index c70436e68f99..b244e9c1bfce 100644
--- a/pkgs/applications/misc/wordnet/default.nix
+++ b/pkgs/applications/misc/wordnet/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, tcl, tk, x11, makeWrapper}:
+{stdenv, fetchurl, tcl, tk, xlibsWrapper, makeWrapper}:
 
 let version = "3.0"; in
 stdenv.mkDerivation {
@@ -8,7 +8,7 @@ stdenv.mkDerivation {
     sha256 = "08pgjvd2vvmqk3h641x63nxp7wqimb9r30889mkyfh2agc62sjbc";
   };
 
-  buildInputs = [tcl tk x11 makeWrapper];
+  buildInputs = [tcl tk xlibsWrapper makeWrapper];
 
   patchPhase = ''
     sed "13i#define USE_INTERP_RESULT 1" -i src/stubs.c
diff --git a/pkgs/applications/misc/xcruiser/default.nix b/pkgs/applications/misc/xcruiser/default.nix
index 15202a1e90c6..f580c41c0a4d 100644
--- a/pkgs/applications/misc/xcruiser/default.nix
+++ b/pkgs/applications/misc/xcruiser/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gccmakedep, xlibs }:
+{ stdenv, fetchurl, gccmakedep, xorg }:
 
 stdenv.mkDerivation {
   name = "xcruiser-0.30";
@@ -8,7 +8,7 @@ stdenv.mkDerivation {
       sha256 = "1r8whva38xizqdh7jmn6wcmfmsndc67pkw22wzfzr6rq0vf6hywi";
     };
 
-  buildInputs = with xlibs; [ gccmakedep imake libXt libXaw libXpm libXext ];
+  buildInputs = with xorg; [ gccmakedep imake libXt libXaw libXpm libXext ];
 
   configurePhase = "xmkmf -a";
 
diff --git a/pkgs/applications/misc/xfe/default.nix b/pkgs/applications/misc/xfe/default.nix
index 5055ac50089d..0ea1159208f4 100644
--- a/pkgs/applications/misc/xfe/default.nix
+++ b/pkgs/applications/misc/xfe/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fox, pkgconfig, gettext, x11, gcc, intltool, file, libpng }:
+{ stdenv, fetchurl, fox, pkgconfig, gettext, xlibsWrapper, gcc, intltool, file, libpng }:
 
 stdenv.mkDerivation rec {
   name = "xfe-1.37";
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "1g9a0bpny2m7ixgxpqjh0wvh2x6d0lpj6682zn5dfqwan4j2xfsd";
   };
 
-  buildInputs = [ fox pkgconfig gettext x11 gcc intltool file libpng ];
+  buildInputs = [ fox pkgconfig gettext xlibsWrapper gcc intltool file libpng ];
 
   preConfigure = ''
     sed -i s,/usr/share/xfe,$out/share/xfe, src/xfedefs.h
diff --git a/pkgs/applications/misc/xpdf/default.nix b/pkgs/applications/misc/xpdf/default.nix
index 2e690dcce090..e677164ecf48 100644
--- a/pkgs/applications/misc/xpdf/default.nix
+++ b/pkgs/applications/misc/xpdf/default.nix
@@ -1,9 +1,9 @@
 { enableGUI ? true, enablePDFtoPPM ? true, useT1Lib ? false
-, stdenv, fetchurl, zlib, libpng, x11 ? null, motif ? null, freetype ? null, t1lib ? null
+, stdenv, fetchurl, zlib, libpng, xlibsWrapper ? null, motif ? null, freetype ? null, t1lib ? null
 , base14Fonts ? null
 }:
 
-assert enableGUI -> x11 != null && motif != null && freetype != null;
+assert enableGUI -> xlibsWrapper != null && motif != null && freetype != null;
 assert enablePDFtoPPM -> freetype != null;
 assert useT1Lib -> t1lib != null;
 
@@ -18,7 +18,7 @@ stdenv.mkDerivation {
   };
 
   buildInputs = [ zlib libpng ] ++
-    stdenv.lib.optionals enableGUI [x11 motif] ++
+    stdenv.lib.optionals enableGUI [xlibsWrapper motif] ++
     stdenv.lib.optional useT1Lib t1lib ++
     stdenv.lib.optional enablePDFtoPPM freetype;
 
diff --git a/pkgs/applications/misc/yakuake/default.nix b/pkgs/applications/misc/yakuake/default.nix
index 323782d60fe0..10b63d1db514 100644
--- a/pkgs/applications/misc/yakuake/default.nix
+++ b/pkgs/applications/misc/yakuake/default.nix
@@ -1,4 +1,5 @@
-{ stdenv, fetchurl, kdelibs, gettext, konsole }:
+{ stdenv, fetchurl, automoc4, cmake, gettext, perl, pkgconfig
+, kdelibs, konsole }:
 
 let
   pname = "yakuake";
@@ -14,7 +15,7 @@ stdenv.mkDerivation {
 
   buildInputs = [ kdelibs ];
 
-  nativeBuildInputs = [ gettext ];
+  nativeBuildInputs = [ automoc4 cmake gettext perl pkgconfig ];
 
   patchPhase = ''
     substituteInPlace app/terminal.cpp --replace \"konsolepart\" "\"${konsole}/lib/kde4/libkonsolepart.so\""
diff --git a/pkgs/applications/networking/browsers/chromium/source/sources.nix b/pkgs/applications/networking/browsers/chromium/source/sources.nix
index 62a5fd80a585..9ed001e06192 100644
--- a/pkgs/applications/networking/browsers/chromium/source/sources.nix
+++ b/pkgs/applications/networking/browsers/chromium/source/sources.nix
@@ -13,9 +13,9 @@
     sha256bin64 = "1kn0k8gpjnm1xsdiby76phwr0i8yb1w9mzmnf7ppj5cddikc5n3v";
   };
   stable = {
-    version = "45.0.2454.93";
-    sha256 = "1iraimblbzp9q16s5q7rbbb7079v095kr8dzqq1wwdb1bvcsllh6";
-    sha256bin32 = "1gndmychajm4qb623k57zirp72w4y1vfxp17gyrbjpg4kzbi1qcg";
-    sha256bin64 = "107l7f7crhcsv4xa219lmnsg2i7jqi5zly71cix54qg2bb7wgfwn";
+    version = "45.0.2454.99";
+    sha256 = "0h53gvgrs7f9sjw9vq21fr890f4qja0m2ja2c5ys1z5cs0gs7l8m";
+    sha256bin32 = "18cc3vqvcfv1x11w1briis57fz53cdnmlxzzkrgs3585kw1q3m1d";
+    sha256bin64 = "16pj25zvjiinc2wgvj2fwai6s2y5g8nx7j1p2s8bjix3hfnp26df";
   };
 }
diff --git a/pkgs/applications/networking/browsers/elinks/default.nix b/pkgs/applications/networking/browsers/elinks/default.nix
index 0e4fd4db1ba8..1a698b0effda 100644
--- a/pkgs/applications/networking/browsers/elinks/default.nix
+++ b/pkgs/applications/networking/browsers/elinks/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, perl, ncurses, x11, bzip2, zlib, openssl
+{ stdenv, fetchurl, perl, ncurses, xlibsWrapper, bzip2, zlib, openssl
 , spidermonkey, gpm
 , enableGuile ? false, guile ? null   # Incompatible licenses, LGPLv3 - GPLv2
 , enablePython ? false, python ? null
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
 
   patches = [ ./gc-init.patch ];
 
-  buildInputs = [ perl ncurses x11 bzip2 zlib openssl spidermonkey gpm ]
+  buildInputs = [ perl ncurses xlibsWrapper bzip2 zlib openssl spidermonkey gpm ]
     ++ stdenv.lib.optional enableGuile guile
     ++ stdenv.lib.optional enablePython python;
 
diff --git a/pkgs/applications/networking/browsers/firefox-bin/sources.nix b/pkgs/applications/networking/browsers/firefox-bin/sources.nix
index b29cdec27e97..3dcf855d0625 100644
--- a/pkgs/applications/networking/browsers/firefox-bin/sources.nix
+++ b/pkgs/applications/networking/browsers/firefox-bin/sources.nix
@@ -4,185 +4,185 @@
 # ruby generate_source.rb > source.nix
 
 {
-  version = "40.0.3";
+  version = "41.0";
   sources = [
-    { locale = "ach"; arch = "linux-i686"; sha1 = "68adee53b26075e18d0ef4d43da4260ec274d861"; }
-    { locale = "ach"; arch = "linux-x86_64"; sha1 = "8e2cc81fc414fb71e5a83c40b4a4197f6648af78"; }
-    { locale = "af"; arch = "linux-i686"; sha1 = "f36ae5a72738cfa70c6824a5929cb14faa60be1b"; }
-    { locale = "af"; arch = "linux-x86_64"; sha1 = "4b7a01e76db920d4aa1cbeb556cbe91b37070304"; }
-    { locale = "an"; arch = "linux-i686"; sha1 = "a71cc4c7f988f1b5470dec60a73643f53104a1b2"; }
-    { locale = "an"; arch = "linux-x86_64"; sha1 = "1c47a2b37a88d405a819c7bdbe84489a31e838dd"; }
-    { locale = "ar"; arch = "linux-i686"; sha1 = "d25ec2c169ea9a953636e0cbd4049095834c808d"; }
-    { locale = "ar"; arch = "linux-x86_64"; sha1 = "5f588ffb8e21ea15fb78dca128a33be734575e3e"; }
-    { locale = "as"; arch = "linux-i686"; sha1 = "aadbbc147c65d2436916e81bb43ca342f5c19a9d"; }
-    { locale = "as"; arch = "linux-x86_64"; sha1 = "9e04c39967e0a667b5a33f7436d555ac25ea4240"; }
-    { locale = "ast"; arch = "linux-i686"; sha1 = "9062edea598e4ec354259268be1fa2f85b8ba6d0"; }
-    { locale = "ast"; arch = "linux-x86_64"; sha1 = "98e6cac1de95a571ea6f88b18970c11b8056b8cb"; }
-    { locale = "az"; arch = "linux-i686"; sha1 = "4c23a1fb7e8ecdd1e20f9d398c387fbd766fa51e"; }
-    { locale = "az"; arch = "linux-x86_64"; sha1 = "5b4bb2a9906c7475c718ad0abd299606718c3880"; }
-    { locale = "be"; arch = "linux-i686"; sha1 = "e10d45e9c2de22d9af5db6750f5466d0fddce6d8"; }
-    { locale = "be"; arch = "linux-x86_64"; sha1 = "ce70351af3ce9f27051ae14e9a529cba9876aeb8"; }
-    { locale = "bg"; arch = "linux-i686"; sha1 = "e9546468eb2ddf67ea93563bd1a1c69736effa6b"; }
-    { locale = "bg"; arch = "linux-x86_64"; sha1 = "fb734bc851775335e4dbd795fb7a56ca30a2a7ae"; }
-    { locale = "bn-BD"; arch = "linux-i686"; sha1 = "36aeba40a75a80ab186bab0024607a263c92a8b5"; }
-    { locale = "bn-BD"; arch = "linux-x86_64"; sha1 = "e6f3833728864120906a7409561c09ace56713bb"; }
-    { locale = "bn-IN"; arch = "linux-i686"; sha1 = "c641603161439f8c982952db76a9a947a5e68f5f"; }
-    { locale = "bn-IN"; arch = "linux-x86_64"; sha1 = "97f560a79f9dffd208cc572875c9bd683ce7e0f7"; }
-    { locale = "br"; arch = "linux-i686"; sha1 = "08e490ecf22f1e6e2646ddb1bba508835593b6ae"; }
-    { locale = "br"; arch = "linux-x86_64"; sha1 = "e0b84df55b0ae2e216196037f62004d11074c618"; }
-    { locale = "bs"; arch = "linux-i686"; sha1 = "8f2f9e0870b27f4d184ee98052a78eff64192981"; }
-    { locale = "bs"; arch = "linux-x86_64"; sha1 = "8fbf417d8e2fe33d926bafc0fe4a4b433bd4ac93"; }
-    { locale = "ca"; arch = "linux-i686"; sha1 = "db308680eda482ebe59bd7807e433a3761b69160"; }
-    { locale = "ca"; arch = "linux-x86_64"; sha1 = "888fe735b223b2d233900c1f356de187a92eca02"; }
-    { locale = "cs"; arch = "linux-i686"; sha1 = "c3a185149605ec5818de19047c3a9be4cc8800b6"; }
-    { locale = "cs"; arch = "linux-x86_64"; sha1 = "6e6477d578bec18d7e67d35012c5d019f4055c65"; }
-    { locale = "cy"; arch = "linux-i686"; sha1 = "7990f07ca2fc0f28bdd2e96d5fe227b29f6eebaf"; }
-    { locale = "cy"; arch = "linux-x86_64"; sha1 = "11457870a82224739a5b02e7645703613b7c207b"; }
-    { locale = "da"; arch = "linux-i686"; sha1 = "9d96c67f5b22e6f8c114dd39230c666778d872b6"; }
-    { locale = "da"; arch = "linux-x86_64"; sha1 = "bff7b7716f2195fbb8e746b8e65498283c872710"; }
-    { locale = "de"; arch = "linux-i686"; sha1 = "7de018d1749c18a37da19db55a3070ef84e62ce4"; }
-    { locale = "de"; arch = "linux-x86_64"; sha1 = "44fe11de7503409417ad9c7ae0bf39c425c2dc90"; }
-    { locale = "dsb"; arch = "linux-i686"; sha1 = "2f9a019ff89e8b20d22d2e22cf58002a4d627228"; }
-    { locale = "dsb"; arch = "linux-x86_64"; sha1 = "f708084b81a3a98ac64e0e2ea4b6f97fe48a7209"; }
-    { locale = "el"; arch = "linux-i686"; sha1 = "77ddde8a32e0d81d5d7e136324117a4e07aaf7f0"; }
-    { locale = "el"; arch = "linux-x86_64"; sha1 = "dce4f745d77da895075b10f921b445e0df349edd"; }
-    { locale = "en-GB"; arch = "linux-i686"; sha1 = "7de8827e2929114f869af44e90dbac306b0ce9e7"; }
-    { locale = "en-GB"; arch = "linux-x86_64"; sha1 = "ead42059b82f9ab565a34fa3d6b3bc0f5a211a50"; }
-    { locale = "en-US"; arch = "linux-i686"; sha1 = "765f0120c223d07e84bc3ebf00eeef2e2907640e"; }
-    { locale = "en-US"; arch = "linux-x86_64"; sha1 = "0a317d7a0926e29e6dc8c563cf09fe667141da7d"; }
-    { locale = "en-ZA"; arch = "linux-i686"; sha1 = "52629a4afcc9f3224e3a8fdd12f2385ffd21cf00"; }
-    { locale = "en-ZA"; arch = "linux-x86_64"; sha1 = "d2fa0d6970a88de5125d89ae8263517a9bbc2346"; }
-    { locale = "eo"; arch = "linux-i686"; sha1 = "fbd01eae326465a8f4efeb08ff44d27f04e2ed66"; }
-    { locale = "eo"; arch = "linux-x86_64"; sha1 = "08b0f4d181ce1f0db0a799a7876315c6752c76af"; }
-    { locale = "es-AR"; arch = "linux-i686"; sha1 = "1a6d77533438619715e37b43c97f131ac7066ac0"; }
-    { locale = "es-AR"; arch = "linux-x86_64"; sha1 = "fae63a4b373d2074775dfa67ba7d4320cad59e61"; }
-    { locale = "es-CL"; arch = "linux-i686"; sha1 = "6068e7326eddf2d36afdd20dee1dd433abb0e3d0"; }
-    { locale = "es-CL"; arch = "linux-x86_64"; sha1 = "010544ad413acf7210c10aa3dc99ef0cdab6b475"; }
-    { locale = "es-ES"; arch = "linux-i686"; sha1 = "0378eb7346f686a8a25c71febfd933f3080e7e29"; }
-    { locale = "es-ES"; arch = "linux-x86_64"; sha1 = "01647b2981d62e2171f9e7b6e8286c542a00583a"; }
-    { locale = "es-MX"; arch = "linux-i686"; sha1 = "0f6194bce1a065d7b41fd8a46c52ea38874e9e56"; }
-    { locale = "es-MX"; arch = "linux-x86_64"; sha1 = "04f6cb55cb4f9171adf14c7a11ec0271d6c2cf3e"; }
-    { locale = "et"; arch = "linux-i686"; sha1 = "1da33a7e75efca19810ab7e739f2b81e0d48c379"; }
-    { locale = "et"; arch = "linux-x86_64"; sha1 = "44d8f989b04b16eff2bcf4945d3fa4387279dfc7"; }
-    { locale = "eu"; arch = "linux-i686"; sha1 = "60306283826c048acb1ad0232e9c1461f49f2a95"; }
-    { locale = "eu"; arch = "linux-x86_64"; sha1 = "16de3bde630a31c9330fd87ed7d994443371d84e"; }
-    { locale = "fa"; arch = "linux-i686"; sha1 = "728780b2668bb107db51f3804a53923d1a7c8298"; }
-    { locale = "fa"; arch = "linux-x86_64"; sha1 = "b31affd14286e7462e6c3bca472d88025c2b917b"; }
-    { locale = "ff"; arch = "linux-i686"; sha1 = "52d009168db00b167df1890dee39580ccca36ab6"; }
-    { locale = "ff"; arch = "linux-x86_64"; sha1 = "d65def2945ea4222965fa16e653cd0db8eec9454"; }
-    { locale = "fi"; arch = "linux-i686"; sha1 = "f62e88efed3d68b1ad88dfe9e8111d213b2c713b"; }
-    { locale = "fi"; arch = "linux-x86_64"; sha1 = "708ffd36d036b4c652ac1f20bf0cba2140035bc9"; }
-    { locale = "fr"; arch = "linux-i686"; sha1 = "310076f077abdd7834f341091a9541a27ce1f6ce"; }
-    { locale = "fr"; arch = "linux-x86_64"; sha1 = "5b2e56cf8173b5c4ab0949d9f5d099dbca8f27cb"; }
-    { locale = "fy-NL"; arch = "linux-i686"; sha1 = "de33f286bf9c6461335dc7cc9b997c6f52de34f6"; }
-    { locale = "fy-NL"; arch = "linux-x86_64"; sha1 = "b53848124a0d3d1d71a4e802d99a4344edd91e03"; }
-    { locale = "ga-IE"; arch = "linux-i686"; sha1 = "f3bdd90591fbaa6a15b1ae671e8633af3a2765ea"; }
-    { locale = "ga-IE"; arch = "linux-x86_64"; sha1 = "c8594b0932650c5850a84a35953b7116c432d0a9"; }
-    { locale = "gd"; arch = "linux-i686"; sha1 = "546818b38dc2e21afa2a51a29c2148bfe39ce33b"; }
-    { locale = "gd"; arch = "linux-x86_64"; sha1 = "a70e63927324099122edc032bb699e058c1ef36c"; }
-    { locale = "gl"; arch = "linux-i686"; sha1 = "75d6dc5dc3adc964be970dddc128e13baaac23dd"; }
-    { locale = "gl"; arch = "linux-x86_64"; sha1 = "2eba733d65e7582a23d84392288d10336e978009"; }
-    { locale = "gu-IN"; arch = "linux-i686"; sha1 = "97285fae817794cc05e9a121c33aafeff77442cb"; }
-    { locale = "gu-IN"; arch = "linux-x86_64"; sha1 = "063536c1cbc29c430a8e01674f3bb62ed94e18d9"; }
-    { locale = "he"; arch = "linux-i686"; sha1 = "a4be53b79cd1027f517562a0723233643b6e2020"; }
-    { locale = "he"; arch = "linux-x86_64"; sha1 = "4fcaf3a6347beaac041f9095609a92c03700e911"; }
-    { locale = "hi-IN"; arch = "linux-i686"; sha1 = "80d5db7c9a65de398663b3dc659723b12cdbe502"; }
-    { locale = "hi-IN"; arch = "linux-x86_64"; sha1 = "920bd570abce26d713f11666852fcf5d37d00331"; }
-    { locale = "hr"; arch = "linux-i686"; sha1 = "5de961d08a5bba30245b714271ab4ed5d24a3bc4"; }
-    { locale = "hr"; arch = "linux-x86_64"; sha1 = "fb30c3ab5b224a38416eb783ee30c3aa8b4a743b"; }
-    { locale = "hsb"; arch = "linux-i686"; sha1 = "31113c1b61217820f9a9e3dcace821aef612edd7"; }
-    { locale = "hsb"; arch = "linux-x86_64"; sha1 = "381bce247ea65fee04ee94d56e70cd30cc6959bd"; }
-    { locale = "hu"; arch = "linux-i686"; sha1 = "90515b7c36553cdf6b88b44146766c52d1a7acd5"; }
-    { locale = "hu"; arch = "linux-x86_64"; sha1 = "be0542fc76fedf82b46031dbeb9f4173be2a5313"; }
-    { locale = "hy-AM"; arch = "linux-i686"; sha1 = "4389ed68236bdc4697f3c8e5c53fe986ccb5f277"; }
-    { locale = "hy-AM"; arch = "linux-x86_64"; sha1 = "0bb311890b604d1300ffa887984b4217cfb3b925"; }
-    { locale = "id"; arch = "linux-i686"; sha1 = "8415b519f19a3c52a5d8418046a7a67d118a38e1"; }
-    { locale = "id"; arch = "linux-x86_64"; sha1 = "e492caab12e6dace9dc763209a8b0803e8216d2f"; }
-    { locale = "is"; arch = "linux-i686"; sha1 = "663d406a587449f33561173d6e6d275964b9172d"; }
-    { locale = "is"; arch = "linux-x86_64"; sha1 = "0f649b13c2dad302b0cf449915f5c1a5ab7e198c"; }
-    { locale = "it"; arch = "linux-i686"; sha1 = "490aeed8cd9878d0f22ea99df674d1dbe134a6f3"; }
-    { locale = "it"; arch = "linux-x86_64"; sha1 = "2fbe0baed7379d717174be8dee4b879e6e4afd81"; }
-    { locale = "ja"; arch = "linux-i686"; sha1 = "64144069a001bce53651aa5b8ec835c8c61bce1b"; }
-    { locale = "ja"; arch = "linux-x86_64"; sha1 = "66563588c41fed8e542c89756dc235773c6d201b"; }
-    { locale = "kk"; arch = "linux-i686"; sha1 = "c7e4a6544d4062958d48be26df3738b15871edcd"; }
-    { locale = "kk"; arch = "linux-x86_64"; sha1 = "5a0c5b2dd2dfe83ea9551fd63c249bc6b41c8afc"; }
-    { locale = "km"; arch = "linux-i686"; sha1 = "5f8bbbd2b77447660022464d19b3bb316eeb6b53"; }
-    { locale = "km"; arch = "linux-x86_64"; sha1 = "8211373a9ab45f43f2a895049f49c2b9b7af3670"; }
-    { locale = "kn"; arch = "linux-i686"; sha1 = "48b72a568ea55462d0d80194292ada525d24ee10"; }
-    { locale = "kn"; arch = "linux-x86_64"; sha1 = "27fbe84930417244c900ae864589fd063358e741"; }
-    { locale = "ko"; arch = "linux-i686"; sha1 = "f185c79195b7018edc97bd698d2f2f4f0f619968"; }
-    { locale = "ko"; arch = "linux-x86_64"; sha1 = "bcb4ceb162ae954a6c79ac6e83655b981eb0c168"; }
-    { locale = "lij"; arch = "linux-i686"; sha1 = "037516a147c18d03a74243ea680ec2da7b893b2f"; }
-    { locale = "lij"; arch = "linux-x86_64"; sha1 = "1a2efb6b3253da2e525b25b1e5cf794da203a112"; }
-    { locale = "lt"; arch = "linux-i686"; sha1 = "0200e608a4339158bafdafe32f39581d11ca4fea"; }
-    { locale = "lt"; arch = "linux-x86_64"; sha1 = "b5dd68b8d170b577f49508db110a7e3ef9aa1504"; }
-    { locale = "lv"; arch = "linux-i686"; sha1 = "5d9a22b515130e8c351fbbc71c5ee9c2586a98ca"; }
-    { locale = "lv"; arch = "linux-x86_64"; sha1 = "2b49dc4f3e43c4812239798b9096f4e89c5dc101"; }
-    { locale = "mai"; arch = "linux-i686"; sha1 = "530dfc4740f6c9c45163d51a49d4f6da8a1442c2"; }
-    { locale = "mai"; arch = "linux-x86_64"; sha1 = "927c9ca797e463336a8a7c66fef59fa585a0e985"; }
-    { locale = "mk"; arch = "linux-i686"; sha1 = "71984f44931f8c6e21a0e5a78d33301e9efd0c56"; }
-    { locale = "mk"; arch = "linux-x86_64"; sha1 = "14df4792bebc70fb27aba0e8fa9fa570b3c66cd2"; }
-    { locale = "ml"; arch = "linux-i686"; sha1 = "8301bc4d6919b849e1e0529d79fd56dfd7941e96"; }
-    { locale = "ml"; arch = "linux-x86_64"; sha1 = "5f7f352c4c6a316bfd8aa825771178be5e15def0"; }
-    { locale = "mr"; arch = "linux-i686"; sha1 = "2da181729cd1b9816d9530bfe2da47324595ceae"; }
-    { locale = "mr"; arch = "linux-x86_64"; sha1 = "4665e54e425d3b783c2ef045c7d4908862a604db"; }
-    { locale = "ms"; arch = "linux-i686"; sha1 = "48c57c3952cd918b4547f3aa17e52f856cb441d6"; }
-    { locale = "ms"; arch = "linux-x86_64"; sha1 = "769b7e80547be03bc81153c56da69b0660672a5b"; }
-    { locale = "nb-NO"; arch = "linux-i686"; sha1 = "c5123a9df2463883c38d748c360476ec16afafbd"; }
-    { locale = "nb-NO"; arch = "linux-x86_64"; sha1 = "50899fd2ddeeaa0011aa68f80ea23af808a2b13d"; }
-    { locale = "nl"; arch = "linux-i686"; sha1 = "8d2fa9624fe78538ac3be7afef67b5f077ea9087"; }
-    { locale = "nl"; arch = "linux-x86_64"; sha1 = "1ce05cc5d619ad8056720ee0a3aa1c142d323577"; }
-    { locale = "nn-NO"; arch = "linux-i686"; sha1 = "fc1e15e364b4b35ee097cb8a8e58f193cfab07fe"; }
-    { locale = "nn-NO"; arch = "linux-x86_64"; sha1 = "750189f10439b7d0592b5b1e5478571778a7b80c"; }
-    { locale = "or"; arch = "linux-i686"; sha1 = "562b5113560d43ab0332f12eb5b77f700adc3cac"; }
-    { locale = "or"; arch = "linux-x86_64"; sha1 = "7eea2b63095baaaf4077d21aec79a0262014231f"; }
-    { locale = "pa-IN"; arch = "linux-i686"; sha1 = "a474b711304003f7872f4d89482e460d6a5c6809"; }
-    { locale = "pa-IN"; arch = "linux-x86_64"; sha1 = "b44b52752754082dafa7cc2fe3ab820c15ad9dee"; }
-    { locale = "pl"; arch = "linux-i686"; sha1 = "5b4b8acd59a82feed1015e96efef60693bebc670"; }
-    { locale = "pl"; arch = "linux-x86_64"; sha1 = "be13540ad54f006884e5b15c80e60c24739a3afd"; }
-    { locale = "pt-BR"; arch = "linux-i686"; sha1 = "289f94519a382e07e9ea85c09c50ee0c1e4c78f8"; }
-    { locale = "pt-BR"; arch = "linux-x86_64"; sha1 = "ee789e0347ae16caeb803db227f917c2dec7402f"; }
-    { locale = "pt-PT"; arch = "linux-i686"; sha1 = "fdef92aba85eb308f77d5d218eab13ce1869720d"; }
-    { locale = "pt-PT"; arch = "linux-x86_64"; sha1 = "dac1e72db319e193b014d53ec2a937939bfda4ee"; }
-    { locale = "rm"; arch = "linux-i686"; sha1 = "8bdee17c004721832b978028c8249151522d1a53"; }
-    { locale = "rm"; arch = "linux-x86_64"; sha1 = "876ea6b07a58dcab72cc431bd4a956f6631616a4"; }
-    { locale = "ro"; arch = "linux-i686"; sha1 = "4de224d9b431e802274878b1ded2831a7976772d"; }
-    { locale = "ro"; arch = "linux-x86_64"; sha1 = "a620baccf62ead31da80d384ea65db816240180f"; }
-    { locale = "ru"; arch = "linux-i686"; sha1 = "979efbef49bbe7bdd21bb8b6cddf1c79d21e6d7c"; }
-    { locale = "ru"; arch = "linux-x86_64"; sha1 = "cce4b5be59a7072aee27b27496cfd2b36995592e"; }
-    { locale = "si"; arch = "linux-i686"; sha1 = "64fce36b5536da41b0d6e2144b1d8458fd29c1ec"; }
-    { locale = "si"; arch = "linux-x86_64"; sha1 = "cdf1ccb39f324ada803ebc606ef86f96b813151b"; }
-    { locale = "sk"; arch = "linux-i686"; sha1 = "a9933f868908c2dd361df41836c8af32e5849f48"; }
-    { locale = "sk"; arch = "linux-x86_64"; sha1 = "5462d38f1ea28c5a0abf7523f039f5ae0b4e860a"; }
-    { locale = "sl"; arch = "linux-i686"; sha1 = "a7e555402c5d7460696b86a2001333f66951a4b1"; }
-    { locale = "sl"; arch = "linux-x86_64"; sha1 = "ded2864cea9cdb70f25eaea61d6be6d4d5aaf822"; }
-    { locale = "son"; arch = "linux-i686"; sha1 = "fe596ad2b09ada772a38e7504f56776ee382851e"; }
-    { locale = "son"; arch = "linux-x86_64"; sha1 = "c920476a3e726708b447a7c3f9b38223fb5c705c"; }
-    { locale = "sq"; arch = "linux-i686"; sha1 = "16b4033cd9a05717ba5b32e57935a2a9b2e86e1e"; }
-    { locale = "sq"; arch = "linux-x86_64"; sha1 = "dfbf24d40bd5c098aa4c00be18db9adeb278b8a1"; }
-    { locale = "sr"; arch = "linux-i686"; sha1 = "18e143882f23f6bd2ea7b99849d840c5649b67da"; }
-    { locale = "sr"; arch = "linux-x86_64"; sha1 = "c748cbc2444151a2df6dc497b26bb6107cf603a0"; }
-    { locale = "sv-SE"; arch = "linux-i686"; sha1 = "36abc5c42eaf284249612e2bcf5940aeedadc6b7"; }
-    { locale = "sv-SE"; arch = "linux-x86_64"; sha1 = "73e1b14a3f00d73f85aced9b83cc281da6fff8eb"; }
-    { locale = "ta"; arch = "linux-i686"; sha1 = "621451f0be0f7d3edab0f4fdfaa2199d7e18941b"; }
-    { locale = "ta"; arch = "linux-x86_64"; sha1 = "89a750bd28b600375823f92fac3c1ac28e26f24a"; }
-    { locale = "te"; arch = "linux-i686"; sha1 = "0cab27456eb5b5124a848c1fcda70e3d8f2fd9d9"; }
-    { locale = "te"; arch = "linux-x86_64"; sha1 = "80c1b1e5cc6385f1e8b6922024726c36bc3360fb"; }
-    { locale = "th"; arch = "linux-i686"; sha1 = "4c23cebce4f2548f8692d5d36ab4295bc05a4597"; }
-    { locale = "th"; arch = "linux-x86_64"; sha1 = "e06d1ae0f6dc90766de010102864da5cccca14df"; }
-    { locale = "tr"; arch = "linux-i686"; sha1 = "0916aaa3a68831ad887708d13770e29edd129ea9"; }
-    { locale = "tr"; arch = "linux-x86_64"; sha1 = "a875fa64a788e3fe4b115fc01ad47b631d8aba27"; }
-    { locale = "uk"; arch = "linux-i686"; sha1 = "d9054dcf7d37ee6e88e462926d5f769bc1392342"; }
-    { locale = "uk"; arch = "linux-x86_64"; sha1 = "da23b4a2c9e4434ff927c6af81a3c823e546c24e"; }
-    { locale = "uz"; arch = "linux-i686"; sha1 = "ee12407db146542b1094342fd618678a8f6d20a3"; }
-    { locale = "uz"; arch = "linux-x86_64"; sha1 = "e4c433f31561006c5ba891ca701a03713d30e115"; }
-    { locale = "vi"; arch = "linux-i686"; sha1 = "07d95dbe0e967732a90b8c6dd1366010791a5286"; }
-    { locale = "vi"; arch = "linux-x86_64"; sha1 = "18b0a04c1e38476d85457b0a79942dbe2a0b6b04"; }
-    { locale = "xh"; arch = "linux-i686"; sha1 = "c4e1f30a92da9ded560209d9a4b8784ec19f9fa8"; }
-    { locale = "xh"; arch = "linux-x86_64"; sha1 = "22bfdd2d772f6080dc569b86f27e736c38e99374"; }
-    { locale = "zh-CN"; arch = "linux-i686"; sha1 = "1d72f825659eec22f52cacdcf4f5890957e8a38e"; }
-    { locale = "zh-CN"; arch = "linux-x86_64"; sha1 = "cd1cea8be94c3c4318e0bf9c283acade45f846ff"; }
-    { locale = "zh-TW"; arch = "linux-i686"; sha1 = "8ddfad29ebeccdddd3e5cdff3d8167a671e6821c"; }
-    { locale = "zh-TW"; arch = "linux-x86_64"; sha1 = "b4b36e9624ba93ddea2cca52d974acb67ba3407b"; }
+    { locale = "ach"; arch = "linux-i686"; sha1 = "f5170ec868dd1aee22e42ce5df62714cd5bd0272"; }
+    { locale = "ach"; arch = "linux-x86_64"; sha1 = "45cc71012e2c9423f53a9ba501087dc8d47e6b8a"; }
+    { locale = "af"; arch = "linux-i686"; sha1 = "d9677f0ad122cc64a99638397d52177d6df20128"; }
+    { locale = "af"; arch = "linux-x86_64"; sha1 = "7516c969fe2d572d1f9ef9d4de523e3d6caa88e1"; }
+    { locale = "an"; arch = "linux-i686"; sha1 = "d4ad4e5f5f7469b0fea1650b4104bf888cb5c15b"; }
+    { locale = "an"; arch = "linux-x86_64"; sha1 = "70bbff8841cc16f77c5095bd5b1069cb00c5f1cc"; }
+    { locale = "ar"; arch = "linux-i686"; sha1 = "efa4ed982bf62ffdfc665bb87d658936d8db5776"; }
+    { locale = "ar"; arch = "linux-x86_64"; sha1 = "0f9f7ade25f478081ba4c727aecd9984aee4df70"; }
+    { locale = "as"; arch = "linux-i686"; sha1 = "eb2367bf83ac5dbd2ee8878321b52db10d3639ad"; }
+    { locale = "as"; arch = "linux-x86_64"; sha1 = "e08846464bc3ff55d6964d19d737d0039322100f"; }
+    { locale = "ast"; arch = "linux-i686"; sha1 = "86304c1e29b9c5231767bd401273ec68046c76b2"; }
+    { locale = "ast"; arch = "linux-x86_64"; sha1 = "920f441939469910ddc938036cde2ab509cb2343"; }
+    { locale = "az"; arch = "linux-i686"; sha1 = "1f8520b21a3addb7f75068cc10a7b8e33b8ca518"; }
+    { locale = "az"; arch = "linux-x86_64"; sha1 = "177e632d49f6c1d97e5f1597e23ce11dca07e0e5"; }
+    { locale = "be"; arch = "linux-i686"; sha1 = "142285626aa67c743c5713b6a65e153fe0a641e0"; }
+    { locale = "be"; arch = "linux-x86_64"; sha1 = "7d49ab01ed0c42bca581bf86b3e8e1ad5bbf7bf1"; }
+    { locale = "bg"; arch = "linux-i686"; sha1 = "ab1b18aa69960298dfabd161f45d0a27795f0a1a"; }
+    { locale = "bg"; arch = "linux-x86_64"; sha1 = "0993c19e4345d993bb94c2dd2b5e4a80c95c4a43"; }
+    { locale = "bn-BD"; arch = "linux-i686"; sha1 = "a23f101ec5f80a88720615daa367cf0c019da41c"; }
+    { locale = "bn-BD"; arch = "linux-x86_64"; sha1 = "5a192b64a22e21cc4e35342c06f90529e0677703"; }
+    { locale = "bn-IN"; arch = "linux-i686"; sha1 = "0c316e902d44dea1a0c6bdb021ac189207aa791a"; }
+    { locale = "bn-IN"; arch = "linux-x86_64"; sha1 = "fc72cd6c2fa14120b78f19e75271a3ab61795889"; }
+    { locale = "br"; arch = "linux-i686"; sha1 = "5c159e461a8bf96f2189a843786451c62e842a2b"; }
+    { locale = "br"; arch = "linux-x86_64"; sha1 = "236b0c31e5f0ebd147bab0b0b03be356316242db"; }
+    { locale = "bs"; arch = "linux-i686"; sha1 = "515501f46ba1b02b076204a88954a31b2b2e7914"; }
+    { locale = "bs"; arch = "linux-x86_64"; sha1 = "5c7a4a0a260b5b16dc972cc2e4acaf001b3cdd41"; }
+    { locale = "ca"; arch = "linux-i686"; sha1 = "aa7ea9c8ec0c71445d89bf43031ac87951ea192f"; }
+    { locale = "ca"; arch = "linux-x86_64"; sha1 = "b6d9e57dc189c5178bbb585091d133fc8c04e718"; }
+    { locale = "cs"; arch = "linux-i686"; sha1 = "20fe53563a9c8c21a1e1c4095ac42ed0254bfbdd"; }
+    { locale = "cs"; arch = "linux-x86_64"; sha1 = "eb763eefb704c57ac367b4d242695c28eed640b4"; }
+    { locale = "cy"; arch = "linux-i686"; sha1 = "41c8826a12e642d0a4d073628a02ce3ef1ebd5fe"; }
+    { locale = "cy"; arch = "linux-x86_64"; sha1 = "057359932d6526eaa463907513814e2767a21f7d"; }
+    { locale = "da"; arch = "linux-i686"; sha1 = "b347c71204d4257b0a4ac710644fa0dab1aa8325"; }
+    { locale = "da"; arch = "linux-x86_64"; sha1 = "c0e54aa74ae60b241435a80450f75a8246a472cd"; }
+    { locale = "de"; arch = "linux-i686"; sha1 = "1eb209d6512043b1a51c805fef9056d377fd23bb"; }
+    { locale = "de"; arch = "linux-x86_64"; sha1 = "de9ba01f5f29a704ee4e9ddd05d0072d340c40f3"; }
+    { locale = "dsb"; arch = "linux-i686"; sha1 = "17c154b2f579ee94efc222dc0ba790e8bd93f324"; }
+    { locale = "dsb"; arch = "linux-x86_64"; sha1 = "d6f14ca2d875559e8459967b103fde124ab2827b"; }
+    { locale = "el"; arch = "linux-i686"; sha1 = "6cece97d1faca809bb44cccf1b46c83ec9391ef7"; }
+    { locale = "el"; arch = "linux-x86_64"; sha1 = "a47eecbd48135bb114fcd7160d7368074501a260"; }
+    { locale = "en-GB"; arch = "linux-i686"; sha1 = "e7a85809117d0092cc6532c781bfab915b3f16f6"; }
+    { locale = "en-GB"; arch = "linux-x86_64"; sha1 = "62823bc5fed9ed5b86566e2f4ddfb9764d3c3b83"; }
+    { locale = "en-US"; arch = "linux-i686"; sha1 = "5d5fa02110c31f1b1cca53f23f00119bf404a06d"; }
+    { locale = "en-US"; arch = "linux-x86_64"; sha1 = "41909356a1f661a64cef3c3ae696b356084be5a7"; }
+    { locale = "en-ZA"; arch = "linux-i686"; sha1 = "077a01cd8a9205c025693eb0cb3055e997a1b40e"; }
+    { locale = "en-ZA"; arch = "linux-x86_64"; sha1 = "51c13e2eddbabd12d7d35bb7465003768991806e"; }
+    { locale = "eo"; arch = "linux-i686"; sha1 = "a3851ca2e53b4fb2be4b2bb05e5551037d11184d"; }
+    { locale = "eo"; arch = "linux-x86_64"; sha1 = "103d1300b9fa071ae3c793874846c3cdff2c90c4"; }
+    { locale = "es-AR"; arch = "linux-i686"; sha1 = "275d3c72a0b8e6905c97bc58ad7e51811e6e37d7"; }
+    { locale = "es-AR"; arch = "linux-x86_64"; sha1 = "027749dee7e3541b0c29e4c8d1b27e7caa21044e"; }
+    { locale = "es-CL"; arch = "linux-i686"; sha1 = "a1c918e6e4460b49e8efdb4e5999ef1e28db9a5c"; }
+    { locale = "es-CL"; arch = "linux-x86_64"; sha1 = "6ebbb610c3614e308b5ee47a9b034292674b76ca"; }
+    { locale = "es-ES"; arch = "linux-i686"; sha1 = "21d50757c31db0a1a608aff651971670b8f10ab2"; }
+    { locale = "es-ES"; arch = "linux-x86_64"; sha1 = "f3549981b618fe6de379c1806ae8e5b4c088788e"; }
+    { locale = "es-MX"; arch = "linux-i686"; sha1 = "8918a3ae0b1327a100bea927aaad7a6c0fdf35ed"; }
+    { locale = "es-MX"; arch = "linux-x86_64"; sha1 = "e40461a28eb7c1dfa0c9e3bbfd76fbf9f532ca9f"; }
+    { locale = "et"; arch = "linux-i686"; sha1 = "779f1a8399d47a9515e79028e3a0f12a9e9e791a"; }
+    { locale = "et"; arch = "linux-x86_64"; sha1 = "5c1c8be5bc86d386a938d6ad1080d0fd8a763c0d"; }
+    { locale = "eu"; arch = "linux-i686"; sha1 = "5b8c59f4cf19d66bca5c34d51727717e0626ffd6"; }
+    { locale = "eu"; arch = "linux-x86_64"; sha1 = "0e2ba0116a0976059b224321747eb34b91d229dd"; }
+    { locale = "fa"; arch = "linux-i686"; sha1 = "3f1a0cab5c292d5319b852d4a974b17489b5516d"; }
+    { locale = "fa"; arch = "linux-x86_64"; sha1 = "199a7f70e3fa43e910da21b5680368a8b0805fe5"; }
+    { locale = "ff"; arch = "linux-i686"; sha1 = "7f54aa948b7b030e40019612ad5420d913d636d7"; }
+    { locale = "ff"; arch = "linux-x86_64"; sha1 = "38aaae5894f1c9a9aec27a8be3d93239d754178e"; }
+    { locale = "fi"; arch = "linux-i686"; sha1 = "338d3556673f77ee63f21cfaf5f58eaee4442181"; }
+    { locale = "fi"; arch = "linux-x86_64"; sha1 = "f8bd7b421699d499aed052396b2bbaf98c050728"; }
+    { locale = "fr"; arch = "linux-i686"; sha1 = "e2c58911aa0ff3b5bd98e83c758947c97d955503"; }
+    { locale = "fr"; arch = "linux-x86_64"; sha1 = "9b50488ae97c01f2848e827cd842e17abd8b5d21"; }
+    { locale = "fy-NL"; arch = "linux-i686"; sha1 = "cceb0a3752bd584cd02b3f84f8c07bc27ec38eef"; }
+    { locale = "fy-NL"; arch = "linux-x86_64"; sha1 = "c6c0d21b8230fdd2b35b8da591b027a594ef60d0"; }
+    { locale = "ga-IE"; arch = "linux-i686"; sha1 = "c662e5b2b59ce620754a845111bc58eab8e8a0ef"; }
+    { locale = "ga-IE"; arch = "linux-x86_64"; sha1 = "17e5c0a48e998c9e6f703033b386533ebd8354c0"; }
+    { locale = "gd"; arch = "linux-i686"; sha1 = "9a4569025d500290a4e1db03bca59d5731ba1e85"; }
+    { locale = "gd"; arch = "linux-x86_64"; sha1 = "3ca3494e510159ef1bb8e5c323a1b7c5b8faf235"; }
+    { locale = "gl"; arch = "linux-i686"; sha1 = "0b331461d902100249ef67d9038023ed8001d513"; }
+    { locale = "gl"; arch = "linux-x86_64"; sha1 = "1b11c8dfe0bdd4de77e03148fb1fe3ecbfb20677"; }
+    { locale = "gu-IN"; arch = "linux-i686"; sha1 = "03c09178f69f4040fe3817ba6d2fd40e98392aef"; }
+    { locale = "gu-IN"; arch = "linux-x86_64"; sha1 = "b0e6de684fcb7a47f7616f3071d09d89afbbcb80"; }
+    { locale = "he"; arch = "linux-i686"; sha1 = "e3d8f15caf7fa19df43e676a5cf93ca5e09ee27b"; }
+    { locale = "he"; arch = "linux-x86_64"; sha1 = "18441b8f340c0afe14f3869cc37ed041b911fb26"; }
+    { locale = "hi-IN"; arch = "linux-i686"; sha1 = "fb3627d0f89553741a8fbc3b7671309928832076"; }
+    { locale = "hi-IN"; arch = "linux-x86_64"; sha1 = "3da130031d183f003aa7c0fa3509f8982a4e70e1"; }
+    { locale = "hr"; arch = "linux-i686"; sha1 = "e6e4909d66672c665cf86db494351354720d5682"; }
+    { locale = "hr"; arch = "linux-x86_64"; sha1 = "027575c413be191f23b22f87a3db0ecdcb48b13c"; }
+    { locale = "hsb"; arch = "linux-i686"; sha1 = "24f5f3027708320a01d884ba7a91feac98c11f98"; }
+    { locale = "hsb"; arch = "linux-x86_64"; sha1 = "ede78b5b3ac15fec01de936dc722f25239dac5fb"; }
+    { locale = "hu"; arch = "linux-i686"; sha1 = "816f5e910aea73d6e36470d3169f900cda2004e2"; }
+    { locale = "hu"; arch = "linux-x86_64"; sha1 = "f5248943de5e8af2ed3e15fb85aa4429a7b97787"; }
+    { locale = "hy-AM"; arch = "linux-i686"; sha1 = "ae4e11326f3ad491ec2f823267be4c54a55f93cc"; }
+    { locale = "hy-AM"; arch = "linux-x86_64"; sha1 = "0ad1dce94bdc81f534399b00a09c004bac3c69c9"; }
+    { locale = "id"; arch = "linux-i686"; sha1 = "6568d4e201def196d457eaf13b6e4486ff70d336"; }
+    { locale = "id"; arch = "linux-x86_64"; sha1 = "45b74a17607f5d93d0062bb09c372afec0eedce6"; }
+    { locale = "is"; arch = "linux-i686"; sha1 = "d550eefe14d84cf91b3265675298f6c58cfbfe5c"; }
+    { locale = "is"; arch = "linux-x86_64"; sha1 = "0ddf532263b7f987867e640b278a9f2554e792cb"; }
+    { locale = "it"; arch = "linux-i686"; sha1 = "6cb353c7fbd9fc67571c5ba00b92d4760e33efaa"; }
+    { locale = "it"; arch = "linux-x86_64"; sha1 = "353d8e6e83f709d5ba5d26b1a42bc3cfca9997bf"; }
+    { locale = "ja"; arch = "linux-i686"; sha1 = "e03b1ad563f75cfdec52b392a888c60d2f1438f0"; }
+    { locale = "ja"; arch = "linux-x86_64"; sha1 = "5fad4f77e055e827ae948e9119d6c30e40ecd831"; }
+    { locale = "kk"; arch = "linux-i686"; sha1 = "68b9b9d57b6a28000abfcb6363273888f6f4814a"; }
+    { locale = "kk"; arch = "linux-x86_64"; sha1 = "09f3e62b0e084c26beabdb175232c3a46b8deba9"; }
+    { locale = "km"; arch = "linux-i686"; sha1 = "7bb71271eae1fecc328abd3a22f97eb8218f2ef4"; }
+    { locale = "km"; arch = "linux-x86_64"; sha1 = "c328d9f0ae6805aa5d1d4747c375a1f049e77252"; }
+    { locale = "kn"; arch = "linux-i686"; sha1 = "51d910f52c22180e2a92be77c846303ed037a437"; }
+    { locale = "kn"; arch = "linux-x86_64"; sha1 = "71411c26ed9c3a899c0e059301050acbcb96a751"; }
+    { locale = "ko"; arch = "linux-i686"; sha1 = "74f5c7e44dfd537857b29297f27037a6a741cbdd"; }
+    { locale = "ko"; arch = "linux-x86_64"; sha1 = "dcecd4c55763ec7441c37e048439dc1cb6ea480f"; }
+    { locale = "lij"; arch = "linux-i686"; sha1 = "df8d745849099c514ad7b6c40b89e2a6f1333a54"; }
+    { locale = "lij"; arch = "linux-x86_64"; sha1 = "d449eab057742d8798f2d255b4c3134f820e4379"; }
+    { locale = "lt"; arch = "linux-i686"; sha1 = "9186dab13998c5d01e508fca536f36c1a4fc7dfb"; }
+    { locale = "lt"; arch = "linux-x86_64"; sha1 = "11e28641755c2ee9648d46181f2861ef67937f53"; }
+    { locale = "lv"; arch = "linux-i686"; sha1 = "552bd1ef40500c9a5e68b122c8b3525077ce5f6e"; }
+    { locale = "lv"; arch = "linux-x86_64"; sha1 = "6a6403dd89318608b1436b7d42700054f9a6945a"; }
+    { locale = "mai"; arch = "linux-i686"; sha1 = "ec3d4b155e58cfec6496fbd824a15dba9377e6ae"; }
+    { locale = "mai"; arch = "linux-x86_64"; sha1 = "15c2e13971e05b8023826e96ad9d326dd254bbdc"; }
+    { locale = "mk"; arch = "linux-i686"; sha1 = "7fb2263b3376b8f05ccf12672994919b6a0bdeee"; }
+    { locale = "mk"; arch = "linux-x86_64"; sha1 = "67b91736a82ab8ce2c523ea084e9be2587d6ee9a"; }
+    { locale = "ml"; arch = "linux-i686"; sha1 = "9558d57c27f08cf87e35d827bffdc1161505bdf8"; }
+    { locale = "ml"; arch = "linux-x86_64"; sha1 = "07dd0613207de1b32d7ea7d057154a25f162c240"; }
+    { locale = "mr"; arch = "linux-i686"; sha1 = "1f1138e747e86fd2408ae827f7785af9a46e49ec"; }
+    { locale = "mr"; arch = "linux-x86_64"; sha1 = "6b9d24d1f1956fbe375d4850d977c8794b2094ce"; }
+    { locale = "ms"; arch = "linux-i686"; sha1 = "d8c35c7542ad0c30ac06ba8c6670396eb4cba115"; }
+    { locale = "ms"; arch = "linux-x86_64"; sha1 = "b885a83d29c8b7670bba999df6bcb67f6c9a13de"; }
+    { locale = "nb-NO"; arch = "linux-i686"; sha1 = "3fbd8181255cca312da88cadd088b6fe5edabaad"; }
+    { locale = "nb-NO"; arch = "linux-x86_64"; sha1 = "969f2d6715824ca22cb19a5c7c338d9b4e9cbc87"; }
+    { locale = "nl"; arch = "linux-i686"; sha1 = "e8f99b167cc4d9101168c5d054e439fa00b53d66"; }
+    { locale = "nl"; arch = "linux-x86_64"; sha1 = "121c2c1839fb65c242e719c05c2794fb80d3df29"; }
+    { locale = "nn-NO"; arch = "linux-i686"; sha1 = "b77b21a3d8fc78df630f9b412aad94e6bbf6045d"; }
+    { locale = "nn-NO"; arch = "linux-x86_64"; sha1 = "bece8813404652dc07b4223d93cf925085a8c2d7"; }
+    { locale = "or"; arch = "linux-i686"; sha1 = "5c79f1aa2a5a4b9d173f8705000cb950764d308e"; }
+    { locale = "or"; arch = "linux-x86_64"; sha1 = "edb4f388e48f6a5e63e285f4fca64fd7053ea291"; }
+    { locale = "pa-IN"; arch = "linux-i686"; sha1 = "618063149909ead3828d509b3f4bdebe98f562c5"; }
+    { locale = "pa-IN"; arch = "linux-x86_64"; sha1 = "a50d2f536cbf118ab1480d716f7729627c57e05c"; }
+    { locale = "pl"; arch = "linux-i686"; sha1 = "e94e2d515b8aed6c24a5239f852b971eb7001202"; }
+    { locale = "pl"; arch = "linux-x86_64"; sha1 = "58e2208b25a70586ae6aff1b58e9c25948622be0"; }
+    { locale = "pt-BR"; arch = "linux-i686"; sha1 = "732f7e366000509958fdd8065f67138ea38a55a6"; }
+    { locale = "pt-BR"; arch = "linux-x86_64"; sha1 = "2a6e341c14b8bc060e93e9fdbe20f6c7f14ffaeb"; }
+    { locale = "pt-PT"; arch = "linux-i686"; sha1 = "5f54ba5748c637d3a94558bc10e6fab3db1518ec"; }
+    { locale = "pt-PT"; arch = "linux-x86_64"; sha1 = "72e93c7a33b799c7067163cb7834ab2f93f851f5"; }
+    { locale = "rm"; arch = "linux-i686"; sha1 = "8c47019cc0cb465431d207e1f8e499d00a7fe8d0"; }
+    { locale = "rm"; arch = "linux-x86_64"; sha1 = "29bea7462e7b3295e1964ff472a295906e297925"; }
+    { locale = "ro"; arch = "linux-i686"; sha1 = "2822d04eef821bbd35448b69f27f8e933def6f4e"; }
+    { locale = "ro"; arch = "linux-x86_64"; sha1 = "9a31c8ce51c31d118de81ef9c7afbd2a0536a9e4"; }
+    { locale = "ru"; arch = "linux-i686"; sha1 = "04a8a632f3cb50445091baa52aced77cfb00f4e2"; }
+    { locale = "ru"; arch = "linux-x86_64"; sha1 = "1de49f0817c3a7c6cf4f58f72c10203a8b5a59ba"; }
+    { locale = "si"; arch = "linux-i686"; sha1 = "f7983c4ce6a6d8b30ae0f55228cc9e3a25ae3971"; }
+    { locale = "si"; arch = "linux-x86_64"; sha1 = "f5cd2cc05d03d34d6284468c08ba76f7ac95b6ef"; }
+    { locale = "sk"; arch = "linux-i686"; sha1 = "dbe36a51050b2efb613318d81da0df2e32a7361c"; }
+    { locale = "sk"; arch = "linux-x86_64"; sha1 = "77dcba31255d019e19c01dc1131b4a2364817e6b"; }
+    { locale = "sl"; arch = "linux-i686"; sha1 = "42976aa670cf12730ac548603f6a84fde0dd4152"; }
+    { locale = "sl"; arch = "linux-x86_64"; sha1 = "7f3d486be4782a5a9a85fbbcccb30cd7f020b0a6"; }
+    { locale = "son"; arch = "linux-i686"; sha1 = "5becaf85ea5b992798e1bf2561f3771d23676d9d"; }
+    { locale = "son"; arch = "linux-x86_64"; sha1 = "56f32e6524b0d16ba7e3aeb1fde7d9d56fae67e6"; }
+    { locale = "sq"; arch = "linux-i686"; sha1 = "654860607a653d13895c188d6d7acba8a3cd3342"; }
+    { locale = "sq"; arch = "linux-x86_64"; sha1 = "859f9e3fda8e9952dd33e67f619124af6a8f3147"; }
+    { locale = "sr"; arch = "linux-i686"; sha1 = "e5b06f11813d3e7e1bce62a20c85a3e860828e0a"; }
+    { locale = "sr"; arch = "linux-x86_64"; sha1 = "fa2167558158241844e2061cb28c7890bef939ac"; }
+    { locale = "sv-SE"; arch = "linux-i686"; sha1 = "71c099a731af87a46dfb153b7ba3ea9a5d188fb4"; }
+    { locale = "sv-SE"; arch = "linux-x86_64"; sha1 = "f1a151abc610c75ce54fddfc0649e1e361469d01"; }
+    { locale = "ta"; arch = "linux-i686"; sha1 = "feff271a83d4ed97c754c7502033d5d5d7af8082"; }
+    { locale = "ta"; arch = "linux-x86_64"; sha1 = "1976cdbf1153579bc97e00595ce60f93732ee85c"; }
+    { locale = "te"; arch = "linux-i686"; sha1 = "063c1c55aad4f055cba90292dd231ef037b6add1"; }
+    { locale = "te"; arch = "linux-x86_64"; sha1 = "d04d784383d0bf4a6cf10750c1e2d2dce280e8ad"; }
+    { locale = "th"; arch = "linux-i686"; sha1 = "4b453bd313d45386d5d99b935e24289bd4c51f25"; }
+    { locale = "th"; arch = "linux-x86_64"; sha1 = "784c38a90182d136407a056892349607b414bdd3"; }
+    { locale = "tr"; arch = "linux-i686"; sha1 = "bcbc685a2122c23460d8d2ac4e807fdccd75b8e9"; }
+    { locale = "tr"; arch = "linux-x86_64"; sha1 = "167ffbf3547713c6f236f9c661de8b239699070d"; }
+    { locale = "uk"; arch = "linux-i686"; sha1 = "ebd2e78cd94454a58757ff093b3ee84faf08e7b8"; }
+    { locale = "uk"; arch = "linux-x86_64"; sha1 = "6b8f59fefb8d37750a311614f8403f5be989917f"; }
+    { locale = "uz"; arch = "linux-i686"; sha1 = "5a799fd0f5cdcab2580f14dc107a43160e065092"; }
+    { locale = "uz"; arch = "linux-x86_64"; sha1 = "c28fe123246a378035ee6ceee3e2d33d0412e874"; }
+    { locale = "vi"; arch = "linux-i686"; sha1 = "2cdc27ce098519017e006e2cdfb4b4d883264050"; }
+    { locale = "vi"; arch = "linux-x86_64"; sha1 = "b5891e4e1284ea3e1a2ee7dc60a60ad5460b65e5"; }
+    { locale = "xh"; arch = "linux-i686"; sha1 = "ce010fe5110e0dd6b3763d23c460d74ec7bfcaad"; }
+    { locale = "xh"; arch = "linux-x86_64"; sha1 = "231a10effa87e4a5d8848a175a4016e104c1cbaf"; }
+    { locale = "zh-CN"; arch = "linux-i686"; sha1 = "d40f8e841323cd2cb99392514e6e5daae7ab9246"; }
+    { locale = "zh-CN"; arch = "linux-x86_64"; sha1 = "5bf94401578d12e01a0f4a4911472efbae95f5c9"; }
+    { locale = "zh-TW"; arch = "linux-i686"; sha1 = "1e96feab226294cb6170bd4c707d97c6298db91e"; }
+    { locale = "zh-TW"; arch = "linux-x86_64"; sha1 = "c7a7698cec959f3592c9cf2e7f3f425016281c04"; }
   ];
 }
diff --git a/pkgs/applications/networking/browsers/firefox/default.nix b/pkgs/applications/networking/browsers/firefox/default.nix
index 12d581b15666..9f027a25c175 100644
--- a/pkgs/applications/networking/browsers/firefox/default.nix
+++ b/pkgs/applications/networking/browsers/firefox/default.nix
@@ -1,10 +1,10 @@
 { lib, stdenv, fetchurl, pkgconfig, gtk, gtk3, pango, perl, python, zip, libIDL
-, libjpeg, zlib, dbus, dbus_glib, bzip2, xlibs
+, libjpeg, zlib, dbus, dbus_glib, bzip2, xorg
 , freetype, fontconfig, file, alsaLib, nspr, nss, libnotify
 , yasm, mesa, sqlite, unzip, makeWrapper, pysqlite
 , hunspell, libevent, libstartup_notification, libvpx
 , cairo, gstreamer, gst_plugins_base, icu, libpng, jemalloc, libpulseaudio
-, enableGTK3 ? false, fetchpatch
+, enableGTK3 ? false
 , debugBuild ? false
 , # If you want the resulting program to call itself "Firefox" instead
   # of "Shiretoko" or whatever, enable this option.  However, those
@@ -22,28 +22,19 @@ common = { pname, version, sha1 }: stdenv.mkDerivation rec {
   name = "${pname}-${version}";
 
   src = fetchurl {
-    url = "http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${version}/source/firefox-${version}.source.tar.bz2";
+    url =
+      let ext = if lib.versionAtLeast version "41.0" then "xz" else "bz2";
+      in "http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${version}/source/firefox-${version}.source.tar.${ext}";
     inherit sha1;
   };
 
-  patches = if !enableGTK3 then null else [(fetchpatch {
-    name = "crash_OTMC+GTK3.patch";
-    # backported from 40.1
-    # https://bugzilla.mozilla.org/show_bug.cgi?id=1127752
-    # https://bugzilla.redhat.com/show_bug.cgi?id=1256875
-    url = "http://pkgs.fedoraproject.org/cgit/firefox.git/plain/"
-      + "mozilla-1127752.patch?id=571fefe2c8f741b92c865e9122af56f6258b3fc1";
-    sha256 = "04yq4lcq8ln2fmknz4c0zah77wxqp2mcgr8pjx860dmcmzvyi3p5";
-  })];
-  patchFlags = "-p2";
-
   buildInputs =
     [ pkgconfig gtk perl zip libIDL libjpeg zlib bzip2
-      python dbus dbus_glib pango freetype fontconfig xlibs.libXi
-      xlibs.libX11 xlibs.libXrender xlibs.libXft xlibs.libXt file
-      alsaLib nspr nss libnotify xlibs.pixman yasm mesa
-      xlibs.libXScrnSaver xlibs.scrnsaverproto pysqlite
-      xlibs.libXext xlibs.xextproto sqlite unzip makeWrapper
+      python 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 pysqlite
+      xorg.libXext xorg.xextproto sqlite unzip makeWrapper
       hunspell libevent libstartup_notification libvpx /* cairo */
       gstreamer gst_plugins_base icu libpng jemalloc
       libpulseaudio # only headers are needed
@@ -77,6 +68,7 @@ common = { pname, version, sha1 }: stdenv.mkDerivation rec {
       "--disable-installer"
       "--disable-updater"
       "--enable-jemalloc"
+      "--disable-gconf"
     ]
     ++ lib.optional enableGTK3 "--enable-default-toolkit=cairo-gtk3"
     ++ (if debugBuild then [ "--enable-debug" "--enable-profiling" ]
@@ -137,14 +129,14 @@ in {
 
   firefox = common {
     pname = "firefox";
-    version = "40.0.3";
-    sha1 = "6ddda46bd6540ab3ae932fbb5ffec8e9a85cab13";
+    version = "41.0";
+    sha1 = "0ce7a5ccdf671a6c98eaac07d06d49a895a99449";
   };
 
   firefox-esr = common {
     pname = "firefox-esr";
-    version = "38.2.1esr";
-    sha1 = "c596174e7273be5079bf55aecde33ec191d99538";
+    version = "38.3.0esr";
+    sha1 = "57d2c255348ac13b6ffbb952c5e0d57757aa0290";
   };
 
 }
diff --git a/pkgs/applications/networking/browsers/kwebkitpart/default.nix b/pkgs/applications/networking/browsers/kwebkitpart/default.nix
index cb3a0e9eac49..173ffcb93304 100644
--- a/pkgs/applications/networking/browsers/kwebkitpart/default.nix
+++ b/pkgs/applications/networking/browsers/kwebkitpart/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, kdelibs }:
+{ stdenv, fetchgit, automoc4, cmake, perl, pkgconfig, kdelibs }:
 
 stdenv.mkDerivation rec {
   name = "kwebkitpart-${version}";
@@ -14,6 +14,8 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ kdelibs ];
 
+  nativeBuildInputs = [ automoc4 cmake perl pkgconfig ];
+
   meta = with stdenv.lib; {
     platforms = platforms.linux;
     maintainers = [ maintainers.phreedom ];
diff --git a/pkgs/applications/networking/browsers/mozilla-plugins/gecko-mediaplayer/default.nix b/pkgs/applications/networking/browsers/mozilla-plugins/gecko-mediaplayer/default.nix
index 05e3a8bf613a..ba40925e1d1e 100644
--- a/pkgs/applications/networking/browsers/mozilla-plugins/gecko-mediaplayer/default.nix
+++ b/pkgs/applications/networking/browsers/mozilla-plugins/gecko-mediaplayer/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, glib, dbus, dbus_glib, browser, x11
+{ stdenv, fetchurl, pkgconfig, glib, dbus, dbus_glib, browser, xlibsWrapper
 , GConf, gnome_mplayer, mplayer, gmtk
 }:
 
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     sha256 = "913fd39e70c564cb210c2544a88869f9d1a448184421f000b14b2bc5ba718b49";
   };
 
-  buildInputs = [ pkgconfig glib dbus dbus_glib browser x11 GConf browser gmtk ];
+  buildInputs = [ pkgconfig glib dbus dbus_glib browser xlibsWrapper GConf browser gmtk ];
 
   # !!! fix this
   preBuild =
diff --git a/pkgs/applications/networking/browsers/qutebrowser/default.nix b/pkgs/applications/networking/browsers/qutebrowser/default.nix
index c90c13b190dc..7f2190ab82c6 100644
--- a/pkgs/applications/networking/browsers/qutebrowser/default.nix
+++ b/pkgs/applications/networking/browsers/qutebrowser/default.nix
@@ -1,4 +1,5 @@
-{ stdenv, fetchgit, python, buildPythonPackage, qt5, pyqt5, jinja2, pygments, pyyaml, pypeg2 }:
+{ stdenv, fetchgit, python, buildPythonPackage, qt5, pyqt5, jinja2, pygments, pyyaml, pypeg2,
+  gst_plugins_base, gst_plugins_good, gst_ffmpeg }:
 
 let version = "0.4.0"; in
 
@@ -19,6 +20,12 @@ buildPythonPackage {
     python pyyaml pyqt5 jinja2 pygments pypeg2
   ];
 
+  makeWrapperArgs = ''
+    --prefix GST_PLUGIN_PATH : "${stdenv.lib.makeSearchPath "lib/gstreamer-0.10"
+       [ gst_plugins_base gst_plugins_good gst_ffmpeg ]}"
+    --prefix QT_PLUGIN_PATH : "${qt5.multimedia}/lib/qt5/plugins"
+  '';
+
   meta = {
     homepage = https://github.com/The-Compiler/qutebrowser;
     description = "Keyboard-focused browser with a minimal GUI";
diff --git a/pkgs/applications/networking/browsers/rekonq/default.nix b/pkgs/applications/networking/browsers/rekonq/default.nix
index ce36e26d6fcc..df8ad1eb3508 100644
--- a/pkgs/applications/networking/browsers/rekonq/default.nix
+++ b/pkgs/applications/networking/browsers/rekonq/default.nix
@@ -1,4 +1,5 @@
-{ stdenv, fetchurl, kde4, gettext, pkgconfig, shared_desktop_ontologies, qca2, qoauth }:
+{ stdenv, fetchurl, automoc4, cmake, gettext, perl, pkgconfig
+, kde4, shared_desktop_ontologies, qca2, qoauth }:
 
 assert builtins.compareVersions "4.8.3" kde4.release != 1; # https://bugs.kde.org/show_bug.cgi?id=306077
 
@@ -12,7 +13,9 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ kde4.kdelibs qca2 qoauth ];
 
-  nativeBuildInputs = [ gettext pkgconfig shared_desktop_ontologies ];
+  nativeBuildInputs = [
+    automoc4 cmake gettext perl pkgconfig shared_desktop_ontologies
+  ];
 
   meta = with stdenv.lib; {
     platforms = platforms.linux;
diff --git a/pkgs/applications/networking/browsers/w3m/default.nix b/pkgs/applications/networking/browsers/w3m/default.nix
index ade28b519bc5..d8c421af46a8 100644
--- a/pkgs/applications/networking/browsers/w3m/default.nix
+++ b/pkgs/applications/networking/browsers/w3m/default.nix
@@ -3,12 +3,12 @@
 , graphicsSupport ? false
 , mouseSupport ? false
 , ncurses, openssl ? null, boehmgc, gettext, zlib
-, imlib2 ? null, x11 ? null, fbcon ? null
+, imlib2 ? null, xlibsWrapper ? null, fbcon ? null
 , gpm-ncurses ? null
 }:
 
 assert sslSupport -> openssl != null;
-assert graphicsSupport -> imlib2 != null && (x11 != null || fbcon != null);
+assert graphicsSupport -> imlib2 != null && (xlibsWrapper != null || fbcon != null);
 assert mouseSupport -> gpm-ncurses != null;
 
 stdenv.mkDerivation rec {
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ncurses boehmgc gettext zlib]
     ++ stdenv.lib.optional sslSupport openssl
     ++ stdenv.lib.optional mouseSupport gpm-ncurses
-    ++ stdenv.lib.optionals graphicsSupport [imlib2 x11 fbcon];
+    ++ stdenv.lib.optionals graphicsSupport [imlib2 xlibsWrapper fbcon];
 
   configureFlags = "--with-ssl=${openssl} --with-gc=${boehmgc}"
     + stdenv.lib.optionalString graphicsSupport " --enable-image=x11,fb";
diff --git a/pkgs/applications/networking/dropbox/default.nix b/pkgs/applications/networking/dropbox/default.nix
index 3b157857ff96..08a4b0dacbd9 100644
--- a/pkgs/applications/networking/dropbox/default.nix
+++ b/pkgs/applications/networking/dropbox/default.nix
@@ -1,6 +1,7 @@
-{ stdenv, fetchurl, makeDesktopItem, makeWrapper
+{ stdenv, fetchurl, makeDesktopItem, makeWrapper, patchelf
 , dbus_libs, gcc, glib, libdrm, libffi, libICE, libSM
 , libX11, libXmu, ncurses, popt, qt5, zlib
+, qtbase, qtdeclarative, qtwebkit
 }:
 
 # this package contains the daemon version of dropbox
@@ -32,20 +33,13 @@ let
       "i686-linux" = "x86";
     }."${stdenv.system}" or (throw "system ${stdenv.system} not supported");
 
-  interpreter =
-    {
-      "x86_64-linux" = "ld-linux-x86-64.so.2";
-      "i686-linux" = "ld-linux.so.2";
-    }."${stdenv.system}" or (throw "system ${stdenv.system} not supported");
-
   # relative location where the dropbox libraries are stored
   appdir = "opt/dropbox";
 
   ldpath = stdenv.lib.makeSearchPath "lib"
     [
-      dbus_libs gcc glib libdrm libffi libICE libSM libX11
-      libXmu ncurses popt qt5.base qt5.declarative qt5.webkit
-      zlib
+      dbus_libs gcc.cc glib libdrm libffi libICE libSM libX11 libXmu
+      ncurses popt qtbase qtdeclarative qtwebkit zlib
     ];
 
   desktopItem = makeDesktopItem {
@@ -58,24 +52,22 @@ let
   };
 
 in stdenv.mkDerivation {
-  name = "dropbox-${version}-bin";
+  name = "dropbox-${version}";
   src = fetchurl {
     name = "dropbox-${version}.tar.gz";
     url = "https://dl-web.dropbox.com/u/17/dropbox-lnx.${arch}-${version}.tar.gz";
     inherit sha256;
   };
 
-  sourceRoot = ".";
+  sourceRoot = ".dropbox-dist";
 
-  patchPhase = ''
-    rm -f .dropbox-dist/dropboxd
-  '';
-
-  buildInputs = [ makeWrapper ];
+  buildInputs = [ makeWrapper patchelf ];
+  dontPatchELF = true; # patchelf invoked explicitly below
+  dontStrip = true; # already done
 
   installPhase = ''
     mkdir -p "$out/${appdir}"
-    cp -r ".dropbox-dist/dropbox-lnx.${arch}-${version}"/* "$out/${appdir}/"
+    cp -r "dropbox-lnx.${arch}-${version}"/* "$out/${appdir}/"
 
     rm "$out/${appdir}/libdrm.so.2"
     rm "$out/${appdir}/libffi.so.6"
@@ -101,28 +93,62 @@ in stdenv.mkDerivation {
     rm "$out/${appdir}/qt.conf"
     rm -fr "$out/${appdir}/plugins"
 
-    find "$out/${appdir}" -type f -a -perm -0100 \
-      -print -exec patchelf --set-interpreter ${stdenv.glibc}/lib/${interpreter} {} \;
-
-    RPATH=${ldpath}:${gcc.cc}/lib:$out/${appdir}
-    echo "updating rpaths to: $RPATH"
-    find "$out/${appdir}" -type f -a -perm -0100 \
-      -print -exec patchelf --force-rpath --set-rpath "$RPATH" {} \;
-
     mkdir -p "$out/share/applications"
     cp "${desktopItem}/share/applications/"* $out/share/applications
 
+    mkdir -p "$out/share/icons"
+    ln -s "$out/${appdir}/images/hicolor" "$out/share/icons/hicolor"
+
     mkdir -p "$out/bin"
+    RPATH="${ldpath}:$out/${appdir}"
     makeWrapper "$out/${appdir}/dropbox" "$out/bin/dropbox" \
-      --prefix LD_LIBRARY_PATH : "${ldpath}"
+      --prefix LD_LIBRARY_PATH : "$RPATH"
+  '';
 
-    mkdir -p "$out/share/icons"
-    ln -s "$out/${appdir}/images/hicolor" "$out/share/icons/hicolor"
+  fixupPhase = ''
+    INTERP=$(cat $NIX_CC/nix-support/dynamic-linker)
+    RPATH="${ldpath}:$out/${appdir}"
+    getType='s/ *Type: *\([A-Z]*\) (.*/\1/'
+    find "$out/${appdir}" -type f -a -perm -0100 -print | while read obj; do
+        dynamic=$(readelf -S "$obj" 2>/dev/null | grep "DYNAMIC" || true)
+
+        if [[ -n "$dynamic" ]]; then
+            type=$(readelf -h "$obj" 2>/dev/null | grep 'Type:' | sed -e "$getType")
+
+            if [[ "$type" == "EXEC" ]]; then
+
+                echo "patching interpreter path in $type $obj"
+                patchelf --set-interpreter "$INTERP" "$obj"
+
+                echo "patching RPATH in $type $obj"
+                oldRPATH=$(patchelf --print-rpath "$obj")
+                patchelf --set-rpath "''${oldRPATH:+$oldRPATH:}$RPATH" "$obj"
+
+                echo "shrinking RPATH in $type $obj"
+                patchelf --shrink-rpath "$obj"
+
+            elif [[ "$type" == "DYN" ]]; then
+
+                echo "patching RPATH in $type $obj"
+                oldRPATH=$(patchelf --print-rpath "$obj")
+                patchelf --set-rpath "''${oldRPATH:+$oldRPATH:}$RPATH" "$obj"
+
+                echo "shrinking RPATH in $type $obj"
+                patchelf --shrink-rpath "$obj"
+
+            else
+
+                echo "unknown ELF type \"$type\"; not patching $obj"
+
+            fi
+        fi
+    done
   '';
 
   meta = {
     homepage = "http://www.dropbox.com";
     description = "Online stored folders (daemon version)";
     maintainers = with stdenv.lib.maintainers; [ ttuegel ];
+    platforms = [ "i686-linux" "x86_64-linux" ];
   };
 }
diff --git a/pkgs/applications/networking/instant-messengers/amsn/default.nix b/pkgs/applications/networking/instant-messengers/amsn/default.nix
index 37c0b4a694dd..770f0952e1fc 100644
--- a/pkgs/applications/networking/instant-messengers/amsn/default.nix
+++ b/pkgs/applications/networking/instant-messengers/amsn/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, which, tcl, tk, x11, libpng, libjpeg, makeWrapper}:
+{stdenv, fetchurl, which, tcl, tk, xlibsWrapper, libpng, libjpeg, makeWrapper}:
 
 stdenv.mkDerivation {
   name = "amsn-0.98.9";
@@ -9,7 +9,7 @@ stdenv.mkDerivation {
 
   configureFlags = "--with-tcl=${tcl}/lib --with-tk=${tk}/lib --enable-static";
 
-  buildInputs = [which tcl tk x11 libpng libjpeg makeWrapper];
+  buildInputs = [which tcl tk xlibsWrapper libpng libjpeg makeWrapper];
 
   postInstall = ''
     wrapProgram $out/bin/amsn --prefix PATH : ${tk}/bin
diff --git a/pkgs/applications/networking/instant-messengers/hipchat/default.nix b/pkgs/applications/networking/instant-messengers/hipchat/default.nix
index c6551307df9d..6dc0df03eef8 100644
--- a/pkgs/applications/networking/instant-messengers/hipchat/default.nix
+++ b/pkgs/applications/networking/instant-messengers/hipchat/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libtool, xlibs, freetype, fontconfig, openssl, glib
+{ stdenv, fetchurl, libtool, xorg, freetype, fontconfig, openssl, glib
 , mesa, gstreamer, gst_plugins_base, dbus, alsaLib, zlib, libuuid
 , libxml2, libxslt, sqlite, libogg, libvorbis, xz, libcanberra
 , makeWrapper, libredirect, xkeyboard_config, xcbutilkeysyms }:
@@ -10,18 +10,18 @@ let
   rpath = stdenv.lib.makeSearchPath "lib" [
     stdenv.glibc
     libtool
-    xlibs.libXext
-    xlibs.libSM
-    xlibs.libICE
-    xlibs.libX11
-    xlibs.libXft
-    xlibs.libXau
-    xlibs.libXdmcp
-    xlibs.libXrender
-    xlibs.libXfixes
-    xlibs.libXcomposite
-    xlibs.libxcb
-    xlibs.libXi
+    xorg.libXext
+    xorg.libSM
+    xorg.libICE
+    xorg.libX11
+    xorg.libXft
+    xorg.libXau
+    xorg.libXdmcp
+    xorg.libXrender
+    xorg.libXfixes
+    xorg.libXcomposite
+    xorg.libxcb
+    xorg.libXi
     freetype
     fontconfig
     openssl
diff --git a/pkgs/applications/networking/instant-messengers/jitsi/default.nix b/pkgs/applications/networking/instant-messengers/jitsi/default.nix
index 494f40f804e1..d7b98d535af2 100644
--- a/pkgs/applications/networking/instant-messengers/jitsi/default.nix
+++ b/pkgs/applications/networking/instant-messengers/jitsi/default.nix
@@ -1,6 +1,6 @@
 { stdenv, lib, fetchurl, makeDesktopItem, unzip, ant, jdk
 # Optional, Jitsi still runs without, but you may pass null:
-, alsaLib, dbus_libs, gtk2, libpulseaudio, openssl, xlibs
+, alsaLib, dbus_libs, gtk2, libpulseaudio, openssl, xorg
 }:
 
 assert stdenv.isLinux;
@@ -35,11 +35,11 @@ stdenv.mkDerivation rec {
     gtk2
     libpulseaudio
     openssl
-  ] ++ lib.optionals (xlibs != null) [
-    xlibs.libX11
-    xlibs.libXext
-    xlibs.libXScrnSaver
-    xlibs.libXv
+  ] ++ lib.optionals (xorg != null) [
+    xorg.libX11
+    xorg.libXext
+    xorg.libXScrnSaver
+    xorg.libXv
   ]);
 
   buildInputs = [unzip ant jdk];
@@ -66,12 +66,12 @@ stdenv.mkDerivation rec {
     done
   '';
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = https://jitsi.org/;
     description = "Open Source Video Calls and Chat";
-    license = stdenv.lib.licenses.lgpl21Plus.shortName;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = [ stdenv.lib.maintainers.khumba ];
+    license = licenses.lgpl21Plus;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.khumba ];
   };
 
 }
diff --git a/pkgs/applications/networking/instant-messengers/qtox/default.nix b/pkgs/applications/networking/instant-messengers/qtox/default.nix
index 5c8a03eb8efc..170702e44d13 100644
--- a/pkgs/applications/networking/instant-messengers/qtox/default.nix
+++ b/pkgs/applications/networking/instant-messengers/qtox/default.nix
@@ -2,13 +2,17 @@
   libsodium, libXScrnSaver, glib, gdk_pixbuf, gtk2, cairo,
   pango, atk, qrencode, ffmpeg, filter-audio, makeWrapper }:
 
+let
+  revision = "1673b43e26c853f6446f228fec083af166cbf446";
+in
+
 stdenv.mkDerivation rec {
-  name = "qtox-dev-20150821";
+  name = "qtox-dev-20150925";
 
   src = fetchgit {
       url = "https://github.com/tux3/qTox.git";
-      rev = "2f6b5e052f2a625d506e83f880c5d68b49118f95";
-      md5 = "b2f9cf283136b6e558876ca2e6d128a3";
+      rev = "${revision}";
+      md5 = "785f5b305cdcdf777d93ee823a5b9f49";
   };
 
   buildInputs =
@@ -21,6 +25,10 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ pkgconfig ];
 
   preConfigure = ''
+    # patch .pro file for proper set of the git hash
+    sed -i '/git rev-parse/d' qtox.pro
+    sed -i 's/$$quote($$GIT_VERSION)/${revision}/' qtox.pro
+    # since .pro have hardcoded paths, we need to explicitly set paths here
     export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE $(pkg-config --cflags glib-2.0)"
     export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE $(pkg-config --cflags gdk-pixbuf-2.0)"
     export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE $(pkg-config --cflags gtk+-2.0)"
@@ -44,9 +52,9 @@ stdenv.mkDerivation rec {
   enableParallelBuilding = true;
 
   meta = with stdenv.lib; {
-    description = "QT Tox client";
+    description = "Qt Tox client";
     license = licenses.gpl3;
-    maintainers = with maintainers; [ viric jgeerds ];
+    maintainers = with maintainers; [ viric jgeerds akaWolf ];
     platforms = platforms.all;
   };
 }
diff --git a/pkgs/applications/networking/instant-messengers/teamspeak/client.nix b/pkgs/applications/networking/instant-messengers/teamspeak/client.nix
index 13798061b71b..ece4b9f0e013 100644
--- a/pkgs/applications/networking/instant-messengers/teamspeak/client.nix
+++ b/pkgs/applications/networking/instant-messengers/teamspeak/client.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, makeWrapper, makeDesktopItem, zlib, glib, libpng, freetype
-, xorg, fontconfig, xlibs, qt5, xkeyboard_config, alsaLib, libpulseaudio ? null
+, xorg, fontconfig, qt5, xkeyboard_config, alsaLib, libpulseaudio ? null
 , libredirect, quazip, less, which, unzip
 }:
 
@@ -12,7 +12,7 @@ let
   deps =
     [ zlib glib libpng freetype xorg.libSM xorg.libICE xorg.libXrender
       xorg.libXrandr xorg.libXfixes xorg.libXcursor xorg.libXinerama
-      xlibs.libxcb fontconfig xorg.libXext xorg.libX11 alsaLib qt5.base libpulseaudio
+      xorg.libxcb fontconfig xorg.libXext xorg.libX11 alsaLib qt5.base libpulseaudio
     ];
 
   desktopItem = makeDesktopItem {
diff --git a/pkgs/applications/networking/instant-messengers/telepathy/kde/default.nix b/pkgs/applications/networking/instant-messengers/telepathy/kde/default.nix
index 564952480f23..532d68ad6605 100644
--- a/pkgs/applications/networking/instant-messengers/telepathy/kde/default.nix
+++ b/pkgs/applications/networking/instant-messengers/telepathy/kde/default.nix
@@ -1,12 +1,19 @@
-{ stdenv, fetchurl, fetchgit, telepathy_qt, kdelibs, kde_workspace, gettext, dbus_libs, farstream
-, pkgconfigUpstream , qt_gstreamer1, telepathy_glib, telepathy_logger, qjson, flex, bison, qca2 }:
+{ stdenv, fetchurl, fetchgit, automoc4, cmake, gettext, perl, pkgconfig
+, telepathy_qt, kdelibs, kde_workspace, dbus_glib, dbus_libs, farstream
+, qt_gstreamer1, telepathy_glib, telepathy_logger
+, qjson, flex, bison, qca2 }:
 
 let
-  pkgconfig = pkgconfigUpstream;
   version = "0.8.80";
   manifest = import (./. + "/${version}.nix");
 
   overrides = {
+    call_ui = x : x // {
+      NIX_CFLAGS_COMPILE =
+        "-I${telepathy_glib}/include/telepathy-1.0"
+        + " -I${dbus_glib}/include/dbus-1.0"
+        + " -I${dbus_libs}/include/dbus-1.0";
+    };
     telepathy_logger_qt = x : x // {
       NIX_CFLAGS_COMPILE = "-I${dbus_libs}/include/dbus-1.0";
     };
@@ -38,7 +45,9 @@ let
           inherit sha256;
         };
 
-        nativeBuildInputs = [ gettext pkgconfig ] ++ (stdenv.lib.attrByPath [ key ] [] extraNativeBuildInputs);
+        nativeBuildInputs =
+          [ automoc4 cmake gettext perl pkgconfig ]
+          ++ (stdenv.lib.attrByPath [ key ] [] extraNativeBuildInputs);
         buildInputs = [ kdelibs telepathy_qt ]
           ++ stdenv.lib.optional (name != "ktp-common-internals") ktp.common_internals
           ++ (stdenv.lib.attrByPath [ key ] [] extraBuildInputs);
diff --git a/pkgs/applications/networking/instant-messengers/tkabber/default.nix b/pkgs/applications/networking/instant-messengers/tkabber/default.nix
index d0cc333c71b6..f9209f28cf20 100644
--- a/pkgs/applications/networking/instant-messengers/tkabber/default.nix
+++ b/pkgs/applications/networking/instant-messengers/tkabber/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, tcl, tk, tcllib, tcltls, tclgpg
-, bwidget, makeWrapper, x11
+, bwidget, makeWrapper, xlibsWrapper
 , withSitePlugins ? true
 , theme ? null
 }:
@@ -62,7 +62,7 @@ in mkTkabber (main // {
     done
   '';
 
-  buildInputs = [ tcl tk x11 makeWrapper ] ++ tclLibraries;
+  buildInputs = [ tcl tk xlibsWrapper makeWrapper ] ++ tclLibraries;
 
   meta = {
     homepage = "http://tkabber.jabber.ru/";
diff --git a/pkgs/applications/networking/instant-messengers/viber/default.nix b/pkgs/applications/networking/instant-messengers/viber/default.nix
index 4ebfddf82e19..8e07bbf975b2 100644
--- a/pkgs/applications/networking/instant-messengers/viber/default.nix
+++ b/pkgs/applications/networking/instant-messengers/viber/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, dpkg, makeWrapper, xlibs, qt5Full, gstreamer, zlib, sqlite, libxslt }:
+{ fetchurl, stdenv, dpkg, makeWrapper, xorg, qt5Full, gstreamer, zlib, sqlite, libxslt }:
 
 assert stdenv.system == "x86_64-linux";
 
@@ -23,15 +23,15 @@ stdenv.mkDerivation rec {
 
   libPath = stdenv.lib.makeLibraryPath [
       qt5Full
-      xlibs.libX11
+      xorg.libX11
       gstreamer
       zlib
       sqlite
-      xlibs.libXrender
+      xorg.libXrender
       libxslt
       stdenv.cc.cc
-      xlibs.libXScrnSaver
-      xlibs.libXext
+      xorg.libXScrnSaver
+      xorg.libXext
   ];
 
   installPhase = ''
diff --git a/pkgs/applications/networking/irc/quassel/default.nix b/pkgs/applications/networking/irc/quassel/default.nix
index 4cc54b9f8120..9c77e6b133f1 100644
--- a/pkgs/applications/networking/irc/quassel/default.nix
+++ b/pkgs/applications/networking/irc/quassel/default.nix
@@ -3,15 +3,12 @@
 , client ? false # build Quassel client
 , previews ? false # enable webpage previews on hovering over URLs
 , tag ? "" # tag added to the package name
-, useQt5 ? false, phonon_qt5, libdbusmenu_qt5, qca-qt5
 , withKDE ? stdenv.isLinux # enable KDE integration
-, kf5 ? null, kdelibs ? null
+, kdelibs ? null
 
 , stdenv, fetchurl, cmake, makeWrapper, qt, automoc4, phonon, dconf, qca2 }:
 
-let useKF5 = useQt5 && withKDE;
-    useKDE4 = withKDE && !useQt5;
-    buildClient = monolithic || client;
+let buildClient = monolithic || client;
     buildCore = monolithic || daemon;
 in
 
@@ -19,8 +16,7 @@ assert stdenv.isLinux;
 
 assert monolithic -> !client && !daemon;
 assert client || daemon -> !monolithic;
-assert useKDE4 -> kdelibs != null;
-assert useKF5 -> kf5 != null;
+assert withKDE -> kdelibs != null;
 assert !buildClient -> !withKDE; # KDE is used by the client only
 
 let
@@ -39,20 +35,9 @@ in with stdenv; mkDerivation rec {
   enableParallelBuilding = true;
 
   buildInputs =
-       [ cmake makeWrapper ]
-    ++ [(if useQt5 then qt.base else qt)]
-    ++ lib.optionals buildCore (if useQt5 then [qt.script qca-qt5] else [qca2])
-    ++ lib.optionals buildClient
-       (   lib.optionals (previews && useQt5) [qt.webkit qt.webkitwidgets]
-        ++ lib.optionals useQt5 [libdbusmenu_qt5 phonon_qt5]
-        ++ lib.optionals useKDE4 [automoc4 kdelibs phonon]
-        ++ lib.optionals useKF5
-           (with kf5; [
-             extra-cmake-modules kconfigwidgets kcoreaddons
-             knotifications knotifyconfig ktextwidgets kwidgetsaddons
-             kxmlgui
-           ])
-       );
+       [ cmake makeWrapper qt ]
+    ++ lib.optionals buildCore [qca2]
+    ++ lib.optionals withKDE [automoc4 kdelibs phonon];
 
   NIX_CFLAGS_COMPILE = "-fPIC";
 
@@ -63,8 +48,7 @@ in with stdenv; mkDerivation rec {
     ++ edf daemon "WANT_CORE"
     ++ edf client "WANT_QTCLIENT"
     ++ edf withKDE "WITH_KDE"
-    ++ edf previews "WITH_WEBKIT"
-    ++ edf useQt5 "USE_QT5";
+    ++ edf previews "WITH_WEBKIT";
 
   preFixup =
     lib.optionalString buildClient ''
@@ -85,6 +69,6 @@ in with stdenv; mkDerivation rec {
     license = stdenv.lib.licenses.gpl3;
     maintainers = with maintainers; [ phreedom ttuegel ];
     repositories.git = https://github.com/quassel/quassel.git;
-    inherit ((if useQt5 then qt.base else qt).meta) platforms;
+    inherit (qt.meta) platforms;
   };
 }
diff --git a/pkgs/applications/networking/irc/quassel/qt-5.nix b/pkgs/applications/networking/irc/quassel/qt-5.nix
new file mode 100644
index 000000000000..8e75f16dbda4
--- /dev/null
+++ b/pkgs/applications/networking/irc/quassel/qt-5.nix
@@ -0,0 +1,91 @@
+{ monolithic ? true # build monolithic Quassel
+, daemon ? false # build Quassel daemon
+, client ? false # build Quassel client
+, previews ? false # enable webpage previews on hovering over URLs
+, tag ? "" # tag added to the package name
+
+, stdenv, fetchurl, cmake, makeWrapper, dconf
+, qtbase, qtscript, qtwebkit
+, phonon, libdbusmenu, qca-qt5
+
+, withKDE ? stdenv.isLinux # enable KDE integration
+, extra-cmake-modules
+, kconfigwidgets
+, kcoreaddons
+, knotifications
+, knotifyconfig
+, ktextwidgets
+, kwidgetsaddons
+, kxmlgui
+}:
+
+let
+    buildClient = monolithic || client;
+    buildCore = monolithic || daemon;
+in
+
+assert stdenv.isLinux;
+
+assert monolithic -> !client && !daemon;
+assert client || daemon -> !monolithic;
+assert !buildClient -> !withKDE; # KDE is used by the client only
+
+let
+  edf = flag: feature: [("-D" + feature + (if flag then "=ON" else "=OFF"))];
+
+in with stdenv; mkDerivation rec {
+
+  version = "0.12.2";
+  name = "quassel${tag}-${version}";
+
+  src = fetchurl {
+    url = "http://quassel-irc.org/pub/quassel-${version}.tar.bz2";
+    sha256 = "15vqjiw38mifvnc95bhvy0zl23xxldkwg2byx9xqbyw8rfgggmkb";
+  };
+
+  enableParallelBuilding = true;
+
+  buildInputs =
+       [ cmake makeWrapper qtbase ]
+    ++ lib.optionals buildCore [qtscript qca-qt5]
+    ++ lib.optionals buildClient [libdbusmenu phonon]
+    ++ lib.optionals (buildClient && previews) [qtwebkit]
+    ++ lib.optionals (buildClient && withKDE) [
+      extra-cmake-modules kconfigwidgets kcoreaddons
+      knotifications knotifyconfig ktextwidgets kwidgetsaddons
+      kxmlgui
+    ];
+
+  cmakeFlags = [
+    "-DEMBED_DATA=OFF"
+    "-DSTATIC=OFF"
+    "-DUSE_QT5=ON"
+  ]
+    ++ edf monolithic "WANT_MONO"
+    ++ edf daemon "WANT_CORE"
+    ++ edf client "WANT_QTCLIENT"
+    ++ edf withKDE "WITH_KDE"
+    ++ edf previews "WITH_WEBKIT";
+
+  preFixup =
+    lib.optionalString buildClient ''
+        wrapProgram "$out/bin/quassel${lib.optionalString client "client"}" \
+          --prefix GIO_EXTRA_MODULES : "${dconf}/lib/gio/modules"
+    '';
+
+  meta = with stdenv.lib; {
+    homepage = http://quassel-irc.org/;
+    description = "Qt/KDE distributed IRC client suppporting a remote daemon";
+    longDescription = ''
+      Quassel IRC is a cross-platform, distributed IRC client,
+      meaning that one (or multiple) client(s) can attach to
+      and detach from a central core -- much like the popular
+      combination of screen and a text-based IRC client such
+      as WeeChat, but graphical (based on Qt4/KDE4 or Qt5/KF5).
+    '';
+    license = stdenv.lib.licenses.gpl3;
+    maintainers = with maintainers; [ phreedom ttuegel ];
+    repositories.git = https://github.com/quassel/quassel.git;
+    inherit (qtbase.meta) platforms;
+  };
+}
diff --git a/pkgs/applications/networking/mailreaders/mutt/default.nix b/pkgs/applications/networking/mailreaders/mutt/default.nix
index 40d302464f62..a1bfb9f854c4 100644
--- a/pkgs/applications/networking/mailreaders/mutt/default.nix
+++ b/pkgs/applications/networking/mailreaders/mutt/default.nix
@@ -17,14 +17,14 @@ assert saslSupport -> cyrus_sasl != null;
 assert gpgmeSupport -> gpgme != null;
 
 let
-  version = "1.5.23";
+  version = "1.5.24";
 in
 stdenv.mkDerivation rec {
   name = "mutt${stdenv.lib.optionalString withSidebar "-with-sidebar"}-${version}";
 
   src = fetchurl {
-    url = "mirror://sourceforge/mutt/mutt-${version}.tar.gz";
-    sha256 = "0dzx4qk50pjfsb6cs5jahng96a52k12f7pm0sc78iqdrawg71w1s";
+    url = "http://ftp.mutt.org/pub/mutt/mutt-${version}.tar.gz";
+    sha256 = "0012njrgxf1barjksqkx7ccid2l0xyikhna9mjs9vcfpbrvcm4m2";
   };
 
   buildInputs = with stdenv.lib;
@@ -59,11 +59,16 @@ stdenv.mkDerivation rec {
   ];
 
   # Adding the sidebar
-  patches = [] ++
-    (stdenv.lib.optional withSidebar (fetchurl {
-      url = http://lunar-linux.org/~tchan/mutt/patch-1.5.23.sidebar.20140412.txt;
-      sha256 = "1i2r7dj0pd1k0z3jjxn2szi6sf0k28i8dwhr4f65pn8r2lh3wisz";
-    }));
+  patches = stdenv.lib.optional withSidebar [
+    ./trash-folder.patch
+    ./sidebar.patch
+    ./sidebar-dotpathsep.patch
+    ./sidebar-utf8.patch
+    ./sidebar-newonly.patch
+    ./sidebar-delimnullwide.patch
+    ./sidebar-compose.patch
+    ./sidebar-new.patch
+  ];
 
   meta = with stdenv.lib; {
     description = "A small but very powerful text-based mail client";
diff --git a/pkgs/applications/networking/mailreaders/mutt/sidebar-compose.patch b/pkgs/applications/networking/mailreaders/mutt/sidebar-compose.patch
new file mode 100644
index 000000000000..90d815b841d7
--- /dev/null
+++ b/pkgs/applications/networking/mailreaders/mutt/sidebar-compose.patch
@@ -0,0 +1,40 @@
+From: Evgeni Golov <evgeni@debian.org>
+Date: Fri, 14 Mar 2014 08:54:47 +0100
+Subject: sidebar-compose
+
+draw_sidebar sets SidebarWidth to 0 when sidebar_visible is false.
+However, if you start mutt in compose mode, draw_sidebar won't be
+called until the next redraw and your header lines will be off by
+the width of the sidebar, even when you did not want a sidebar at
+all.
+
+Can be tested with:
+  HOME=/ LC_ALL=C mutt -e 'unset sidebar_visible' -s test recipient
+
+Closes: #502627
+
+Gbp-Pq: Topic mutt-patched
+---
+ compose.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/compose.c b/compose.c
+index b63695f..0fa6df2 100644
+--- a/compose.c
++++ b/compose.c
+@@ -32,6 +32,7 @@
+ #include "mailbox.h"
+ #include "sort.h"
+ #include "charset.h"
++#include "sidebar.h"
+ 
+ #ifdef MIXMASTER
+ #include "remailer.h"
+@@ -248,6 +249,7 @@ static void draw_envelope_addr (int line, ADDRESS *addr)
+ 
+ static void draw_envelope (HEADER *msg, char *fcc)
+ {
++  draw_sidebar (MENU_COMPOSE);
+   draw_envelope_addr (HDR_FROM, msg->env->from);
+   draw_envelope_addr (HDR_TO, msg->env->to);
+   draw_envelope_addr (HDR_CC, msg->env->cc);
diff --git a/pkgs/applications/networking/mailreaders/mutt/sidebar-delimnullwide.patch b/pkgs/applications/networking/mailreaders/mutt/sidebar-delimnullwide.patch
new file mode 100644
index 000000000000..11d2ced5a0c0
--- /dev/null
+++ b/pkgs/applications/networking/mailreaders/mutt/sidebar-delimnullwide.patch
@@ -0,0 +1,38 @@
+From: Evgeni Golov <sargentd@die-welt.net>
+Date: Wed, 5 Mar 2014 17:46:07 +0100
+Subject: sidebar-delimnullwide
+
+SidebarDelim can be NULL and strlen(NULL) is a bad idea, as it will segfault.
+Wrap it with NONULL().
+
+While at it, change strlen to mbstowcs for better utf8 support.
+
+Closes: #696145, #663883
+
+Gbp-Pq: Topic mutt-patched
+---
+ sidebar.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/sidebar.c b/sidebar.c
+index 51a25ca..c3ea338 100644
+--- a/sidebar.c
++++ b/sidebar.c
+@@ -88,7 +88,7 @@ char *make_sidebar_entry(char *box, int size, int new, int flagged)
+     int box_len, box_bytes;
+     int int_len;
+     int right_offset = 0;
+-    int delim_len = strlen(SidebarDelim);
++    int delim_len = mbstowcs(NULL, NONULL(SidebarDelim), 0);
+     static char *entry;
+ 
+     right_width = left_width = 0;
+@@ -178,7 +178,7 @@ int draw_sidebar(int menu) {
+ #ifndef USE_SLANG_CURSES
+         attr_t attrs;
+ #endif
+-        short delim_len = strlen(SidebarDelim);
++        short delim_len = mbstowcs(NULL, NONULL(SidebarDelim), 0);
+         short color_pair;
+ 
+         static bool initialized = false;
diff --git a/pkgs/applications/networking/mailreaders/mutt/sidebar-dotpathsep.patch b/pkgs/applications/networking/mailreaders/mutt/sidebar-dotpathsep.patch
new file mode 100644
index 000000000000..315fa1649bcf
--- /dev/null
+++ b/pkgs/applications/networking/mailreaders/mutt/sidebar-dotpathsep.patch
@@ -0,0 +1,98 @@
+From: Fabian Groffen <grobian@gentoo.org>
+Date: Tue, 4 Mar 2014 21:12:15 +0100
+Subject: sidebar-dotpathsep
+
+Make path separators for sidebar folders configurable.
+
+When using IMAP, a '.' is often used as path separator, hence make the
+path separators configurable through sidebar_delim_chars variable.
+It defaults to "/." to work for both mboxes as well as IMAP folders.  It
+can be set to only "/" or "." or whichever character desired as needed.
+
+Gbp-Pq: Topic mutt-patched
+---
+ globals.h |  1 +
+ init.h    |  8 ++++++++
+ sidebar.c | 31 ++++++++++++++++++++++++-------
+ 3 files changed, 33 insertions(+), 7 deletions(-)
+
+diff --git a/globals.h b/globals.h
+index 004c795..602f932 100644
+--- a/globals.h
++++ b/globals.h
+@@ -119,6 +119,7 @@ WHERE char *SendCharset;
+ WHERE char *Sendmail;
+ WHERE char *Shell;
+ WHERE char *SidebarDelim;
++WHERE char *SidebarDelimChars INITVAL (NULL);
+ WHERE char *Signature;
+ WHERE char *SimpleSearch;
+ #if USE_SMTP
+diff --git a/init.h b/init.h
+index c664e5f..166671b 100644
+--- a/init.h
++++ b/init.h
+@@ -2051,6 +2051,14 @@ struct option_t MuttVars[] = {
+   ** .pp
+   ** The width of the sidebar.
+   */
++  { "sidebar_delim_chars",		DT_STR, R_NONE, UL &SidebarDelimChars, UL "/." },
++  /*
++  ** .pp
++  ** This contains the list of characters which you would like to treat
++  ** as folder separators for displaying paths in the sidebar.  If
++  ** you're not using IMAP folders, you probably prefer setting this to "/"
++  ** alone.
++  */
+   { "pgp_use_gpg_agent", DT_BOOL, R_NONE, OPTUSEGPGAGENT, 0},
+   /*
+   ** .pp
+diff --git a/sidebar.c b/sidebar.c
+index 6098c2a..4356ffc 100644
+--- a/sidebar.c
++++ b/sidebar.c
+@@ -249,20 +249,37 @@ int draw_sidebar(int menu) {
+ 		// calculate depth of current folder and generate its display name with indented spaces
+ 		int sidebar_folder_depth = 0;
+ 		char *sidebar_folder_name;
+-		sidebar_folder_name = basename(tmp->path);
++		int i;
++		sidebar_folder_name = tmp->path;
++		/* disregard a trailing separator, so strlen() - 2
++		 * https://bugs.gentoo.org/show_bug.cgi?id=373197#c16 */
++		for (i = strlen(sidebar_folder_name) - 2; i >= 0; i--) {
++			if (SidebarDelimChars &&
++					strchr(SidebarDelimChars, sidebar_folder_name[i]))
++			{
++				sidebar_folder_name += i + 1;
++				break;
++			}
++		}
+ 		if ( maildir_is_prefix ) {
+ 			char *tmp_folder_name;
+-			int i;
++			int lastsep = 0;
+ 			tmp_folder_name = tmp->path + strlen(Maildir);
+-			for (i = 0; i < strlen(tmp->path) - strlen(Maildir); i++) {
+-				if (tmp_folder_name[i] == '/') sidebar_folder_depth++;
+-			}   
++			for (i = 0; i < strlen(tmp_folder_name) - 1; i++) {
++				if (SidebarDelimChars &&
++						strchr(SidebarDelimChars, tmp_folder_name[i]))
++				{
++					sidebar_folder_depth++;
++					lastsep = i + 1;
++				}
++			}
+ 			if (sidebar_folder_depth > 0) {
+-				sidebar_folder_name = malloc(strlen(basename(tmp->path)) + sidebar_folder_depth + 1);
++				tmp_folder_name += lastsep;  /* basename */
++				sidebar_folder_name = malloc(strlen(tmp_folder_name) + sidebar_folder_depth + 1);
+ 				for (i=0; i < sidebar_folder_depth; i++)
+ 					sidebar_folder_name[i]=' ';
+ 				sidebar_folder_name[i]=0;
+-				strncat(sidebar_folder_name, basename(tmp->path), strlen(basename(tmp->path)) + sidebar_folder_depth);
++				strncat(sidebar_folder_name, tmp_folder_name, strlen(tmp_folder_name) + sidebar_folder_depth);
+ 			}
+ 		}
+ 		printw( "%.*s", SidebarWidth - delim_len + 1,
diff --git a/pkgs/applications/networking/mailreaders/mutt/sidebar-new.patch b/pkgs/applications/networking/mailreaders/mutt/sidebar-new.patch
new file mode 100644
index 000000000000..fb2653463611
--- /dev/null
+++ b/pkgs/applications/networking/mailreaders/mutt/sidebar-new.patch
@@ -0,0 +1,97 @@
+From 355399bde98203af59d20821f9e840fc056bd383 Mon Sep 17 00:00:00 2001
+From: Julius Haertl <jus@bitgrid.net>
+Date: Tue, 9 Sep 2014 22:31:49 +0200
+Subject: Patch for sidebar iteration functionality
+
+sidebar-new will move the selected folder to the next with new messages.
+If the end is reached, it will start at the top.
+
+Useful macros would be:
+
+	macro index <esc>a "<sidebar-new><sidebar-open>"
+	macro pager <esc>a "<exit><sidebar-new><sidebar-open>"
+---
+ OPS         |  1 +
+ curs_main.c |  1 +
+ functions.h |  2 ++
+ pager.c     |  1 +
+ sidebar.c   | 10 ++++++++++
+ 5 files changed, 15 insertions(+)
+
+diff --git a/OPS b/OPS
+index 1ed9c96..3ffb82a 100644
+--- a/OPS
++++ b/OPS
+@@ -187,3 +187,4 @@ OP_SIDEBAR_PREV "go to previous mailbox"
+ OP_SIDEBAR_OPEN "open hilighted mailbox"
+ OP_SIDEBAR_NEXT_NEW "go down to next mailbox with new mail"
+ OP_SIDEBAR_PREV_NEW "go to previous mailbox with new mail"
++OP_SIDEBAR_NEW "iterate though mailboxes with new mail"
+diff --git a/curs_main.c b/curs_main.c
+index acb106d..2e35f90 100644
+--- a/curs_main.c
++++ b/curs_main.c
+@@ -2328,6 +2328,7 @@ int mutt_index_menu (void)
+       case OP_SIDEBAR_PREV:
+       case OP_SIDEBAR_NEXT_NEW:
+       case OP_SIDEBAR_PREV_NEW:
++      case OP_SIDEBAR_NEW:
+         scroll_sidebar(op, menu->menu);
+         break;
+       default:
+diff --git a/functions.h b/functions.h
+index 363b4d5..1485080 100644
+--- a/functions.h
++++ b/functions.h
+@@ -176,6 +176,7 @@ const struct binding_t OpMain[] = { /* map: index */
+  { "sidebar-prev",		OP_SIDEBAR_PREV, NULL },
+  { "sidebar-next-new", OP_SIDEBAR_NEXT_NEW, NULL},
+  { "sidebar-prev-new", OP_SIDEBAR_PREV_NEW, NULL},
++ { "sidebar-new",		OP_SIDEBAR_NEW, NULL },
+  { "sidebar-open",		OP_SIDEBAR_OPEN, NULL },
+   { NULL,			0,				NULL }
+ };
+@@ -287,6 +288,7 @@ const struct binding_t OpPager[] = { /* map: pager */
+   { "sidebar-prev",	OP_SIDEBAR_PREV, NULL },
+   { "sidebar-next-new", OP_SIDEBAR_NEXT_NEW, NULL},
+   { "sidebar-prev-new", OP_SIDEBAR_PREV_NEW, NULL},
++  { "sidebar-new",		OP_SIDEBAR_NEW, NULL },
+   { "sidebar-open", OP_SIDEBAR_OPEN, NULL },
+   { NULL,		0,				NULL }
+ };
+diff --git a/pager.c b/pager.c
+index 8d64fe1..696e55c 100644
+--- a/pager.c
++++ b/pager.c
+@@ -2791,6 +2791,7 @@ search_next:
+       case OP_SIDEBAR_PREV:
+       case OP_SIDEBAR_NEXT_NEW:
+       case OP_SIDEBAR_PREV_NEW:
++      case OP_SIDEBAR_NEW:
+ 	scroll_sidebar(ch, MENU_PAGER);
+  	break;
+ 
+diff --git a/sidebar.c b/sidebar.c
+index c3ea338..eb8ecd2 100644
+--- a/sidebar.c
++++ b/sidebar.c
+@@ -429,6 +429,16 @@ void scroll_sidebar(int op, int menu)
+ 				CurBuffy = CurBuffy->next;
+ 			}
+ 			break;
++                case OP_SIDEBAR_NEW:
++                	if ( (tmp = exist_next_new()) == NULL)
++				tmp = TopBuffy;
++			if ( tmp->msg_unread == 0 ) {
++				CurBuffy = tmp;
++				tmp = exist_next_new();
++			}
++			if ( tmp != NULL )
++				CurBuffy = tmp;
++			break;
+ 		default:
+ 			return;
+ 	}
+-- 
+2.6.0.rc0.2.g7662973.dirty
+
diff --git a/pkgs/applications/networking/mailreaders/mutt/sidebar-newonly.patch b/pkgs/applications/networking/mailreaders/mutt/sidebar-newonly.patch
new file mode 100644
index 000000000000..d206848026b6
--- /dev/null
+++ b/pkgs/applications/networking/mailreaders/mutt/sidebar-newonly.patch
@@ -0,0 +1,198 @@
+From: Steve Kemp <steve@steve.org.uk>
+Date: Tue, 4 Mar 2014 22:07:06 +0100
+Subject: sidebar-newonly
+
+patches written by Steve Kemp, it adds two new functionalities to the sidebar,
+so only the mailbox with new messages will be shown (and/or) selected
+See Debian bug http://bugs.debian.org/532510
+
+Gbp-Pq: Topic mutt-patched
+---
+ OPS         |  2 ++
+ curs_main.c |  2 ++
+ functions.h |  4 ++++
+ init.h      |  5 +++++
+ mutt.h      |  2 ++
+ pager.c     |  2 ++
+ sidebar.c   | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++--
+ 7 files changed, 70 insertions(+), 2 deletions(-)
+
+diff --git a/OPS b/OPS
+index b036db9..1ed9c96 100644
+--- a/OPS
++++ b/OPS
+@@ -185,3 +185,5 @@ OP_SIDEBAR_SCROLL_DOWN "scroll the mailbox pane down 1 page"
+ OP_SIDEBAR_NEXT "go down to next mailbox"
+ OP_SIDEBAR_PREV "go to previous mailbox"
+ OP_SIDEBAR_OPEN "open hilighted mailbox"
++OP_SIDEBAR_NEXT_NEW "go down to next mailbox with new mail"
++OP_SIDEBAR_PREV_NEW "go to previous mailbox with new mail"
+diff --git a/curs_main.c b/curs_main.c
+index ea530a6..acb106d 100644
+--- a/curs_main.c
++++ b/curs_main.c
+@@ -2326,6 +2326,8 @@ int mutt_index_menu (void)
+       case OP_SIDEBAR_SCROLL_DOWN:
+       case OP_SIDEBAR_NEXT:
+       case OP_SIDEBAR_PREV:
++      case OP_SIDEBAR_NEXT_NEW:
++      case OP_SIDEBAR_PREV_NEW:
+         scroll_sidebar(op, menu->menu);
+         break;
+       default:
+diff --git a/functions.h b/functions.h
+index ef8937a..363b4d5 100644
+--- a/functions.h
++++ b/functions.h
+@@ -174,6 +174,8 @@ const struct binding_t OpMain[] = { /* map: index */
+  { "sidebar-scroll-down",	OP_SIDEBAR_SCROLL_DOWN, NULL },
+  { "sidebar-next",		OP_SIDEBAR_NEXT, NULL },
+  { "sidebar-prev",		OP_SIDEBAR_PREV, NULL },
++ { "sidebar-next-new", OP_SIDEBAR_NEXT_NEW, NULL},
++ { "sidebar-prev-new", OP_SIDEBAR_PREV_NEW, NULL},
+  { "sidebar-open",		OP_SIDEBAR_OPEN, NULL },
+   { NULL,			0,				NULL }
+ };
+@@ -283,6 +285,8 @@ const struct binding_t OpPager[] = { /* map: pager */
+   { "sidebar-scroll-down",	OP_SIDEBAR_SCROLL_DOWN, NULL },
+   { "sidebar-next",	OP_SIDEBAR_NEXT, NULL },
+   { "sidebar-prev",	OP_SIDEBAR_PREV, NULL },
++  { "sidebar-next-new", OP_SIDEBAR_NEXT_NEW, NULL},
++  { "sidebar-prev-new", OP_SIDEBAR_PREV_NEW, NULL},
+   { "sidebar-open", OP_SIDEBAR_OPEN, NULL },
+   { NULL,		0,				NULL }
+ };
+diff --git a/init.h b/init.h
+index 166671b..a5d4238 100644
+--- a/init.h
++++ b/init.h
+@@ -2059,6 +2059,11 @@ struct option_t MuttVars[] = {
+   ** you're not using IMAP folders, you probably prefer setting this to "/"
+   ** alone.
+   */
++  {"sidebar_newmail_only", DT_BOOL, R_BOTH, OPTSIDEBARNEWMAILONLY, 0 },
++  /*
++  ** .pp
++  ** Show only new mail in the sidebar.
++  */
+   { "pgp_use_gpg_agent", DT_BOOL, R_NONE, OPTUSEGPGAGENT, 0},
+   /*
+   ** .pp
+diff --git a/mutt.h b/mutt.h
+index 5f25406..d73e514 100644
+--- a/mutt.h
++++ b/mutt.h
+@@ -529,6 +529,8 @@ enum
+   OPTDONTHANDLEPGPKEYS,	/* (pseudo) used to extract PGP keys */
+   OPTUNBUFFEREDINPUT,   /* (pseudo) don't use key buffer */
+ 
++  OPTSIDEBARNEWMAILONLY,
++
+   OPTMAX
+ };
+ 
+diff --git a/pager.c b/pager.c
+index 5cfcb75..8d64fe1 100644
+--- a/pager.c
++++ b/pager.c
+@@ -2789,6 +2789,8 @@ search_next:
+       case OP_SIDEBAR_SCROLL_DOWN:
+       case OP_SIDEBAR_NEXT:
+       case OP_SIDEBAR_PREV:
++      case OP_SIDEBAR_NEXT_NEW:
++      case OP_SIDEBAR_PREV_NEW:
+ 	scroll_sidebar(ch, MENU_PAGER);
+  	break;
+ 
+diff --git a/sidebar.c b/sidebar.c
+index 8f58f85..51a25ca 100644
+--- a/sidebar.c
++++ b/sidebar.c
+@@ -269,8 +269,21 @@ int draw_sidebar(int menu) {
+ 			SETCOLOR(MT_COLOR_NEW);
+ 		else if ( tmp->msg_flagged > 0 )
+ 		        SETCOLOR(MT_COLOR_FLAGGED);
+-		else
+-			SETCOLOR(MT_COLOR_NORMAL);
++		else {
++                  /* make sure the path is either:
++                     1.  Containing new mail.
++                     2.  The inbox.
++                     3.  The current box.
++                   */
++                  if ((option (OPTSIDEBARNEWMAILONLY)) &&
++                      ( (tmp->msg_unread <= 0)  &&
++                        ( tmp != Incoming ) &&
++                        Context &&
++                        ( strcmp( tmp->path, Context->path ) != 0 ) ) )
++                    continue;
++                  else
++                    SETCOLOR(MT_COLOR_NORMAL);
++                }
+ 
+ 		move( lines, 0 );
+ 		if ( Context && !strcmp( tmp->path, Context->path ) ) {
+@@ -336,6 +349,29 @@ int draw_sidebar(int menu) {
+ 	return 0;
+ }
+ 
++BUFFY * exist_next_new()
++{
++       BUFFY *tmp = CurBuffy;
++       if(tmp == NULL) return NULL;
++       while (tmp->next != NULL)
++       {
++              tmp = tmp->next;
++               if(tmp->msg_unread) return tmp;
++       }
++       return NULL;
++}
++
++BUFFY * exist_prev_new()
++{
++       BUFFY *tmp = CurBuffy;
++       if(tmp == NULL) return NULL;
++       while (tmp->prev != NULL)
++       {
++               tmp = tmp->prev;
++               if(tmp->msg_unread) return tmp;
++       }
++       return NULL;
++}
+ 
+ void set_buffystats(CONTEXT* Context)
+ {
+@@ -352,18 +388,33 @@ void set_buffystats(CONTEXT* Context)
+ 
+ void scroll_sidebar(int op, int menu)
+ {
++        BUFFY *tmp;
+         if(!SidebarWidth) return;
+         if(!CurBuffy) return;
+ 
+ 	switch (op) {
+ 		case OP_SIDEBAR_NEXT:
++                if (!option (OPTSIDEBARNEWMAILONLY)) {
+ 			if ( CurBuffy->next == NULL ) return;
+ 			CurBuffy = CurBuffy->next;
+ 			break;
++                }
++                case OP_SIDEBAR_NEXT_NEW:
++                        if ( (tmp = exist_next_new()) == NULL)
++                                return;
++                        else CurBuffy = tmp;
++                        break;
+ 		case OP_SIDEBAR_PREV:
++                 if (!option (OPTSIDEBARNEWMAILONLY)) {
+ 			if ( CurBuffy->prev == NULL ) return;
+ 			CurBuffy = CurBuffy->prev;
+ 			break;
++                }
++                case OP_SIDEBAR_PREV_NEW:
++                       if ( (tmp = exist_prev_new()) == NULL)
++                               return;
++                       else CurBuffy = tmp;
++                       break;
+ 		case OP_SIDEBAR_SCROLL_UP:
+ 			CurBuffy = TopBuffy;
+ 			if ( CurBuffy != Incoming ) {
diff --git a/pkgs/applications/networking/mailreaders/mutt/sidebar-utf8.patch b/pkgs/applications/networking/mailreaders/mutt/sidebar-utf8.patch
new file mode 100644
index 000000000000..d67e43c24b6e
--- /dev/null
+++ b/pkgs/applications/networking/mailreaders/mutt/sidebar-utf8.patch
@@ -0,0 +1,132 @@
+From: Antonio Radici <antonio@debian.org>
+Date: Tue, 4 Mar 2014 15:39:14 +0100
+Subject: sidebar-utf8
+
+This patch fixes a problem with utf-8 strings and the sidebar,
+it rewrites entirely make_sidebar_entry so it also fixes some
+segfaults due to misallocations and overflows.
+
+See:
+ http://bugs.debian.org/584581
+ http://bugs.debian.org/603287
+
+Gbp-Pq: Topic mutt-patched
+---
+ sidebar.c | 97 +++++++++++++++++++++++++++++++++++++++++++--------------------
+ 1 file changed, 67 insertions(+), 30 deletions(-)
+
+diff --git a/sidebar.c b/sidebar.c
+index 4356ffc..8f58f85 100644
+--- a/sidebar.c
++++ b/sidebar.c
+@@ -30,6 +30,7 @@
+ #include <libgen.h>
+ #include "keymap.h"
+ #include <stdbool.h>
++#include <wchar.h>
+ 
+ /*BUFFY *CurBuffy = 0;*/
+ static BUFFY *TopBuffy = 0;
+@@ -82,36 +83,72 @@ void calc_boundaries (int menu)
+ 
+ char *make_sidebar_entry(char *box, int size, int new, int flagged)
+ {
+-	static char *entry = 0;
+-	char *c;
+-	int i = 0;
+-	int delim_len = strlen(SidebarDelim);
+-
+-	c = realloc(entry, SidebarWidth - delim_len + 2);
+-	if ( c ) entry = c;
+-	entry[SidebarWidth - delim_len + 1] = 0;
+-	for (; i < SidebarWidth - delim_len + 1; entry[i++] = ' ' );
+-	i = strlen(box);
+-	strncpy( entry, box, i < (SidebarWidth - delim_len + 1) ? i : (SidebarWidth - delim_len + 1) );
+-
+-        if (size == -1)
+-                sprintf(entry + SidebarWidth - delim_len - 3, "?");
+-        else if ( new ) {
+-          if (flagged > 0) {
+-              sprintf(
+-		        entry + SidebarWidth - delim_len - 5 - quick_log10(size) - quick_log10(new) - quick_log10(flagged),
+-		        "% d(%d)[%d]", size, new, flagged);
+-          } else {
+-              sprintf(
+-                      entry + SidebarWidth - delim_len - 3 - quick_log10(size) - quick_log10(new),
+-                      "% d(%d)", size, new);
+-          }
+-        } else if (flagged > 0) {
+-              sprintf( entry + SidebarWidth - delim_len - 3 - quick_log10(size) - quick_log10(flagged), "% d[%d]", size, flagged);
+-        } else {
+-              sprintf( entry + SidebarWidth - delim_len - 1 - quick_log10(size), "% d", size);
+-        }
+-	return entry;
++    char int_store[20]; // up to 64 bits integers
++    int right_width, left_width;
++    int box_len, box_bytes;
++    int int_len;
++    int right_offset = 0;
++    int delim_len = strlen(SidebarDelim);
++    static char *entry;
++
++    right_width = left_width = 0;
++    box_len = box_bytes = 0;
++
++    // allocate an entry big enough to contain SidebarWidth wide chars
++    entry = malloc((SidebarWidth*4)+1); // TODO: error check
++
++    // determine the right space (i.e.: how big are the numbers that we want to print)
++    if ( size > 0 ) {
++        int_len = snprintf(int_store, sizeof(int_store), "%d", size);
++        right_width += int_len;
++    } else {
++        right_width = 1; // to represent 0
++    }
++    if ( new > 0 ) {
++        int_len = snprintf(int_store, sizeof(int_store), "%d", new);
++        right_width += int_len + 2; // 2 is for ()
++    }
++    if ( flagged > 0 ) {
++        int_len = snprintf(int_store, sizeof(int_store), "%d", flagged);
++        right_width += int_len + 2; // 2 is for []
++    }
++
++    // determine how much space we have for *box and its padding (if any)
++    left_width = SidebarWidth - right_width - 1 - delim_len; // 1 is for the space
++    //fprintf(stdout, "left_width: %d right_width: %d\n", left_width, right_width);
++    // right side overflow case
++    if ( left_width <= 0 ) {
++        snprintf(entry, SidebarWidth*4, "%-*.*s ...", SidebarWidth-4-delim_len, SidebarWidth-4-delim_len, box);
++        return entry;
++    }
++    right_width -= delim_len;
++
++    // to support utf-8 chars we need to add enough space padding in case there
++    // are less chars than bytes in *box
++    box_len = mbstowcs(NULL, box, 0);
++    box_bytes = strlen(box);
++    // debug
++    //fprintf(stdout, "box_len: %d box_bytes: %d (diff: %d)\n", box_len, box_bytes, (box_bytes-box_len));
++    // if there is less string than the space we allow, then we will add the
++    // spaces
++    if ( box_len != -1 && box_len < left_width ) {
++        left_width += (box_bytes - box_len);
++    }
++    // otherwise sprintf will truncate the string for us (therefore, no else case)
++
++    // print the sidebar entry (without new and flagged messages, at the moment)
++    //fprintf(stdout, "left_width: %d right_width: %d\n", left_width, right_width);
++    right_offset = snprintf(entry, SidebarWidth*4, "%-*.*s %d", left_width, left_width, box, size);
++
++    // then pad new and flagged messages if any
++    if ( new > 0 ) {
++        right_offset += snprintf(entry+right_offset, SidebarWidth*4-right_offset, "(%d)", new);
++    }
++    if ( flagged > 0 ) {
++        right_offset += snprintf(entry+right_offset, SidebarWidth*4-right_offset, "[%d]", flagged);
++    }
++
++    return entry;
+ }
+ 
+ void set_curbuffy(char buf[LONG_STRING])
diff --git a/pkgs/applications/networking/mailreaders/mutt/sidebar.patch b/pkgs/applications/networking/mailreaders/mutt/sidebar.patch
new file mode 100644
index 000000000000..262e8f98a65a
--- /dev/null
+++ b/pkgs/applications/networking/mailreaders/mutt/sidebar.patch
@@ -0,0 +1,1477 @@
+From: Antonio Radici <antonio@debian.org>
+Date: Tue, 4 Mar 2014 15:21:10 +0100
+Subject: sidebar
+
+When enabled, mutt will show a list of mailboxes with (new) message counts in a
+separate column on the left side of the screen.
+
+As this feature is still considered to be unstable, this patch is only applied
+in the "mutt-patched" package.
+
+* Configuration variables:
+
+  sidebar_delim (string, default "|")
+
+    This specifies the delimiter between the sidebar (if visible) and
+    other screens.
+
+  sidebar_visible (boolean, default no)
+
+    This specifies whether or not to show sidebar (left-side list of folders).
+
+  sidebar_width (integer, default 0)
+-
+    The width of the sidebar.
+
+* Patch source:
+  - http://www.lunar-linux.org/index.php?page=mutt-sidebar
+  - http://lunar-linux.org/~tchan/mutt/patch-1.5.19.sidebar.20090522.txt
+
+* Changes made:
+  - 2008-08-02 myon: Refreshed patch using quilt push -f to remove hunks we do
+    not need (Makefile.in).
+
+  - 2014-03-04 evgeni: refresh sidebar patch with the version from OpenBSD
+    Source:
+      ftp://ftp.openbsd.org/pub/OpenBSD/distfiles/mutt/sidebar-1.5.22.diff1.gz
+
+Signed-off-by: Matteo F. Vescovi <mfvescovi@gmail.com>
+Signed-off-by: Evgeni Golov <evgeni@debian.org>
+
+Gbp-Pq: Topic mutt-patched
+---
+ Makefile.am    |   1 +
+ OPS            |   5 +
+ buffy.c        | 124 +++++++++++++++++++++
+ buffy.h        |   4 +
+ color.c        |   2 +
+ compose.c      |  26 ++---
+ curs_main.c    |  30 +++++-
+ flags.c        |   3 +
+ functions.h    |  10 ++
+ globals.h      |   4 +
+ imap/command.c |   7 ++
+ imap/imap.c    |   2 +-
+ init.h         |  21 ++++
+ mailbox.h      |   1 +
+ mbox.c         |   2 +
+ menu.c         |  20 ++--
+ mh.c           |  22 ++++
+ mutt.h         |   4 +
+ mutt_curses.h  |   3 +
+ muttlib.c      |  48 +++++++++
+ mx.c           |  15 +++
+ mx.h           |   1 +
+ pager.c        |  30 ++++--
+ sidebar.c      | 333 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ sidebar.h      |  36 +++++++
+ 25 files changed, 720 insertions(+), 34 deletions(-)
+ create mode 100644 sidebar.c
+ create mode 100644 sidebar.h
+
+diff --git a/Makefile.am b/Makefile.am
+index 5dfeff6..cf1ac98 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -33,6 +33,7 @@ mutt_SOURCES = \
+ 	rfc822.c rfc1524.c rfc2047.c rfc2231.c rfc3676.c \
+ 	score.c send.c sendlib.c signal.c sort.c \
+ 	status.c system.c thread.c charset.c history.c lib.c \
++	sidebar.c \
+ 	muttlib.c editmsg.c mbyte.c \
+ 	url.c ascii.c crypt-mod.c crypt-mod.h safe_asprintf.c
+ 
+diff --git a/OPS b/OPS
+index 02cea8e..b036db9 100644
+--- a/OPS
++++ b/OPS
+@@ -180,3 +180,8 @@ OP_WHAT_KEY "display the keycode for a key press"
+ OP_MAIN_SHOW_LIMIT "show currently active limit pattern"
+ OP_MAIN_COLLAPSE_THREAD "collapse/uncollapse current thread"
+ OP_MAIN_COLLAPSE_ALL "collapse/uncollapse all threads"
++OP_SIDEBAR_SCROLL_UP "scroll the mailbox pane up 1 page"
++OP_SIDEBAR_SCROLL_DOWN "scroll the mailbox pane down 1 page"
++OP_SIDEBAR_NEXT "go down to next mailbox"
++OP_SIDEBAR_PREV "go to previous mailbox"
++OP_SIDEBAR_OPEN "open hilighted mailbox"
+diff --git a/buffy.c b/buffy.c
+index 12a16d1..90ca6db 100644
+--- a/buffy.c
++++ b/buffy.c
+@@ -161,6 +161,49 @@ void mutt_buffy_cleanup (const char *buf, struct stat *st)
+   }
+ }
+ 
++static int buffy_compare_name(const void *a, const void *b) {
++  const BUFFY *b1 = * (BUFFY * const *) a;
++  const BUFFY *b2 = * (BUFFY * const *) b;
++
++  return mutt_strcoll(b1->path, b2->path);
++}
++
++static BUFFY *buffy_sort(BUFFY *b)
++{
++  BUFFY *tmp = b;
++  int buffycount = 0;
++  BUFFY **ary;
++  int i;
++
++  if (!option(OPTSIDEBARSORT))
++    return b;
++
++  for (; tmp != NULL; tmp = tmp->next)
++    buffycount++;
++
++  ary = (BUFFY **) safe_calloc(buffycount, sizeof (*ary));
++
++  tmp = b;
++  for (i = 0; tmp != NULL; tmp = tmp->next, i++) {
++    ary[i] = tmp;
++  }
++
++  qsort(ary, buffycount, sizeof(*ary), buffy_compare_name);
++
++  for (i = 0; i < buffycount - 1; i++) {
++    ary[i]->next = ary[i+1];
++  }
++  ary[buffycount - 1]->next = NULL;
++  for (i = 1; i < buffycount; i++) {
++    ary[i]->prev = ary[i-1];
++  }
++  ary[0]->prev = NULL;
++
++  tmp = ary[0];
++  free(ary);
++  return tmp;
++}
++
+ BUFFY *mutt_find_mailbox (const char *path)
+ {
+   BUFFY *tmp = NULL;
+@@ -282,6 +325,7 @@ int mutt_parse_mailboxes (BUFFER *path, BUFFER *s, unsigned long data, BUFFER *e
+     else
+       (*tmp)->size = 0;
+   }
++  Incoming = buffy_sort(Incoming);
+   return 0;
+ }
+ 
+@@ -357,6 +401,69 @@ static int buffy_maildir_hasnew (BUFFY* mailbox)
+ 
+   return 0;
+ }
++
++/* update message counts for the sidebar */
++void buffy_maildir_update (BUFFY* mailbox)
++{
++  char path[_POSIX_PATH_MAX];
++  DIR *dirp;
++  struct dirent *de;
++  char *p;
++
++  mailbox->msgcount = 0;
++  mailbox->msg_unread = 0;
++  mailbox->msg_flagged = 0;
++
++  snprintf (path, sizeof (path), "%s/new", mailbox->path);
++        
++  if ((dirp = opendir (path)) == NULL)
++  {   
++    mailbox->magic = 0;
++    return;
++  } 
++      
++  while ((de = readdir (dirp)) != NULL)
++  {
++    if (*de->d_name == '.')
++      continue;
++
++    if (!(p = strstr (de->d_name, ":2,")) || !strchr (p + 3, 'T')) {
++      mailbox->new = 1;
++      mailbox->msgcount++;
++      mailbox->msg_unread++;
++    }
++  }
++
++  closedir (dirp);
++  snprintf (path, sizeof (path), "%s/cur", mailbox->path);
++        
++  if ((dirp = opendir (path)) == NULL)
++  {   
++    mailbox->magic = 0;
++    return;
++  } 
++      
++  while ((de = readdir (dirp)) != NULL)
++  {
++    if (*de->d_name == '.')
++      continue;
++
++    if (!(p = strstr (de->d_name, ":2,")) || !strchr (p + 3, 'T')) {
++      mailbox->msgcount++;
++      if ((p = strstr (de->d_name, ":2,"))) {
++        if (!strchr (p + 3, 'T')) {
++          if (!strchr (p + 3, 'S'))
++            mailbox->msg_unread++;
++          if (strchr(p + 3, 'F'))
++            mailbox->msg_flagged++;
++        }
++      }
++    }
++  }
++
++  closedir (dirp);
++}
++
+ /* returns 1 if mailbox has new mail */ 
+ static int buffy_mbox_hasnew (BUFFY* mailbox, struct stat *sb)
+ {
+@@ -388,6 +495,20 @@ static int buffy_mbox_hasnew (BUFFY* mailbox, struct stat *sb)
+   return rc;
+ }
+ 
++/* update message counts for the sidebar */
++void buffy_mbox_update (BUFFY* mailbox)
++{
++  CONTEXT *ctx = NULL;
++
++  ctx = mx_open_mailbox(mailbox->path, M_READONLY | M_QUIET | M_NOSORT | M_PEEK, NULL);
++  if(ctx)
++  {
++    mailbox->msgcount = ctx->msgcount;
++    mailbox->msg_unread = ctx->unread;
++    mx_close_mailbox(ctx, 0);
++  }
++}
++
+ int mutt_buffy_check (int force)
+ {
+   BUFFY *tmp;
+@@ -461,16 +582,19 @@ int mutt_buffy_check (int force)
+       {
+       case M_MBOX:
+       case M_MMDF:
++	buffy_mbox_update (tmp);
+ 	if (buffy_mbox_hasnew (tmp, &sb) > 0)
+ 	  BuffyCount++;
+ 	break;
+ 
+       case M_MAILDIR:
++	buffy_maildir_update (tmp);
+ 	if (buffy_maildir_hasnew (tmp) > 0)
+ 	  BuffyCount++;
+ 	break;
+ 
+       case M_MH:
++	mh_buffy_update (tmp->path, &tmp->msgcount, &tmp->msg_unread, &tmp->msg_flagged);
+ 	mh_buffy(tmp);
+ 	if (tmp->new)
+ 	  BuffyCount++;
+diff --git a/buffy.h b/buffy.h
+index f9fc55a..672d178 100644
+--- a/buffy.h
++++ b/buffy.h
+@@ -25,7 +25,11 @@ typedef struct buffy_t
+   char path[_POSIX_PATH_MAX];
+   off_t size;
+   struct buffy_t *next;
++  struct buffy_t *prev;
+   short new;			/* mailbox has new mail */
++  int msgcount;			/* total number of messages */
++  int msg_unread;		/* number of unread messages */
++  int msg_flagged;		/* number of flagged messages */
+   short notified;		/* user has been notified */
+   short magic;			/* mailbox type */
+   short newly_created;		/* mbox or mmdf just popped into existence */
+diff --git a/color.c b/color.c
+index 64a46dc..d6f9198 100644
+--- a/color.c
++++ b/color.c
+@@ -94,6 +94,8 @@ static const struct mapping_t Fields[] =
+   { "underline",	MT_COLOR_UNDERLINE },
+   { "index",		MT_COLOR_INDEX },
+   { "prompt",		MT_COLOR_PROMPT },
++  { "sidebar_new",	MT_COLOR_NEW },
++  { "sidebar_flagged",	MT_COLOR_FLAGGED },
+   { NULL,		0 }
+ };
+ 
+diff --git a/compose.c b/compose.c
+index 9d87060..b63695f 100644
+--- a/compose.c
++++ b/compose.c
+@@ -72,7 +72,7 @@ enum
+ 
+ #define HDR_XOFFSET 10
+ #define TITLE_FMT "%10s" /* Used for Prompts, which are ASCII */
+-#define W (COLS - HDR_XOFFSET)
++#define W (COLS - HDR_XOFFSET - SidebarWidth)
+ 
+ static const char * const Prompts[] =
+ {
+@@ -110,7 +110,7 @@ static void snd_entry (char *b, size_t blen, MUTTMENU *menu, int num)
+ 
+ static void redraw_crypt_lines (HEADER *msg)
+ {
+-  mvaddstr (HDR_CRYPT, 0, "Security: ");
++  mvaddstr (HDR_CRYPT, SidebarWidth, "Security: ");
+ 
+   if ((WithCrypto & (APPLICATION_PGP | APPLICATION_SMIME)) == 0)
+   {
+@@ -145,7 +145,7 @@ static void redraw_crypt_lines (HEADER *msg)
+       addstr (_(" (OppEnc mode)"));
+ 
+   clrtoeol ();
+-  move (HDR_CRYPTINFO, 0);
++  move (HDR_CRYPTINFO, SidebarWidth);
+   clrtoeol ();
+ 
+   if ((WithCrypto & APPLICATION_PGP)
+@@ -162,7 +162,7 @@ static void redraw_crypt_lines (HEADER *msg)
+       && (msg->security & ENCRYPT)
+       && SmimeCryptAlg
+       && *SmimeCryptAlg) {
+-      mvprintw (HDR_CRYPTINFO, 40, "%s%s", _("Encrypt with: "),
++      mvprintw (HDR_CRYPTINFO, SidebarWidth + 40, "%s%s", _("Encrypt with: "),
+ 		NONULL(SmimeCryptAlg));
+   }
+ }
+@@ -175,7 +175,7 @@ static void redraw_mix_line (LIST *chain)
+   int c;
+   char *t;
+ 
+-  mvaddstr (HDR_MIX, 0,     "     Mix: ");
++  mvaddstr (HDR_MIX, SidebarWidth,     "     Mix: ");
+ 
+   if (!chain)
+   {
+@@ -190,7 +190,7 @@ static void redraw_mix_line (LIST *chain)
+     if (t && t[0] == '0' && t[1] == '\0')
+       t = "<random>";
+     
+-    if (c + mutt_strlen (t) + 2 >= COLS)
++    if (c + mutt_strlen (t) + 2 >= COLS - SidebarWidth)
+       break;
+ 
+     addstr (NONULL(t));
+@@ -242,7 +242,7 @@ static void draw_envelope_addr (int line, ADDRESS *addr)
+ 
+   buf[0] = 0;
+   rfc822_write_address (buf, sizeof (buf), addr, 1);
+-  mvprintw (line, 0, TITLE_FMT, Prompts[line - 1]);
++  mvprintw (line, SidebarWidth, TITLE_FMT, Prompts[line - 1]);
+   mutt_paddstr (W, buf);
+ }
+ 
+@@ -252,10 +252,10 @@ static void draw_envelope (HEADER *msg, char *fcc)
+   draw_envelope_addr (HDR_TO, msg->env->to);
+   draw_envelope_addr (HDR_CC, msg->env->cc);
+   draw_envelope_addr (HDR_BCC, msg->env->bcc);
+-  mvprintw (HDR_SUBJECT, 0, TITLE_FMT, Prompts[HDR_SUBJECT - 1]);
++  mvprintw (HDR_SUBJECT, SidebarWidth, TITLE_FMT, Prompts[HDR_SUBJECT - 1]);
+   mutt_paddstr (W, NONULL (msg->env->subject));
+   draw_envelope_addr (HDR_REPLYTO, msg->env->reply_to);
+-  mvprintw (HDR_FCC, 0, TITLE_FMT, Prompts[HDR_FCC - 1]);
++  mvprintw (HDR_FCC, SidebarWidth, TITLE_FMT, Prompts[HDR_FCC - 1]);
+   mutt_paddstr (W, fcc);
+ 
+   if (WithCrypto)
+@@ -266,7 +266,7 @@ static void draw_envelope (HEADER *msg, char *fcc)
+ #endif
+ 
+   SETCOLOR (MT_COLOR_STATUS);
+-  mvaddstr (HDR_ATTACH - 1, 0, _("-- Attachments"));
++  mvaddstr (HDR_ATTACH - 1, SidebarWidth, _("-- Attachments"));
+   clrtoeol ();
+ 
+   NORMAL_COLOR;
+@@ -302,7 +302,7 @@ static int edit_address_list (int line, ADDRESS **addr)
+   /* redraw the expanded list so the user can see the result */
+   buf[0] = 0;
+   rfc822_write_address (buf, sizeof (buf), *addr, 1);
+-  move (line, HDR_XOFFSET);
++  move (line, HDR_XOFFSET+SidebarWidth);
+   mutt_paddstr (W, buf);
+   
+   return 0;
+@@ -562,7 +562,7 @@ int mutt_compose_menu (HEADER *msg,   /* structure for new message */
+ 	if (mutt_get_field ("Subject: ", buf, sizeof (buf), 0) == 0)
+ 	{
+ 	  mutt_str_replace (&msg->env->subject, buf);
+-	  move (HDR_SUBJECT, HDR_XOFFSET);
++	  move (HDR_SUBJECT, HDR_XOFFSET + SidebarWidth);
+ 	  if (msg->env->subject)
+ 	    mutt_paddstr (W, msg->env->subject);
+ 	  else
+@@ -580,7 +580,7 @@ int mutt_compose_menu (HEADER *msg,   /* structure for new message */
+ 	{
+ 	  strfcpy (fcc, buf, fcclen);
+ 	  mutt_pretty_mailbox (fcc, fcclen);
+-	  move (HDR_FCC, HDR_XOFFSET);
++	  move (HDR_FCC, HDR_XOFFSET + SidebarWidth);
+ 	  mutt_paddstr (W, fcc);
+ 	  fccSet = 1;
+ 	}
+diff --git a/curs_main.c b/curs_main.c
+index 9d718ee..ea530a6 100644
+--- a/curs_main.c
++++ b/curs_main.c
+@@ -26,7 +26,9 @@
+ #include "mailbox.h"
+ #include "mapping.h"
+ #include "sort.h"
++#include "buffy.h"
+ #include "mx.h"
++#include "sidebar.h"
+ 
+ #ifdef USE_POP
+ #include "pop.h"
+@@ -596,8 +598,12 @@ int mutt_index_menu (void)
+        menu->redraw |= REDRAW_STATUS;
+      if (do_buffy_notify)
+      {
+-       if (mutt_buffy_notify () && option (OPTBEEPNEW))
+- 	beep ();
++       if (mutt_buffy_notify ())
++       {
++         menu->redraw |= REDRAW_FULL;
++         if (option (OPTBEEPNEW))
++           beep ();
++       }
+      }
+      else
+        do_buffy_notify = 1;
+@@ -609,6 +615,7 @@ int mutt_index_menu (void)
+     if (menu->redraw & REDRAW_FULL)
+     {
+       menu_redraw_full (menu);
++      draw_sidebar(menu->menu);
+       mutt_show_error ();
+     }
+ 
+@@ -631,9 +638,12 @@ int mutt_index_menu (void)
+ 
+       if (menu->redraw & REDRAW_STATUS)
+       {
++	DrawFullLine = 1;
+ 	menu_status_line (buf, sizeof (buf), menu, NONULL (Status));
++	DrawFullLine = 0;
+ 	move (option (OPTSTATUSONTOP) ? 0 : LINES-2, 0);
+ 	SETCOLOR (MT_COLOR_STATUS);
++	set_buffystats(Context);
+ 	mutt_paddstr (COLS, buf);
+ 	NORMAL_COLOR;
+ 	menu->redraw &= ~REDRAW_STATUS;
+@@ -653,7 +663,7 @@ int mutt_index_menu (void)
+ 	menu->oldcurrent = -1;
+ 
+       if (option (OPTARROWCURSOR))
+-	move (menu->current - menu->top + menu->offset, 2);
++	move (menu->current - menu->top + menu->offset, SidebarWidth + 2);
+       else if (option (OPTBRAILLEFRIENDLY))
+ 	move (menu->current - menu->top + menu->offset, 0);
+       else
+@@ -1154,6 +1164,7 @@ int mutt_index_menu (void)
+ 	  menu->redraw = REDRAW_FULL;
+ 	break;
+ 
++      case OP_SIDEBAR_OPEN:
+       case OP_MAIN_CHANGE_FOLDER:
+       case OP_MAIN_NEXT_UNREAD_MAILBOX:
+ 
+@@ -1185,7 +1196,11 @@ int mutt_index_menu (void)
+ 	{
+ 	  mutt_buffy (buf, sizeof (buf));
+ 
+-	  if (mutt_enter_fname (cp, buf, sizeof (buf), &menu->redraw, 1) == -1)
++          if ( op == OP_SIDEBAR_OPEN ) {
++              if(!CurBuffy)
++                break;
++            strncpy( buf, CurBuffy->path, sizeof(buf) );  
++	    } else if (mutt_enter_fname (cp, buf, sizeof (buf), &menu->redraw, 1) == -1)
+ 	  {
+ 	    if (menu->menu == MENU_PAGER)
+ 	    {
+@@ -1203,6 +1218,7 @@ int mutt_index_menu (void)
+ 	}
+ 
+ 	mutt_expand_path (buf, sizeof (buf));
++        set_curbuffy(buf);
+ 	if (mx_get_magic (buf) <= 0)
+ 	{
+ 	  mutt_error (_("%s is not a mailbox."), buf);
+@@ -2306,6 +2322,12 @@ int mutt_index_menu (void)
+ 	mutt_what_key();
+ 	break;
+ 
++      case OP_SIDEBAR_SCROLL_UP:
++      case OP_SIDEBAR_SCROLL_DOWN:
++      case OP_SIDEBAR_NEXT:
++      case OP_SIDEBAR_PREV:
++        scroll_sidebar(op, menu->menu);
++        break;
+       default:
+ 	if (menu->menu == MENU_MAIN)
+ 	  km_error_key (MENU_MAIN);
+diff --git a/flags.c b/flags.c
+index 133fa35..48fb287 100644
+--- a/flags.c
++++ b/flags.c
+@@ -22,8 +22,10 @@
+ 
+ #include "mutt.h"
+ #include "mutt_curses.h"
++#include "mutt_menu.h"
+ #include "sort.h"
+ #include "mx.h"
++#include "sidebar.h"
+ 
+ void _mutt_set_flag (CONTEXT *ctx, HEADER *h, int flag, int bf, int upd_ctx)
+ {
+@@ -290,6 +292,7 @@ void _mutt_set_flag (CONTEXT *ctx, HEADER *h, int flag, int bf, int upd_ctx)
+    */
+   if (h->searched && (changed != h->changed || deleted != ctx->deleted || tagged != ctx->tagged || flagged != ctx->flagged))
+     h->searched = 0;
++	draw_sidebar(0);
+ }
+ 
+ void mutt_tag_set_flag (int flag, int bf)
+diff --git a/functions.h b/functions.h
+index 26171a0..ef8937a 100644
+--- a/functions.h
++++ b/functions.h
+@@ -170,6 +170,11 @@ const struct binding_t OpMain[] = { /* map: index */
+   { "decrypt-save",		OP_DECRYPT_SAVE,		NULL },
+ 
+ 
++ { "sidebar-scroll-up",	OP_SIDEBAR_SCROLL_UP, NULL },
++ { "sidebar-scroll-down",	OP_SIDEBAR_SCROLL_DOWN, NULL },
++ { "sidebar-next",		OP_SIDEBAR_NEXT, NULL },
++ { "sidebar-prev",		OP_SIDEBAR_PREV, NULL },
++ { "sidebar-open",		OP_SIDEBAR_OPEN, NULL },
+   { NULL,			0,				NULL }
+ };
+ 
+@@ -274,6 +279,11 @@ const struct binding_t OpPager[] = { /* map: pager */
+ 
+   { "what-key",		OP_WHAT_KEY,		NULL },
+ 
++  { "sidebar-scroll-up",	OP_SIDEBAR_SCROLL_UP, NULL },
++  { "sidebar-scroll-down",	OP_SIDEBAR_SCROLL_DOWN, NULL },
++  { "sidebar-next",	OP_SIDEBAR_NEXT, NULL },
++  { "sidebar-prev",	OP_SIDEBAR_PREV, NULL },
++  { "sidebar-open", OP_SIDEBAR_OPEN, NULL },
+   { NULL,		0,				NULL }
+ };
+ 
+diff --git a/globals.h b/globals.h
+index 282fde3..004c795 100644
+--- a/globals.h
++++ b/globals.h
+@@ -118,6 +118,7 @@ WHERE short SearchContext;
+ WHERE char *SendCharset;
+ WHERE char *Sendmail;
+ WHERE char *Shell;
++WHERE char *SidebarDelim;
+ WHERE char *Signature;
+ WHERE char *SimpleSearch;
+ #if USE_SMTP
+@@ -214,6 +215,9 @@ WHERE short ScoreThresholdDelete;
+ WHERE short ScoreThresholdRead;
+ WHERE short ScoreThresholdFlag;
+ 
++WHERE struct buffy_t *CurBuffy INITVAL(0);
++WHERE short DrawFullLine INITVAL(0);
++WHERE short SidebarWidth;
+ #ifdef USE_IMAP
+ WHERE short ImapKeepalive;
+ WHERE short ImapPipelineDepth;
+diff --git a/imap/command.c b/imap/command.c
+index 32f8417..d68e3ab 100644
+--- a/imap/command.c
++++ b/imap/command.c
+@@ -1012,6 +1012,13 @@ static void cmd_parse_status (IMAP_DATA* idata, char* s)
+ 	     opened */
+ 	  status->uidnext = oldun;
+ 
++        /* Added to make the sidebar show the correct numbers */
++        if (status->messages)
++        {
++          inc->msgcount = status->messages;
++          inc->msg_unread = status->unseen;
++        }
++
+         FREE (&value);
+         return;
+       }
+diff --git a/imap/imap.c b/imap/imap.c
+index f476873..af3ac3d 100644
+--- a/imap/imap.c
++++ b/imap/imap.c
+@@ -1529,7 +1529,7 @@ int imap_buffy_check (int force)
+ 
+     imap_munge_mbox_name (munged, sizeof (munged), name);
+     snprintf (command, sizeof (command),
+-	      "STATUS %s (UIDNEXT UIDVALIDITY UNSEEN RECENT)", munged);
++	      "STATUS %s (UIDNEXT UIDVALIDITY UNSEEN RECENT MESSAGES)", munged);
+ 
+     if (imap_exec (idata, command, IMAP_CMD_QUEUE) < 0)
+     {
+diff --git a/init.h b/init.h
+index 35224c1..c664e5f 100644
+--- a/init.h
++++ b/init.h
+@@ -2030,6 +2030,27 @@ struct option_t MuttVars[] = {
+   ** not used.
+   ** (PGP only)
+   */
++  {"sidebar_delim", DT_STR, R_BOTH, UL &SidebarDelim, "|"},
++  /*
++  ** .pp
++  ** This specifies the delimiter between the sidebar (if visible) and 
++  ** other screens.
++  */
++  { "sidebar_visible", DT_BOOL, R_BOTH, OPTSIDEBAR, 0 },
++  /*
++  ** .pp
++  ** This specifies whether or not to show sidebar (left-side list of folders).
++  */
++  { "sidebar_sort", DT_BOOL, R_BOTH, OPTSIDEBARSORT, 0 },
++  /*
++  ** .pp
++  ** This specifies whether or not to sort the sidebar alphabetically.
++  */
++  { "sidebar_width", DT_NUM, R_BOTH, UL &SidebarWidth, 0 },
++  /*
++  ** .pp
++  ** The width of the sidebar.
++  */
+   { "pgp_use_gpg_agent", DT_BOOL, R_NONE, OPTUSEGPGAGENT, 0},
+   /*
+   ** .pp
+diff --git a/mailbox.h b/mailbox.h
+index 2b2c9a1..000503d 100644
+--- a/mailbox.h
++++ b/mailbox.h
+@@ -27,6 +27,7 @@
+ #define M_NEWFOLDER	(1<<4) /* create a new folder - same as M_APPEND, but uses
+ 				* safe_fopen() for mbox-style folders.
+ 				*/
++#define M_PEEK		(1<<5) /* revert atime back after taking a look (if applicable) */
+ 
+ /* mx_open_new_message() */
+ #define M_ADD_FROM	(1<<0)	/* add a From_ line */
+diff --git a/mbox.c b/mbox.c
+index 6d3b6bd..fa82eb3 100644
+--- a/mbox.c
++++ b/mbox.c
+@@ -104,6 +104,7 @@ int mmdf_parse_mailbox (CONTEXT *ctx)
+     mutt_perror (ctx->path);
+     return (-1);
+   }
++  ctx->atime = sb.st_atime;
+   ctx->mtime = sb.st_mtime;
+   ctx->size = sb.st_size;
+ 
+@@ -255,6 +256,7 @@ int mbox_parse_mailbox (CONTEXT *ctx)
+ 
+   ctx->size = sb.st_size;
+   ctx->mtime = sb.st_mtime;
++  ctx->atime = sb.st_atime;
+ 
+ #ifdef NFS_ATTRIBUTE_HACK
+   if (sb.st_mtime > sb.st_atime)
+diff --git a/menu.c b/menu.c
+index 27b5f8e..bc3a02f 100644
+--- a/menu.c
++++ b/menu.c
+@@ -24,6 +24,7 @@
+ #include "mutt_curses.h"
+ #include "mutt_menu.h"
+ #include "mbyte.h"
++#include "sidebar.h"
+ 
+ extern size_t UngetCount;
+ 
+@@ -186,7 +187,7 @@ static void menu_pad_string (char *s, size_t n)
+ {
+   char *scratch = safe_strdup (s);
+   int shift = option (OPTARROWCURSOR) ? 3 : 0;
+-  int cols = COLS - shift;
++  int cols = COLS - shift - SidebarWidth;
+ 
+   mutt_format_string (s, n, cols, cols, FMT_LEFT, ' ', scratch, mutt_strlen (scratch), 1);
+   s[n - 1] = 0;
+@@ -239,6 +240,7 @@ void menu_redraw_index (MUTTMENU *menu)
+   int do_color;
+   int attr;
+ 
++  draw_sidebar(1);
+   for (i = menu->top; i < menu->top + menu->pagelen; i++)
+   {
+     if (i < menu->max)
+@@ -249,7 +251,7 @@ void menu_redraw_index (MUTTMENU *menu)
+       menu_pad_string (buf, sizeof (buf));
+ 
+       ATTRSET(attr);
+-      move(i - menu->top + menu->offset, 0);
++      move(i - menu->top + menu->offset, SidebarWidth);
+       do_color = 1;
+ 
+       if (i == menu->current)
+@@ -272,7 +274,7 @@ void menu_redraw_index (MUTTMENU *menu)
+     else
+     {
+       NORMAL_COLOR;
+-      CLEARLINE(i - menu->top + menu->offset);
++      CLEARLINE_WIN(i - menu->top + menu->offset);
+     }
+   }
+   NORMAL_COLOR;
+@@ -289,7 +291,7 @@ void menu_redraw_motion (MUTTMENU *menu)
+     return;
+   }
+   
+-  move (menu->oldcurrent + menu->offset - menu->top, 0);
++  move (menu->oldcurrent + menu->offset - menu->top, SidebarWidth);
+   ATTRSET(menu->color (menu->oldcurrent));
+ 
+   if (option (OPTARROWCURSOR))
+@@ -301,13 +303,13 @@ void menu_redraw_motion (MUTTMENU *menu)
+     {
+       menu_make_entry (buf, sizeof (buf), menu, menu->oldcurrent);
+       menu_pad_string (buf, sizeof (buf));
+-      move (menu->oldcurrent + menu->offset - menu->top, 3);
++      move (menu->oldcurrent + menu->offset - menu->top, SidebarWidth + 3);
+       print_enriched_string (menu->color(menu->oldcurrent), (unsigned char *) buf, 1);
+     }
+ 
+     /* now draw it in the new location */
+     SETCOLOR(MT_COLOR_INDICATOR);
+-    mvaddstr(menu->current + menu->offset - menu->top, 0, "->");
++    mvaddstr(menu->current + menu->offset - menu->top, SidebarWidth, "->");
+   }
+   else
+   {
+@@ -320,7 +322,7 @@ void menu_redraw_motion (MUTTMENU *menu)
+     menu_make_entry (buf, sizeof (buf), menu, menu->current);
+     menu_pad_string (buf, sizeof (buf));
+     SETCOLOR(MT_COLOR_INDICATOR);
+-    move(menu->current - menu->top + menu->offset, 0);
++    move(menu->current - menu->top + menu->offset, SidebarWidth);
+     print_enriched_string (menu->color(menu->current), (unsigned char *) buf, 0);
+   }
+   menu->redraw &= REDRAW_STATUS;
+@@ -332,7 +334,7 @@ void menu_redraw_current (MUTTMENU *menu)
+   char buf[LONG_STRING];
+   int attr = menu->color (menu->current);
+   
+-  move (menu->current + menu->offset - menu->top, 0);
++  move (menu->current + menu->offset - menu->top, SidebarWidth);
+   menu_make_entry (buf, sizeof (buf), menu, menu->current);
+   menu_pad_string (buf, sizeof (buf));
+ 
+@@ -881,7 +883,7 @@ int mutt_menuLoop (MUTTMENU *menu)
+     
+     
+     if (option (OPTARROWCURSOR))
+-      move (menu->current - menu->top + menu->offset, 2);
++      move (menu->current - menu->top + menu->offset, SidebarWidth + 2);
+     else if (option (OPTBRAILLEFRIENDLY))
+       move (menu->current - menu->top + menu->offset, 0);
+     else
+diff --git a/mh.c b/mh.c
+index 63e12d2..4a84a99 100644
+--- a/mh.c
++++ b/mh.c
+@@ -295,6 +295,28 @@ void mh_buffy(BUFFY *b)
+   mhs_free_sequences (&mhs);
+ }
+ 
++void mh_buffy_update (const char *path, int *msgcount, int *msg_unread, int *msg_flagged)
++{
++  int i;
++  struct mh_sequences mhs;
++  memset (&mhs, 0, sizeof (mhs));
++
++  if (mh_read_sequences (&mhs, path) < 0)
++    return;
++
++  msgcount = 0;
++  msg_unread = 0;
++  msg_flagged = 0;
++  for (i = 0; i <= mhs.max; i++)
++    msgcount++;
++  if (mhs_check (&mhs, i) & MH_SEQ_UNSEEN) {
++    msg_unread++;
++  }
++  if (mhs_check (&mhs, i) & MH_SEQ_FLAGGED)
++    msg_flagged++;
++  mhs_free_sequences (&mhs);
++}
++
+ static int mh_mkstemp (CONTEXT * dest, FILE ** fp, char **tgt)
+ {
+   int fd;
+diff --git a/mutt.h b/mutt.h
+index 01d47de..5f25406 100644
+--- a/mutt.h
++++ b/mutt.h
+@@ -435,6 +435,8 @@ enum
+   OPTSAVEEMPTY,
+   OPTSAVENAME,
+   OPTSCORE,
++  OPTSIDEBAR,
++  OPTSIDEBARSORT,
+   OPTSIGDASHES,
+   OPTSIGONTOP,
+   OPTSORTRE,
+@@ -880,6 +882,7 @@ typedef struct _context
+ {
+   char *path;
+   FILE *fp;
++  time_t atime;
+   time_t mtime;
+   off_t size;
+   off_t vsize;
+@@ -920,6 +923,7 @@ typedef struct _context
+   unsigned int quiet : 1;	/* inhibit status messages? */
+   unsigned int collapsed : 1;   /* are all threads collapsed? */
+   unsigned int closing : 1;	/* mailbox is being closed */
++  unsigned int peekonly : 1;	/* just taking a glance, revert atime */
+ 
+   /* driver hooks */
+   void *data;			/* driver specific data */
+diff --git a/mutt_curses.h b/mutt_curses.h
+index f8bc47c..ef9884e 100644
+--- a/mutt_curses.h
++++ b/mutt_curses.h
+@@ -64,6 +64,7 @@
+ #undef lines
+ #endif /* lines */
+ 
++#define CLEARLINE_WIN(x) move(x,SidebarWidth), clrtoeol()
+ #define CLEARLINE(x) move(x,0), clrtoeol()
+ #define CENTERLINE(x,y) move(y, (COLS-strlen(x))/2), addstr(x)
+ #define BEEP() do { if (option (OPTBEEP)) beep(); } while (0)
+@@ -121,6 +122,8 @@ enum
+   MT_COLOR_UNDERLINE,
+   MT_COLOR_INDEX,
+   MT_COLOR_PROMPT,
++  MT_COLOR_NEW,
++  MT_COLOR_FLAGGED,
+   MT_COLOR_MAX
+ };
+ 
+diff --git a/muttlib.c b/muttlib.c
+index c1d565f..039e7c3 100644
+--- a/muttlib.c
++++ b/muttlib.c
+@@ -1279,6 +1279,8 @@ void mutt_FormatString (char *dest,		/* output buffer */
+ 	  pl = pw = 1;
+ 
+ 	/* see if there's room to add content, else ignore */
++        if ( DrawFullLine )
++        {
+ 	if ((col < COLS && wlen < destlen) || soft)
+ 	{
+ 	  int pad;
+@@ -1322,6 +1324,52 @@ void mutt_FormatString (char *dest,		/* output buffer */
+ 	  col += wid;
+ 	  src += pl;
+ 	}
++        }
++        else
++        {
++	if ((col < COLS-SidebarWidth && wlen < destlen) || soft)
++        {
++	  int pad;
++
++	  /* get contents after padding */
++	  mutt_FormatString (buf, sizeof (buf), 0, src + pl, callback, data, flags);
++	  len = mutt_strlen (buf);
++	  wid = mutt_strwidth (buf);
++
++	  /* try to consume as many columns as we can, if we don't have
++	   * memory for that, use as much memory as possible */
++	  pad = (COLS - SidebarWidth - col - wid) / pw;
++	  if (pad > 0 && wlen + (pad * pl) + len > destlen)
++	    pad = ((signed)(destlen - wlen - len)) / pl;
++	  if (pad > 0)
++	  {
++	    while (pad--)
++	    {
++	      memcpy (wptr, src, pl);
++	      wptr += pl;
++	      wlen += pl;
++	      col += pw;
++	    }
++	  }
++	  else if (soft && pad < 0)
++	  {
++	    /* \0-terminate dest for length computation in mutt_wstr_trunc() */
++	    *wptr = 0;
++	    /* make sure right part is at most as wide as display */
++	    len = mutt_wstr_trunc (buf, destlen, COLS, &wid);
++	    /* truncate left so that right part fits completely in */
++	    wlen = mutt_wstr_trunc (dest, destlen - len, col + pad, &col);
++	    wptr = dest + wlen;
++	  }
++	  if (len + wlen > destlen)
++	    len = mutt_wstr_trunc (buf, destlen - wlen, COLS - SidebarWidth - col, NULL);
++	  memcpy (wptr, buf, len);
++	  wptr += len;
++	  wlen += len;
++	  col += wid;
++	  src += pl;
++	}
++        }
+ 	break; /* skip rest of input */
+       }
+       else if (ch == '|')
+diff --git a/mx.c b/mx.c
+index 0a1a80e..e80b8ff 100644
+--- a/mx.c
++++ b/mx.c
+@@ -595,6 +595,7 @@ static int mx_open_mailbox_append (CONTEXT *ctx, int flags)
+  *		M_APPEND	open mailbox for appending
+  *		M_READONLY	open mailbox in read-only mode
+  *		M_QUIET		only print error messages
++ *		M_PEEK		revert atime where applicable
+  *	ctx	if non-null, context struct to use
+  */
+ CONTEXT *mx_open_mailbox (const char *path, int flags, CONTEXT *pctx)
+@@ -617,6 +618,8 @@ CONTEXT *mx_open_mailbox (const char *path, int flags, CONTEXT *pctx)
+     ctx->quiet = 1;
+   if (flags & M_READONLY)
+     ctx->readonly = 1;
++  if (flags & M_PEEK)
++    ctx->peekonly = 1;
+ 
+   if (flags & (M_APPEND|M_NEWFOLDER))
+   {
+@@ -721,9 +724,21 @@ CONTEXT *mx_open_mailbox (const char *path, int flags, CONTEXT *pctx)
+ void mx_fastclose_mailbox (CONTEXT *ctx)
+ {
+   int i;
++#ifndef BUFFY_SIZE
++  struct utimbuf ut;
++#endif
+ 
+   if(!ctx) 
+     return;
++#ifndef BUFFY_SIZE
++  /* fix up the times so buffy won't get confused */
++  if (ctx->peekonly && ctx->path && ctx->mtime > ctx->atime)
++  {
++    ut.actime = ctx->atime;
++    ut.modtime = ctx->mtime;
++    utime (ctx->path, &ut); 
++  }
++#endif
+ 
+   /* never announce that a mailbox we've just left has new mail. #3290
+    * XXX: really belongs in mx_close_mailbox, but this is a nice hook point */
+diff --git a/mx.h b/mx.h
+index 2ef4ec7..4aabadf 100644
+--- a/mx.h
++++ b/mx.h
+@@ -60,6 +60,7 @@ void mbox_reset_atime (CONTEXT *, struct stat *);
+ int mh_read_dir (CONTEXT *, const char *);
+ int mh_sync_mailbox (CONTEXT *, int *);
+ int mh_check_mailbox (CONTEXT *, int *);
++void mh_buffy_update (const char *, int *, int *, int *);
+ int mh_check_empty (const char *);
+ 
+ int maildir_read_dir (CONTEXT *);
+diff --git a/pager.c b/pager.c
+index c99f1e4..5cfcb75 100644
+--- a/pager.c
++++ b/pager.c
+@@ -29,6 +29,7 @@
+ #include "pager.h"
+ #include "attach.h"
+ #include "mbyte.h"
++#include "sidebar.h"
+ 
+ #include "mutt_crypt.h"
+ 
+@@ -1095,6 +1096,7 @@ static int format_line (struct line_t **lineInfo, int n, unsigned char *buf,
+   wchar_t wc;
+   mbstate_t mbstate;
+   int wrap_cols = mutt_term_width ((flags & M_PAGER_NOWRAP) ? 0 : Wrap);
++  wrap_cols -= SidebarWidth;
+ 
+   if (check_attachment_marker ((char *)buf) == 0)
+     wrap_cols = COLS;
+@@ -1746,7 +1748,7 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra)
+     if ((redraw & REDRAW_BODY) || topline != oldtopline)
+     {
+       do {
+-	move (bodyoffset, 0);
++	move (bodyoffset, SidebarWidth);
+ 	curline = oldtopline = topline;
+ 	lines = 0;
+ 	force_redraw = 0;
+@@ -1759,6 +1761,7 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra)
+ 			    &QuoteList, &q_level, &force_redraw, &SearchRE) > 0)
+ 	    lines++;
+ 	  curline++;
++  	  move(lines + bodyoffset, SidebarWidth);
+ 	}
+ 	last_offset = lineInfo[curline].offset;
+       } while (force_redraw);
+@@ -1771,6 +1774,7 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra)
+ 	  addch ('~');
+ 	addch ('\n');
+ 	lines++;
++  	move(lines + bodyoffset, SidebarWidth);
+       }
+       NORMAL_COLOR;
+ 
+@@ -1794,22 +1798,22 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra)
+ 	strfcpy(pager_progress_str, (topline == 0) ? "all" : "end", sizeof(pager_progress_str));
+ 
+       /* print out the pager status bar */
+-      move (statusoffset, 0);
++      move (statusoffset, SidebarWidth);
+       SETCOLOR (MT_COLOR_STATUS);
+ 
+       if (IsHeader (extra) || IsMsgAttach (extra))
+       {
+-	size_t l1 = COLS * MB_LEN_MAX;
++	size_t l1 = (COLS-SidebarWidth) * MB_LEN_MAX;
+ 	size_t l2 = sizeof (buffer);
+ 	hfi.hdr = (IsHeader (extra)) ? extra->hdr : extra->bdy->hdr;
+ 	mutt_make_string_info (buffer, l1 < l2 ? l1 : l2, NONULL (PagerFmt), &hfi, M_FORMAT_MAKEPRINT);
+-	mutt_paddstr (COLS, buffer);
++	mutt_paddstr (COLS-SidebarWidth, buffer);
+       }
+       else
+       {
+ 	char bn[STRING];
+ 	snprintf (bn, sizeof (bn), "%s (%s)", banner, pager_progress_str);
+-	mutt_paddstr (COLS, bn);
++	mutt_paddstr (COLS-SidebarWidth, bn);
+       }
+       NORMAL_COLOR;
+       if (option(OPTTSENABLED) && TSSupported)
+@@ -1826,16 +1830,21 @@ mutt_pager (const char *banner, const char *fname, int flags, pager_t *extra)
+       /* redraw the pager_index indicator, because the
+        * flags for this message might have changed. */
+       menu_redraw_current (index);
++      draw_sidebar(MENU_PAGER);
+ 
+       /* print out the index status bar */
+       menu_status_line (buffer, sizeof (buffer), index, NONULL(Status));
+  
+-      move (indexoffset + (option (OPTSTATUSONTOP) ? 0 : (indexlen - 1)), 0);
++      move (indexoffset + (option (OPTSTATUSONTOP) ? 0 : (indexlen - 1)), SidebarWidth);
+       SETCOLOR (MT_COLOR_STATUS);
+-      mutt_paddstr (COLS, buffer);
++      mutt_paddstr (COLS-SidebarWidth, buffer);
+       NORMAL_COLOR;
+     }
+ 
++    /* if we're not using the index, update every time */
++    if ( index == 0 )
++      draw_sidebar(MENU_PAGER);
++
+     redraw = 0;
+ 
+     if (option(OPTBRAILLEFRIENDLY)) {
+@@ -2776,6 +2785,13 @@ search_next:
+ 	mutt_what_key ();
+ 	break;
+ 
++      case OP_SIDEBAR_SCROLL_UP:
++      case OP_SIDEBAR_SCROLL_DOWN:
++      case OP_SIDEBAR_NEXT:
++      case OP_SIDEBAR_PREV:
++	scroll_sidebar(ch, MENU_PAGER);
++ 	break;
++
+       default:
+ 	ch = -1;
+ 	break;
+diff --git a/sidebar.c b/sidebar.c
+new file mode 100644
+index 0000000..6098c2a
+--- /dev/null
++++ b/sidebar.c
+@@ -0,0 +1,333 @@
++/*
++ * Copyright (C) ????-2004 Justin Hibbits <jrh29@po.cwru.edu>
++ * Copyright (C) 2004 Thomer M. Gil <mutt@thomer.com>
++ * 
++ *     This program is free software; you can redistribute it and/or modify
++ *     it under the terms of the GNU General Public License as published by
++ *     the Free Software Foundation; either version 2 of the License, or
++ *     (at your option) any later version.
++ * 
++ *     This program is distributed in the hope that it will be useful,
++ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
++ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ *     GNU General Public License for more details.
++ * 
++ *     You should have received a copy of the GNU General Public License
++ *     along with this program; if not, write to the Free Software
++ *     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
++ */ 
++
++
++#if HAVE_CONFIG_H
++# include "config.h"
++#endif
++
++#include "mutt.h"
++#include "mutt_menu.h"
++#include "mutt_curses.h"
++#include "sidebar.h"
++#include "buffy.h"
++#include <libgen.h>
++#include "keymap.h"
++#include <stdbool.h>
++
++/*BUFFY *CurBuffy = 0;*/
++static BUFFY *TopBuffy = 0;
++static BUFFY *BottomBuffy = 0;
++static int known_lines = 0;
++
++static int quick_log10(int n)
++{
++        char string[32];
++        sprintf(string, "%d", n);
++        return strlen(string);
++}
++
++void calc_boundaries (int menu)
++{
++	BUFFY *tmp = Incoming;
++
++	if ( known_lines != LINES ) {
++		TopBuffy = BottomBuffy = 0;
++		known_lines = LINES;
++	}
++	for ( ; tmp->next != 0; tmp = tmp->next )
++		tmp->next->prev = tmp;
++
++	if ( TopBuffy == 0 && BottomBuffy == 0 )
++		TopBuffy = Incoming;
++	if ( BottomBuffy == 0 ) {
++		int count = LINES - 2 - (menu != MENU_PAGER || option(OPTSTATUSONTOP));
++		BottomBuffy = TopBuffy;
++		while ( --count && BottomBuffy->next )
++			BottomBuffy = BottomBuffy->next;
++	}
++	else if ( TopBuffy == CurBuffy->next ) {
++		int count = LINES - 2 - (menu != MENU_PAGER);
++		BottomBuffy = CurBuffy;
++		tmp = BottomBuffy;
++		while ( --count && tmp->prev)
++			tmp = tmp->prev;
++		TopBuffy = tmp;
++	}
++	else if ( BottomBuffy == CurBuffy->prev ) {
++		int count = LINES - 2 - (menu != MENU_PAGER);
++		TopBuffy = CurBuffy;
++		tmp = TopBuffy;
++		while ( --count && tmp->next )
++			tmp = tmp->next;
++		BottomBuffy = tmp;
++	}
++}
++
++char *make_sidebar_entry(char *box, int size, int new, int flagged)
++{
++	static char *entry = 0;
++	char *c;
++	int i = 0;
++	int delim_len = strlen(SidebarDelim);
++
++	c = realloc(entry, SidebarWidth - delim_len + 2);
++	if ( c ) entry = c;
++	entry[SidebarWidth - delim_len + 1] = 0;
++	for (; i < SidebarWidth - delim_len + 1; entry[i++] = ' ' );
++	i = strlen(box);
++	strncpy( entry, box, i < (SidebarWidth - delim_len + 1) ? i : (SidebarWidth - delim_len + 1) );
++
++        if (size == -1)
++                sprintf(entry + SidebarWidth - delim_len - 3, "?");
++        else if ( new ) {
++          if (flagged > 0) {
++              sprintf(
++		        entry + SidebarWidth - delim_len - 5 - quick_log10(size) - quick_log10(new) - quick_log10(flagged),
++		        "% d(%d)[%d]", size, new, flagged);
++          } else {
++              sprintf(
++                      entry + SidebarWidth - delim_len - 3 - quick_log10(size) - quick_log10(new),
++                      "% d(%d)", size, new);
++          }
++        } else if (flagged > 0) {
++              sprintf( entry + SidebarWidth - delim_len - 3 - quick_log10(size) - quick_log10(flagged), "% d[%d]", size, flagged);
++        } else {
++              sprintf( entry + SidebarWidth - delim_len - 1 - quick_log10(size), "% d", size);
++        }
++	return entry;
++}
++
++void set_curbuffy(char buf[LONG_STRING])
++{
++  BUFFY* tmp = CurBuffy = Incoming;
++
++  if (!Incoming)
++    return;
++
++  while(1) {
++    if(!strcmp(tmp->path, buf)) {
++      CurBuffy = tmp;
++      break;
++    }
++
++    if(tmp->next)
++      tmp = tmp->next;
++    else
++      break;
++  }
++}
++
++int draw_sidebar(int menu) {
++
++	int lines = option(OPTHELP) ? 1 : 0;
++	BUFFY *tmp;
++#ifndef USE_SLANG_CURSES
++        attr_t attrs;
++#endif
++        short delim_len = strlen(SidebarDelim);
++        short color_pair;
++
++        static bool initialized = false;
++        static int prev_show_value;
++        static short saveSidebarWidth;
++
++        /* initialize first time */
++        if(!initialized) {
++                prev_show_value = option(OPTSIDEBAR);
++                saveSidebarWidth = SidebarWidth;
++                if(!option(OPTSIDEBAR)) SidebarWidth = 0;
++                initialized = true;
++        }
++
++        /* save or restore the value SidebarWidth */
++        if(prev_show_value != option(OPTSIDEBAR)) {
++                if(prev_show_value && !option(OPTSIDEBAR)) {
++                        saveSidebarWidth = SidebarWidth;
++                        SidebarWidth = 0;
++                } else if(!prev_show_value && option(OPTSIDEBAR)) {
++                        SidebarWidth = saveSidebarWidth;
++                }
++                prev_show_value = option(OPTSIDEBAR);
++        }
++
++
++//	if ( SidebarWidth == 0 ) return 0;
++       if (SidebarWidth > 0 && option (OPTSIDEBAR)
++           && delim_len >= SidebarWidth) {
++         unset_option (OPTSIDEBAR);
++         /* saveSidebarWidth = SidebarWidth; */
++         if (saveSidebarWidth > delim_len) {
++           SidebarWidth = saveSidebarWidth;
++           mutt_error (_("Value for sidebar_delim is too long. Disabling sidebar."));
++           sleep (2);
++         } else {
++           SidebarWidth = 0;
++           mutt_error (_("Value for sidebar_delim is too long. Disabling sidebar. Please set your sidebar_width to a sane value."));
++           sleep (4); /* the advise to set a sane value should be seen long enough */
++         }
++         saveSidebarWidth = 0;
++         return (0);
++       }
++
++    if ( SidebarWidth == 0 || !option(OPTSIDEBAR)) {
++      if (SidebarWidth > 0) {
++        saveSidebarWidth = SidebarWidth;
++        SidebarWidth = 0;
++      }
++      unset_option(OPTSIDEBAR);
++      return 0;
++    }
++
++        /* get attributes for divider */
++	SETCOLOR(MT_COLOR_STATUS);
++#ifndef USE_SLANG_CURSES
++        attr_get(&attrs, &color_pair, 0);
++#else
++        color_pair = attr_get();
++#endif
++	SETCOLOR(MT_COLOR_NORMAL);
++
++	/* draw the divider */
++
++	for ( ; lines < LINES-1-(menu != MENU_PAGER || option(OPTSTATUSONTOP)); lines++ ) {
++		move(lines, SidebarWidth - delim_len);
++		addstr(NONULL(SidebarDelim));
++#ifndef USE_SLANG_CURSES
++                mvchgat(lines, SidebarWidth - delim_len, delim_len, 0, color_pair, NULL);
++#endif
++	}
++
++	if ( Incoming == 0 ) return 0;
++	lines = option(OPTHELP) ? 1 : 0; /* go back to the top */
++
++	if ( known_lines != LINES || TopBuffy == 0 || BottomBuffy == 0 ) 
++		calc_boundaries(menu);
++	if ( CurBuffy == 0 ) CurBuffy = Incoming;
++
++	tmp = TopBuffy;
++
++	SETCOLOR(MT_COLOR_NORMAL);
++
++	for ( ; tmp && lines < LINES-1 - (menu != MENU_PAGER || option(OPTSTATUSONTOP)); tmp = tmp->next ) {
++		if ( tmp == CurBuffy )
++			SETCOLOR(MT_COLOR_INDICATOR);
++		else if ( tmp->msg_unread > 0 )
++			SETCOLOR(MT_COLOR_NEW);
++		else if ( tmp->msg_flagged > 0 )
++		        SETCOLOR(MT_COLOR_FLAGGED);
++		else
++			SETCOLOR(MT_COLOR_NORMAL);
++
++		move( lines, 0 );
++		if ( Context && !strcmp( tmp->path, Context->path ) ) {
++			tmp->msg_unread = Context->unread;
++			tmp->msgcount = Context->msgcount;
++			tmp->msg_flagged = Context->flagged;
++		}
++		// check whether Maildir is a prefix of the current folder's path
++		short maildir_is_prefix = 0;
++		if ( (strlen(tmp->path) > strlen(Maildir)) &&
++			(strncmp(Maildir, tmp->path, strlen(Maildir)) == 0) )
++        		maildir_is_prefix = 1;
++		// calculate depth of current folder and generate its display name with indented spaces
++		int sidebar_folder_depth = 0;
++		char *sidebar_folder_name;
++		sidebar_folder_name = basename(tmp->path);
++		if ( maildir_is_prefix ) {
++			char *tmp_folder_name;
++			int i;
++			tmp_folder_name = tmp->path + strlen(Maildir);
++			for (i = 0; i < strlen(tmp->path) - strlen(Maildir); i++) {
++				if (tmp_folder_name[i] == '/') sidebar_folder_depth++;
++			}   
++			if (sidebar_folder_depth > 0) {
++				sidebar_folder_name = malloc(strlen(basename(tmp->path)) + sidebar_folder_depth + 1);
++				for (i=0; i < sidebar_folder_depth; i++)
++					sidebar_folder_name[i]=' ';
++				sidebar_folder_name[i]=0;
++				strncat(sidebar_folder_name, basename(tmp->path), strlen(basename(tmp->path)) + sidebar_folder_depth);
++			}
++		}
++		printw( "%.*s", SidebarWidth - delim_len + 1,
++			make_sidebar_entry(sidebar_folder_name, tmp->msgcount,
++			tmp->msg_unread, tmp->msg_flagged));
++		if (sidebar_folder_depth > 0)
++		        free(sidebar_folder_name);
++		lines++;
++	}
++	SETCOLOR(MT_COLOR_NORMAL);
++	for ( ; lines < LINES-1 - (menu != MENU_PAGER || option(OPTSTATUSONTOP)); lines++ ) {
++		int i = 0;
++		move( lines, 0 );
++		for ( ; i < SidebarWidth - delim_len; i++ )
++			addch(' ');
++	}
++	return 0;
++}
++
++
++void set_buffystats(CONTEXT* Context)
++{
++        BUFFY *tmp = Incoming;
++        while(tmp) {
++                if(Context && !strcmp(tmp->path, Context->path)) {
++			tmp->msg_unread = Context->unread;
++			tmp->msgcount = Context->msgcount;
++                        break;
++                }
++                tmp = tmp->next;
++        }
++}
++
++void scroll_sidebar(int op, int menu)
++{
++        if(!SidebarWidth) return;
++        if(!CurBuffy) return;
++
++	switch (op) {
++		case OP_SIDEBAR_NEXT:
++			if ( CurBuffy->next == NULL ) return;
++			CurBuffy = CurBuffy->next;
++			break;
++		case OP_SIDEBAR_PREV:
++			if ( CurBuffy->prev == NULL ) return;
++			CurBuffy = CurBuffy->prev;
++			break;
++		case OP_SIDEBAR_SCROLL_UP:
++			CurBuffy = TopBuffy;
++			if ( CurBuffy != Incoming ) {
++				calc_boundaries(menu);
++				CurBuffy = CurBuffy->prev;
++			}
++			break;
++		case OP_SIDEBAR_SCROLL_DOWN:
++			CurBuffy = BottomBuffy;
++			if ( CurBuffy->next ) {
++				calc_boundaries(menu);
++				CurBuffy = CurBuffy->next;
++			}
++			break;
++		default:
++			return;
++	}
++	calc_boundaries(menu);
++	draw_sidebar(menu);
++}
++
+diff --git a/sidebar.h b/sidebar.h
+new file mode 100644
+index 0000000..d195f11
+--- /dev/null
++++ b/sidebar.h
+@@ -0,0 +1,36 @@
++/*
++ * Copyright (C) ????-2004 Justin Hibbits <jrh29@po.cwru.edu>
++ * Copyright (C) 2004 Thomer M. Gil <mutt@thomer.com>
++ * 
++ *     This program is free software; you can redistribute it and/or modify
++ *     it under the terms of the GNU General Public License as published by
++ *     the Free Software Foundation; either version 2 of the License, or
++ *     (at your option) any later version.
++ * 
++ *     This program is distributed in the hope that it will be useful,
++ *     but WITHOUT ANY WARRANTY; without even the implied warranty of
++ *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ *     GNU General Public License for more details.
++ * 
++ *     You should have received a copy of the GNU General Public License
++ *     along with this program; if not, write to the Free Software
++ *     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
++ */ 
++
++#ifndef SIDEBAR_H
++#define SIDEBAR_H
++
++struct MBOX_LIST {
++	char *path;
++	int msgcount;
++	int new;
++} MBLIST;
++
++/* parameter is whether or not to go to the status line */
++/* used for omitting the last | that covers up the status bar in the index */
++int draw_sidebar(int);
++void scroll_sidebar(int, int);
++void set_curbuffy(char*);
++void set_buffystats(CONTEXT*);
++
++#endif /* SIDEBAR_H */
diff --git a/pkgs/applications/networking/mailreaders/mutt/trash-folder.patch b/pkgs/applications/networking/mailreaders/mutt/trash-folder.patch
new file mode 100644
index 000000000000..ce47b0c30e5d
--- /dev/null
+++ b/pkgs/applications/networking/mailreaders/mutt/trash-folder.patch
@@ -0,0 +1,316 @@
+From: Cedric Duval <cedricduval@free.fr>
+Date: Thu, 27 Feb 2014 12:27:41 +0100
+Subject: trash-folder
+
+With this patch, if the trash variable is set to a path (unset by default), the
+deleted mails will be moved to a trash folder instead of being irremediably
+purged when syncing the mailbox.
+
+For instance, set trash="~/Mail/trash" will cause every deleted mail to go to
+this folder.
+
+Note that the append to the trash folder doesn't occur until the resync is
+done. This allows you to change your mind and undo deletes, and thus the moves
+to the trash folder are unnecessary.
+
+Notes
+
+    * You might also want to have a look at the purge message feature below
+      which is related to this patch.
+    * IMAP is now supported. To retain the previous behavior, add this to your
+      muttrc:
+      folder-hook ^imap:// 'unset trash'
+
+FAQ
+
+Every once in a while, someone asks what are the advantages of this patch over
+a macro based solution. Here's an attempt to answer this question:
+
+    * The folder history doesn't clutter up with unwanted trash entries.
+    * Delayed move to the trash allows to change one's mind.
+    * No need to treat the case of "normal folders" and trash folders
+      separately with folder-hooks, and to create two sets of macros (one for
+      the index, one for the pager).
+    * Works not only with delete-message, but also with every deletion
+      functions like delete-pattern, delete-thread or delete-subthread.
+
+To sum up, it's more integrated and transparent to the user.
+
+* Patch last synced with upstream:
+  - Date: 2007-02-15
+  - File: http://cedricduval.free.fr/mutt/patches/download/patch-1.5.5.1.cd.trash_folder.3.4
+
+* Changes made:
+  - Updated to 1.5.13:
+    - structure of _mutt_save_message changed (commands.c)
+    - context of option (OPTCONFIRMAPPEND) changed (muttlib.c)
+  - Fixed indentation of "appended" in mutt.h.
+
+Signed-off-by: Matteo F. Vescovi <mfvescovi@gmail.com>
+
+Gbp-Pq: Topic features
+---
+ commands.c     |  1 +
+ flags.c        | 19 +++++++++++++++++-
+ globals.h      |  1 +
+ imap/message.c |  2 ++
+ init.h         | 10 ++++++++++
+ mutt.h         |  3 +++
+ muttlib.c      |  4 +++-
+ mx.c           | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+ postpone.c     |  3 +++
+ 9 files changed, 103 insertions(+), 2 deletions(-)
+
+diff --git a/commands.c b/commands.c
+index 5dbd100..7fd014b 100644
+--- a/commands.c
++++ b/commands.c
+@@ -720,6 +720,7 @@ int _mutt_save_message (HEADER *h, CONTEXT *ctx, int delete, int decode, int dec
+     if (option (OPTDELETEUNTAG))
+       mutt_set_flag (Context, h, M_TAG, 0);
+   }
++  mutt_set_flag (Context, h, M_APPENDED, 1);
+   
+   return 0;
+ }
+diff --git a/flags.c b/flags.c
+index f0f3d81..dfa6a50 100644
+--- a/flags.c
++++ b/flags.c
+@@ -65,7 +65,13 @@ void _mutt_set_flag (CONTEXT *ctx, HEADER *h, int flag, int bf, int upd_ctx)
+       {
+ 	h->deleted = 0;
+         update = 1;
+-	if (upd_ctx) ctx->deleted--;
++	if (upd_ctx)
++	{
++	  ctx->deleted--;
++	  if (h->appended)
++	    ctx->appended--;
++	}
++	h->appended = 0; /* when undeleting, also reset the appended flag */
+ #ifdef USE_IMAP
+         /* see my comment above */
+ 	if (ctx->magic == M_IMAP) 
+@@ -87,6 +93,17 @@ void _mutt_set_flag (CONTEXT *ctx, HEADER *h, int flag, int bf, int upd_ctx)
+       }
+       break;
+ 
++    case M_APPENDED:
++      if (bf)
++      {
++	if (!h->appended)
++	{
++	  h->appended = 1;
++	  if (upd_ctx) ctx->appended++;
++	}
++      }
++      break;
++
+     case M_NEW:
+ 
+       if (!mutt_bit_isset(ctx->rights,M_ACL_SEEN))
+diff --git a/globals.h b/globals.h
+index e77030c..6a1b8da 100644
+--- a/globals.h
++++ b/globals.h
+@@ -144,6 +144,7 @@ WHERE char *Tochars;
+ WHERE char *TSStatusFormat;
+ WHERE char *TSIconFormat;
+ WHERE short TSSupported;
++WHERE char *TrashPath;
+ WHERE char *Username;
+ WHERE char *Visual;
+ 
+diff --git a/imap/message.c b/imap/message.c
+index 3877381..039fda6 100644
+--- a/imap/message.c
++++ b/imap/message.c
+@@ -884,6 +884,7 @@ int imap_copy_messages (CONTEXT* ctx, HEADER* h, char* dest, int delete)
+         if (ctx->hdrs[n]->tagged)
+         {
+           mutt_set_flag (ctx, ctx->hdrs[n], M_DELETE, 1);
++	  mutt_set_flag (ctx, ctx->hdrs[n], M_APPENDED, 1);
+           if (option (OPTDELETEUNTAG))
+             mutt_set_flag (ctx, ctx->hdrs[n], M_TAG, 0);
+         }
+@@ -891,6 +892,7 @@ int imap_copy_messages (CONTEXT* ctx, HEADER* h, char* dest, int delete)
+     else
+     {
+       mutt_set_flag (ctx, h, M_DELETE, 1);
++      mutt_set_flag (ctx, h, M_APPENDED, 1);
+       if (option (OPTDELETEUNTAG))
+         mutt_set_flag (ctx, h, M_TAG, 0);
+     }
+diff --git a/init.h b/init.h
+index 6b49341..d3206f9 100644
+--- a/init.h
++++ b/init.h
+@@ -3341,6 +3341,16 @@ struct option_t MuttVars[] = {
+   ** provided that ``$$ts_enabled'' has been set. This string is identical in
+   ** formatting to the one used by ``$$status_format''.
+   */
++  { "trash",		DT_PATH, R_NONE, UL &TrashPath, 0 },
++  /*
++  ** .pp
++  ** If set, this variable specifies the path of the trash folder where the
++  ** mails marked for deletion will be moved, instead of being irremediably
++  ** purged.
++  ** .pp
++  ** NOTE: When you delete a message in the trash folder, it is really
++  ** deleted, so that you have a way to clean the trash.
++  */
+ #ifdef USE_SOCKET
+   { "tunnel",            DT_STR, R_NONE, UL &Tunnel, UL 0 },
+   /*
+diff --git a/mutt.h b/mutt.h
+index f8565fa..29bb6c2 100644
+--- a/mutt.h
++++ b/mutt.h
+@@ -185,6 +185,7 @@ enum
+   M_DELETE,
+   M_UNDELETE,
+   M_DELETED,
++  M_APPENDED,
+   M_FLAG,
+   M_TAG,
+   M_UNTAG,
+@@ -713,6 +714,7 @@ typedef struct header
+   unsigned int mime : 1;    		/* has a MIME-Version header? */
+   unsigned int flagged : 1; 		/* marked important? */
+   unsigned int tagged : 1;
++  unsigned int appended : 1;		/* has been saved */
+   unsigned int deleted : 1;
+   unsigned int changed : 1;
+   unsigned int attach_del : 1; 		/* has an attachment marked for deletion */
+@@ -885,6 +887,7 @@ typedef struct _context
+   int new;			/* how many new messages? */
+   int unread;			/* how many unread messages? */
+   int deleted;			/* how many deleted messages */
++  int appended;                 /* how many saved messages? */
+   int flagged;			/* how many flagged messages */
+   int msgnotreadyet;		/* which msg "new" in pager, -1 if none */
+ 
+diff --git a/muttlib.c b/muttlib.c
+index 02067cc..0fd9766 100644
+--- a/muttlib.c
++++ b/muttlib.c
+@@ -1505,7 +1505,9 @@ int mutt_save_confirm (const char *s, struct stat *st)
+ 
+   if (magic > 0 && !mx_access (s, W_OK))
+   {
+-    if (option (OPTCONFIRMAPPEND))
++    if (option (OPTCONFIRMAPPEND) &&
++	(!TrashPath || (mutt_strcmp (s, TrashPath) != 0)))
++      /* if we're appending to the trash, there's no point in asking */
+     {
+       snprintf (tmp, sizeof (tmp), _("Append messages to %s?"), s);
+       if ((rc = mutt_yesorno (tmp, M_YES)) == M_NO)
+diff --git a/mx.c b/mx.c
+index 4c5cb07..c0a6d30 100644
+--- a/mx.c
++++ b/mx.c
+@@ -776,6 +776,53 @@ static int sync_mailbox (CONTEXT *ctx, int *index_hint)
+   return rc;
+ }
+ 
++/* move deleted mails to the trash folder */
++static int trash_append (CONTEXT *ctx)
++{
++    CONTEXT *ctx_trash;
++    int i = 0;
++    struct stat st, stc;
++
++    if (!TrashPath || !ctx->deleted ||
++	(ctx->magic == M_MAILDIR && option (OPTMAILDIRTRASH)))
++      return 0;
++
++    for (;i < ctx->msgcount && (!ctx->hdrs[i]->deleted ||
++				ctx->hdrs[i]->appended); i++);
++    if (i == ctx->msgcount)
++      return 0; /* nothing to be done */
++
++    if (mutt_save_confirm (TrashPath, &st) != 0)
++    {
++      mutt_error _("message(s) not deleted");
++      return -1;
++    }
++
++    if (lstat (ctx->path, &stc) == 0 && stc.st_ino == st.st_ino
++	&& stc.st_dev == st.st_dev && stc.st_rdev == st.st_rdev)
++      return 0;  /* we are in the trash folder: simple sync */
++
++    if ((ctx_trash = mx_open_mailbox (TrashPath, M_APPEND, NULL)) != NULL)
++    {
++      for (i = 0 ; i < ctx->msgcount ; i++)
++	if (ctx->hdrs[i]->deleted && !ctx->hdrs[i]->appended
++	    && mutt_append_message (ctx_trash, ctx, ctx->hdrs[i], 0, 0) == -1)
++	  {
++	    mx_close_mailbox (ctx_trash, NULL);
++	    return -1;
++	  }
++
++      mx_close_mailbox (ctx_trash, NULL);
++    }
++    else
++    {
++      mutt_error _("Can't open trash folder");
++      return -1;
++    }
++
++    return 0;
++}
++
+ /* save changes and close mailbox */
+ int mx_close_mailbox (CONTEXT *ctx, int *index_hint)
+ {
+@@ -912,6 +959,7 @@ int mx_close_mailbox (CONTEXT *ctx, int *index_hint)
+ 	  if (mutt_append_message (&f, ctx, ctx->hdrs[i], 0, CH_UPDATE_LEN) == 0)
+ 	  {
+ 	    mutt_set_flag (ctx, ctx->hdrs[i], M_DELETE, 1);
++	    mutt_set_flag (ctx, ctx->hdrs[i], M_APPENDED, 1);
+ 	  }
+ 	  else
+ 	  {
+@@ -936,6 +984,14 @@ int mx_close_mailbox (CONTEXT *ctx, int *index_hint)
+     return 0;
+   }
+   
++  /* copy mails to the trash before expunging */
++  if (purge && ctx->deleted && mutt_strcmp(ctx->path, TrashPath))
++    if (trash_append (ctx) != 0)
++    {
++      ctx->closing = 0;
++      return -1;
++    }
++
+ #ifdef USE_IMAP
+   /* allow IMAP to preserve the deleted flag across sessions */
+   if (ctx->magic == M_IMAP)
+@@ -1133,6 +1189,12 @@ int mx_sync_mailbox (CONTEXT *ctx, int *index_hint)
+   msgcount = ctx->msgcount;
+   deleted = ctx->deleted;
+ 
++  if (purge && ctx->deleted && mutt_strcmp(ctx->path, TrashPath))
++  {
++    if (trash_append (ctx) == -1)
++      return -1;
++  }
++
+ #ifdef USE_IMAP
+   if (ctx->magic == M_IMAP)
+     rc = imap_sync_mailbox (ctx, purge, index_hint);
+diff --git a/postpone.c b/postpone.c
+index a703161..7a4cbb1 100644
+--- a/postpone.c
++++ b/postpone.c
+@@ -277,6 +277,9 @@ int mutt_get_postponed (CONTEXT *ctx, HEADER *hdr, HEADER **cur, char *fcc, size
+   /* finished with this message, so delete it. */
+   mutt_set_flag (PostContext, h, M_DELETE, 1);
+ 
++  /* and consider it saved, so that it won't be moved to the trash folder */
++  mutt_set_flag (PostContext, h, M_APPENDED, 1);
++
+   /* update the count for the status display */
+   PostCount = PostContext->msgcount - PostContext->deleted;
+ 
diff --git a/pkgs/applications/networking/mailreaders/thunderbird/default.nix b/pkgs/applications/networking/mailreaders/thunderbird/default.nix
index 5d6e0faad4a8..ad43cd0116f0 100644
--- a/pkgs/applications/networking/mailreaders/thunderbird/default.nix
+++ b/pkgs/applications/networking/mailreaders/thunderbird/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, pkgconfig, which, m4, gtk, pango, perl, python, zip, libIDL
-, libjpeg, libpng, zlib, dbus, dbus_glib, bzip2, xlibs
+, libjpeg, libpng, zlib, dbus, dbus_glib, bzip2, xorg
 , freetype, fontconfig, file, alsaLib, nspr, nss, libnotify
 , yasm, mesa, sqlite, unzip, makeWrapper, pysqlite
 , hunspell, libevent, libstartup_notification, libvpx
@@ -13,7 +13,7 @@
   enableOfficialBranding ? false
 }:
 
-let version = "38.1.0"; in
+let version = "38.2.0"; in
 let verName = "${version}"; in
 
 stdenv.mkDerivation rec {
@@ -23,16 +23,16 @@ stdenv.mkDerivation rec {
     url = "http://archive.mozilla.org/pub/thunderbird/releases/${verName}/source/thunderbird-${verName}.source.tar.bz2";
 
     # https://archive.mozilla.org/pub/thunderbird/releases/${verName}/SHA1SUMS
-    sha1 = "7bb0c85e889e397e53dcbcbd36957dbd7c8c10bd";
+    sha1 = "0e27c54ee63b71cd7e8ff4fd87bbe66e0a16ffc1";
   };
 
   buildInputs = # from firefox30Pkgs.xulrunner, but without gstreamer and libvpx
     [ pkgconfig which libpng gtk perl zip libIDL libjpeg zlib bzip2
-      python dbus dbus_glib pango freetype fontconfig xlibs.libXi
-      xlibs.libX11 xlibs.libXrender xlibs.libXft xlibs.libXt file
-      alsaLib nspr nss libnotify xlibs.pixman yasm mesa
-      xlibs.libXScrnSaver xlibs.scrnsaverproto pysqlite
-      xlibs.libXext xlibs.xextproto sqlite unzip makeWrapper
+      python 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 pysqlite
+      xorg.libXext xorg.xextproto sqlite unzip makeWrapper
       hunspell libevent libstartup_notification cairo icu
     ] ++ [ m4 ];
 
diff --git a/pkgs/applications/networking/newsreaders/kwooty/0001-search-paths.patch b/pkgs/applications/networking/newsreaders/kwooty/0001-search-paths.patch
new file mode 100644
index 000000000000..6d1d2bac409b
--- /dev/null
+++ b/pkgs/applications/networking/newsreaders/kwooty/0001-search-paths.patch
@@ -0,0 +1,33 @@
+From 6b5730e729d72c8d9242163e7061b956abee61f5 Mon Sep 17 00:00:00 2001
+From: Thomas Tuegel <ttuegel@gmail.com>
+Date: Sat, 12 Sep 2015 16:14:10 -0500
+Subject: [PATCH] search paths
+
+---
+ src/utilities/utility.cpp | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/src/utilities/utility.cpp b/src/utilities/utility.cpp
+index 2e322aa..2e9e4d2 100644
+--- a/src/utilities/utility.cpp
++++ b/src/utilities/utility.cpp
+@@ -299,6 +299,7 @@ QString Utility::searchExternalPrograms(const QString& programToSearch, bool& pr
+ 
+     QString programPathName;
+     QStringList searchPathList = Settings::searchPathList();
++    searchPathList << "/usr/bin/unpar" << "/usr/bin/unrar" << "/usr/bin/7z";
+ 
+     QStringList programsWithDifferentNames = programToSearch.split(";");
+ 
+@@ -368,7 +369,7 @@ QStringList Utility::buildPriorityArgument(const int& processPriority, const int
+     QStringList niceProcessArgs;
+ 
+     // look for 'nice' location :
+-    QString nicePath = KStandardDirs::findExe("nice");
++    QString nicePath = QString("/usr/bin/nice");
+     niceProcessArgs.append(nicePath);
+     niceProcessArgs.append("-n");
+ 
+-- 
+2.5.0
+
diff --git a/pkgs/applications/networking/newsreaders/kwooty/default.nix b/pkgs/applications/networking/newsreaders/kwooty/default.nix
index e49e2c6fe261..d8e417cdd3a8 100644
--- a/pkgs/applications/networking/newsreaders/kwooty/default.nix
+++ b/pkgs/applications/networking/newsreaders/kwooty/default.nix
@@ -5,17 +5,17 @@
 , unrar, p7zip, par2cmdline, coreutils
 }:
 
-let version = "0.8.4";
+let version = "1.1.0";
     name = "kwooty-${version}";
 in stdenv.mkDerivation {
   inherit name;
-  
+
   src = fetchurl {
-    url = "mirror://sourceforge/kwooty/${name}.tar.gz";
-    sha256 = "0i3zmh7y52n5k0yn3xc6zjpjz75f48nly40n394i6sxy89psgfc2";
+    url = "http://kde-apps.org/CONTENT/content-files/114385-${name}.tar.gz";
+    sha256 = "10a9asjv6ja1xdjli2399dyka2rbia3qdm5bdpmcng6xdsbhx3ap";
   };
 
-  patches = [ ./searchPath.patch ];
+  patches = [ ./0001-search-paths.patch ];
 
   postPatch = ''
     echo "Changing paths to archive utilities to the nix store";
@@ -31,7 +31,7 @@ in stdenv.mkDerivation {
       kdelibs kdebase_workspace phonon
       libX11 libXext libXft
     ];
-                  
+
   meta = {
     description = "Binary news reader of KDE";
   };
diff --git a/pkgs/applications/networking/newsreaders/kwooty/searchPath.patch b/pkgs/applications/networking/newsreaders/kwooty/searchPath.patch
deleted file mode 100644
index 602002d0173f..000000000000
--- a/pkgs/applications/networking/newsreaders/kwooty/searchPath.patch
+++ /dev/null
@@ -1,19 +0,0 @@
---- kwooty-kwooty/src/utility.cpp	2012-01-24 22:22:45.091383072 +0100
-+++ kwooty-kwooty/src/utility.cpp	2012-01-24 22:29:08.526208140 +0100
-@@ -299,6 +299,7 @@
- 
-     QString programPathName;
-     QStringList searchPathList = Settings::searchPathList();
-+    searchPathList << "/usr/bin/unpar" << "/usr/bin/unrar" << "/usr/bin/7z";
- 
-     QStringList programsWithDifferentNames = programToSearch.split(";");
- 
-@@ -363,7 +364,7 @@
-     QStringList niceProcessArgs;
- 
-     // look for 'nice' location :
--    QString nicePath = KStandardDirs::findExe("nice");
-+    QString nicePath = QString("/usr/bin/nice");
-     niceProcessArgs.append(nicePath);
-     niceProcessArgs.append("-n");
- 
diff --git a/pkgs/applications/office/basket/default.nix b/pkgs/applications/office/basket/default.nix
index 023d133b4dd7..2417e263d442 100644
--- a/pkgs/applications/office/basket/default.nix
+++ b/pkgs/applications/office/basket/default.nix
@@ -1,4 +1,6 @@
-{ stdenv, fetchurl, cmake, gettext, kdelibs, qimageblitz, kdepimlibs, gpgme }:
+{ stdenv, fetchurl, automoc4, cmake, gettext, perl, pkgconfig
+, kdelibs, qimageblitz, kdepimlibs, gpgme
+}:
 
 stdenv.mkDerivation rec {
   name = "basket-1.81";
@@ -12,8 +14,8 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ kdelibs qimageblitz kdepimlibs gpgme ];
 
-  nativeBuildInputs = [ cmake gettext ];
-  
+  nativeBuildInputs = [ automoc4 cmake gettext perl pkgconfig ];
+
   meta = {
     description = "A multi-purpose note-taking application";
     homepage = http://basket.kde.org/;
diff --git a/pkgs/applications/office/calligra/default.nix b/pkgs/applications/office/calligra/default.nix
index 0b28d13e4e55..3d1eada1db61 100644
--- a/pkgs/applications/office/calligra/default.nix
+++ b/pkgs/applications/office/calligra/default.nix
@@ -1,10 +1,10 @@
-{ stdenv, fetchurl, cmake, kdelibs, attica, perl, zlib, libpng, boost, mesa
+{ stdenv, fetchurl, automoc4, cmake, kdelibs, attica, perl, zlib, libpng, boost, mesa
 , kdepimlibs, createresources ? null, eigen, qca2, exiv2, soprano, marble, lcms2
 , fontconfig, freetype, sqlite, icu, libwpd, libwpg, pkgconfig, poppler_qt4
 , libkdcraw, libxslt, fftw, glew, gsl, shared_desktop_ontologies, okular
 , libvisio, kactivities, mysql, postgresql, freetds, xbase, openexr, ilmbase
 , libodfgen, opencolorio, openjpeg, pstoedit, librevenge
- }:
+}:
 
 stdenv.mkDerivation rec {
   name = "calligra-2.8.7";
@@ -14,12 +14,13 @@ stdenv.mkDerivation rec {
     sha256 = "1d8fx0xn8n8y6jglw8hhpk7kr6kbhsbaxqwqlfzmnzh7x9s8nsxg";
   };
 
-  nativeBuildInputs = [ cmake perl pkgconfig ];
+  nativeBuildInputs = [ automoc4 cmake perl pkgconfig ];
 
 # TODO: package Vc, libWPS, Spnav, m2mml, LibEtonyek, poppler-qt4-xpdf-headers
 # not found: xbase, openjpeg(too new)
 
-  buildInputs = [ kdelibs attica zlib libpng boost mesa kdepimlibs
+  buildInputs = [
+    kdelibs attica zlib libpng boost mesa kdepimlibs
     createresources eigen qca2 exiv2 soprano marble lcms2 fontconfig freetype
     sqlite icu libwpd libwpg poppler_qt4 libkdcraw libxslt fftw glew gsl
     shared_desktop_ontologies okular libodfgen opencolorio openjpeg
diff --git a/pkgs/applications/office/eventlist/default.nix b/pkgs/applications/office/eventlist/default.nix
index c260220aad4d..395cb3d0a914 100644
--- a/pkgs/applications/office/eventlist/default.nix
+++ b/pkgs/applications/office/eventlist/default.nix
@@ -1,4 +1,5 @@
-{ stdenv, fetchurl, kdelibs, kdepimlibs, akonadi, gettext, boost }:
+{ stdenv, fetchurl, automoc4, cmake, gettext, perl, pkgconfig
+, kdelibs, kdepimlibs, akonadi, boost }:
 
 stdenv.mkDerivation rec {
   name = "plasmoid-eventlist-0.6.96";
@@ -8,7 +9,8 @@ stdenv.mkDerivation rec {
     sha256 = "26cc7bd1c465bf1379fd0ba1fa8592eaa62f2553734d1b283e17359103908eea";
   };
 
-  buildInputs = [ kdelibs kdepimlibs akonadi gettext boost ];
+  nativeBuildInputs = [ automoc4 cmake gettext perl pkgconfig ];
+  buildInputs = [ kdelibs kdepimlibs akonadi boost ];
 
   meta = {
     inherit (kdelibs.meta) platforms;
diff --git a/pkgs/applications/office/kbibtex/default.nix b/pkgs/applications/office/kbibtex/default.nix
index b3e62b8e0511..a18ba50cabe2 100644
--- a/pkgs/applications/office/kbibtex/default.nix
+++ b/pkgs/applications/office/kbibtex/default.nix
@@ -1,4 +1,6 @@
-{ stdenv, fetchurl, kdelibs, libxslt, poppler_qt4 }:
+{ stdenv, fetchurl, automoc4, cmake, perl, pkgconfig
+, kdelibs, libxslt, poppler_qt4
+}:
 
 stdenv.mkDerivation rec {
   pname = "kbibtex";
@@ -15,4 +17,5 @@ stdenv.mkDerivation rec {
     '';
 
   buildInputs = [ kdelibs libxslt poppler_qt4 ];
+  nativeBuildInputs = [ automoc4 cmake perl pkgconfig ];
 }
diff --git a/pkgs/applications/office/mendeley/default.nix b/pkgs/applications/office/mendeley/default.nix
index b0c3e58cfbb6..ea6d565a10ba 100644
--- a/pkgs/applications/office/mendeley/default.nix
+++ b/pkgs/applications/office/mendeley/default.nix
@@ -1,5 +1,5 @@
 { fetchurl, stdenv, dpkg, makeWrapper, which
-,gcc, xlibs, qt4, zlib
+,gcc, xorg, qt4, zlib
 , ...}:
 
 assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
@@ -24,7 +24,7 @@ let
   deps = [
     gcc.cc
     qt4
-    xlibs.libX11
+    xorg.libX11
     zlib
   ];
 
diff --git a/pkgs/applications/office/skrooge/default.nix b/pkgs/applications/office/skrooge/default.nix
index 52dd08e1e0d8..712725f52753 100644
--- a/pkgs/applications/office/skrooge/default.nix
+++ b/pkgs/applications/office/skrooge/default.nix
@@ -1,4 +1,5 @@
-{ stdenv, fetchurl, libxslt, kdelibs, kdepimlibs, grantlee, qjson, qca2, libofx, sqlite, gettext, boost }:
+{ stdenv, fetchurl, automoc4, cmake, gettext, perl, pkgconfig, shared_mime_info
+, libxslt, kdelibs, kdepimlibs, grantlee, qjson, qca2, libofx, sqlite, boost }:
 
 stdenv.mkDerivation rec {
   name = "skrooge-1.10.0";
@@ -10,7 +11,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ libxslt kdelibs kdepimlibs grantlee qjson qca2 libofx sqlite boost ];
 
-  nativeBuildInputs = [ gettext ];
+  nativeBuildInputs = [ automoc4 cmake gettext perl pkgconfig shared_mime_info ];
 
   meta = {
     inherit (kdelibs.meta) platforms;
diff --git a/pkgs/applications/office/zanshin/default.nix b/pkgs/applications/office/zanshin/default.nix
index 123342882542..7ae758d7e4f7 100644
--- a/pkgs/applications/office/zanshin/default.nix
+++ b/pkgs/applications/office/zanshin/default.nix
@@ -1,4 +1,5 @@
-{ stdenv, fetchurl, kdelibs, kdepimlibs, boost }:
+{ stdenv, fetchurl, automoc4, cmake, perl, pkgconfig
+, kdelibs, kdepimlibs, boost }:
 
 stdenv.mkDerivation rec {
   name = "zanshin-0.2.1";
@@ -8,6 +9,8 @@ stdenv.mkDerivation rec {
     sha256 = "155k72vk7kw0p0x9dhlky6q017kanzcbwvp4dpf1hcbr1dsr55fx";
   };
 
+  nativeBuildInputs = [ automoc4 cmake perl pkgconfig ];
+
   buildInputs = [ kdelibs kdepimlibs boost ];
 
   meta = {
diff --git a/pkgs/applications/office/zotero/default.nix b/pkgs/applications/office/zotero/default.nix
index 9283072c0c1b..be1729b57c91 100644
--- a/pkgs/applications/office/zotero/default.nix
+++ b/pkgs/applications/office/zotero/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, bash, firefox, perl, unzipNLS, xlibs }:
+{ stdenv, fetchurl, bash, firefox, perl, unzipNLS, xorg }:
 
 let
 
diff --git a/pkgs/applications/science/logic/hol_light/Makefile.patch b/pkgs/applications/science/logic/hol_light/Makefile.patch
new file mode 100644
index 000000000000..2cb05f27a4f6
--- /dev/null
+++ b/pkgs/applications/science/logic/hol_light/Makefile.patch
@@ -0,0 +1,13 @@
+Index: Makefile
+===================================================================
+--- a/Makefile	(révision 199)
++++ b/Makefile	(copie de travail)
+@@ -59,7 +59,7 @@
+              then cp pa_j_3.1x_6.02.1.ml pa_j.ml; \
+              else if test ${CAMLP5_VERSION} = "6.02.2" -o ${CAMLP5_VERSION} = "6.02.3" -o ${CAMLP5_VERSION} = "6.03" -o ${CAMLP5_VERSION} = "6.04" -o ${CAMLP5_VERSION} = "6.05" -o ${CAMLP5_VERSION} = "6.06" ; \
+                   then cp pa_j_3.1x_6.02.2.ml pa_j.ml; \
+-                  else if test ${CAMLP5_VERSION} = "6.06" -o ${CAMLP5_VERSION} = "6.07" -o ${CAMLP5_VERSION} = "6.08" -o ${CAMLP5_VERSION} = "6.09" -o ${CAMLP5_VERSION} = "6.10" -o ${CAMLP5_VERSION} = "6.11" -o ${CAMLP5_VERSION} = "6.12" ; \
++                  else if test ${CAMLP5_VERSION} = "6.06" -o ${CAMLP5_VERSION} = "6.07" -o ${CAMLP5_VERSION} = "6.08" -o ${CAMLP5_VERSION} = "6.09" -o ${CAMLP5_VERSION} = "6.10" -o ${CAMLP5_VERSION} = "6.11" -o ${CAMLP5_VERSION} = "6.12" -o ${CAMLP5_VERSION} = "6.13" -o ${CAMLP5_VERSION} = "6.14" ; \
+                        then cp pa_j_3.1x_6.11.ml pa_j.ml; \
+                        else cp pa_j_3.1x_${CAMLP5_BINARY_VERSION}.xx.ml pa_j.ml; \
+                        fi \
diff --git a/pkgs/applications/science/logic/hol_light/default.nix b/pkgs/applications/science/logic/hol_light/default.nix
index 7653e137e260..8311ac466543 100644
--- a/pkgs/applications/science/logic/hol_light/default.nix
+++ b/pkgs/applications/science/logic/hol_light/default.nix
@@ -20,6 +20,8 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ ocaml camlp5 ];
 
+  patches = [ ./Makefile.patch ];
+
   installPhase = ''
     mkdir -p "$out/lib/hol_light" "$out/bin"
     cp -a  . $out/lib/hol_light
diff --git a/pkgs/applications/science/math/mathematica/9.nix b/pkgs/applications/science/math/mathematica/9.nix
index 3c7f758d91bc..7573b8955b19 100644
--- a/pkgs/applications/science/math/mathematica/9.nix
+++ b/pkgs/applications/science/math/mathematica/9.nix
@@ -12,7 +12,7 @@
 , opencv
 , openssl
 , unixODBC
-, xlibs
+, xorg
 , zlib
 }:
 
@@ -51,7 +51,7 @@ stdenv.mkDerivation rec {
     opencv
     openssl
     unixODBC
-  ] ++ (with xlibs; [
+  ] ++ (with xorg; [
     libX11
     libXext
     libXtst
diff --git a/pkgs/applications/science/math/mathematica/default.nix b/pkgs/applications/science/math/mathematica/default.nix
index 39f2409a987c..233323fceef9 100644
--- a/pkgs/applications/science/math/mathematica/default.nix
+++ b/pkgs/applications/science/math/mathematica/default.nix
@@ -12,7 +12,7 @@
 , opencv
 , openssl
 , unixODBC
-, xlibs
+, xorg
 , zlib
 , libxml2
 , libuuid
@@ -56,7 +56,7 @@ stdenv.mkDerivation rec {
     unixODBC
     libxml2
     libuuid
-  ] ++ (with xlibs; [
+  ] ++ (with xorg; [
     libX11
     libXext
     libXtst
diff --git a/pkgs/applications/science/math/scilab/default.nix b/pkgs/applications/science/math/scilab/default.nix
index bbb34e08c468..8482bd6fe94b 100644
--- a/pkgs/applications/science/math/scilab/default.nix
+++ b/pkgs/applications/science/math/scilab/default.nix
@@ -8,7 +8,7 @@
 , ocaml, withOCaml ? false
 #, withJava ? false
 #, atlasMath, withAtlas ? false
-, x11, withX ? false
+, xlibsWrapper, withX ? false
 }:
 
 stdenv.mkDerivation rec {
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
   buildInputs = [gfortran ncurses]
   ++ lib.optionals withGtk [gtk]
   ++ lib.optionals withOCaml [ocaml]
-  ++ lib.optionals withX [x11]
+  ++ lib.optional withX xlibsWrapper
   ;
 
 
@@ -58,11 +58,7 @@ stdenv.mkDerivation rec {
   # do not compile Java interface
   + " --without-java"
   # use the X Window System
-  + (lib.optionalString withX "
-      --with-x
-      --x-libraries=${x11}/lib
-      --x-includes=${x11}/include
-    ")
+  + lib.optionalString withX "--with-x"
   ;
 
   makeFlags = "all";
diff --git a/pkgs/applications/science/misc/openmodelica/default.nix b/pkgs/applications/science/misc/openmodelica/default.nix
index 3741187067dd..5357ff09b21d 100644
--- a/pkgs/applications/science/misc/openmodelica/default.nix
+++ b/pkgs/applications/science/misc/openmodelica/default.nix
@@ -1,7 +1,7 @@
 {stdenv, fetchgit, fetchsvn, autoconf, automake, libtool, gfortran, clang, cmake, gnumake,
 hwloc, jre, liblapack, blas, hdf5, expat, ncurses, readline, qt4, webkit, which,
 lp_solve, omniorb, sqlite, libatomic_ops, pkgconfig, file, gettext, flex, bison,
-doxygen, boost, openscenegraph, gnome, pangox_compat, xlibs, git, bash, gtk, makeWrapper }:
+doxygen, boost, openscenegraph, gnome, pangox_compat, xorg, git, bash, gtk, makeWrapper }:
 
 let
 
@@ -17,7 +17,7 @@ stdenv.mkDerivation {
   buildInputs = [autoconf cmake automake libtool gfortran clang gnumake
     hwloc jre liblapack blas hdf5 expat ncurses readline qt4 webkit which
     lp_solve omniorb sqlite libatomic_ops pkgconfig file gettext flex bison
-    doxygen boost openscenegraph gnome.gtkglext pangox_compat xlibs.libXmu
+    doxygen boost openscenegraph gnome.gtkglext pangox_compat xorg.libXmu
     git gtk makeWrapper];
 
   patchPhase = ''
diff --git a/pkgs/applications/version-management/git-and-tools/default.nix b/pkgs/applications/version-management/git-and-tools/default.nix
index 12ca1434466b..6a365dc69a51 100644
--- a/pkgs/applications/version-management/git-and-tools/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/default.nix
@@ -51,13 +51,13 @@ rec {
 
   qgit = import ./qgit {
     inherit fetchurl stdenv;
-    inherit (xlibs) libXext libX11;
+    inherit (xorg) libXext libX11;
     qt = qt4;
   };
 
   qgitGit = import ./qgit/qgit-git.nix {
     inherit fetchurl sourceFromHead stdenv;
-    inherit (xlibs) libXext libX11;
+    inherit (xorg) libXext libX11;
     qt = qt4;
   };
 
diff --git a/pkgs/applications/version-management/git-and-tools/git-extras/default.nix b/pkgs/applications/version-management/git-and-tools/git-extras/default.nix
index 3392c1c00217..aa62fbc4d168 100644
--- a/pkgs/applications/version-management/git-and-tools/git-extras/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/git-extras/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "git-extras-${version}";
-  version = "2.2.0";
+  version = "3.0.0";
 
   src = fetchurl {
     url = "https://github.com/tj/git-extras/archive/${version}.tar.gz";
-    sha256 = "0qwgaj0r9lsmwricpnma9rm7llfrcqarcfk5iq3ilxkns8a334va";
+    sha256 = "01x8n9i5sgl1s53sgglg9sd9lyp35dhvdhwlx03yimi4i11441s9";
   };
 
   phases = [ "unpackPhase" "installPhase" ];
diff --git a/pkgs/applications/version-management/git-and-tools/git/default.nix b/pkgs/applications/version-management/git-and-tools/git/default.nix
index 2c29ce82de56..0710e38c9414 100644
--- a/pkgs/applications/version-management/git-and-tools/git/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/git/default.nix
@@ -9,7 +9,7 @@
 }:
 
 let
-  version = "2.5.2";
+  version = "2.5.3";
   svn = subversionClient.override { perlBindings = true; };
 in
 
@@ -18,7 +18,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "https://www.kernel.org/pub/software/scm/git/git-${version}.tar.xz";
-    sha256 = "16qcli3cip1ixbrxrb3hhvvgx6ppy4anig83wz7aqlfy1sln0isb";
+    sha256 = "06is8pq8gsia3dav8mgl2zlvms2ny4hs1x0w2792ya51azc2jk8j";
   };
 
   patches = [
diff --git a/pkgs/applications/version-management/gitinspector/default.nix b/pkgs/applications/version-management/gitinspector/default.nix
new file mode 100644
index 000000000000..43df0e5b885f
--- /dev/null
+++ b/pkgs/applications/version-management/gitinspector/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, fetchzip, buildPythonPackage }:
+
+buildPythonPackage rec {
+  name = "gitinspector-${version}";
+  version = "0.4.1";
+  namePrefix = "";
+
+  src = fetchzip {
+    url = "https://github.com/ejwa/gitinspector/archive/v${version}.tar.gz";
+    sha256 = "07kjvf9cj6g6gvjgnnas5facm3nhxppf0l0fcxyd4vq6xhdb3swp";
+    name = name + "-src";
+  };
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/ejwa/gitinspector;
+    description = "Statistical analysis tool for git repositories";
+    license = licenses.gpl3;
+    platforms = platforms.all;
+    maintainers = [ maintainers.bjornfor ];
+  };
+}
diff --git a/pkgs/applications/version-management/kdesvn/default.nix b/pkgs/applications/version-management/kdesvn/default.nix
index 60f5d8bb9e08..b94978bb4881 100644
--- a/pkgs/applications/version-management/kdesvn/default.nix
+++ b/pkgs/applications/version-management/kdesvn/default.nix
@@ -1,4 +1,6 @@
-{ stdenv, fetchurl, gettext, apr, aprutil, subversion, db, kdelibs, expat }:
+{ stdenv, fetchurl, automoc4, cmake, gettext, perl, pkgconfig
+, apr, aprutil, subversion, db, kdelibs, expat
+}:
 
 # the homepage mentions this is the final release.
 # from now on, kdesvn will be part of the official kde software distribution
@@ -16,7 +18,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ apr aprutil subversion db kdelibs expat ];
 
-  nativeBuildInputs = [ gettext ];
+  nativeBuildInputs = [ automoc4 cmake gettext perl pkgconfig ];
 
   meta = {
     description = "KDE SVN front-end";
diff --git a/pkgs/applications/version-management/mercurial/default.nix b/pkgs/applications/version-management/mercurial/default.nix
index 62f2cc80d6fd..5a44240fa769 100644
--- a/pkgs/applications/version-management/mercurial/default.nix
+++ b/pkgs/applications/version-management/mercurial/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, python, makeWrapper, docutils, unzip, hg-git, dulwich
-, guiSupport ? false, tk ? null, curses
+, guiSupport ? false, tk ? null, hg-crecord ? null, curses
 , ApplicationServices }:
 
 let
@@ -36,6 +36,13 @@ stdenv.mkDerivation {
       WRAP_TK=" --set TK_LIBRARY \"${tk}/lib/${tk.libPrefix}\"
                 --set HG \"$out/bin/hg\"
                 --prefix PATH : \"${tk}/bin\" "
+    '') + (stdenv.lib.optionalString (hg-crecord != null)
+    ''
+      mkdir -p $out/etc/mercurial
+      cat >> $out/etc/mercurial/hgrc << EOF
+      [extensions]
+      crecord=${hg-crecord}/${python.sitePackages}/crecord
+      EOF
     '') +
     ''
       for i in $(cd $out/bin && ls); do
diff --git a/pkgs/applications/version-management/smartgithg/default.nix b/pkgs/applications/version-management/smartgithg/default.nix
index 40a3a3f9ae52..778ae995f3de 100644
--- a/pkgs/applications/version-management/smartgithg/default.nix
+++ b/pkgs/applications/version-management/smartgithg/default.nix
@@ -8,11 +8,11 @@
 
 stdenv.mkDerivation rec {
   name = "smartgithg-${version}";
-  version = "7_0_0";
+  version = "7_0_2";
 
   src = fetchurl {
     url = "http://www.syntevo.com/downloads/smartgit/smartgit-generic-${version}.tar.gz";
-    sha256 = "099hnpczh2c0s86nsdybymmm4903n0bsjdq1fpdmm0x5w4216iy6";
+    sha256 = "1jpi424aqy6niq31j750rgbspwii013c8kbi965i4jzjpba1pagi";
   };
 
   buildInputs = [
@@ -23,6 +23,7 @@ stdenv.mkDerivation rec {
   buildCommand = let
     pkg_path = "$out/${name}";
     bin_path = "$out/bin";
+    install_freedesktop_items = ./install_freedesktop_items.sh;
     runtime_paths = lib.makeSearchPath "bin" [
       jre
       git mercurial subversion
@@ -48,6 +49,8 @@ stdenv.mkDerivation rec {
       --prefix SMARTGITHG_JAVA_HOME : ${jre}
     patchShebangs $out
     cp ${bin_path}/smartgit ${bin_path}/smartgithg
+
+    ${install_freedesktop_items} "${pkg_path}/bin" "$out"
   '';
 
   meta = with stdenv.lib; {
diff --git a/pkgs/applications/version-management/smartgithg/install_freedesktop_items.sh b/pkgs/applications/version-management/smartgithg/install_freedesktop_items.sh
new file mode 100755
index 000000000000..66fb0cf8f95a
--- /dev/null
+++ b/pkgs/applications/version-management/smartgithg/install_freedesktop_items.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+inBinDir=$1
+out=$2
+
+cat $inBinDir/add-menuitem.sh | \
+sed -re 's#xdg-icon-resource[ ]+install[ ]+--size[ ]+([0-9]+)[ ]+("[^"]+")[ ]+([$0-9a-zA-Z_]+)#mkdir -p '${out}'/share/icons/hicolor/\1x\1/apps \&\& cp \2 '${out}'/share/icons/hicolor/\1x\1/apps/\3\.png #' | \
+sed -re 's#xdg-desktop-menu[ ]+install[ ]+([$0-9a-zA-Z_]+)#mkdir -p '${out}'/share/applications \&\& cp \1 '${out}'/share/applications/#' | \
+sed -re 's#Exec="[^"]+"#Exec=smartgit#' |
+sed -re 's#SMARTGIT_BIN=.*#'SMARTGIT_BIN=${inBinDir}'#' \
+| bash
diff --git a/pkgs/applications/version-management/subversion/default.nix b/pkgs/applications/version-management/subversion/default.nix
index 9e0a093c958f..db29360c9ecb 100644
--- a/pkgs/applications/version-management/subversion/default.nix
+++ b/pkgs/applications/version-management/subversion/default.nix
@@ -17,13 +17,13 @@ assert javahlBindings -> jdk != null && perl != null;
 
 stdenv.mkDerivation (rec {
 
-  version = "1.9.1";
+  version = "1.9.2";
 
   name = "subversion-${version}";
 
   src = fetchurl {
     url = "mirror://apache/subversion/${name}.tar.bz2";
-    sha1 = "1244a741dbcf24f2b1d165225f0159a0c994e37a";
+    sha1 = "fb9db3b7ddf48ae37aa8785872301b59bfcc7017";
   };
 
   buildInputs = [ zlib apr aprutil sqlite ]
diff --git a/pkgs/applications/video/bangarang/default.nix b/pkgs/applications/video/bangarang/default.nix
index f962b52dd627..ceece8879dcb 100644
--- a/pkgs/applications/video/bangarang/default.nix
+++ b/pkgs/applications/video/bangarang/default.nix
@@ -1,4 +1,8 @@
-{ stdenv, fetchurl, cmake, qt4, kdelibs, automoc4, phonon, soprano, shared_desktop_ontologies, kdemultimedia, taglib, glibc, gettext }:
+{ stdenv, fetchurl, automoc4, cmake, perl, pkgconfig
+, kdelibs, phonon, soprano, shared_desktop_ontologies
+, kdemultimedia, taglib, glibc, gettext
+}:
+
 stdenv.mkDerivation rec {
   name = "bangarang-2.1";
 
@@ -7,8 +11,12 @@ stdenv.mkDerivation rec {
     sha256 = "1g4pap79k8qaqi0py34xqvisxln1nc5hbvph692ah3af06n6cly1";
   };
 
-  buildInputs = [ kdelibs phonon soprano shared_desktop_ontologies kdemultimedia taglib gettext ];
-  nativeBuildInputs = [ cmake ];
+  buildInputs = [
+    kdelibs phonon soprano shared_desktop_ontologies kdemultimedia
+    taglib gettext
+  ];
+
+  nativeBuildInputs = [ automoc4 cmake perl pkgconfig ];
 
   patches = [ ./gcc-4.7.patch ];
 
diff --git a/pkgs/applications/video/gnash/default.nix b/pkgs/applications/video/gnash/default.nix
index 5a170047e8fc..f53ce93328bf 100644
--- a/pkgs/applications/video/gnash/default.nix
+++ b/pkgs/applications/video/gnash/default.nix
@@ -3,7 +3,7 @@
 , gst_ffmpeg, speex
 , libogg, libxml2, libjpeg, mesa, libpng, libungif, libtool
 , boost, freetype, agg, dbus, curl, pkgconfig, gettext
-, glib, gtk, gtkglext, pangox_compat, x11, ming, dejagnu, python, perl
+, glib, gtk, gtkglext, pangox_compat, xlibsWrapper, ming, dejagnu, python, perl
 , freefont_ttf, haxe, swftools
 , lib, makeWrapper
 , xulrunner }:
@@ -51,7 +51,7 @@ stdenv.mkDerivation rec {
 
   # XXX: KDE is supported as well so we could make it available optionally.
   buildInputs = [
-    gettext x11 SDL SDL_mixer gstreamer gst_plugins_base gst_plugins_good
+    gettext xlibsWrapper SDL SDL_mixer gstreamer gst_plugins_base gst_plugins_good
     gst_ffmpeg speex libtool
     libogg libxml2 libjpeg mesa libpng libungif boost freetype agg
     dbus curl pkgconfig glib gtk gtkglext pangox_compat
diff --git a/pkgs/applications/video/k9copy/default.nix b/pkgs/applications/video/k9copy/default.nix
index 70558eb39a4c..047f23011855 100644
--- a/pkgs/applications/video/k9copy/default.nix
+++ b/pkgs/applications/video/k9copy/default.nix
@@ -1,5 +1,9 @@
-{ stdenv, fetchurl, cmake, automoc4, qt5, kf5, dvdauthor, xineLib, libmpeg2, libav,
-libdvdread, libdvdnav, dvdplusrwtools, phonon_qt5 }:
+{ stdenv, fetchurl
+, cmake, automoc4
+, dvdauthor, xineLib, libmpeg2, libav, libdvdread, libdvdnav, dvdplusrwtools
+, phonon, qtx11extras
+, extra-cmake-modules, kio, kiconthemes, ki18n, kdesu, kdoctools, solid
+}:
 
 stdenv.mkDerivation rec {
   version = "3.0.3";
@@ -30,18 +34,17 @@ stdenv.mkDerivation rec {
     libdvdread
     libdvdnav
     dvdplusrwtools
-    automoc4
-    phonon_qt5
-  ] ++ (with kf5; [
+    #automoc4
+    phonon
     extra-cmake-modules
     kio
     solid
-    qt5.x11extras
+    qtx11extras
     kiconthemes
     ki18n
     kdesu
-    kdoctools
-  ]);
+  ];
+  nativeBuildInputs = [ kdoctools ];
 
   meta = {
     description = "DVD backup and DVD authoring program";
diff --git a/pkgs/applications/video/kdenlive/default.nix b/pkgs/applications/video/kdenlive/default.nix
index f29ad00ea9e3..3da5180352c6 100644
--- a/pkgs/applications/video/kdenlive/default.nix
+++ b/pkgs/applications/video/kdenlive/default.nix
@@ -14,9 +14,12 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [
-    automoc4 cmake frei0r gettext kdelibs libv4l makeWrapper mlt perl
-    phonon pkgconfig qimageblitz qjson qt4 shared_desktop_ontologies
-    shared_mime_info soprano
+    frei0r kdelibs libv4l mlt phonon qimageblitz qjson qt4
+    shared_desktop_ontologies soprano
+  ];
+
+  nativeBuildInputs = [
+    automoc4 cmake gettext makeWrapper perl pkgconfig shared_mime_info
   ];
 
   propagatedUserEnvPkgs = [ oxygen_icons ];
diff --git a/pkgs/applications/video/kmplayer/default.nix b/pkgs/applications/video/kmplayer/default.nix
index 8d4a328cc094..2e62cb139e34 100644
--- a/pkgs/applications/video/kmplayer/default.nix
+++ b/pkgs/applications/video/kmplayer/default.nix
@@ -1,4 +1,5 @@
-{ stdenv, fetchurl, cmake, pkgconfig, gettext, makeWrapper
+{ stdenv, fetchurl
+, automoc4, cmake, gettext, makeWrapper, perl, pkgconfig
 , kdelibs, cairo, dbus_glib, mplayer
 }:
 
@@ -11,10 +12,9 @@ stdenv.mkDerivation {
     sha256 = "1yvbkb1hh5y7fqfvixjf2rryzm0fm0fpkx4lmvhi7k7d0v4wpgky";
   };
 
-  buildInputs = [
-    cmake gettext pkgconfig makeWrapper
-    kdelibs cairo dbus_glib
-  ];
+  buildInputs = [ kdelibs cairo dbus_glib ];
+
+  nativeBuildInputs = [ automoc4 cmake gettext makeWrapper perl pkgconfig ];
 
   postInstall = ''
     wrapProgram $out/bin/kmplayer --suffix PATH : ${mplayer}/bin
diff --git a/pkgs/applications/video/mythtv/default.nix b/pkgs/applications/video/mythtv/default.nix
index cd157a473e62..4320022192a4 100644
--- a/pkgs/applications/video/mythtv/default.nix
+++ b/pkgs/applications/video/mythtv/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, which, qt4, x11, libpulseaudio, fftwSinglePrec
+{ stdenv, fetchurl, which, qt4, xlibsWrapper, libpulseaudio, fftwSinglePrec
 , lame, zlib, mesa, alsaLib, freetype, perl, pkgconfig
 , libX11, libXv, libXrandr, libXvMC, libXinerama, libXxf86vm, libXmu
 , yasm, libuuid, taglib, libtool, autoconf, automake, file
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   sourceRoot = "${name}/mythtv";
 
   buildInputs = [
-    freetype qt4 lame zlib x11 mesa perl alsaLib libpulseaudio fftwSinglePrec
+    freetype qt4 lame zlib xlibsWrapper mesa perl alsaLib libpulseaudio fftwSinglePrec
     libX11 libXv libXrandr libXvMC libXmu libXinerama libXxf86vm libXmu
     libuuid taglib
   ];
diff --git a/pkgs/applications/video/tvtime/default.nix b/pkgs/applications/video/tvtime/default.nix
index 2ec5e813c412..459ea533dba7 100644
--- a/pkgs/applications/video/tvtime/default.nix
+++ b/pkgs/applications/video/tvtime/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, xlibs, libX11, libXtst, libSM, libXext, libXv, libXxf86vm, libXau, 
+{stdenv, fetchurl, xorg, libX11, libXtst, libSM, libXext, libXv, libXxf86vm, libXau, 
    libXdmcp, zlib, libpng, libxml2, freetype, libICE, intltool, libXinerama, gettext, 
    pkgconfig, kernel, file, libXi}:
 
@@ -48,8 +48,8 @@ stdenv.mkDerivation rec {
   '';
 
   configureFlags = '' 
-    --x-includes=${xlibs.libX11}/include 
-    --x-libraries=${xlibs.libX11}/lib
+    --x-includes=${xorg.libX11}/include 
+    --x-libraries=${xorg.libX11}/lib
   '';
 
   buildInputs = [ libX11 libXtst libSM libXext libXv libXxf86vm libXau libXdmcp zlib libpng libxml2 freetype libICE intltool libXinerama gettext pkgconfig file libXi ];
diff --git a/pkgs/applications/video/vlc/default.nix b/pkgs/applications/video/vlc/default.nix
index 80aa1b3c5c33..e5db4c0b2db8 100644
--- a/pkgs/applications/video/vlc/default.nix
+++ b/pkgs/applications/video/vlc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, xz, bzip2, perl, xlibs, libdvdnav, libbluray
+{ stdenv, fetchurl, xz, bzip2, perl, xorg, libdvdnav, libbluray
 , zlib, a52dec, libmad, faad2, ffmpeg, alsaLib
 , pkgconfig, dbus, fribidi, freefont_ttf, libebml, libmatroska
 , libvorbis, libtheora, speex, lua5, libgcrypt, libupnp
@@ -8,13 +8,14 @@
 , libass, libva, libdvbpsi, libdc1394, libraw1394, libopus
 , libvdpau, libsamplerate
 , onlyLibVLC ? false
-, qt4 ? null, qt5 ? null, withQt5 ? false
+, qt4 ? null
+, withQt5 ? false, qtbase ? null
 , jackSupport ? false
 }:
 
 with stdenv.lib;
 
-assert (withQt5 -> qt5 != null);
+assert (withQt5 -> qtbase != null);
 assert (!withQt5 -> qt4 != null);
 
 stdenv.mkDerivation rec {
@@ -32,10 +33,10 @@ stdenv.mkDerivation rec {
       libupnp libcaca libpulseaudio flac schroedinger libxml2 librsvg mpeg2dec
       udev gnutls avahi libcddb SDL SDL_image libmtp unzip taglib
       libkate libtiger libv4l samba liboggz libass libdvbpsi libva
-      xlibs.xlibs xlibs.libXv xlibs.libXvMC xlibs.libXpm xlibs.xcbutilkeysyms
+      xorg.xlibsWrapper xorg.libXv xorg.libXvMC xorg.libXpm xorg.xcbutilkeysyms
       libdc1394 libraw1394 libopus libebml libmatroska libvdpau libsamplerate
     ]
-    ++ (if withQt5 then with qt5; [ base ] else [qt4])
+    ++ [(if withQt5 then qtbase else qt4)]
     ++ optional jackSupport libjack2;
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/applications/video/xine-ui/default.nix b/pkgs/applications/video/xine-ui/default.nix
index 6ae4100c8275..fd7b31de16ed 100644
--- a/pkgs/applications/video/xine-ui/default.nix
+++ b/pkgs/applications/video/xine-ui/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, pkgconfig, xlibs, libpng, xineLib, readline, ncurses, curl
+{stdenv, fetchurl, pkgconfig, xorg, libpng, xineLib, readline, ncurses, curl
 , lirc, shared_mime_info, libjpeg }:
 
 stdenv.mkDerivation rec {
@@ -13,8 +13,8 @@ stdenv.mkDerivation rec {
 
   buildInputs =
     [ xineLib libpng readline ncurses curl lirc libjpeg
-      xlibs.xlibs xlibs.libXext xlibs.libXv xlibs.libXxf86vm xlibs.libXtst xlibs.inputproto
-      xlibs.libXinerama xlibs.libXi xlibs.libXft
+      xorg.xlibsWrapper xorg.libXext xorg.libXv xorg.libXxf86vm xorg.libXtst xorg.inputproto
+      xorg.libXinerama xorg.libXi xorg.libXft
     ];
 
   patchPhase = ''sed -e '/curl\/types\.h/d' -i src/xitk/download.c'';
diff --git a/pkgs/applications/virtualization/open-vm-tools/default.nix b/pkgs/applications/virtualization/open-vm-tools/default.nix
index cfe4ad3a8e19..e8c6b39f4933 100644
--- a/pkgs/applications/virtualization/open-vm-tools/default.nix
+++ b/pkgs/applications/virtualization/open-vm-tools/default.nix
@@ -1,6 +1,6 @@
 { stdenv, lib, fetchurl, makeWrapper, autoconf, automake,
   libmspack, openssl, pam, xercesc, icu, libdnet, procps, 
-  x11, libXinerama, libXi, libXrender, libXrandr, libXtst,
+  xlibsWrapper, libXinerama, libXi, libXrender, libXrandr, libXtst,
   pkgconfig, glib, gtk, gtkmm }:
 
 let
@@ -18,7 +18,7 @@ in stdenv.mkDerivation {
 
   buildInputs = 
     [ autoconf automake makeWrapper libmspack openssl pam xercesc icu libdnet procps
-      pkgconfig glib gtk gtkmm x11 libXinerama libXi libXrender libXrandr libXtst ];
+      pkgconfig glib gtk gtkmm xlibsWrapper libXinerama libXi libXrender libXrandr libXtst ];
 
   patchPhase = ''
      sed -i s,-Werror,,g configure.ac
diff --git a/pkgs/applications/virtualization/xen/generic.nix b/pkgs/applications/virtualization/xen/generic.nix
index 2ff66d843cad..71c26c5f99c9 100644
--- a/pkgs/applications/virtualization/xen/generic.nix
+++ b/pkgs/applications/virtualization/xen/generic.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl, which, zlib, pkgconfig, SDL, openssl
 , libuuid, gettext, ncurses, dev86, iasl, pciutils, bzip2
 , lvm2, utillinux, procps, texinfo, perl, pythonPackages
-, glib, bridge-utils, xlibs, pixman, iproute, udev, bison
+, glib, bridge-utils, xorg, pixman, iproute, udev, bison
 , flex, cmake, ocaml, ocamlPackages, figlet, libaio, yajl
 , checkpolicy, transfig, glusterfs, acl, fetchgit, xz, spice
 , spice_protocol, usbredir, alsaLib, quilt
@@ -66,7 +66,7 @@ stdenv.mkDerivation {
     [ which zlib pkgconfig SDL openssl libuuid gettext ncurses
       dev86 iasl pciutils bzip2 xz texinfo perl yajl
       pythonPackages.python pythonPackages.wrapPython
-      glib bridge-utils pixman iproute udev bison xlibs.libX11
+      glib bridge-utils pixman iproute udev bison xorg.libX11
       flex ocaml ocamlPackages.findlib figlet libaio
       checkpolicy pythonPackages.markdown transfig
       glusterfs acl cmake spice spice_protocol usbredir
diff --git a/pkgs/applications/window-managers/awesome/default.nix b/pkgs/applications/window-managers/awesome/default.nix
index c57a89193b5e..9c9d3d5f4514 100644
--- a/pkgs/applications/window-managers/awesome/default.nix
+++ b/pkgs/applications/window-managers/awesome/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, luaPackages, cairo, cmake, imagemagick, pkgconfig, gdk_pixbuf
-, xlibs, libstartup_notification, libxdg_basedir, libpthreadstubs
+, xorg, libstartup_notification, libxdg_basedir, libpthreadstubs
 , xcb-util-cursor, makeWrapper, pango, gobjectIntrospection, unclutter
 , compton, procps, iproute, coreutils, curl, alsaUtils, findutils, xterm
 , which, dbus, nettools, git, asciidoc, doxygen
@@ -46,15 +46,15 @@ stdenv.mkDerivation rec {
     pango
     pkgconfig
     xcb-util-cursor
-    xlibs.libXau
-    xlibs.libXdmcp
-    xlibs.libxcb
-    xlibs.libxshmfence
-    xlibs.xcbutil
-    xlibs.xcbutilimage
-    xlibs.xcbutilkeysyms
-    xlibs.xcbutilrenderutil
-    xlibs.xcbutilwm
+    xorg.libXau
+    xorg.libXdmcp
+    xorg.libxcb
+    xorg.libxshmfence
+    xorg.xcbutil
+    xorg.xcbutilimage
+    xorg.xcbutilkeysyms
+    xorg.xcbutilrenderutil
+    xorg.xcbutilwm
     #xmlto docbook_xml_dtd_45 docbook_xsl
   ];
 
diff --git a/pkgs/applications/window-managers/ion-3/default.nix b/pkgs/applications/window-managers/ion-3/default.nix
index 7a467b1fcdb9..f41990730774 100644
--- a/pkgs/applications/window-managers/ion-3/default.nix
+++ b/pkgs/applications/window-managers/ion-3/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, x11, lua, gettext, groff }:
+{ stdenv, fetchurl, xlibsWrapper, lua, gettext, groff }:
 
 stdenv.mkDerivation {
   name = "ion-3-20090110";
@@ -10,7 +10,7 @@ stdenv.mkDerivation {
     url = http://tuomov.iki.fi/software/dl/ion-3-20090110.tar.gz;
     sha256 = "1nkks5a95986nyfkxvg2rik6zmwx0lh7szd5fji7yizccwzc9xns";
   };
-  buildInputs = [ x11 lua gettext groff ];
+  buildInputs = [ xlibsWrapper lua gettext groff ];
   buildFlags = "LUA_DIR=${lua} X11_PREFIX=/no-such-path PREFIX=\${out}";
   installFlags = "PREFIX=\${out}";
 }
diff --git a/pkgs/applications/window-managers/notion/default.nix b/pkgs/applications/window-managers/notion/default.nix
index cd43c06d33e2..2177d1a871f0 100644
--- a/pkgs/applications/window-managers/notion/default.nix
+++ b/pkgs/applications/window-managers/notion/default.nix
@@ -4,7 +4,7 @@
   stdenv, fetchurl,
   lua, gettext, groff,
   pkgconfig, busybox,
-  x11, libXinerama, libXrandr, libX11
+  xlibsWrapper, libXinerama, libXrandr, libX11
 }:
 
 assert enableXft -> libXft != null;
@@ -26,7 +26,7 @@ stdenv.mkDerivation {
 
   patches = patches ++ stdenv.lib.optional enableXft ./notion-xft_nixos.diff;
   postPatch = "substituteInPlace system-autodetect.mk --replace '#PRELOAD_MODULES=1' 'PRELOAD_MODULES=1'";
-  buildInputs = [x11 lua gettext groff pkgconfig busybox libXinerama libXrandr libX11] ++ stdenv.lib.optional enableXft libXft;
+  buildInputs = [xlibsWrapper lua gettext groff pkgconfig busybox libXinerama libXrandr libX11] ++ stdenv.lib.optional enableXft libXft;
 
   buildFlags = "LUA_DIR=${lua} X11_PREFIX=/no-such-path PREFIX=\${out}";
   installFlags = "PREFIX=\${out}";
diff --git a/pkgs/applications/window-managers/qtile/default.nix b/pkgs/applications/window-managers/qtile/default.nix
index 39d942362be1..236baa131c94 100644
--- a/pkgs/applications/window-managers/qtile/default.nix
+++ b/pkgs/applications/window-managers/qtile/default.nix
@@ -17,20 +17,20 @@ buildPythonPackage rec {
     substituteInPlace libqtile/manager.py --subst-var-by out $out
   '';
 
-  buildInputs = [ pkgs.pkgconfig pkgs.glib pkgs.xlibs.libxcb pkgs.cairo pkgs.pango python27Packages.xcffib ];
+  buildInputs = [ pkgs.pkgconfig pkgs.glib pkgs.xorg.libxcb pkgs.cairo pkgs.pango python27Packages.xcffib ];
 
   cairocffi-xcffib = python27Packages.cairocffi.override {
-    LD_LIBRARY_PATH = "${pkgs.xlibs.libxcb}/lib:${pkgs.cairo}/lib";
+    LD_LIBRARY_PATH = "${pkgs.xorg.libxcb}/lib:${pkgs.cairo}/lib";
     pythonPath = [ python27Packages.xcffib ];
   };
 
   pythonPath = with python27Packages; [ xcffib cairocffi-xcffib trollius readline ];
 
-  LD_LIBRARY_PATH = "${pkgs.xlibs.libxcb}/lib:${pkgs.cairo}/lib";
+  LD_LIBRARY_PATH = "${pkgs.xorg.libxcb}/lib:${pkgs.cairo}/lib";
 
   postInstall = ''
     wrapProgram $out/bin/qtile \
-      --prefix LD_LIBRARY_PATH : ${pkgs.xlibs.libxcb}/lib \
+      --prefix LD_LIBRARY_PATH : ${pkgs.xorg.libxcb}/lib \
       --prefix LD_LIBRARY_PATH : ${pkgs.glib}/lib \
       --prefix LD_LIBRARY_PATH : ${pkgs.cairo}/lib \
       --prefix LD_LIBRARY_PATH : ${pkgs.pango}/lib
diff --git a/pkgs/applications/window-managers/weston/default.nix b/pkgs/applications/window-managers/weston/default.nix
index d270d3a2b1d6..7a662aaf09e8 100644
--- a/pkgs/applications/window-managers/weston/default.nix
+++ b/pkgs/applications/window-managers/weston/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, pkgconfig, wayland, mesa, libxkbcommon, cairo, libxcb
-, libXcursor, x11, udev, libdrm, mtdev, libjpeg, pam, dbus, libinput
+, libXcursor, xlibsWrapper, udev, libdrm, mtdev, libjpeg, pam, dbus, libinput
 , pango ? null, libunwind ? null, freerdp ? null, vaapi ? null, libva ? null
 , libwebp ? null, xwayland ? null
 # beware of null defaults, as the parameters *are* supplied by callPackage by default
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [
-    pkgconfig wayland mesa libxkbcommon cairo libxcb libXcursor x11 udev libdrm
+    pkgconfig wayland mesa libxkbcommon cairo libxcb libXcursor xlibsWrapper udev libdrm
     mtdev libjpeg pam dbus.libs libinput pango libunwind freerdp vaapi libva
     libwebp
   ];