about summary refs log tree commit diff
path: root/pkgs/applications
diff options
context:
space:
mode:
authorMathijs Kwik <mathijs@bluescreen303.nl>2013-11-01 08:29:09 +0100
committerMathijs Kwik <mathijs@bluescreen303.nl>2013-11-01 08:29:09 +0100
commitdb83d9a35b09a7cc548d9b8b2ad63c1f8ca8ba28 (patch)
tree6a32901d16731d1b109ea218f6360f0deaf7edde /pkgs/applications
parent1a55c4b89f6f6e337d1ca8878bfd8104f3fb6304 (diff)
parentb6519f08da3321a8bc002e6608297a3225cc5439 (diff)
downloadnixlib-db83d9a35b09a7cc548d9b8b2ad63c1f8ca8ba28.tar
nixlib-db83d9a35b09a7cc548d9b8b2ad63c1f8ca8ba28.tar.gz
nixlib-db83d9a35b09a7cc548d9b8b2ad63c1f8ca8ba28.tar.bz2
nixlib-db83d9a35b09a7cc548d9b8b2ad63c1f8ca8ba28.tar.lz
nixlib-db83d9a35b09a7cc548d9b8b2ad63c1f8ca8ba28.tar.xz
nixlib-db83d9a35b09a7cc548d9b8b2ad63c1f8ca8ba28.tar.zst
nixlib-db83d9a35b09a7cc548d9b8b2ad63c1f8ca8ba28.zip
Merge branch 'master' into multiple-outputs
Diffstat (limited to 'pkgs/applications')
-rw-r--r--pkgs/applications/audio/a2jmidid/default.nix2
-rw-r--r--pkgs/applications/audio/abcde/default.nix2
-rw-r--r--pkgs/applications/audio/audacious/default.nix21
-rw-r--r--pkgs/applications/audio/audacity/default.nix4
-rw-r--r--pkgs/applications/audio/aumix/default.nix2
-rw-r--r--pkgs/applications/audio/google-musicmanager/default.nix57
-rw-r--r--pkgs/applications/audio/mixxx/default.nix51
-rw-r--r--pkgs/applications/audio/mopidy/default.nix5
-rw-r--r--pkgs/applications/audio/mopidy/git.nix44
-rwxr-xr-xpkgs/applications/audio/mpc/default.nix27
-rw-r--r--pkgs/applications/audio/quodlibet/default.nix2
-rw-r--r--pkgs/applications/audio/rubyripper/default.nix16
-rw-r--r--pkgs/applications/audio/snd/default.nix2
-rw-r--r--pkgs/applications/audio/spotify/default.nix34
-rw-r--r--pkgs/applications/display-managers/slim/default.nix32
-rw-r--r--pkgs/applications/display-managers/slim/run-once.patch12
-rw-r--r--pkgs/applications/display-managers/slim/runtime-paths.patch66
-rw-r--r--pkgs/applications/editors/aseprite/default.nix48
-rw-r--r--pkgs/applications/editors/eclipse/default.nix19
-rw-r--r--pkgs/applications/editors/emacs-24/default.nix49
-rw-r--r--pkgs/applications/editors/emacs-modes/coffee/default.nix2
-rw-r--r--pkgs/applications/editors/emacs-modes/color-theme/default.nix2
-rw-r--r--pkgs/applications/editors/emacs-modes/flymake-cursor/default.nix2
-rw-r--r--pkgs/applications/editors/emacs-modes/htmlize/default.nix2
-rw-r--r--pkgs/applications/editors/emacs-modes/jade/default.nix2
-rw-r--r--pkgs/applications/editors/emacs-modes/lorem-ipsum/default.nix2
-rw-r--r--pkgs/applications/editors/emacs-modes/org/default.nix6
-rw-r--r--pkgs/applications/editors/emacs-modes/org2blog/default.nix2
-rw-r--r--pkgs/applications/editors/emacs-modes/rect-mark/default.nix2
-rw-r--r--pkgs/applications/editors/emacs-modes/sunrise-commander/default.nix2
-rw-r--r--pkgs/applications/editors/emacs-modes/xml-rpc/default.nix2
-rw-r--r--pkgs/applications/editors/flpsed/default.nix5
-rw-r--r--pkgs/applications/editors/geany/default.nix2
-rw-r--r--pkgs/applications/editors/mg/default.nix2
-rw-r--r--pkgs/applications/editors/sublime/default.nix2
-rw-r--r--pkgs/applications/editors/vim/configurable.nix33
-rw-r--r--pkgs/applications/editors/vim/default.nix21
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.001489
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.00277
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.003100
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.004232
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.00548
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.00666
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.00795
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.00871
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.00964
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.01079
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.011100
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.012202
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.01399
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.014102
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.015106
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.016221
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.01778
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.01845
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.01961
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.02082
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.02186
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.022148
-rw-r--r--pkgs/applications/editors/vim/patches/7.4.02353
-rw-r--r--pkgs/applications/graphics/ImageMagick/default.nix22
-rw-r--r--pkgs/applications/graphics/darktable/default.nix18
-rw-r--r--pkgs/applications/graphics/gpicview/default.nix21
-rw-r--r--pkgs/applications/graphics/jbrout/default.nix1
-rw-r--r--pkgs/applications/graphics/openscad/default.nix14
-rw-r--r--pkgs/applications/graphics/paraview/default.nix6
-rw-r--r--pkgs/applications/graphics/sane/backends.nix2
-rw-r--r--pkgs/applications/ike/default.nix39
-rw-r--r--pkgs/applications/misc/abook/default.nix2
-rw-r--r--pkgs/applications/misc/bitcoin/default.nix4
-rw-r--r--pkgs/applications/misc/calibre/default.nix4
-rw-r--r--pkgs/applications/misc/djvulibre/default.nix6
-rw-r--r--pkgs/applications/misc/fbreader/default.nix34
-rw-r--r--pkgs/applications/misc/freicoin/default.nix4
-rw-r--r--pkgs/applications/misc/gkrellm/default.nix2
-rw-r--r--pkgs/applications/misc/gmrun/default.nix2
-rw-r--r--pkgs/applications/misc/gnome_terminator/default.nix2
-rw-r--r--pkgs/applications/misc/lyx/default.nix2
-rw-r--r--pkgs/applications/misc/mysql-workbench/default.nix2
-rw-r--r--pkgs/applications/misc/navit/default.nix17
-rw-r--r--pkgs/applications/misc/redshift/default.nix34
-rw-r--r--pkgs/applications/misc/rxvt_unicode/default.nix18
-rw-r--r--pkgs/applications/misc/surf/default.nix14
-rw-r--r--pkgs/applications/misc/synergy/cryptopp.patch12
-rw-r--r--pkgs/applications/misc/synergy/default.nix6
-rw-r--r--pkgs/applications/misc/taskjuggler/default.nix2
-rw-r--r--pkgs/applications/misc/urlview/default.nix39
-rw-r--r--pkgs/applications/misc/xca/default.nix27
-rw-r--r--pkgs/applications/misc/xfe/default.nix4
-rw-r--r--pkgs/applications/misc/xmobar/default.nix4
-rw-r--r--pkgs/applications/misc/xpdf/default.nix26
-rw-r--r--pkgs/applications/networking/bittorrentsync/default.nix2
-rw-r--r--pkgs/applications/networking/browsers/chromium/default.nix134
-rw-r--r--pkgs/applications/networking/browsers/chromium/sandbox.nix20
-rw-r--r--pkgs/applications/networking/browsers/chromium/sandbox_userns_31.patch (renamed from pkgs/applications/networking/browsers/chromium/sandbox_userns_29.patch)60
-rw-r--r--pkgs/applications/networking/browsers/chromium/sources.nix18
-rw-r--r--pkgs/applications/networking/browsers/dwb/default.nix35
-rw-r--r--pkgs/applications/networking/browsers/firefox/default.nix30
-rw-r--r--pkgs/applications/networking/browsers/firefox/system-cairo.patch73
-rw-r--r--pkgs/applications/networking/browsers/firefox/wrapper.nix5
-rw-r--r--pkgs/applications/networking/browsers/midori/default.nix2
-rw-r--r--pkgs/applications/networking/browsers/mozilla-plugins/fribid/builder.sh4
-rw-r--r--pkgs/applications/networking/browsers/mozilla-plugins/fribid/default.nix31
-rw-r--r--pkgs/applications/networking/browsers/mozilla-plugins/fribid/emulated-version.patch12
-rw-r--r--pkgs/applications/networking/browsers/mozilla-plugins/fribid/ipc-lazytrace.patch10
-rw-r--r--pkgs/applications/networking/browsers/mozilla-plugins/fribid/plugin-linkfix.patch11
-rw-r--r--pkgs/applications/networking/browsers/mozilla-plugins/fribid/translation-xgettext-to-intltool.patch16
-rw-r--r--pkgs/applications/networking/dropbox-cli/default.nix5
-rw-r--r--pkgs/applications/networking/dropbox/default.nix12
-rw-r--r--pkgs/applications/networking/ids/bro/default.nix2
-rw-r--r--pkgs/applications/networking/instant-messengers/amsn/default.nix1
-rw-r--r--pkgs/applications/networking/instant-messengers/oneteam/default.nix2
-rw-r--r--pkgs/applications/networking/instant-messengers/pidgin-plugins/msn-pecan/default.nix2
-rw-r--r--pkgs/applications/networking/instant-messengers/pidgin-plugins/sipe/default.nix2
-rw-r--r--pkgs/applications/networking/instant-messengers/pidgin-plugins/tox-prpl/default.nix29
-rw-r--r--pkgs/applications/networking/instant-messengers/pidgin/default.nix2
-rw-r--r--pkgs/applications/networking/instant-messengers/skype/default.nix1
-rw-r--r--pkgs/applications/networking/instant-messengers/torchat/default.nix13
-rw-r--r--pkgs/applications/networking/instant-messengers/toxic/default.nix40
-rw-r--r--pkgs/applications/networking/irc/kvirc/default.nix24
-rw-r--r--pkgs/applications/networking/irc/quassel/default.nix7
-rw-r--r--pkgs/applications/networking/irc/weechat/default.nix11
-rw-r--r--pkgs/applications/networking/jmeter/default.nix27
-rw-r--r--pkgs/applications/networking/mailreaders/sup/default.nix28
-rw-r--r--pkgs/applications/networking/p2p/gnunet/svn.nix9
-rw-r--r--pkgs/applications/networking/p2p/transmission/2.60.nix41
-rw-r--r--pkgs/applications/networking/p2p/transmission/default.nix42
-rw-r--r--pkgs/applications/networking/remote/ssvnc/default.nix23
-rw-r--r--pkgs/applications/networking/sniffers/ettercap/default.nix33
-rw-r--r--pkgs/applications/networking/znc/default.nix1
-rw-r--r--pkgs/applications/networking/znc/modules.nix56
-rw-r--r--pkgs/applications/office/abiword/default.nix4
-rw-r--r--pkgs/applications/office/antiword/default.nix2
-rw-r--r--pkgs/applications/office/eventlist/default.nix28
-rw-r--r--pkgs/applications/office/libreoffice/default.nix8
-rw-r--r--pkgs/applications/science/astronomy/gravit/default.nix4
-rw-r--r--pkgs/applications/science/biology/arb/default.nix2
-rw-r--r--pkgs/applications/science/biology/plink/default.nix24
-rw-r--r--pkgs/applications/science/chemistry/avogadro/default.nix3
-rw-r--r--pkgs/applications/science/electronics/alliance/default.nix2
-rw-r--r--pkgs/applications/science/electronics/ngspice/default.nix2
-rw-r--r--pkgs/applications/science/logic/ekrhyper/default.nix8
-rw-r--r--pkgs/applications/science/logic/eprover/default.nix8
-rw-r--r--pkgs/applications/science/logic/hol/default.nix36
-rw-r--r--pkgs/applications/science/logic/hol_light/default.nix16
-rw-r--r--pkgs/applications/science/logic/logisim/default.nix2
-rw-r--r--pkgs/applications/science/logic/prover9/default.nix4
-rw-r--r--pkgs/applications/science/math/R/default.nix10
-rw-r--r--pkgs/applications/science/math/R/setup-hook.sh5
-rw-r--r--pkgs/applications/science/math/mathematica/default.nix126
-rw-r--r--pkgs/applications/science/math/maxima/default.nix4
-rw-r--r--pkgs/applications/science/math/pssp/default.nix40
-rw-r--r--pkgs/applications/science/math/speedcrunch/default.nix38
-rw-r--r--pkgs/applications/science/math/speedcrunch/speedcrunch-0.11-alpha-dso_linking.patch23
-rw-r--r--pkgs/applications/science/math/wxmaxima/default.nix6
-rw-r--r--pkgs/applications/version-management/bazaar/tools.nix2
-rw-r--r--pkgs/applications/version-management/codeville/0.8.0.nix2
-rw-r--r--pkgs/applications/version-management/fossil/default.nix11
-rw-r--r--pkgs/applications/version-management/git-and-tools/default.nix2
-rw-r--r--pkgs/applications/version-management/git-and-tools/fast-export/default.nix4
-rw-r--r--pkgs/applications/version-management/git-and-tools/git-annex/default.nix30
-rw-r--r--pkgs/applications/version-management/git-and-tools/git/default.nix4
-rw-r--r--pkgs/applications/version-management/git-and-tools/git/docbook2texi.patch26
-rw-r--r--pkgs/applications/version-management/git-and-tools/gitflow/default.nix23
-rw-r--r--pkgs/applications/version-management/git-and-tools/github-backup/default.nix11
-rw-r--r--pkgs/applications/version-management/subversion/default.nix4
-rw-r--r--pkgs/applications/video/gpac/default.nix6
-rw-r--r--pkgs/applications/video/miro/default.nix76
-rw-r--r--pkgs/applications/video/miro/gconf.patch374
-rw-r--r--pkgs/applications/video/mplayer/default.nix20
-rw-r--r--pkgs/applications/video/ogmtools/default.nix9
-rw-r--r--pkgs/applications/video/quvi/library.nix2
-rw-r--r--pkgs/applications/video/quvi/scripts.nix2
-rw-r--r--pkgs/applications/video/quvi/tool.nix2
-rw-r--r--pkgs/applications/video/vlc/default.nix4
-rw-r--r--pkgs/applications/video/xbmc/default.nix4
-rw-r--r--pkgs/applications/virtualization/OVMF/default.nix2
-rw-r--r--pkgs/applications/virtualization/virt-manager/default.nix13
-rw-r--r--pkgs/applications/virtualization/virt-viewer/default.nix2
-rw-r--r--pkgs/applications/virtualization/virtinst/default.nix2
-rw-r--r--pkgs/applications/virtualization/virtualbox/default.nix10
-rw-r--r--pkgs/applications/virtualization/virtualbox/guest-additions/default.nix2
-rw-r--r--pkgs/applications/window-managers/compiz/default.nix9
-rw-r--r--pkgs/applications/window-managers/ion-3/default.nix2
-rw-r--r--pkgs/applications/window-managers/stumpwm/default.nix61
-rw-r--r--pkgs/applications/window-managers/wmii31/default.nix2
186 files changed, 4934 insertions, 750 deletions
diff --git a/pkgs/applications/audio/a2jmidid/default.nix b/pkgs/applications/audio/a2jmidid/default.nix
index ca8565ac3238..f6c17e6d8ed5 100644
--- a/pkgs/applications/audio/a2jmidid/default.nix
+++ b/pkgs/applications/audio/a2jmidid/default.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     homepage = http://home.gna.org/a2jmidid;
-    description = "daemon for exposing legacy ALSA sequencer applications in JACK MIDI system";
+    description = "Daemon for exposing legacy ALSA sequencer applications in JACK MIDI system";
     license = licenses.gpl2;
     maintainers = [ maintainers.goibhniu ];
 
diff --git a/pkgs/applications/audio/abcde/default.nix b/pkgs/applications/audio/abcde/default.nix
index c6b5e9da0dd7..031b0fe93b59 100644
--- a/pkgs/applications/audio/abcde/default.nix
+++ b/pkgs/applications/audio/abcde/default.nix
@@ -62,7 +62,7 @@ in
     meta = {
       homepage = "http://lly.org/~rcw/abcde/page/";
       license = "GPLv2+";
-      description = "A Better CD Encoder (ABCDE)";
+      description = "Command-line audio CD ripper";
 
       longDescription = ''
         abcde is a front-end command-line utility (actually, a shell
diff --git a/pkgs/applications/audio/audacious/default.nix b/pkgs/applications/audio/audacious/default.nix
index 9ae2fcdd20ed..f9a8d0752415 100644
--- a/pkgs/applications/audio/audacious/default.nix
+++ b/pkgs/applications/audio/audacious/default.nix
@@ -1,28 +1,28 @@
 { stdenv, fetchurl, pkgconfig, glib, gtk3, libmowgli, libmcs
 , gettext, dbus_glib, libxml2, libmad, xlibs, alsaLib, libogg
-, libvorbis, libcdio, libcddb, flac, ffmpeg
+, libvorbis, libcdio, libcddb, flac, ffmpeg, makeWrapper
 }:
 
 let
-  version = "3.3.4";
+  version = "3.4.1";
 in
 stdenv.mkDerivation {
   name = "audacious-${version}";
 
   src = fetchurl {
     url = "http://distfiles.audacious-media-player.org/audacious-${version}.tar.bz2";
-    sha256 = "19zw4yj8g4fvxkv0ql8v8vgxzldxl1fzig239zzv88mpnvwxn737";
+    sha256 = "0wf99b0nrk90fyak4gpwi076qnsrmv1j8958cvi57rxig21lvvap";
   };
 
   pluginsSrc = fetchurl {
     url = "http://distfiles.audacious-media-player.org/audacious-plugins-${version}.tar.bz2";
-    sha256 = "1l5g0zq73qp1hlrf4xsaj0n3hg0asrp7169531jgpncjn15dhvdn";
+    sha256 = "02ivrxs6109nmmz9pkbf9dkm36s2lyp9vfv59sm0acxxd4db71md";
   };
 
   buildInputs =
     [ gettext pkgconfig glib gtk3 libmowgli libmcs libxml2 dbus_glib
       libmad xlibs.libXcomposite libogg libvorbis flac alsaLib libcdio
-      libcddb ffmpeg
+      libcddb ffmpeg makeWrapper
     ];
 
   # Here we build bouth audacious and audacious-plugins in one
@@ -44,12 +44,21 @@ stdenv.mkDerivation {
         src=$pluginsSrc
         genericBuild
       )
+
+      (
+        source $stdenv/setup
+        # gsettings schemas for file dialogues
+        for file in "$out"/bin/*; do
+          wrapProgram "$file" --prefix XDG_DATA_DIRS : "$XDG_ADD"
+        done
+      )
     '';
+  XDG_ADD = gtk3 + "/share";
 
   enableParallelBuilding = true;
 
   meta = {
-    description = "Audacious, a media player forked from the Beep Media Player, which was itself an XMMS fork";
+    description = "Audio player";
     homepage = http://audacious-media-player.org/;
     maintainers = with stdenv.lib.maintainers; [ eelco simons ];
     platforms = stdenv.lib.platforms.linux;
diff --git a/pkgs/applications/audio/audacity/default.nix b/pkgs/applications/audio/audacity/default.nix
index fa392c4e43c3..4a6797f9010b 100644
--- a/pkgs/applications/audio/audacity/default.nix
+++ b/pkgs/applications/audio/audacity/default.nix
@@ -4,12 +4,12 @@
   }:
 
 stdenv.mkDerivation rec {
-  version = "2.0.3";
+  version = "2.0.4";
   name = "audacity-${version}";
 
   src = fetchurl {
     url = "http://audacity.googlecode.com/files/audacity-minsrc-${version}.tar.xz";
-    sha256 = "1k4bbxhpfl80vm3gm3jxqly0syqjij5kwziy4xyq2c8aj2miwj1f";
+    sha256 = "0pl92filykzs4g2pn7i02kdqgja326wjgafzw2vcgwn3dwrs4avp";
   };
 
   preConfigure = /* we prefer system-wide libs */ ''
diff --git a/pkgs/applications/audio/aumix/default.nix b/pkgs/applications/audio/aumix/default.nix
index d69d9d471336..1e19a3ac5c39 100644
--- a/pkgs/applications/audio/aumix/default.nix
+++ b/pkgs/applications/audio/aumix/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
     ++ (if gtkGUI then [pkgconfig gtk] else []);
 
   meta = {
-    description = "Aumix, an audio mixer for X and the console";
+    description = "Audio mixer for X and the console";
     longDescription = ''
       Aumix adjusts an audio mixer from X, the console, a terminal,
       the command line or a script.
diff --git a/pkgs/applications/audio/google-musicmanager/default.nix b/pkgs/applications/audio/google-musicmanager/default.nix
new file mode 100644
index 000000000000..8cff94c25d93
--- /dev/null
+++ b/pkgs/applications/audio/google-musicmanager/default.nix
@@ -0,0 +1,57 @@
+{ stdenv, fetchurl, readline, patchelf, ncurses, qt48, libidn, expat, flac
+, libvorbis }:
+
+assert stdenv.system == "x86_64-linux" || stdenv.system == "1686-linux";
+
+stdenv.mkDerivation rec {
+  debversion = "beta_1.0.84.1107-r0";
+  version = "1.0.84.1107-beta-r0"; # friendly to nix-env version sorting algo
+  product = "google-musicmanager";
+  name    = "${product}-${version}";
+
+  # When looking for newer versions, since google doesn't let you list their repo dirs,
+  # curl http://dl.google.com/linux/musicmanager/deb/dists/stable/Release
+  # fetch an appropriate packages file eg main/binary-amd64/Packages
+  # which will contain the links to all available *.debs for the arch.
+
+  src = if stdenv.system == "x86_64-linux"
+    then fetchurl {
+      url    = "http://dl.google.com/linux/musicmanager/deb/pool/main/g/${product}-beta/${product}-${debversion}_amd64.deb";
+      sha256 = "0irlrspw508b1s9i5d1mddpp2x9w1ny3svf27gxf8pmwbiyd1cyi";
+    }
+    else fetchurl {
+       url    = "http://dl.google.com/linux/musicmanager/deb/pool/main/g/${product}-beta/${product}-${debversion}_i386.deb";
+       sha256 = "13pfsjvaygap6axrlbfhyk1h8377xmwi47x4af6j57qq6z7329rg";
+    };
+
+  unpackPhase = ''
+    ar vx ${src}
+    tar -xvf data.tar.lzma
+  '';
+
+  buildInputs = [ patchelf ];
+
+  buildPhase = ''
+    patchelf \
+      --set-interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
+      --set-rpath "$out/opt/google/musicmanager:${readline}/lib:${ncurses}/lib:${stdenv.gcc.libc}/lib:${qt48}/lib:${stdenv.gcc.gcc}/lib:${libidn}/lib:${expat}/lib:${flac}/lib:${libvorbis}/lib" opt/google/musicmanager/MusicManager
+  '';
+
+  dontPatchELF = true;
+  dontStrip    = true;
+
+  installPhase = ''
+    mkdir -p "$out"
+    cp -r opt "$out"
+    mkdir "$out/bin"
+    ln -s "$out/opt/google/musicmanager/google-musicmanager" "$out/bin"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Uploads music from your computer to Google Play";
+    homepage    = "https://support.google.com/googleplay/answer/1229970";
+    license     = licenses.unfree;
+    maintainers = with maintainers; [ lovek323 ];
+    platforms   = platforms.linux;
+  };
+}
diff --git a/pkgs/applications/audio/mixxx/default.nix b/pkgs/applications/audio/mixxx/default.nix
new file mode 100644
index 000000000000..b76eecc9e4ad
--- /dev/null
+++ b/pkgs/applications/audio/mixxx/default.nix
@@ -0,0 +1,51 @@
+{ stdenv, fetchurl, scons, pkgconfig, qt4, portaudio, portmidi, libusb1
+, libmad, protobuf, libvorbis, taglib, libid3tag, flac, libsndfile, libshout
+, fftw, vampSDK
+}:
+
+stdenv.mkDerivation rec {
+  name = "mixxx-${version}";
+  version = "1.11.0";
+
+  src = fetchurl {
+    url = "http://downloads.mixxx.org/${name}/${name}-src.tar.gz";
+    sha256 = "0c833gf4169xvpfn7car9vzvwfwl9d3xwmbfsy36cv8ydifip5h0";
+  };
+
+  buildInputs = [
+    scons pkgconfig qt4 portaudio portmidi libusb1 libmad protobuf libvorbis
+    taglib libid3tag flac libsndfile libshout fftw vampSDK
+  ];
+
+  sconsFlags = [
+    "build=release"
+    "qtdir=${qt4}"
+  ];
+
+  postPatch = ''
+    sed -i -e 's/"which /"type -P /' build/depends.py
+  '';
+
+  buildPhase = ''
+    runHook preBuild
+    ensureDir "$out"
+    scons \
+      -j$NIX_BUILD_CORES -l$NIX_BUILD_CORES \
+      $sconsFlags "prefix=$out"
+    runHook postBuild
+  '';
+
+  installPhase = ''
+    runHook preInstall
+    scons $sconsFlags "prefix=$out" install
+    runHook postInstall
+  '';
+
+  meta = {
+    homepage = "http://mixxx.org/";
+    description = "Digital DJ mixing software";
+    license = stdenv.lib.licenses.gpl2Plus;
+    maintainers = [ stdenv.lib.maintainers.aszlig ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/applications/audio/mopidy/default.nix b/pkgs/applications/audio/mopidy/default.nix
index e31798a101b9..611d9f4226dd 100644
--- a/pkgs/applications/audio/mopidy/default.nix
+++ b/pkgs/applications/audio/mopidy/default.nix
@@ -5,11 +5,11 @@
 pythonPackages.buildPythonPackage rec {
   name = "mopidy-${version}";
 
-  version = "0.14.2";
+  version = "0.15.0";
 
   src = fetchurl {
     url = "https://github.com/mopidy/mopidy/archive/v${version}.tar.gz";
-    sha256 = "0fqx7lk9g61d744b951cwx0szqbyji58dhw2ravnq9785nkhi7i4";
+    sha256 = "1fpnddcx6343wgxzh10s035w21g8jmfh2kzgx32w0xsshpra3gn1";
   };
 
   propagatedBuildInputs = with pythonPackages; [
@@ -39,5 +39,6 @@ pythonPackages.buildPythonPackage rec {
       local hard drive.
     '';
     maintainers = [ stdenv.lib.maintainers.rickynils ];
+    platforms = [];
   };
 }
diff --git a/pkgs/applications/audio/mopidy/git.nix b/pkgs/applications/audio/mopidy/git.nix
deleted file mode 100644
index 2b5e1627ac63..000000000000
--- a/pkgs/applications/audio/mopidy/git.nix
+++ /dev/null
@@ -1,44 +0,0 @@
-{ stdenv, fetchgit, pythonPackages, pygobject, gst_python
-, gst_plugins_good, gst_plugins_base
-}:
-
-pythonPackages.buildPythonPackage rec {
-  name = "mopidy-${version}";
-
-  version = "git-20130226";
-
-  src = fetchgit {
-    url = "https://github.com/mopidy/mopidy.git";
-    rev = "86a7c2d7519680c6b9130795d35c4654958f4c04";
-    sha256 = "00fxcfkpl19nslv4f4bspzw0kvjjp6hhcwag7rknmb8scfinqfac";
-  };
-
-  propagatedBuildInputs = with pythonPackages; [
-   gst_python pygobject pykka pyspotify pylast cherrypy ws4py
-  ];
-
-  # python zip complains about old timestamps
-  preConfigure = ''
-    find -print0 | xargs -0 touch
-  '';
-
-  # There are no tests
-  doCheck = false;
-
-  postInstall = ''
-    for p in $out/bin/mopidy $out/bin/mopidy-scan; do
-      wrapProgram $p \
-        --prefix GST_PLUGIN_PATH : ${gst_plugins_good}/lib/gstreamer-0.10 \
-        --prefix GST_PLUGIN_PATH : ${gst_plugins_base}/lib/gstreamer-0.10
-    done
-  '';
-
-  meta = {
-    homepage = http://www.mopidy.com/;
-    description = ''
-      A music server which can play music from Spotify and from your
-      local hard drive.
-    '';
-    maintainers = [ stdenv.lib.maintainers.rickynils ];
-  };
-}
diff --git a/pkgs/applications/audio/mpc/default.nix b/pkgs/applications/audio/mpc/default.nix
new file mode 100755
index 000000000000..bd21550a64cf
--- /dev/null
+++ b/pkgs/applications/audio/mpc/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchurl, mpd_clientlib }:
+
+stdenv.mkDerivation rec {
+  version = "0.23";
+  name = "mpc-${version}";
+
+  src = fetchurl {
+    url = "http://www.musicpd.org/download/mpc/0/${name}.tar.bz2";
+    sha256 = "1ir96wfgq5qfdd2s06zfycv38g3bhn3bpndwx9hwf1w507rvifi9";
+  };
+	
+  buildInputs = [ mpd_clientlib ]; 
+  
+  preConfigure =
+    ''
+      export LIBMPDCLIENT_LIBS=${mpd_clientlib}/lib/libmpdclient.so.${mpd_clientlib.majorVersion}.0.${mpd_clientlib.minorVersion}
+      export LIBMPDCLIENT_CFLAGS=${mpd_clientlib}
+    '';
+
+  meta = {
+    description = "A minimalist command line interface to MPD";
+    homepage = http://www.musicpd.org/clients/mpc/;
+    license = "GPL2";
+    maintainers = [ stdenv.lib.maintainers.algorith ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
\ No newline at end of file
diff --git a/pkgs/applications/audio/quodlibet/default.nix b/pkgs/applications/audio/quodlibet/default.nix
index d9554d5f7249..9f4859d6e070 100644
--- a/pkgs/applications/audio/quodlibet/default.nix
+++ b/pkgs/applications/audio/quodlibet/default.nix
@@ -46,7 +46,7 @@ buildPythonPackage {
   '';
 
   meta = {
-    description = "Quod Libet is a GTK+-based audio player written in Python, using the Mutagen tagging library.";
+    description = "GTK+-based audio player written in Python, using the Mutagen tagging library";
 
     longDescription = ''
       Quod Libet is a GTK+-based audio player written in Python, using
diff --git a/pkgs/applications/audio/rubyripper/default.nix b/pkgs/applications/audio/rubyripper/default.nix
new file mode 100644
index 000000000000..36f1fc8312fb
--- /dev/null
+++ b/pkgs/applications/audio/rubyripper/default.nix
@@ -0,0 +1,16 @@
+{ stdenv, fetchurl, ruby, cdparanoia, makeWrapper }:
+stdenv.mkDerivation rec {
+  version = "0.6.2";
+  name = "rubyripper-${version}";
+  src = fetchurl {
+    url = "https://rubyripper.googlecode.com/files/rubyripper-${version}.tar.bz2";
+    sha256 = "1fwyk3y0f45l2vi3a481qd7drsy82ccqdb8g2flakv58m45q0yl1";
+  };
+  configureFlags = [ "--enable-cli" ];
+  buildInputs = [ ruby cdparanoia makeWrapper ];
+  postInstall = ''
+    wrapProgram "$out/bin/rrip_cli" \
+      --prefix PATH : "${ruby}/bin" \
+      --prefix PATH : "${cdparanoia}/bin"
+  '';
+}
diff --git a/pkgs/applications/audio/snd/default.nix b/pkgs/applications/audio/snd/default.nix
index fe32aca029bc..a49bfd9cccf4 100644
--- a/pkgs/applications/audio/snd/default.nix
+++ b/pkgs/applications/audio/snd/default.nix
@@ -51,7 +51,7 @@ rec {
 
   name = "snd-" + version;
   meta = {
-    description = "Snd sound editor.";
+    description = "Sound editor";
     homepage = http://ccrma.stanford.edu/software/snd;
     inherit src;
   };
diff --git a/pkgs/applications/audio/spotify/default.nix b/pkgs/applications/audio/spotify/default.nix
index f4d264c0d8f8..615ee6a93cc9 100644
--- a/pkgs/applications/audio/spotify/default.nix
+++ b/pkgs/applications/audio/spotify/default.nix
@@ -1,9 +1,11 @@
-{ fetchurl, stdenv, dpkg, xlibs, qt4, alsaLib, makeWrapper, openssl, freetype, glib, pango, cairo, atk, gdk_pixbuf, gtk, cups, nspr, nss, libpng, GConf, libgcrypt, chromium, sqlite, gst_plugins_base, gstreamer }:
+{ fetchurl, stdenv, dpkg, xlibs, qt4, alsaLib, makeWrapper, openssl, freetype
+, glib, pango, cairo, atk, gdk_pixbuf, gtk, cups, nspr, nss, libpng, GConf
+, libgcrypt, chromium, sqlite, gst_plugins_base, gstreamer, udev }:
 
 assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
 
 let
-  version = "0.9.1.55";
+  version = "0.9.4.183";
   qt4webkit =
     if stdenv.system == "i686-linux" then
       fetchurl {
@@ -25,13 +27,13 @@ stdenv.mkDerivation {
   src =
     if stdenv.system == "i686-linux" then
       fetchurl {
-        url = "http://repository.spotify.com/pool/non-free/s/spotify/spotify-client_${version}.gbdd3b79.203-1_i386.deb";
-        sha256 = "1sls4gb85700126bbk4sz73ipa2rjcinmpnsi78q0bsdj365y2wc";
+        url = "http://repository.spotify.com/pool/non-free/s/spotify/spotify-client_${version}.g644e24e.428-1_i386.deb";
+        sha256 = "1wl6v5x8vm74h5lxp8fhvmih8l122aadsf1qxvpk0k3y6mbx0ifa";
       }
     else if stdenv.system == "x86_64-linux" then
       fetchurl {
-        url = "http://repository.spotify.com/pool/non-free/s/spotify/spotify-client_${version}.gbdd3b79.203-1_amd64.deb";
-        sha256 = "10pzj3p8bjbxh9nnm4qc5s1hn9nh7hgh3vbwm0xblj9rn71wl03y";
+        url = "http://repository.spotify.com/pool/non-free/s/spotify/spotify-client_${version}.g644e24e.428-1_amd64.deb";
+        sha256 = "1yniln6iswrrrny01qr2w5zcvam0vnrvy9mwbnk9i14i2ch0f3fx";
       }
     else throw "Spotify not supported on this platform.";
 
@@ -57,12 +59,15 @@ stdenv.mkDerivation {
       ln -s ${nspr}/lib/libnspr4.so $out/lib/libnspr4.so.0d
       ln -s ${nspr}/lib/libplc4.so $out/lib/libplc4.so.0d
 
+      # Work around Spotify trying to open libudev.so.0 (which we don't have)
+      ln -s ${udev}/lib/libudev.so.1 $out/lib/libudev.so.0
+
       mkdir -p $out/bin
 
       ln -s $out/spotify-client/spotify $out/bin/spotify
       patchelf \
         --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
-        --set-rpath $out/lib:$out/spotify-client:${stdenv.lib.makeLibraryPath [ xlibs.libXScrnSaver xlibs.libX11 qt4 alsaLib stdenv.gcc.gcc freetype glib pango cairo atk gdk_pixbuf gtk GConf cups sqlite]}:${stdenv.gcc.gcc}/lib64 \
+        --set-rpath $out/spotify-client/Data:$out/lib:$out/spotify-client:${stdenv.lib.makeLibraryPath [ xlibs.libXScrnSaver xlibs.libX11 qt4 alsaLib stdenv.gcc.gcc freetype glib pango cairo atk gdk_pixbuf gtk GConf cups sqlite]}:${stdenv.gcc.gcc}/lib64 \
         $out/spotify-client/spotify
 
       dpkg-deb -x ${qt4webkit} ./
@@ -74,23 +79,20 @@ stdenv.mkDerivation {
       gcc -shared ${./preload.c} -o $preload -ldl -DOUT=\"$out\" -fPIC
 
       wrapProgram $out/bin/spotify --set LD_PRELOAD $preload --prefix LD_LIBRARY_PATH : "${stdenv.lib.makeLibraryPath [ GConf libpng cups libgcrypt sqlite gst_plugins_base gstreamer]}:$out/lib"
+
+      # Desktop file
+      mkdir -p "$out/share/applications/"
+      cp "$out/spotify-client/spotify.desktop" "$out/share/applications/"
+      sed -i "s|Icon=.*|Icon=$out/spotify-client/Icons/spotify-linux-512.png|" "$out/share/applications/spotify.desktop"
     ''; # */
 
   dontStrip = true;
   dontPatchELF = true;
 
   meta = {
-    homepage = https://www.spotify.com/download/previews/;
+    homepage = https://www.spotify.com/;
     description = "Spotify for Linux allows you to play music from the Spotify music service";
     license = "unfree";
     maintainers = [ stdenv.lib.maintainers.eelco ];
-
-    longDescription =
-      ''
-        Spotify is a digital music streaming service.  This package
-        provides the Spotify client for Linux.  At present, it does not
-        work with free Spotify accounts; it requires a Premium or
-        Unlimited account.
-      '';
   };
 }
diff --git a/pkgs/applications/display-managers/slim/default.nix b/pkgs/applications/display-managers/slim/default.nix
index 9d5c728de262..0b5bcccfb21a 100644
--- a/pkgs/applications/display-managers/slim/default.nix
+++ b/pkgs/applications/display-managers/slim/default.nix
@@ -1,29 +1,37 @@
-{ stdenv, fetchurl, cmake, pkgconfig, x11, libjpeg, libpng, libXmu
+{ stdenv, fetchurl, cmake, pkgconfig, xorg, libjpeg, libpng
 , fontconfig, freetype, pam, dbus_libs }:
 
 stdenv.mkDerivation rec {
-  name = "slim-1.3.4";
+  name = "slim-1.3.6";
 
   src = fetchurl {
     url = "http://download.berlios.de/slim/${name}.tar.gz";
-    sha256 = "00fmrg2v41jnqhx0yc1kv97xxh5gai18n0i4as9g1fcq1i32cp0m";
+    sha256 = "1pqhk22jb4aja4hkrm7rjgbgzjyh7i4zswdgf5nw862l2znzxpi1";
   };
 
-  patches = [
-    # Allow the paths of the configuration file and theme directory to
-    # be set at runtime.
-    ./runtime-paths.patch
-  ];
+  patches =
+    [ # Allow the paths of the configuration file and theme directory to
+      # be set at runtime.
+      ./runtime-paths.patch
 
-  buildInputs =
-    [ cmake pkgconfig x11 libjpeg libpng libXmu fontconfig freetype
-      pam dbus_libs
+      # Exit after the user's session has finished.  This works around
+      # slim's broken PAM session handling (see
+      # http://developer.berlios.de/bugs/?func=detailbug&bug_id=19102&group_id=2663).
+      ./run-once.patch
     ];
 
-  preConfigure = "substituteInPlace CMakeLists.txt --replace /etc $out/etc";
+  preConfigure = "substituteInPlace CMakeLists.txt --replace /etc $out/etc --replace /lib $out/lib";
 
   cmakeFlags = [ "-DUSE_PAM=1" ];
 
+  enableParallelBuilding = true;
+
+  buildInputs =
+    [ cmake pkgconfig libjpeg libpng fontconfig freetype
+      pam dbus_libs
+      xorg.libX11 xorg.libXext xorg.libXrandr xorg.libXrender xorg.libXmu xorg.libXft
+    ];
+
   NIX_CFLAGS_LINK = "-lXmu";
 
   meta = {
diff --git a/pkgs/applications/display-managers/slim/run-once.patch b/pkgs/applications/display-managers/slim/run-once.patch
new file mode 100644
index 000000000000..78f1454a883e
--- /dev/null
+++ b/pkgs/applications/display-managers/slim/run-once.patch
@@ -0,0 +1,12 @@
+diff -ru -x '*~' slim-1.3.6-orig/app.cpp slim-1.3.6/app.cpp
+--- slim-1.3.6-orig/app.cpp	2013-10-15 11:02:55.629263422 +0200
++++ slim-1.3.6/app.cpp	2013-10-15 13:00:10.141210784 +0200
+@@ -816,7 +822,7 @@
+ 	StopServer();
+ 	RemoveLock();
+ 	while (waitpid(-1, NULL, WNOHANG) > 0); /* Collects all dead childrens */
+-	Run();
++	exit(OK_EXIT);
+ }
+ 
+ void App::KillAllClients(Bool top) {
diff --git a/pkgs/applications/display-managers/slim/runtime-paths.patch b/pkgs/applications/display-managers/slim/runtime-paths.patch
index b59b32f31114..f6811dbe6682 100644
--- a/pkgs/applications/display-managers/slim/runtime-paths.patch
+++ b/pkgs/applications/display-managers/slim/runtime-paths.patch
@@ -1,41 +1,25 @@
-diff -rc slim-1.2.6-orig/app.cpp slim-1.2.6/app.cpp
-*** slim-1.2.6-orig/app.cpp	Fri Sep 15 23:00:37 2006
---- slim-1.2.6/app.cpp	Sun Feb 25 17:30:50 2007
-***************
-*** 113,119 ****
-  
-      // Read configuration and theme
-      cfg = new Cfg;
-!     cfg->readConf(CFGFILE);
-      string themebase = "";
-      string themefile = "";
-      string themedir = "";
---- 113,121 ----
-  
-      // Read configuration and theme
-      cfg = new Cfg;
-!     char *cfgfile = getenv("SLIM_CFGFILE");
-!     if (!cfgfile) cfgfile = CFGFILE;
-!     cfg->readConf(cfgfile);
-      string themebase = "";
-      string themefile = "";
-      string themedir = "";
-***************
-*** 121,127 ****
-      if (testing) {
-          themeName = testtheme;
-      } else {
-!         themebase = string(THEMESDIR) + "/";
-          themeName = cfg->getOption("current_theme");
-          string::size_type pos;
-          if ((pos = themeName.find(",")) != string::npos) {
---- 123,131 ----
-      if (testing) {
-          themeName = testtheme;
-      } else {
-!         char *themesdir = getenv("SLIM_THEMESDIR");
-!         if (!themesdir) themesdir = THEMESDIR;
-!         themebase = string(themesdir) + "/";
-          themeName = cfg->getOption("current_theme");
-          string::size_type pos;
-          if ((pos = themeName.find(",")) != string::npos) {
+diff -ru -x '*~' slim-1.3.6-orig/app.cpp slim-1.3.6/app.cpp
+--- slim-1.3.6-orig/app.cpp	2013-10-02 00:38:05.000000000 +0200
++++ slim-1.3.6/app.cpp	2013-10-15 11:02:55.629263422 +0200
+@@ -200,7 +200,9 @@
+ 
+ 	/* Read configuration and theme */
+ 	cfg = new Cfg;
+-	cfg->readConf(CFGFILE);
++	char *cfgfile = getenv("SLIM_CFGFILE");
++	if (!cfgfile) cfgfile = CFGFILE;
++	cfg->readConf(cfgfile);
+ 	string themebase = "";
+ 	string themefile = "";
+ 	string themedir = "";
+@@ -208,7 +210,9 @@
+ 	if (testing) {
+ 		themeName = testtheme;
+ 	} else {
+-		themebase = string(THEMESDIR) + "/";
++		char *themesdir = getenv("SLIM_THEMESDIR");
++		if (!themesdir) themesdir = THEMESDIR;
++		themebase = string(themesdir) + "/";
+ 		themeName = cfg->getOption("current_theme");
+ 		string::size_type pos;
+ 		if ((pos = themeName.find(",")) != string::npos) {
diff --git a/pkgs/applications/editors/aseprite/default.nix b/pkgs/applications/editors/aseprite/default.nix
new file mode 100644
index 000000000000..43180bd04e31
--- /dev/null
+++ b/pkgs/applications/editors/aseprite/default.nix
@@ -0,0 +1,48 @@
+{ stdenv, fetchurl, cmake, pkgconfig
+, giflib, libjpeg, zlib, libpng, tinyxml, allegro
+, libX11, libXext, libXcursor, libXpm, libXxf86vm, libXxf86dga
+}:
+
+stdenv.mkDerivation rec {
+  name = "aseprite-0.9.5";
+
+  src = fetchurl {
+    url = "http://aseprite.googlecode.com/files/${name}.tar.xz";
+    sha256 = "0m7i6ybj2bym4w9rybacnnaaq2jjn76vlpbp932xcclakl6kdq41";
+  };
+
+  buildInputs = [
+    cmake pkgconfig
+    giflib libjpeg zlib libpng tinyxml allegro
+    libX11 libXext libXcursor libXpm libXxf86vm libXxf86dga
+  ];
+
+  patchPhase = ''
+    sed -i '/^find_unittests/d' src/CMakeLists.txt
+    sed -i '/include_directories(.*third_party\/gtest.*)/d' src/CMakeLists.txt
+    sed -i '/add_subdirectory(gtest)/d' third_party/CMakeLists.txt
+    sed -i 's/png_\(sizeof\)/\1/g' src/file/png_format.cpp
+  '';
+
+  cmakeFlags = ''
+    -DUSE_SHARED_GIFLIB=ON
+    -DUSE_SHARED_JPEGLIB=ON
+    -DUSE_SHARED_ZLIB=ON
+    -DUSE_SHARED_LIBPNG=ON
+    -DUSE_SHARED_LIBLOADPNG=ON
+    -DUSE_SHARED_TINYXML=ON
+    -DUSE_SHARED_GTEST=ON
+    -DUSE_SHARED_ALLEGRO4=ON
+    -DENABLE_UPDATER=OFF
+  '';
+
+  NIX_LDFLAGS = "-lX11";
+
+  meta = {
+    description = "Animated sprite editor & pixel art tool";
+    homepage = "http://www.aseprite.org/";
+    license = stdenv.lib.licenses.gpl2Plus;
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = with stdenv.lib.maintainers; [iyzsong];
+  };
+}
diff --git a/pkgs/applications/editors/eclipse/default.nix b/pkgs/applications/editors/eclipse/default.nix
index 21dad42ea46d..fe3c74249072 100644
--- a/pkgs/applications/editors/eclipse/default.nix
+++ b/pkgs/applications/editors/eclipse/default.nix
@@ -32,8 +32,9 @@ let
 
         # Patch binaries.
         interpreter=$(echo ${stdenv.glibc}/lib/ld-linux*.so.2)
+        libCairo=$out/eclipse/libcairo-swt.so
         patchelf --set-interpreter $interpreter $out/eclipse/eclipse
-        patchelf --set-rpath ${freetype}/lib:${fontconfig}/lib:${libX11}/lib:${libXrender}/lib:${zlib}/lib $out/eclipse/libcairo-swt.so
+        [ -f $libCairo ] && patchelf --set-rpath ${freetype}/lib:${fontconfig}/lib:${libX11}/lib:${libXrender}/lib:${zlib}/lib $libCairo
 
         # Create wrapper script.  Pass -configuration to store
         # settings in ~/.eclipse/org.eclipse.platform_<version> rather
@@ -205,4 +206,20 @@ in {
         };
     };
   };
+
+  eclipse_sdk_431 = buildEclipse {
+    name = "eclipse-sdk-4.3.1";
+    description = "Eclipse Classic";
+    sources = {
+      "x86_64-linux" = fetchurl {
+          url = http://download.eclipse.org/eclipse/downloads/drops4/R-4.3.1-201309111000/eclipse-SDK-4.3.1-linux-gtk-x86_64.tar.gz;
+          sha256 = "0ncm56ylwxw9z8rk8ccgva68c2yr9yrf1kcr1zkgw6p87xh1yczd";
+        };
+      "i686-linux" = fetchurl {
+          url = http://download.eclipse.org/eclipse/downloads/drops4/R-4.3.1-201309111000/eclipse-SDK-4.3.1-linux-gtk.tar.gz;
+          sha256 = "1zxsh838khny7mvl01h28xna6xdh01yi4mvls28zj22v0340lgsg";
+        };
+    };
+  };
+
 }
diff --git a/pkgs/applications/editors/emacs-24/default.nix b/pkgs/applications/editors/emacs-24/default.nix
index bdb7c2a565a7..18e263dae67e 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
 , pkgconfig, gtk, libXft, dbus, libpng, libjpeg, libungif
 , libtiff, librsvg, texinfo, gconf, libxml2, imagemagick, gnutls
-, alsaLib
+, alsaLib, cairo
 , withX ? true
 }:
 
@@ -14,41 +14,52 @@ stdenv.mkDerivation rec {
   builder = ./builder.sh;
 
   src = fetchurl {
-    url = "mirror://gnu/emacs/${name}.tar.xz";
+    url    = "mirror://gnu/emacs/${name}.tar.xz";
     sha256 = "1385qzs3bsa52s5rcncbrkxlydkw0ajzrvfxgv8rws5fx512kakh";
   };
 
   buildInputs =
     [ ncurses gconf libxml2 gnutls alsaLib pkgconfig texinfo ]
     ++ stdenv.lib.optional stdenv.isLinux dbus
-    ++ stdenv.lib.optionals withX [
-         x11 libXaw Xaw3d libXpm libpng libjpeg libungif
-         libtiff librsvg libXft imagemagick gtk
-       ];
+    ++ stdenv.lib.optionals withX
+      [ x11 libXaw Xaw3d libXpm libpng libjpeg libungif libtiff librsvg libXft
+        imagemagick gtk ]
+    ++ stdenv.lib.optional stdenv.isDarwin cairo;
 
   configureFlags =
-    (if withX then 
-      [ "--with-x-toolkit=gtk" "--with-xft"]
-    else
-      [ "--with-x=no --with-xpm=no --with-jpeg=no --with-png=no --with-gif=no --with-tiff=no" ])
+    ( if withX then 
+        [ "--with-x-toolkit=gtk" "--with-xft"]
+      else
+        [ "--with-x=no" "--with-xpm=no" "--with-jpeg=no" "--with-png=no"
+          "--with-gif=no" "--with-tiff=no" ] )
     # On NixOS, help Emacs find `crt*.o'.
     ++ stdenv.lib.optional (stdenv ? glibc)
          [ "--with-crt-dir=${stdenv.glibc}/lib" ];
 
+  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (stdenv.isDarwin && withX)
+    "-I${cairo}/include/cairo";
+
   postInstall = ''
     cat >$out/share/emacs/site-lisp/site-start.el <<EOF
-;; nixos specific load-path
-(when (getenv "NIX_PROFILES") (setq load-path
-                      (append (reverse (mapcar (lambda (x) (concat x "/share/emacs/site-lisp/"))
-                                               (split-string (getenv "NIX_PROFILES"))))
-                       load-path)))
-EOF
+    ;; nixos specific load-path
+    (when (getenv "NIX_PROFILES") (setq load-path
+                          (append (reverse (mapcar (lambda (x) (concat x "/share/emacs/site-lisp/"))
+                                                   (split-string (getenv "NIX_PROFILES"))))
+                           load-path)))
+        
+    ;; make tramp work for NixOS machines
+    (eval-after-load 'tramp '(add-to-list 'tramp-remote-path "/run/current-system/sw/bin"))
+    EOF
   '';
 
   doCheck = true;
 
   meta = with stdenv.lib; {
     description = "GNU Emacs 24, the extensible, customizable text editor";
+    homepage    = http://www.gnu.org/software/emacs/;
+    license     = licenses.gpl3Plus;
+    maintainers = with maintainers; [ chaoflow lovek323 simons the-kenny ];
+    platforms   = platforms.all;
 
     longDescription = ''
       GNU Emacs is an extensible, customizable text editor—and more.  At its
@@ -66,11 +77,5 @@ EOF
       extensions are distributed with GNU Emacs; others are available
       separately.
     '';
-
-    homepage = "http://www.gnu.org/software/emacs/";
-    license = "GPLv3+";
-
-    maintainers = with maintainers; [ chaoflow lovek323 simons the-kenny ];
-    platforms = platforms.all;
   };
 }
diff --git a/pkgs/applications/editors/emacs-modes/coffee/default.nix b/pkgs/applications/editors/emacs-modes/coffee/default.nix
index c40b3d4cd650..a0ba61431655 100644
--- a/pkgs/applications/editors/emacs-modes/coffee/default.nix
+++ b/pkgs/applications/editors/emacs-modes/coffee/default.nix
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
   '';
 
   meta = {
-    description = "An Emacs major mode for CoffeeScript, unfancy JavaScript.";
+    description = "Emacs major mode for CoffeeScript, unfancy JavaScript";
     homepage = https://github.com/defunkt/coffee-mode;
     license = "GPLv2+";
 
diff --git a/pkgs/applications/editors/emacs-modes/color-theme/default.nix b/pkgs/applications/editors/emacs-modes/color-theme/default.nix
index 327e11bf0862..bad277d61ce3 100644
--- a/pkgs/applications/editors/emacs-modes/color-theme/default.nix
+++ b/pkgs/applications/editors/emacs-modes/color-theme/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
   installTargets = "install-bin";
 
   meta = {
-    description = "An emacs-lisp mode for skinning your emacs.";
+    description = "Emacs-lisp mode for skinning your Emacs";
     homepage = http://www.nongnu.org/color-theme;
     license = "GPLv2+";
 
diff --git a/pkgs/applications/editors/emacs-modes/flymake-cursor/default.nix b/pkgs/applications/editors/emacs-modes/flymake-cursor/default.nix
index 0a26e8fd43df..4b2692a5e22a 100644
--- a/pkgs/applications/editors/emacs-modes/flymake-cursor/default.nix
+++ b/pkgs/applications/editors/emacs-modes/flymake-cursor/default.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
   '';
 
   meta = {
-    description = "Displays flymake error msg in minibuffer after delay.";
+    description = "Displays flymake error msg in minibuffer after delay";
     homepage = http://www.emacswiki.org/emacs/flymake-cursor.el;
     license = stdenv.lib.licenses.publicDomain;
 
diff --git a/pkgs/applications/editors/emacs-modes/htmlize/default.nix b/pkgs/applications/editors/emacs-modes/htmlize/default.nix
index d4c428e5a1e5..96cc4e040c4f 100644
--- a/pkgs/applications/editors/emacs-modes/htmlize/default.nix
+++ b/pkgs/applications/editors/emacs-modes/htmlize/default.nix
@@ -11,6 +11,6 @@ stdenv.mkDerivation {
   };
 
   meta = {
-    description = "Convert buffer text and decorations to HTML.";
+    description = "Convert buffer text and decorations to HTML";
   };
 }
diff --git a/pkgs/applications/editors/emacs-modes/jade/default.nix b/pkgs/applications/editors/emacs-modes/jade/default.nix
index 0c99ceaca22b..ab0e3512ef28 100644
--- a/pkgs/applications/editors/emacs-modes/jade/default.nix
+++ b/pkgs/applications/editors/emacs-modes/jade/default.nix
@@ -21,7 +21,7 @@ stdenv.mkDerivation {
   '';
 
   meta = {
-    description = "Emacs major mode for jade and stylus.";
+    description = "Emacs major mode for jade and stylus";
     homepage = https://github.com/brianc/jade-mode;
     license = "GPLv2+";
 
diff --git a/pkgs/applications/editors/emacs-modes/lorem-ipsum/default.nix b/pkgs/applications/editors/emacs-modes/lorem-ipsum/default.nix
index 94427537003b..72086e54fece 100644
--- a/pkgs/applications/editors/emacs-modes/lorem-ipsum/default.nix
+++ b/pkgs/applications/editors/emacs-modes/lorem-ipsum/default.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
   '';
 
   meta = {
-    description = "Insert dummy pseudo Latin text for emacs.";
+    description = "Insert dummy pseudo Latin text for Emacs";
     homepage = http://www.emacswiki.org/emacs/LoremIpsum;
     license = "GPLv2+";
 
diff --git a/pkgs/applications/editors/emacs-modes/org/default.nix b/pkgs/applications/editors/emacs-modes/org/default.nix
index 51263a6aa0e2..ad2bd2f0ba6a 100644
--- a/pkgs/applications/editors/emacs-modes/org/default.nix
+++ b/pkgs/applications/editors/emacs-modes/org/default.nix
@@ -1,11 +1,11 @@
 { fetchurl, stdenv, emacs, texinfo, which, texLive }:
 
 stdenv.mkDerivation rec {
-  name = "org-7.9.1";
+  name = "org-8.2.1";
 
   src = fetchurl {
     url = "http://orgmode.org/${name}.tar.gz";
-    sha256 = "0kz1dnzfpmmslwal150z9rxrnddjpaw2glx26qihpxzs0zzpw201";
+    sha256 = "625e2b6786158bcf6c43194075f7638ab8048c68a60025289a051c407e467823";
   };
 
   buildInputs = [ emacs ];
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   configurePhase =
     '' sed -i mk/default.mk \
-           -e "s|^prefix\t=.*$|prefix=$out|g"
+           -e "s|^prefix\t=.*$|prefix=$out/share|g"
     '';
 
   postBuild =
diff --git a/pkgs/applications/editors/emacs-modes/org2blog/default.nix b/pkgs/applications/editors/emacs-modes/org2blog/default.nix
index c8c538c5cb7c..e72560be8f44 100644
--- a/pkgs/applications/editors/emacs-modes/org2blog/default.nix
+++ b/pkgs/applications/editors/emacs-modes/org2blog/default.nix
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
   '';
 
   meta = {
-    description = "A tool to publish directly from Emacs’ org-mode to WordPress blogs.";
+    description = "Publish directly from Emacs’ org-mode to WordPress blogs";
     homepage = https://github.com/punchagan/org2blog;
     license = "GPLv3+";
 
diff --git a/pkgs/applications/editors/emacs-modes/rect-mark/default.nix b/pkgs/applications/editors/emacs-modes/rect-mark/default.nix
index ac01e02b4334..896dbdac71be 100644
--- a/pkgs/applications/editors/emacs-modes/rect-mark/default.nix
+++ b/pkgs/applications/editors/emacs-modes/rect-mark/default.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
   '';
 
   meta = {
-    description = "Mark a rectangle of text with highlighting.";
+    description = "Mark a rectangle of text with highlighting";
     homepage = http://emacswiki.org/emacs/RectangleMark;
     license = "GPLv2+";
 
diff --git a/pkgs/applications/editors/emacs-modes/sunrise-commander/default.nix b/pkgs/applications/editors/emacs-modes/sunrise-commander/default.nix
index a253e25cad45..e942189714ea 100644
--- a/pkgs/applications/editors/emacs-modes/sunrise-commander/default.nix
+++ b/pkgs/applications/editors/emacs-modes/sunrise-commander/default.nix
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
   '';
 
   meta = {
-    description = "Two-pane file manager for Emacs based on Dired and inspired by MC.";
+    description = "Two-pane file manager for Emacs based on Dired and inspired by MC";
     homepage = http://www.emacswiki.org/emacs/Sunrise_Commander;
     license = "GPLv3+";
 
diff --git a/pkgs/applications/editors/emacs-modes/xml-rpc/default.nix b/pkgs/applications/editors/emacs-modes/xml-rpc/default.nix
index 87a732b5b4ca..cee0f0ca5534 100644
--- a/pkgs/applications/editors/emacs-modes/xml-rpc/default.nix
+++ b/pkgs/applications/editors/emacs-modes/xml-rpc/default.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
   '';
 
   meta = {
-    description = "An elisp implementation of clientside XML-RPC.";
+    description = "Elisp implementation of clientside XML-RPC";
     homepage = https://launchpad.net/xml-rpc-el;
     license = "GPLv3+";
 
diff --git a/pkgs/applications/editors/flpsed/default.nix b/pkgs/applications/editors/flpsed/default.nix
index ca481f1081d3..15605218b741 100644
--- a/pkgs/applications/editors/flpsed/default.nix
+++ b/pkgs/applications/editors/flpsed/default.nix
@@ -11,10 +11,9 @@ stdenv.mkDerivation {
   buildInputs = [ fltk13 ghostscript ];
 
   meta = {
-    description = "A WYSIWYG PostScript annotator.";
+    description = "WYSIWYG PostScript annotator";
     homepage = "http://http://flpsed.org/flpsed.html";
     license = "GPLv3";
-    platforms = stdenv.lib.platforms.all;
+    platforms = stdenv.lib.platforms.mesaPlatforms;
   };
-
 }
diff --git a/pkgs/applications/editors/geany/default.nix b/pkgs/applications/editors/geany/default.nix
index 6d43cc279975..e7c8e276d27b 100644
--- a/pkgs/applications/editors/geany/default.nix
+++ b/pkgs/applications/editors/geany/default.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
   postInstall = "rm $out/share/icons/hicolor/icon-theme.cache";
 
   meta = {
-    description = "A GTK2 small and ligthweight IDE.";
+    description = "Small and lightweight IDE";
     longDescription = ''
       Geany is a small and lightweight Integrated Development Environment.
       It was developed to provide a small and fast IDE, which has only a few dependencies from other packages.
diff --git a/pkgs/applications/editors/mg/default.nix b/pkgs/applications/editors/mg/default.nix
index ce69b5c0b5ae..058a54c45a71 100644
--- a/pkgs/applications/editors/mg/default.nix
+++ b/pkgs/applications/editors/mg/default.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     homepage = http://homepage.boetes.org/software/mg/;
-    description = "mg is Micro GNU/emacs, this is a portable version of the mg maintained by the OpenBSD team.";
+    description = "mg is Micro GNU/emacs, this is a portable version of the mg maintained by the OpenBSD team";
     license = "public domain";
     platforms = stdenv.lib.platforms.all;
   };
diff --git a/pkgs/applications/editors/sublime/default.nix b/pkgs/applications/editors/sublime/default.nix
index 6aa0b34314ac..cfa44d9285cc 100644
--- a/pkgs/applications/editors/sublime/default.nix
+++ b/pkgs/applications/editors/sublime/default.nix
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
   '';
 
   meta = {
-    description = "Sublime Text is a sophisticated text editor for code, markup and prose.";
+    description = "Sophisticated text editor for code, markup and prose";
     license = "unfree";
   };
 }
diff --git a/pkgs/applications/editors/vim/configurable.nix b/pkgs/applications/editors/vim/configurable.nix
index b3992dfec304..789ddcc10395 100644
--- a/pkgs/applications/editors/vim/configurable.nix
+++ b/pkgs/applications/editors/vim/configurable.nix
@@ -11,7 +11,7 @@ composableDerivation {
                    else stdenv ).mkDerivation;
 } (fix: {
 
-    name = "vim_configurable-7.4";
+    name = "vim_configurable-7.4.23";
 
     enableParallelBuilding = true; # test this
 
@@ -38,8 +38,10 @@ composableDerivation {
     preConfigure
       = stdenv.lib.optionalString
         (stdenv.isDarwin && (config.vim.darwin or true)) ''
-          sed -i "5387,5390d" src/auto/configure
-          sed -i "5394d" src/auto/configure
+          # TODO: we should find a better way of doing this as, if the configure
+          # file changes, we need to change these line numbers
+          sed -i "5641,5644d" src/auto/configure
+          sed -i "5648d" src/auto/configure
         '';
 
     configureFlags
@@ -49,10 +51,26 @@ composableDerivation {
       = [ ncurses pkgconfig gtk libX11 libXext libSM libXpm libXt libXaw libXau
           libXmu glib libICE ];
 
+    prePatch = "cd src";
+    
+    patches =
+      [ ./patches/7.4.001 ./patches/7.4.002 ./patches/7.4.003 ./patches/7.4.004
+        ./patches/7.4.005 ./patches/7.4.006 ./patches/7.4.007 ./patches/7.4.008
+        ./patches/7.4.009 ./patches/7.4.010 ./patches/7.4.011 ./patches/7.4.012
+        ./patches/7.4.013 ./patches/7.4.014 ./patches/7.4.015 ./patches/7.4.016
+        ./patches/7.4.017 ./patches/7.4.018 ./patches/7.4.019 ./patches/7.4.020
+        ./patches/7.4.021 ./patches/7.4.022 ./patches/7.4.023 ];
+
     # most interpreters aren't tested yet.. (see python for example how to do it)
     flags = {
         ftNix = {
-          patches = [ ./ft-nix-support.patch ];
+          # because we cd to src in the main patch phase, we can't just add this
+          # patch to the list, we have to apply it manually
+          postPatch = ''
+            cd ../runtime
+            patch -p2 < ${./ft-nix-support.patch}
+            cd ..
+          '';
         };
       }
       // edf { name = "darwin"; } #Disable Darwin (Mac OS X) support.
@@ -131,10 +149,11 @@ composableDerivation {
 
   dontStrip = 1;
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "The most popular clone of the VI editor";
-    homepage    = "www.vim.org";
-    platforms   = lib.platforms.unix;
+    homepage    = http://www.vim.org;
+    maintainers = with maintainers; [ lovek323 ];
+    platforms   = platforms.unix;
   };
 })
 
diff --git a/pkgs/applications/editors/vim/default.nix b/pkgs/applications/editors/vim/default.nix
index 2a2b3dd6be4f..a2672b5c0d67 100644
--- a/pkgs/applications/editors/vim/default.nix
+++ b/pkgs/applications/editors/vim/default.nix
@@ -1,10 +1,11 @@
 { stdenv, fetchurl, ncurses, gettext, pkgconfig }:
 
 stdenv.mkDerivation rec {
-  name = "vim-7.4";
+  patchLevel = "23";
+  name       = "vim-7.4.${patchLevel}";
  
   src = fetchurl {
-    url = "ftp://ftp.vim.org/pub/vim/unix/${name}.tar.bz2";
+    url    = "ftp://ftp.vim.org/pub/vim/unix/${name}.tar.bz2";
     sha256 = "1pjaffap91l2rb9pjnlbrpvb3ay5yhhr3g91zabjvw1rqk9adxfh";
   };
 
@@ -39,10 +40,20 @@ stdenv.mkDerivation rec {
   # To fix the trouble in vim73, that it cannot cross-build with this patch
   # to bypass a configure script check that cannot be done cross-building.
   # http://groups.google.com/group/vim_dev/browse_thread/thread/66c02efd1523554b?pli=1
-  patchPhase = ''
-    sed -i -e 's/as_fn_error.*int32.*/:/' src/auto/configure
-  '';
+  # patchPhase = ''
+  #   sed -i -e 's/as_fn_error.*int32.*/:/' src/auto/configure
+  # '';
+
+  prePatch = "cd src";
   
+  patches =
+    [ ./patches/7.4.001 ./patches/7.4.002 ./patches/7.4.003 ./patches/7.4.004
+      ./patches/7.4.005 ./patches/7.4.006 ./patches/7.4.007 ./patches/7.4.008
+      ./patches/7.4.009 ./patches/7.4.010 ./patches/7.4.011 ./patches/7.4.012
+      ./patches/7.4.013 ./patches/7.4.014 ./patches/7.4.015 ./patches/7.4.016
+      ./patches/7.4.017 ./patches/7.4.018 ./patches/7.4.019 ./patches/7.4.020
+      ./patches/7.4.021 ./patches/7.4.022 ./patches/7.4.023 ];
+
   meta = with stdenv.lib; {
     description = "The most popular clone of the VI editor";
     homepage    = http://www.vim.org;
diff --git a/pkgs/applications/editors/vim/patches/7.4.001 b/pkgs/applications/editors/vim/patches/7.4.001
new file mode 100644
index 000000000000..5788972a569d
--- /dev/null
+++ b/pkgs/applications/editors/vim/patches/7.4.001
@@ -0,0 +1,489 @@
+To: vim_dev@googlegroups.com
+Subject: Patch 7.4.001
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.4.001
+Problem:    Character classes such as [a-z] to not react to 'ignorecase'.
+	    Breaks man page highlighting. (Mario Grgic)
+Solution:   Add separate items for classes that react to 'ignorecase'.  Clean
+	    up logic handling character classes.  Add more tests.
+Files:	    src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok
+
+
+*** ../vim-7.4.000/src/regexp_nfa.c	2013-08-01 18:27:51.000000000 +0200
+--- src/regexp_nfa.c	2013-08-14 11:49:50.000000000 +0200
+***************
+*** 29,34 ****
+--- 29,37 ----
+  # define NFA_REGEXP_DEBUG_LOG	"nfa_regexp_debug.log"
+  #endif
+  
++ /* Added to NFA_ANY - NFA_NUPPER_IC to include a NL. */
++ #define NFA_ADD_NL		31
++ 
+  enum
+  {
+      NFA_SPLIT = -1024,
+***************
+*** 183,188 ****
+--- 186,198 ----
+      NFA_NLOWER,		/*	Match non-lowercase char */
+      NFA_UPPER,		/*	Match uppercase char */
+      NFA_NUPPER,		/*	Match non-uppercase char */
++     NFA_LOWER_IC,	/*	Match [a-z] */
++     NFA_NLOWER_IC,	/*	Match [^a-z] */
++     NFA_UPPER_IC,	/*	Match [A-Z] */
++     NFA_NUPPER_IC,	/*	Match [^A-Z] */
++ 
++     NFA_FIRST_NL = NFA_ANY + NFA_ADD_NL,
++     NFA_LAST_NL = NFA_NUPPER_IC + NFA_ADD_NL,
+  
+      NFA_CURSOR,		/*	Match cursor pos */
+      NFA_LNUM,		/*	Match line number */
+***************
+*** 199,207 ****
+      NFA_MARK_LT,	/*	Match < mark */
+      NFA_VISUAL,		/*	Match Visual area */
+  
+-     NFA_FIRST_NL = NFA_ANY + ADD_NL,
+-     NFA_LAST_NL = NFA_NUPPER + ADD_NL,
+- 
+      /* Character classes [:alnum:] etc */
+      NFA_CLASS_ALNUM,
+      NFA_CLASS_ALPHA,
+--- 209,214 ----
+***************
+*** 578,583 ****
+--- 585,592 ----
+   * On failure, return 0 (=FAIL)
+   * Start points to the first char of the range, while end should point
+   * to the closing brace.
++  * Keep in mind that 'ignorecase' applies at execution time, thus [a-z] may
++  * need to be interpreted as [a-zA-Z].
+   */
+      static int
+  nfa_recognize_char_class(start, end, extra_newl)
+***************
+*** 681,687 ****
+  	return FAIL;
+  
+      if (newl == TRUE)
+! 	extra_newl = ADD_NL;
+  
+      switch (config)
+      {
+--- 690,696 ----
+  	return FAIL;
+  
+      if (newl == TRUE)
+! 	extra_newl = NFA_ADD_NL;
+  
+      switch (config)
+      {
+***************
+*** 710,722 ****
+  	case CLASS_not | CLASS_az | CLASS_AZ:
+  	    return extra_newl + NFA_NALPHA;
+  	case CLASS_az:
+! 	   return extra_newl + NFA_LOWER;
+  	case CLASS_not | CLASS_az:
+! 	    return extra_newl + NFA_NLOWER;
+  	case CLASS_AZ:
+! 	    return extra_newl + NFA_UPPER;
+  	case CLASS_not | CLASS_AZ:
+! 	    return extra_newl + NFA_NUPPER;
+      }
+      return FAIL;
+  }
+--- 719,731 ----
+  	case CLASS_not | CLASS_az | CLASS_AZ:
+  	    return extra_newl + NFA_NALPHA;
+  	case CLASS_az:
+! 	   return extra_newl + NFA_LOWER_IC;
+  	case CLASS_not | CLASS_az:
+! 	    return extra_newl + NFA_NLOWER_IC;
+  	case CLASS_AZ:
+! 	    return extra_newl + NFA_UPPER_IC;
+  	case CLASS_not | CLASS_AZ:
+! 	    return extra_newl + NFA_NUPPER_IC;
+      }
+      return FAIL;
+  }
+***************
+*** 914,920 ****
+  		break;
+  	    }
+  
+! 	    extra = ADD_NL;
+  
+  	    /* "\_[" is collection plus newline */
+  	    if (c == '[')
+--- 923,929 ----
+  		break;
+  	    }
+  
+! 	    extra = NFA_ADD_NL;
+  
+  	    /* "\_[" is collection plus newline */
+  	    if (c == '[')
+***************
+*** 970,976 ****
+  	    }
+  #endif
+  	    EMIT(nfa_classcodes[p - classchars]);
+! 	    if (extra == ADD_NL)
+  	    {
+  		EMIT(NFA_NEWL);
+  		EMIT(NFA_OR);
+--- 979,985 ----
+  	    }
+  #endif
+  	    EMIT(nfa_classcodes[p - classchars]);
+! 	    if (extra == NFA_ADD_NL)
+  	    {
+  		EMIT(NFA_NEWL);
+  		EMIT(NFA_OR);
+***************
+*** 1240,1260 ****
+  	    {
+  		/*
+  		 * Try to reverse engineer character classes. For example,
+! 		 * recognize that [0-9] stands for  \d and [A-Za-z_] with \h,
+  		 * and perform the necessary substitutions in the NFA.
+  		 */
+  		result = nfa_recognize_char_class(regparse, endp,
+! 							    extra == ADD_NL);
+  		if (result != FAIL)
+  		{
+! 		    if (result >= NFA_DIGIT && result <= NFA_NUPPER)
+! 			EMIT(result);
+! 		    else	/* must be char class + newline */
+  		    {
+! 			EMIT(result - ADD_NL);
+  			EMIT(NFA_NEWL);
+  			EMIT(NFA_OR);
+  		    }
+  		    regparse = endp;
+  		    mb_ptr_adv(regparse);
+  		    return OK;
+--- 1249,1269 ----
+  	    {
+  		/*
+  		 * Try to reverse engineer character classes. For example,
+! 		 * recognize that [0-9] stands for \d and [A-Za-z_] for \h,
+  		 * and perform the necessary substitutions in the NFA.
+  		 */
+  		result = nfa_recognize_char_class(regparse, endp,
+! 							 extra == NFA_ADD_NL);
+  		if (result != FAIL)
+  		{
+! 		    if (result >= NFA_FIRST_NL && result <= NFA_LAST_NL)
+  		    {
+! 			EMIT(result - NFA_ADD_NL);
+  			EMIT(NFA_NEWL);
+  			EMIT(NFA_OR);
+  		    }
++ 		    else
++ 			EMIT(result);
+  		    regparse = endp;
+  		    mb_ptr_adv(regparse);
+  		    return OK;
+***************
+*** 1504,1510 ****
+  			     * collection, add an OR below. But not for negated
+  			     * range. */
+  			    if (!negated)
+! 				extra = ADD_NL;
+  			}
+  			else
+  			{
+--- 1513,1519 ----
+  			     * collection, add an OR below. But not for negated
+  			     * range. */
+  			    if (!negated)
+! 				extra = NFA_ADD_NL;
+  			}
+  			else
+  			{
+***************
+*** 1537,1543 ****
+  		    EMIT(NFA_END_COLL);
+  
+  		/* \_[] also matches \n but it's not negated */
+! 		if (extra == ADD_NL)
+  		{
+  		    EMIT(reg_string ? NL : NFA_NEWL);
+  		    EMIT(NFA_OR);
+--- 1546,1552 ----
+  		    EMIT(NFA_END_COLL);
+  
+  		/* \_[] also matches \n but it's not negated */
+! 		if (extra == NFA_ADD_NL)
+  		{
+  		    EMIT(reg_string ? NL : NFA_NEWL);
+  		    EMIT(NFA_OR);
+***************
+*** 2011,2017 ****
+      if (c >= NFA_FIRST_NL && c <= NFA_LAST_NL)
+      {
+  	addnl = TRUE;
+! 	c -= ADD_NL;
+      }
+  
+      STRCPY(code, "");
+--- 2020,2026 ----
+      if (c >= NFA_FIRST_NL && c <= NFA_LAST_NL)
+      {
+  	addnl = TRUE;
+! 	c -= NFA_ADD_NL;
+      }
+  
+      STRCPY(code, "");
+***************
+*** 2217,2222 ****
+--- 2226,2235 ----
+  	case NFA_NLOWER:STRCPY(code, "NFA_NLOWER"); break;
+  	case NFA_UPPER:	STRCPY(code, "NFA_UPPER"); break;
+  	case NFA_NUPPER:STRCPY(code, "NFA_NUPPER"); break;
++ 	case NFA_LOWER_IC:  STRCPY(code, "NFA_LOWER_IC"); break;
++ 	case NFA_NLOWER_IC: STRCPY(code, "NFA_NLOWER_IC"); break;
++ 	case NFA_UPPER_IC:  STRCPY(code, "NFA_UPPER_IC"); break;
++ 	case NFA_NUPPER_IC: STRCPY(code, "NFA_NUPPER_IC"); break;
+  
+  	default:
+  	    STRCPY(code, "CHAR(x)");
+***************
+*** 2687,2692 ****
+--- 2700,2709 ----
+  	    case NFA_NLOWER:
+  	    case NFA_UPPER:
+  	    case NFA_NUPPER:
++ 	    case NFA_LOWER_IC:
++ 	    case NFA_NLOWER_IC:
++ 	    case NFA_UPPER_IC:
++ 	    case NFA_NUPPER_IC:
+  		/* possibly non-ascii */
+  #ifdef FEAT_MBYTE
+  		if (has_mbyte)
+***************
+*** 3841,3846 ****
+--- 3858,3867 ----
+  	    case NFA_NLOWER:
+  	    case NFA_UPPER:
+  	    case NFA_NUPPER:
++ 	    case NFA_LOWER_IC:
++ 	    case NFA_NLOWER_IC:
++ 	    case NFA_UPPER_IC:
++ 	    case NFA_NUPPER_IC:
+  	    case NFA_START_COLL:
+  	    case NFA_START_NEG_COLL:
+  	    case NFA_NEWL:
+***************
+*** 5872,5877 ****
+--- 5893,5920 ----
+  		ADD_STATE_IF_MATCH(t->state);
+  		break;
+  
++ 	    case NFA_LOWER_IC:	/* [a-z] */
++ 		result = ri_lower(curc) || (ireg_ic && ri_upper(curc));
++ 		ADD_STATE_IF_MATCH(t->state);
++ 		break;
++ 
++ 	    case NFA_NLOWER_IC:	/* [^a-z] */
++ 		result = curc != NUL
++ 			  && !(ri_lower(curc) || (ireg_ic && ri_upper(curc)));
++ 		ADD_STATE_IF_MATCH(t->state);
++ 		break;
++ 
++ 	    case NFA_UPPER_IC:	/* [A-Z] */
++ 		result = ri_upper(curc) || (ireg_ic && ri_lower(curc));
++ 		ADD_STATE_IF_MATCH(t->state);
++ 		break;
++ 
++ 	    case NFA_NUPPER_IC:	/* ^[A-Z] */
++ 		result = curc != NUL
++ 			  && !(ri_upper(curc) || (ireg_ic && ri_lower(curc)));
++ 		ADD_STATE_IF_MATCH(t->state);
++ 		break;
++ 
+  	    case NFA_BACKREF1:
+  	    case NFA_BACKREF2:
+  	    case NFA_BACKREF3:
+*** ../vim-7.4.000/src/testdir/test64.in	2013-08-01 17:45:33.000000000 +0200
+--- src/testdir/test64.in	2013-08-14 11:50:11.000000000 +0200
+***************
+*** 289,303 ****
+  :call add(tl, [2, '.a\%$', " a\n "])
+  :call add(tl, [2, '.a\%$', " a\n_a", "_a"])
+  :"
+! :"""" Test recognition of some character classes
+! :call add(tl, [2, '[0-9]', '8', '8'])
+! :call add(tl, [2, '[^0-9]', '8'])
+! :call add(tl, [2, '[0-9a-fA-F]*', '0a7', '0a7'])
+! :call add(tl, [2, '[^0-9A-Fa-f]\+', '0a7'])
+! :call add(tl, [2, '[a-z_A-Z0-9]\+', 'aso_sfoij', 'aso_sfoij'])
+! :call add(tl, [2, '[a-z]', 'a', 'a'])
+! :call add(tl, [2, '[a-zA-Z]', 'a', 'a'])
+! :call add(tl, [2, '[A-Z]', 'a'])
+  :call add(tl, [2, '\C[^A-Z]\+', 'ABCOIJDEOIFNSD jsfoij sa', ' jsfoij sa'])
+  :"
+  :"""" Tests for \z features
+--- 289,317 ----
+  :call add(tl, [2, '.a\%$', " a\n "])
+  :call add(tl, [2, '.a\%$', " a\n_a", "_a"])
+  :"
+! :"""" Test recognition of character classes
+! :call add(tl, [2, '[0-7]\+', 'x0123456789x', '01234567'])
+! :call add(tl, [2, '[^0-7]\+', '0a;X+% 897', 'a;X+% 89'])
+! :call add(tl, [2, '[0-9]\+', 'x0123456789x', '0123456789'])
+! :call add(tl, [2, '[^0-9]\+', '0a;X+% 9', 'a;X+% '])
+! :call add(tl, [2, '[0-9a-fA-F]\+', 'x0189abcdefg', '0189abcdef'])
+! :call add(tl, [2, '[^0-9A-Fa-f]\+', '0189g;X+% ab', 'g;X+% '])
+! :call add(tl, [2, '[a-z_A-Z0-9]\+', ';+aso_SfOij ', 'aso_SfOij'])
+! :call add(tl, [2, '[^a-z_A-Z0-9]\+', 'aSo_;+% sfOij', ';+% '])
+! :call add(tl, [2, '[a-z_A-Z]\+', '0abyz_ABYZ;', 'abyz_ABYZ'])
+! :call add(tl, [2, '[^a-z_A-Z]\+', 'abAB_09;+% yzYZ', '09;+% '])
+! :call add(tl, [2, '[a-z]\+', '0abcxyz1', 'abcxyz'])
+! :call add(tl, [2, '[a-z]\+', 'AabxyzZ', 'abxyz'])
+! :call add(tl, [2, '[^a-z]\+', 'a;X09+% x', ';X09+% '])
+! :call add(tl, [2, '[^a-z]\+', 'abX0;%yz', 'X0;%'])
+! :call add(tl, [2, '[a-zA-Z]\+', '0abABxzXZ9', 'abABxzXZ'])
+! :call add(tl, [2, '[^a-zA-Z]\+', 'ab09_;+ XZ', '09_;+ '])
+! :call add(tl, [2, '[A-Z]\+', 'aABXYZz', 'ABXYZ'])
+! :call add(tl, [2, '[^A-Z]\+', 'ABx0;%YZ', 'x0;%'])
+! :call add(tl, [2, '[a-z]\+\c', '0abxyzABXYZ;', 'abxyzABXYZ'])
+! :call add(tl, [2, '[A-Z]\+\c', '0abABxzXZ9', 'abABxzXZ'])
+! :call add(tl, [2, '\c[^a-z]\+', 'ab09_;+ XZ', '09_;+ '])
+! :call add(tl, [2, '\c[^A-Z]\+', 'ab09_;+ XZ', '09_;+ '])
+  :call add(tl, [2, '\C[^A-Z]\+', 'ABCOIJDEOIFNSD jsfoij sa', ' jsfoij sa'])
+  :"
+  :"""" Tests for \z features
+*** ../vim-7.4.000/src/testdir/test64.ok	2013-08-01 18:28:56.000000000 +0200
+--- src/testdir/test64.ok	2013-08-14 11:50:37.000000000 +0200
+***************
+*** 650,679 ****
+  OK 0 - .a\%$
+  OK 1 - .a\%$
+  OK 2 - .a\%$
+! OK 0 - [0-9]
+! OK 1 - [0-9]
+! OK 2 - [0-9]
+! OK 0 - [^0-9]
+! OK 1 - [^0-9]
+! OK 2 - [^0-9]
+! OK 0 - [0-9a-fA-F]*
+! OK 1 - [0-9a-fA-F]*
+! OK 2 - [0-9a-fA-F]*
+  OK 0 - [^0-9A-Fa-f]\+
+  OK 1 - [^0-9A-Fa-f]\+
+  OK 2 - [^0-9A-Fa-f]\+
+  OK 0 - [a-z_A-Z0-9]\+
+  OK 1 - [a-z_A-Z0-9]\+
+  OK 2 - [a-z_A-Z0-9]\+
+! OK 0 - [a-z]
+! OK 1 - [a-z]
+! OK 2 - [a-z]
+! OK 0 - [a-zA-Z]
+! OK 1 - [a-zA-Z]
+! OK 2 - [a-zA-Z]
+! OK 0 - [A-Z]
+! OK 1 - [A-Z]
+! OK 2 - [A-Z]
+  OK 0 - \C[^A-Z]\+
+  OK 1 - \C[^A-Z]\+
+  OK 2 - \C[^A-Z]\+
+--- 650,721 ----
+  OK 0 - .a\%$
+  OK 1 - .a\%$
+  OK 2 - .a\%$
+! OK 0 - [0-7]\+
+! OK 1 - [0-7]\+
+! OK 2 - [0-7]\+
+! OK 0 - [^0-7]\+
+! OK 1 - [^0-7]\+
+! OK 2 - [^0-7]\+
+! OK 0 - [0-9]\+
+! OK 1 - [0-9]\+
+! OK 2 - [0-9]\+
+! OK 0 - [^0-9]\+
+! OK 1 - [^0-9]\+
+! OK 2 - [^0-9]\+
+! OK 0 - [0-9a-fA-F]\+
+! OK 1 - [0-9a-fA-F]\+
+! OK 2 - [0-9a-fA-F]\+
+  OK 0 - [^0-9A-Fa-f]\+
+  OK 1 - [^0-9A-Fa-f]\+
+  OK 2 - [^0-9A-Fa-f]\+
+  OK 0 - [a-z_A-Z0-9]\+
+  OK 1 - [a-z_A-Z0-9]\+
+  OK 2 - [a-z_A-Z0-9]\+
+! OK 0 - [^a-z_A-Z0-9]\+
+! OK 1 - [^a-z_A-Z0-9]\+
+! OK 2 - [^a-z_A-Z0-9]\+
+! OK 0 - [a-z_A-Z]\+
+! OK 1 - [a-z_A-Z]\+
+! OK 2 - [a-z_A-Z]\+
+! OK 0 - [^a-z_A-Z]\+
+! OK 1 - [^a-z_A-Z]\+
+! OK 2 - [^a-z_A-Z]\+
+! OK 0 - [a-z]\+
+! OK 1 - [a-z]\+
+! OK 2 - [a-z]\+
+! OK 0 - [a-z]\+
+! OK 1 - [a-z]\+
+! OK 2 - [a-z]\+
+! OK 0 - [^a-z]\+
+! OK 1 - [^a-z]\+
+! OK 2 - [^a-z]\+
+! OK 0 - [^a-z]\+
+! OK 1 - [^a-z]\+
+! OK 2 - [^a-z]\+
+! OK 0 - [a-zA-Z]\+
+! OK 1 - [a-zA-Z]\+
+! OK 2 - [a-zA-Z]\+
+! OK 0 - [^a-zA-Z]\+
+! OK 1 - [^a-zA-Z]\+
+! OK 2 - [^a-zA-Z]\+
+! OK 0 - [A-Z]\+
+! OK 1 - [A-Z]\+
+! OK 2 - [A-Z]\+
+! OK 0 - [^A-Z]\+
+! OK 1 - [^A-Z]\+
+! OK 2 - [^A-Z]\+
+! OK 0 - [a-z]\+\c
+! OK 1 - [a-z]\+\c
+! OK 2 - [a-z]\+\c
+! OK 0 - [A-Z]\+\c
+! OK 1 - [A-Z]\+\c
+! OK 2 - [A-Z]\+\c
+! OK 0 - \c[^a-z]\+
+! OK 1 - \c[^a-z]\+
+! OK 2 - \c[^a-z]\+
+! OK 0 - \c[^A-Z]\+
+! OK 1 - \c[^A-Z]\+
+! OK 2 - \c[^A-Z]\+
+  OK 0 - \C[^A-Z]\+
+  OK 1 - \C[^A-Z]\+
+  OK 2 - \C[^A-Z]\+
+*** ../vim-7.4.000/src/version.c	2013-08-10 13:29:20.000000000 +0200
+--- src/version.c	2013-08-14 11:54:57.000000000 +0200
+***************
+*** 729,730 ****
+--- 729,732 ----
+  {   /* Add new patch number below this line */
++ /**/
++     1,
+  /**/
+
+-- 
+How many light bulbs does it take to change a person?
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
+///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\  an exciting new programming language -- http://www.Zimbu.org        ///
+ \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.002 b/pkgs/applications/editors/vim/patches/7.4.002
new file mode 100644
index 000000000000..d92f4de6c2d7
--- /dev/null
+++ b/pkgs/applications/editors/vim/patches/7.4.002
@@ -0,0 +1,77 @@
+To: vim_dev@googlegroups.com
+Subject: Patch 7.4.002
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.4b.002
+Problem:    Pattern with two alternative look-behind matches does not match.
+	    (Amadeus Demarzi)
+Solution:   When comparing PIMs also compare their state ID to see if they are
+	    different.
+Files:	    src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok
+
+
+*** ../vim-7.4.001/src/regexp_nfa.c	2013-08-14 12:05:54.000000000 +0200
+--- src/regexp_nfa.c	2013-08-14 13:12:09.000000000 +0200
+***************
+*** 3782,3787 ****
+--- 3782,3790 ----
+      if (two_unused)
+  	/* one is used and two is not: not equal */
+  	return FALSE;
++     /* compare the state id */
++     if (one->state->id != two->state->id)
++ 	return FALSE;
+      /* compare the position */
+      if (REG_MULTI)
+  	return one->end.pos.lnum == two->end.pos.lnum
+*** ../vim-7.4.001/src/testdir/test64.in	2013-08-14 12:05:54.000000000 +0200
+--- src/testdir/test64.in	2013-08-14 12:58:38.000000000 +0200
+***************
+*** 421,426 ****
+--- 421,429 ----
+  :call add(tl, [2, '\(foo\)\@<=\>', 'barfoo', '', 'foo'])
+  :call add(tl, [2, '\(foo\)\@<=.*', 'foobar', 'bar', 'foo'])
+  :"
++ :" complicated look-behind match
++ :call add(tl, [2, '\(r\@<=\|\w\@<!\)\/', 'x = /word/;', '/'])
++ :"
+  :""""" \@>
+  :call add(tl, [2, '\(a*\)\@>a', 'aaaa'])
+  :call add(tl, [2, '\(a*\)\@>b', 'aaab', 'aaab', 'aaa'])
+*** ../vim-7.4.001/src/testdir/test64.ok	2013-08-14 12:05:54.000000000 +0200
+--- src/testdir/test64.ok	2013-08-14 13:14:09.000000000 +0200
+***************
+*** 974,979 ****
+--- 974,982 ----
+  OK 0 - \(foo\)\@<=.*
+  OK 1 - \(foo\)\@<=.*
+  OK 2 - \(foo\)\@<=.*
++ OK 0 - \(r\@<=\|\w\@<!\)\/
++ OK 1 - \(r\@<=\|\w\@<!\)\/
++ OK 2 - \(r\@<=\|\w\@<!\)\/
+  OK 0 - \(a*\)\@>a
+  OK 1 - \(a*\)\@>a
+  OK 2 - \(a*\)\@>a
+*** ../vim-7.4.001/src/version.c	2013-08-14 12:05:54.000000000 +0200
+--- src/version.c	2013-08-14 13:13:45.000000000 +0200
+***************
+*** 729,730 ****
+--- 729,732 ----
+  {   /* Add new patch number below this line */
++ /**/
++     2,
+  /**/
+
+-- 
+From "know your smileys":
+ :-)-O	Smiling doctor with stethoscope
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
+///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\  an exciting new programming language -- http://www.Zimbu.org        ///
+ \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.003 b/pkgs/applications/editors/vim/patches/7.4.003
new file mode 100644
index 000000000000..9aad3c8c8f1c
--- /dev/null
+++ b/pkgs/applications/editors/vim/patches/7.4.003
@@ -0,0 +1,100 @@
+To: vim_dev@googlegroups.com
+Subject: Patch 7.4.003
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.4.003
+Problem:    Memory access error in Ruby syntax highlighting. (Christopher Chow)
+Solution:   Refresh stale pointer. (James McCoy)
+Files:	    src/regexp_nfa.c
+
+
+*** ../vim-7.4.002/src/regexp_nfa.c	2013-08-14 13:31:03.000000000 +0200
+--- src/regexp_nfa.c	2013-08-14 14:02:06.000000000 +0200
+***************
+*** 4120,4126 ****
+  		sub = &subs->norm;
+  	    }
+  #ifdef FEAT_SYN_HL
+! 	    else if (state->c >= NFA_ZOPEN)
+  	    {
+  		subidx = state->c - NFA_ZOPEN;
+  		sub = &subs->synt;
+--- 4120,4126 ----
+  		sub = &subs->norm;
+  	    }
+  #ifdef FEAT_SYN_HL
+! 	    else if (state->c >= NFA_ZOPEN && state->c <= NFA_ZOPEN9)
+  	    {
+  		subidx = state->c - NFA_ZOPEN;
+  		sub = &subs->synt;
+***************
+*** 4189,4194 ****
+--- 4189,4201 ----
+  	    }
+  
+  	    subs = addstate(l, state->out, subs, pim, off);
++ 	    /* "subs" may have changed, need to set "sub" again */
++ #ifdef FEAT_SYN_HL
++ 	    if (state->c >= NFA_ZOPEN && state->c <= NFA_ZOPEN9)
++ 		sub = &subs->synt;
++ 	    else
++ #endif
++ 		sub = &subs->norm;
+  
+  	    if (save_in_use == -1)
+  	    {
+***************
+*** 4237,4243 ****
+  		sub = &subs->norm;
+  	    }
+  #ifdef FEAT_SYN_HL
+! 	    else if (state->c >= NFA_ZCLOSE)
+  	    {
+  		subidx = state->c - NFA_ZCLOSE;
+  		sub = &subs->synt;
+--- 4244,4250 ----
+  		sub = &subs->norm;
+  	    }
+  #ifdef FEAT_SYN_HL
+! 	    else if (state->c >= NFA_ZCLOSE && state->c <= NFA_ZCLOSE9)
+  	    {
+  		subidx = state->c - NFA_ZCLOSE;
+  		sub = &subs->synt;
+***************
+*** 4281,4286 ****
+--- 4288,4300 ----
+  	    }
+  
+  	    subs = addstate(l, state->out, subs, pim, off);
++ 	    /* "subs" may have changed, need to set "sub" again */
++ #ifdef FEAT_SYN_HL
++ 	    if (state->c >= NFA_ZCLOSE && state->c <= NFA_ZCLOSE9)
++ 		sub = &subs->synt;
++ 	    else
++ #endif
++ 		sub = &subs->norm;
+  
+  	    if (REG_MULTI)
+  		sub->list.multi[subidx].end = save_lpos;
+*** ../vim-7.4.002/src/version.c	2013-08-14 13:31:03.000000000 +0200
+--- src/version.c	2013-08-14 14:03:51.000000000 +0200
+***************
+*** 729,730 ****
+--- 729,732 ----
+  {   /* Add new patch number below this line */
++ /**/
++     3,
+  /**/
+
+-- 
+Where do you want to crash today?
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
+///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\  an exciting new programming language -- http://www.Zimbu.org        ///
+ \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.004 b/pkgs/applications/editors/vim/patches/7.4.004
new file mode 100644
index 000000000000..f629d673fb8a
--- /dev/null
+++ b/pkgs/applications/editors/vim/patches/7.4.004
@@ -0,0 +1,232 @@
+To: vim_dev@googlegroups.com
+Subject: Patch 7.4.004
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.4.004
+Problem:    When closing a window fails ":bwipe" may hang.
+Solution:   Let win_close() return FAIL and break out of the loop.
+Files:	    src/window.c, src/proto/window.pro, src/buffer.c
+
+
+*** ../vim-7.4.003/src/window.c	2013-07-24 17:38:29.000000000 +0200
+--- src/window.c	2013-08-14 16:52:44.000000000 +0200
+***************
+*** 2172,2179 ****
+   * If "free_buf" is TRUE related buffer may be unloaded.
+   *
+   * Called by :quit, :close, :xit, :wq and findtag().
+   */
+!     void
+  win_close(win, free_buf)
+      win_T	*win;
+      int		free_buf;
+--- 2172,2180 ----
+   * If "free_buf" is TRUE related buffer may be unloaded.
+   *
+   * Called by :quit, :close, :xit, :wq and findtag().
++  * Returns FAIL when the window was not closed.
+   */
+!     int
+  win_close(win, free_buf)
+      win_T	*win;
+      int		free_buf;
+***************
+*** 2190,2210 ****
+      if (last_window())
+      {
+  	EMSG(_("E444: Cannot close last window"));
+! 	return;
+      }
+  
+  #ifdef FEAT_AUTOCMD
+      if (win->w_closing || (win->w_buffer != NULL && win->w_buffer->b_closing))
+! 	return; /* window is already being closed */
+      if (win == aucmd_win)
+      {
+  	EMSG(_("E813: Cannot close autocmd window"));
+! 	return;
+      }
+      if ((firstwin == aucmd_win || lastwin == aucmd_win) && one_window())
+      {
+  	EMSG(_("E814: Cannot close window, only autocmd window would remain"));
+! 	return;
+      }
+  #endif
+  
+--- 2191,2211 ----
+      if (last_window())
+      {
+  	EMSG(_("E444: Cannot close last window"));
+! 	return FAIL;
+      }
+  
+  #ifdef FEAT_AUTOCMD
+      if (win->w_closing || (win->w_buffer != NULL && win->w_buffer->b_closing))
+! 	return FAIL; /* window is already being closed */
+      if (win == aucmd_win)
+      {
+  	EMSG(_("E813: Cannot close autocmd window"));
+! 	return FAIL;
+      }
+      if ((firstwin == aucmd_win || lastwin == aucmd_win) && one_window())
+      {
+  	EMSG(_("E814: Cannot close window, only autocmd window would remain"));
+! 	return FAIL;
+      }
+  #endif
+  
+***************
+*** 2212,2218 ****
+       * and then close the window and the tab page to avoid that curwin and
+       * curtab are invalid while we are freeing memory. */
+      if (close_last_window_tabpage(win, free_buf, prev_curtab))
+!       return;
+  
+      /* When closing the help window, try restoring a snapshot after closing
+       * the window.  Otherwise clear the snapshot, it's now invalid. */
+--- 2213,2219 ----
+       * and then close the window and the tab page to avoid that curwin and
+       * curtab are invalid while we are freeing memory. */
+      if (close_last_window_tabpage(win, free_buf, prev_curtab))
+!       return FAIL;
+  
+      /* When closing the help window, try restoring a snapshot after closing
+       * the window.  Otherwise clear the snapshot, it's now invalid. */
+***************
+*** 2240,2261 ****
+  	    win->w_closing = TRUE;
+  	    apply_autocmds(EVENT_BUFLEAVE, NULL, NULL, FALSE, curbuf);
+  	    if (!win_valid(win))
+! 		return;
+  	    win->w_closing = FALSE;
+  	    if (last_window())
+! 		return;
+  	}
+  	win->w_closing = TRUE;
+  	apply_autocmds(EVENT_WINLEAVE, NULL, NULL, FALSE, curbuf);
+  	if (!win_valid(win))
+! 	    return;
+  	win->w_closing = FALSE;
+  	if (last_window())
+! 	    return;
+  # ifdef FEAT_EVAL
+  	/* autocmds may abort script processing */
+  	if (aborting())
+! 	    return;
+  # endif
+      }
+  #endif
+--- 2241,2262 ----
+  	    win->w_closing = TRUE;
+  	    apply_autocmds(EVENT_BUFLEAVE, NULL, NULL, FALSE, curbuf);
+  	    if (!win_valid(win))
+! 		return FAIL;
+  	    win->w_closing = FALSE;
+  	    if (last_window())
+! 		return FAIL;
+  	}
+  	win->w_closing = TRUE;
+  	apply_autocmds(EVENT_WINLEAVE, NULL, NULL, FALSE, curbuf);
+  	if (!win_valid(win))
+! 	    return FAIL;
+  	win->w_closing = FALSE;
+  	if (last_window())
+! 	    return FAIL;
+  # ifdef FEAT_EVAL
+  	/* autocmds may abort script processing */
+  	if (aborting())
+! 	    return FAIL;
+  # endif
+      }
+  #endif
+***************
+*** 2303,2309 ****
+       * other window or moved to another tab page. */
+      else if (!win_valid(win) || last_window() || curtab != prev_curtab
+  	    || close_last_window_tabpage(win, free_buf, prev_curtab))
+! 	return;
+  
+      /* Free the memory used for the window and get the window that received
+       * the screen space. */
+--- 2304,2310 ----
+       * other window or moved to another tab page. */
+      else if (!win_valid(win) || last_window() || curtab != prev_curtab
+  	    || close_last_window_tabpage(win, free_buf, prev_curtab))
+! 	return FAIL;
+  
+      /* Free the memory used for the window and get the window that received
+       * the screen space. */
+***************
+*** 2383,2388 ****
+--- 2384,2390 ----
+  #endif
+  
+      redraw_all_later(NOT_VALID);
++     return OK;
+  }
+  
+  /*
+*** ../vim-7.4.003/src/proto/window.pro	2013-08-10 13:37:30.000000000 +0200
+--- src/proto/window.pro	2013-08-14 16:52:50.000000000 +0200
+***************
+*** 9,15 ****
+  void win_equal __ARGS((win_T *next_curwin, int current, int dir));
+  void close_windows __ARGS((buf_T *buf, int keep_curwin));
+  int one_window __ARGS((void));
+! void win_close __ARGS((win_T *win, int free_buf));
+  void win_close_othertab __ARGS((win_T *win, int free_buf, tabpage_T *tp));
+  void win_free_all __ARGS((void));
+  win_T *winframe_remove __ARGS((win_T *win, int *dirp, tabpage_T *tp));
+--- 9,15 ----
+  void win_equal __ARGS((win_T *next_curwin, int current, int dir));
+  void close_windows __ARGS((buf_T *buf, int keep_curwin));
+  int one_window __ARGS((void));
+! int win_close __ARGS((win_T *win, int free_buf));
+  void win_close_othertab __ARGS((win_T *win, int free_buf, tabpage_T *tp));
+  void win_free_all __ARGS((void));
+  win_T *winframe_remove __ARGS((win_T *win, int *dirp, tabpage_T *tp));
+*** ../vim-7.4.003/src/buffer.c	2013-07-17 16:39:00.000000000 +0200
+--- src/buffer.c	2013-08-14 16:54:34.000000000 +0200
+***************
+*** 1186,1192 ****
+  		   && !(curwin->w_closing || curwin->w_buffer->b_closing)
+  # endif
+  		   && (firstwin != lastwin || first_tabpage->tp_next != NULL))
+! 	    win_close(curwin, FALSE);
+  #endif
+  
+  	/*
+--- 1186,1195 ----
+  		   && !(curwin->w_closing || curwin->w_buffer->b_closing)
+  # endif
+  		   && (firstwin != lastwin || first_tabpage->tp_next != NULL))
+! 	{
+! 	    if (win_close(curwin, FALSE) == FAIL)
+! 		break;
+! 	}
+  #endif
+  
+  	/*
+*** ../vim-7.4.003/src/version.c	2013-08-14 14:18:37.000000000 +0200
+--- src/version.c	2013-08-14 17:10:23.000000000 +0200
+***************
+*** 729,730 ****
+--- 729,732 ----
+  {   /* Add new patch number below this line */
++ /**/
++     4,
+  /**/
+
+-- 
+From "know your smileys":
+ *<|:-)	Santa Claus (Ho Ho Ho)
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
+///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\  an exciting new programming language -- http://www.Zimbu.org        ///
+ \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.005 b/pkgs/applications/editors/vim/patches/7.4.005
new file mode 100644
index 000000000000..f85d1f0e3c81
--- /dev/null
+++ b/pkgs/applications/editors/vim/patches/7.4.005
@@ -0,0 +1,48 @@
+To: vim_dev@googlegroups.com
+Subject: Patch 7.4.005
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.4.005
+Problem:    Using "vaB" while 'virtualedit' is set selects the wrong area.
+	    (Dimitar Dimitrov)
+Solution:   Reset coladd when finding a match.
+Files:	    src/search.c
+
+
+*** ../vim-7.4.004/src/search.c	2013-07-17 19:20:47.000000000 +0200
+--- src/search.c	2013-08-14 17:32:38.000000000 +0200
+***************
+*** 1760,1765 ****
+--- 1760,1768 ----
+  #endif
+  
+      pos = curwin->w_cursor;
++ #ifdef FEAT_VIRTUALEDIT
++     pos.coladd = 0;
++ #endif
+      linep = ml_get(pos.lnum);
+  
+      cpo_match = (vim_strchr(p_cpo, CPO_MATCH) != NULL);
+*** ../vim-7.4.004/src/version.c	2013-08-14 17:11:14.000000000 +0200
+--- src/version.c	2013-08-14 17:38:05.000000000 +0200
+***************
+*** 729,730 ****
+--- 729,732 ----
+  {   /* Add new patch number below this line */
++ /**/
++     5,
+  /**/
+
+-- 
+You can't have everything.  Where would you put it?
+		-- Steven Wright
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
+///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\  an exciting new programming language -- http://www.Zimbu.org        ///
+ \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.006 b/pkgs/applications/editors/vim/patches/7.4.006
new file mode 100644
index 000000000000..55d3802c4d14
--- /dev/null
+++ b/pkgs/applications/editors/vim/patches/7.4.006
@@ -0,0 +1,66 @@
+To: vim_dev@googlegroups.com
+Subject: Patch 7.4.006
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.4.006
+Problem:    mkdir("foo/bar/", "p") gives an error message. (David Barnett)
+Solution:   Remove the trailing slash. (lcd)
+Files:	    src/eval.c
+
+
+*** ../vim-7.4.005/src/eval.c	2013-07-05 18:23:42.000000000 +0200
+--- src/eval.c	2013-08-22 12:00:28.000000000 +0200
+***************
+*** 14292,14297 ****
+--- 14292,14301 ----
+  	return;
+  
+      dir = get_tv_string_buf(&argvars[0], buf);
++     if (*gettail(dir) == NUL)
++ 	/* remove trailing slashes */
++ 	*gettail_sep(dir) = NUL;
++ 
+      if (argvars[1].v_type != VAR_UNKNOWN)
+      {
+  	if (argvars[2].v_type != VAR_UNKNOWN)
+***************
+*** 14299,14305 ****
+  	if (prot != -1 && STRCMP(get_tv_string(&argvars[1]), "p") == 0)
+  	    mkdir_recurse(dir, prot);
+      }
+!     rettv->vval.v_number = prot != -1 ? vim_mkdir_emsg(dir, prot) : 0;
+  }
+  #endif
+  
+--- 14303,14309 ----
+  	if (prot != -1 && STRCMP(get_tv_string(&argvars[1]), "p") == 0)
+  	    mkdir_recurse(dir, prot);
+      }
+!     rettv->vval.v_number = prot == -1 ? FAIL : vim_mkdir_emsg(dir, prot);
+  }
+  #endif
+  
+*** ../vim-7.4.005/src/version.c	2013-08-14 17:45:25.000000000 +0200
+--- src/version.c	2013-08-22 12:02:46.000000000 +0200
+***************
+*** 729,730 ****
+--- 729,732 ----
+  {   /* Add new patch number below this line */
++ /**/
++     6,
+  /**/
+
+-- 
+hundred-and-one symptoms of being an internet addict:
+97. Your mother tells you to remember something, and you look for
+    a File/Save command.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
+///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\  an exciting new programming language -- http://www.Zimbu.org        ///
+ \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.007 b/pkgs/applications/editors/vim/patches/7.4.007
new file mode 100644
index 000000000000..5495ffbf9797
--- /dev/null
+++ b/pkgs/applications/editors/vim/patches/7.4.007
@@ -0,0 +1,95 @@
+To: vim_dev@googlegroups.com
+Subject: Patch 7.4.007
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.4.007
+Problem:    Creating a preview window on startup leaves the screen layout in a
+	    messed up state. (Marius Gedminas)
+Solution:   Don't change firstwin. (Christian Brabandt)
+Files:	    src/main.c
+
+
+*** ../vim-7.4.006/src/main.c	2013-07-03 12:36:49.000000000 +0200
+--- src/main.c	2013-08-22 14:02:39.000000000 +0200
+***************
+*** 2727,2732 ****
+--- 2727,2733 ----
+      int		arg_idx;		/* index in argument list */
+      int		i;
+      int		advance = TRUE;
++     win_T	*win;
+  
+  # ifdef FEAT_AUTOCMD
+      /*
+***************
+*** 2816,2839 ****
+  # ifdef FEAT_AUTOCMD
+      --autocmd_no_enter;
+  # endif
+  #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+!     /*
+!      * Avoid making a preview window the current window.
+!      */
+!     if (firstwin->w_p_pvw)
+      {
+!        win_T   *win;
+! 
+!        for (win = firstwin; win != NULL; win = win->w_next)
+!            if (!win->w_p_pvw)
+!            {
+!                firstwin = win;
+!                break;
+!            }
+      }
+  #endif
+!     /* make the first window the current window */
+!     win_enter(firstwin, FALSE);
+  
+  # ifdef FEAT_AUTOCMD
+      --autocmd_no_leave;
+--- 2817,2838 ----
+  # ifdef FEAT_AUTOCMD
+      --autocmd_no_enter;
+  # endif
++ 
++     /* make the first window the current window */
++     win = firstwin;
+  #if defined(FEAT_WINDOWS) && defined(FEAT_QUICKFIX)
+!     /* Avoid making a preview window the current window. */
+!     while (win->w_p_pvw)
+      {
+! 	win = win->w_next;
+! 	if (win == NULL)
+! 	{
+! 	    win = firstwin;
+! 	    break;
+! 	}
+      }
+  #endif
+!     win_enter(win, FALSE);
+  
+  # ifdef FEAT_AUTOCMD
+      --autocmd_no_leave;
+*** ../vim-7.4.006/src/version.c	2013-08-22 12:06:50.000000000 +0200
+--- src/version.c	2013-08-22 14:04:11.000000000 +0200
+***************
+*** 729,730 ****
+--- 729,732 ----
+  {   /* Add new patch number below this line */
++ /**/
++     7,
+  /**/
+
+-- 
+hundred-and-one symptoms of being an internet addict:
+105. When someone asks you for your address, you tell them your URL.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
+///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\  an exciting new programming language -- http://www.Zimbu.org        ///
+ \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.008 b/pkgs/applications/editors/vim/patches/7.4.008
new file mode 100644
index 000000000000..6abd493f9145
--- /dev/null
+++ b/pkgs/applications/editors/vim/patches/7.4.008
@@ -0,0 +1,71 @@
+To: vim_dev@googlegroups.com
+Subject: Patch 7.4.008
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.4.008
+Problem:    New regexp engine can't be interrupted.
+Solution:   Check for CTRL-C pressed. (Yasuhiro Matsumoto)
+Files:	    src/regexp_nfa.c, src/regexp.c
+
+
+*** ../vim-7.4.007/src/regexp_nfa.c	2013-08-14 14:18:37.000000000 +0200
+--- src/regexp_nfa.c	2013-08-25 16:55:56.000000000 +0200
+***************
+*** 5089,5094 ****
+--- 5089,5100 ----
+  	return FALSE;
+      }
+  #endif
++     /* Some patterns may take a long time to match, especially when using
++      * recursive_regmatch(). Allow interrupting them with CTRL-C. */
++     fast_breakcheck();
++     if (got_int)
++ 	return FALSE;
++ 
+      nfa_match = FALSE;
+  
+      /* Allocate memory for the lists of nodes. */
+*** ../vim-7.4.007/src/regexp.c	2013-08-01 18:31:30.000000000 +0200
+--- src/regexp.c	2013-08-25 16:57:35.000000000 +0200
+***************
+*** 4311,4318 ****
+     */
+    for (;;)
+    {
+!     /* Some patterns may cause a long time to match, even though they are not
+!      * illegal.  E.g., "\([a-z]\+\)\+Q".  Allow breaking them with CTRL-C. */
+      fast_breakcheck();
+  
+  #ifdef DEBUG
+--- 4311,4318 ----
+     */
+    for (;;)
+    {
+!     /* Some patterns may take a long time to match, e.g., "\([a-z]\+\)\+Q".
+!      * Allow interrupting them with CTRL-C. */
+      fast_breakcheck();
+  
+  #ifdef DEBUG
+*** ../vim-7.4.007/src/version.c	2013-08-22 14:14:23.000000000 +0200
+--- src/version.c	2013-08-25 16:57:51.000000000 +0200
+***************
+*** 729,730 ****
+--- 729,732 ----
+  {   /* Add new patch number below this line */
++ /**/
++     8,
+  /**/
+
+-- 
+hundred-and-one symptoms of being an internet addict:
+124. You begin conversations with, "Who is your internet service provider?"
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
+///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\  an exciting new programming language -- http://www.Zimbu.org        ///
+ \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.009 b/pkgs/applications/editors/vim/patches/7.4.009
new file mode 100644
index 000000000000..f5e5fa609126
--- /dev/null
+++ b/pkgs/applications/editors/vim/patches/7.4.009
@@ -0,0 +1,64 @@
+To: vim_dev@googlegroups.com
+Subject: Patch 7.4.009
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.4.009
+Problem:    When a file was not decrypted (yet), writing it may destroy the
+	    contents.
+Solution:   Mark the file as readonly until decryption was done. (Christian
+	    Brabandt)
+Files:	    src/fileio.c
+
+
+*** ../vim-7.4.008/src/fileio.c	2013-08-05 21:58:03.000000000 +0200
+--- src/fileio.c	2013-08-25 17:45:27.000000000 +0200
+***************
+*** 2926,2934 ****
+--- 2926,2939 ----
+      int		*did_ask;	/* flag: whether already asked for key */
+  {
+      int method = crypt_method_from_magic((char *)ptr, *sizep);
++     int b_p_ro = curbuf->b_p_ro;
+  
+      if (method >= 0)
+      {
++ 	/* Mark the buffer as read-only until the decryption has taken place.
++ 	 * Avoids accidentally overwriting the file with garbage. */
++ 	curbuf->b_p_ro = TRUE;
++ 
+  	set_crypt_method(curbuf, method);
+  	if (method > 0)
+  	    (void)blowfish_self_test();
+***************
+*** 2977,2982 ****
+--- 2982,2989 ----
+  	    *sizep -= CRYPT_MAGIC_LEN + salt_len + seed_len;
+  	    mch_memmove(ptr, ptr + CRYPT_MAGIC_LEN + salt_len + seed_len,
+  							      (size_t)*sizep);
++ 	    /* Restore the read-only flag. */
++ 	    curbuf->b_p_ro = b_p_ro;
+  	}
+      }
+      /* When starting to edit a new file which does not have encryption, clear
+*** ../vim-7.4.008/src/version.c	2013-08-25 17:01:36.000000000 +0200
+--- src/version.c	2013-08-25 17:44:30.000000000 +0200
+***************
+*** 729,730 ****
+--- 729,732 ----
+  {   /* Add new patch number below this line */
++ /**/
++     9,
+  /**/
+
+-- 
+I have a watch cat! Just break in and she'll watch.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
+///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\  an exciting new programming language -- http://www.Zimbu.org        ///
+ \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.010 b/pkgs/applications/editors/vim/patches/7.4.010
new file mode 100644
index 000000000000..fee6ba5b4a84
--- /dev/null
+++ b/pkgs/applications/editors/vim/patches/7.4.010
@@ -0,0 +1,79 @@
+To: vim_dev@googlegroups.com
+Subject: Patch 7.4.010
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.4.010 (after 7.4.006)
+Problem:    Crash with invalid argument to mkdir().
+Solution:   Check for empty string. (lcd47)
+Files:	    src/eval.c
+
+
+*** ../vim-7.4.009/src/eval.c	2013-08-22 12:06:50.000000000 +0200
+--- src/eval.c	2013-08-30 15:47:47.000000000 +0200
+***************
+*** 14292,14309 ****
+  	return;
+  
+      dir = get_tv_string_buf(&argvars[0], buf);
+!     if (*gettail(dir) == NUL)
+! 	/* remove trailing slashes */
+! 	*gettail_sep(dir) = NUL;
+! 
+!     if (argvars[1].v_type != VAR_UNKNOWN)
+      {
+! 	if (argvars[2].v_type != VAR_UNKNOWN)
+! 	    prot = get_tv_number_chk(&argvars[2], NULL);
+! 	if (prot != -1 && STRCMP(get_tv_string(&argvars[1]), "p") == 0)
+! 	    mkdir_recurse(dir, prot);
+      }
+-     rettv->vval.v_number = prot == -1 ? FAIL : vim_mkdir_emsg(dir, prot);
+  }
+  #endif
+  
+--- 14292,14314 ----
+  	return;
+  
+      dir = get_tv_string_buf(&argvars[0], buf);
+!     if (*dir == NUL)
+! 	rettv->vval.v_number = FAIL;
+!     else
+      {
+! 	if (*gettail(dir) == NUL)
+! 	    /* remove trailing slashes */
+! 	    *gettail_sep(dir) = NUL;
+! 
+! 	if (argvars[1].v_type != VAR_UNKNOWN)
+! 	{
+! 	    if (argvars[2].v_type != VAR_UNKNOWN)
+! 		prot = get_tv_number_chk(&argvars[2], NULL);
+! 	    if (prot != -1 && STRCMP(get_tv_string(&argvars[1]), "p") == 0)
+! 		mkdir_recurse(dir, prot);
+! 	}
+! 	rettv->vval.v_number = prot == -1 ? FAIL : vim_mkdir_emsg(dir, prot);
+      }
+  }
+  #endif
+  
+*** ../vim-7.4.009/src/version.c	2013-08-25 17:46:05.000000000 +0200
+--- src/version.c	2013-08-30 15:48:37.000000000 +0200
+***************
+*** 729,730 ****
+--- 729,732 ----
+  {   /* Add new patch number below this line */
++ /**/
++     10,
+  /**/
+
+-- 
+I wish there was a knob on the TV to turn up the intelligence.
+There's a knob called "brightness", but it doesn't seem to work. 
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
+///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\  an exciting new programming language -- http://www.Zimbu.org        ///
+ \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.011 b/pkgs/applications/editors/vim/patches/7.4.011
new file mode 100644
index 000000000000..efff82c5eba9
--- /dev/null
+++ b/pkgs/applications/editors/vim/patches/7.4.011
@@ -0,0 +1,100 @@
+To: vim_dev@googlegroups.com
+Subject: Patch 7.4.011
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.4.011
+Problem:    Cannot find out if "acl" and "xpm" features are supported.
+Solution:   Add "acl" and "xpm" to the list of features. (Ken Takata)
+Files:	    src/eval.c, src/version.c
+
+
+*** ../vim-7.4.010/src/eval.c	2013-08-30 16:00:04.000000000 +0200
+--- src/eval.c	2013-08-30 16:34:12.000000000 +0200
+***************
+*** 12135,12140 ****
+--- 12135,12143 ----
+  #ifndef CASE_INSENSITIVE_FILENAME
+  	"fname_case",
+  #endif
++ #ifdef HAVE_ACL
++ 	"acl",
++ #endif
+  #ifdef FEAT_ARABIC
+  	"arabic",
+  #endif
+***************
+*** 12538,12544 ****
+  	"xfontset",
+  #endif
+  #ifdef FEAT_XPM_W32
+! 	"xpm_w32",
+  #endif
+  #ifdef USE_XSMP
+  	"xsmp",
+--- 12541,12552 ----
+  	"xfontset",
+  #endif
+  #ifdef FEAT_XPM_W32
+! 	"xpm",
+! 	"xpm_w32",	/* for backward compatibility */
+! #else
+! # if defined(HAVE_XPM)
+! 	"xpm",
+! # endif
+  #endif
+  #ifdef USE_XSMP
+  	"xsmp",
+*** ../vim-7.4.010/src/version.c	2013-08-30 16:00:04.000000000 +0200
+--- src/version.c	2013-08-30 16:34:37.000000000 +0200
+***************
+*** 60,65 ****
+--- 60,70 ----
+  
+  static char *(features[]) =
+  {
++ #ifdef HAVE_ACL
++ 	"+acl",
++ #else
++ 	"-acl",
++ #endif
+  #ifdef AMIGA		/* only for Amiga systems */
+  # ifdef FEAT_ARP
+  	"+ARP",
+***************
+*** 721,726 ****
+--- 726,737 ----
+  # else
+  	"-xpm_w32",
+  # endif
++ #else
++ # ifdef HAVE_XPM
++ 	"+xpm",
++ # else
++ 	"-xpm",
++ # endif
+  #endif
+  	NULL
+  };
+*** ../vim-7.4.010/src/version.c	2013-08-30 16:00:04.000000000 +0200
+--- src/version.c	2013-08-30 16:34:37.000000000 +0200
+***************
+*** 729,730 ****
+--- 740,743 ----
+  {   /* Add new patch number below this line */
++ /**/
++     11,
+  /**/
+
+-- 
+hundred-and-one symptoms of being an internet addict:
+141. You'd rather go to http://www.weather.com/ than look out your window.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
+///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\  an exciting new programming language -- http://www.Zimbu.org        ///
+ \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.012 b/pkgs/applications/editors/vim/patches/7.4.012
new file mode 100644
index 000000000000..f831442ea569
--- /dev/null
+++ b/pkgs/applications/editors/vim/patches/7.4.012
@@ -0,0 +1,202 @@
+To: vim_dev@googlegroups.com
+Subject: Patch 7.4.012
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.4.012
+Problem:    MS-Windows: resolving shortcut does not work properly with
+	    multi-byte characters.
+Solution:   Use wide system functions. (Ken Takata)
+Files:	    src/os_mswin.c
+
+
+*** ../vim-7.4.011/src/os_mswin.c	2013-06-16 16:41:11.000000000 +0200
+--- src/os_mswin.c	2013-08-30 16:43:23.000000000 +0200
+***************
+*** 1761,1769 ****
+      IPersistFile	*ppf = NULL;
+      OLECHAR		wsz[MAX_PATH];
+      WIN32_FIND_DATA	ffd; // we get those free of charge
+!     TCHAR		buf[MAX_PATH]; // could have simply reused 'wsz'...
+      char_u		*rfname = NULL;
+      int			len;
+  
+      /* Check if the file name ends in ".lnk". Avoid calling
+       * CoCreateInstance(), it's quite slow. */
+--- 1761,1773 ----
+      IPersistFile	*ppf = NULL;
+      OLECHAR		wsz[MAX_PATH];
+      WIN32_FIND_DATA	ffd; // we get those free of charge
+!     CHAR		buf[MAX_PATH]; // could have simply reused 'wsz'...
+      char_u		*rfname = NULL;
+      int			len;
++ # ifdef FEAT_MBYTE
++     IShellLinkW		*pslw = NULL;
++     WIN32_FIND_DATAW	ffdw; // we get those free of charge
++ # endif
+  
+      /* Check if the file name ends in ".lnk". Avoid calling
+       * CoCreateInstance(), it's quite slow. */
+***************
+*** 1775,1792 ****
+  
+      CoInitialize(NULL);
+  
+      // create a link manager object and request its interface
+      hr = CoCreateInstance(
+  	    &CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
+  	    &IID_IShellLink, (void**)&psl);
+      if (hr != S_OK)
+! 	goto shortcut_error;
+  
+      // Get a pointer to the IPersistFile interface.
+      hr = psl->lpVtbl->QueryInterface(
+  	    psl, &IID_IPersistFile, (void**)&ppf);
+      if (hr != S_OK)
+! 	goto shortcut_error;
+  
+      // full path string must be in Unicode.
+      MultiByteToWideChar(CP_ACP, 0, fname, -1, wsz, MAX_PATH);
+--- 1779,1840 ----
+  
+      CoInitialize(NULL);
+  
++ # ifdef FEAT_MBYTE
++     if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
++     {
++ 	// create a link manager object and request its interface
++ 	hr = CoCreateInstance(
++ 		&CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
++ 		&IID_IShellLinkW, (void**)&pslw);
++ 	if (hr == S_OK)
++ 	{
++ 	    WCHAR	*p = enc_to_utf16(fname, NULL);
++ 
++ 	    if (p != NULL)
++ 	    {
++ 		// Get a pointer to the IPersistFile interface.
++ 		hr = pslw->lpVtbl->QueryInterface(
++ 			pslw, &IID_IPersistFile, (void**)&ppf);
++ 		if (hr != S_OK)
++ 		    goto shortcut_errorw;
++ 
++ 		// "load" the name and resolve the link
++ 		hr = ppf->lpVtbl->Load(ppf, p, STGM_READ);
++ 		if (hr != S_OK)
++ 		    goto shortcut_errorw;
++ #  if 0  // This makes Vim wait a long time if the target does not exist.
++ 		hr = pslw->lpVtbl->Resolve(pslw, NULL, SLR_NO_UI);
++ 		if (hr != S_OK)
++ 		    goto shortcut_errorw;
++ #  endif
++ 
++ 		// Get the path to the link target.
++ 		ZeroMemory(wsz, MAX_PATH * sizeof(WCHAR));
++ 		hr = pslw->lpVtbl->GetPath(pslw, wsz, MAX_PATH, &ffdw, 0);
++ 		if (hr == S_OK && wsz[0] != NUL)
++ 		    rfname = utf16_to_enc(wsz, NULL);
++ 
++ shortcut_errorw:
++ 		vim_free(p);
++ 		if (hr == S_OK)
++ 		    goto shortcut_end;
++ 	    }
++ 	}
++ 	/* Retry with non-wide function (for Windows 98). */
++     }
++ # endif
+      // create a link manager object and request its interface
+      hr = CoCreateInstance(
+  	    &CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
+  	    &IID_IShellLink, (void**)&psl);
+      if (hr != S_OK)
+! 	goto shortcut_end;
+  
+      // Get a pointer to the IPersistFile interface.
+      hr = psl->lpVtbl->QueryInterface(
+  	    psl, &IID_IPersistFile, (void**)&ppf);
+      if (hr != S_OK)
+! 	goto shortcut_end;
+  
+      // full path string must be in Unicode.
+      MultiByteToWideChar(CP_ACP, 0, fname, -1, wsz, MAX_PATH);
+***************
+*** 1794,1805 ****
+      // "load" the name and resolve the link
+      hr = ppf->lpVtbl->Load(ppf, wsz, STGM_READ);
+      if (hr != S_OK)
+! 	goto shortcut_error;
+! #if 0  // This makes Vim wait a long time if the target doesn't exist.
+      hr = psl->lpVtbl->Resolve(psl, NULL, SLR_NO_UI);
+      if (hr != S_OK)
+! 	goto shortcut_error;
+! #endif
+  
+      // Get the path to the link target.
+      ZeroMemory(buf, MAX_PATH);
+--- 1842,1853 ----
+      // "load" the name and resolve the link
+      hr = ppf->lpVtbl->Load(ppf, wsz, STGM_READ);
+      if (hr != S_OK)
+! 	goto shortcut_end;
+! # if 0  // This makes Vim wait a long time if the target doesn't exist.
+      hr = psl->lpVtbl->Resolve(psl, NULL, SLR_NO_UI);
+      if (hr != S_OK)
+! 	goto shortcut_end;
+! # endif
+  
+      // Get the path to the link target.
+      ZeroMemory(buf, MAX_PATH);
+***************
+*** 1807,1818 ****
+      if (hr == S_OK && buf[0] != NUL)
+  	rfname = vim_strsave(buf);
+  
+! shortcut_error:
+      // Release all interface pointers (both belong to the same object)
+      if (ppf != NULL)
+  	ppf->lpVtbl->Release(ppf);
+      if (psl != NULL)
+  	psl->lpVtbl->Release(psl);
+  
+      CoUninitialize();
+      return rfname;
+--- 1855,1870 ----
+      if (hr == S_OK && buf[0] != NUL)
+  	rfname = vim_strsave(buf);
+  
+! shortcut_end:
+      // Release all interface pointers (both belong to the same object)
+      if (ppf != NULL)
+  	ppf->lpVtbl->Release(ppf);
+      if (psl != NULL)
+  	psl->lpVtbl->Release(psl);
++ # ifdef FEAT_MBYTE
++     if (pslw != NULL)
++ 	pslw->lpVtbl->Release(pslw);
++ # endif
+  
+      CoUninitialize();
+      return rfname;
+*** ../vim-7.4.011/src/version.c	2013-08-30 16:35:41.000000000 +0200
+--- src/version.c	2013-08-30 16:39:40.000000000 +0200
+***************
+*** 740,741 ****
+--- 740,743 ----
+  {   /* Add new patch number below this line */
++ /**/
++     12,
+  /**/
+
+-- 
+hundred-and-one symptoms of being an internet addict:
+142. You dream about creating the world's greatest web site.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
+///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\  an exciting new programming language -- http://www.Zimbu.org        ///
+ \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.013 b/pkgs/applications/editors/vim/patches/7.4.013
new file mode 100644
index 000000000000..dcbe0fb3e43d
--- /dev/null
+++ b/pkgs/applications/editors/vim/patches/7.4.013
@@ -0,0 +1,99 @@
+To: vim_dev@googlegroups.com
+Subject: Patch 7.4.013
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.4.013
+Problem:    File name buffer too small for utf-8.
+Solution:   Use character count instead of byte count. (Ken Takata)
+Files:	    src/os_mswin.c
+
+
+*** ../vim-7.4.012/src/os_mswin.c	2013-08-30 16:44:15.000000000 +0200
+--- src/os_mswin.c	2013-08-30 16:47:54.000000000 +0200
+***************
+*** 456,462 ****
+--- 456,469 ----
+      int
+  mch_isFullName(char_u *fname)
+  {
++ #ifdef FEAT_MBYTE
++     /* WinNT and later can use _MAX_PATH wide characters for a pathname, which
++      * means that the maximum pathname is _MAX_PATH * 3 bytes when 'enc' is
++      * UTF-8. */
++     char szName[_MAX_PATH * 3 + 1];
++ #else
+      char szName[_MAX_PATH + 1];
++ #endif
+  
+      /* A name like "d:/foo" and "//server/share" is absolute */
+      if ((fname[0] && fname[1] == ':' && (fname[2] == '/' || fname[2] == '\\'))
+***************
+*** 464,470 ****
+  	return TRUE;
+  
+      /* A name that can't be made absolute probably isn't absolute. */
+!     if (mch_FullName(fname, szName, _MAX_PATH, FALSE) == FAIL)
+  	return FALSE;
+  
+      return pathcmp(fname, szName, -1) == 0;
+--- 471,477 ----
+  	return TRUE;
+  
+      /* A name that can't be made absolute probably isn't absolute. */
+!     if (mch_FullName(fname, szName, sizeof(szName) - 1, FALSE) == FAIL)
+  	return FALSE;
+  
+      return pathcmp(fname, szName, -1) == 0;
+***************
+*** 498,507 ****
+      int
+  vim_stat(const char *name, struct stat *stp)
+  {
+      char	buf[_MAX_PATH + 1];
+      char	*p;
+  
+!     vim_strncpy((char_u *)buf, (char_u *)name, _MAX_PATH);
+      p = buf + strlen(buf);
+      if (p > buf)
+  	mb_ptr_back(buf, p);
+--- 505,521 ----
+      int
+  vim_stat(const char *name, struct stat *stp)
+  {
++ #ifdef FEAT_MBYTE
++     /* WinNT and later can use _MAX_PATH wide characters for a pathname, which
++      * means that the maximum pathname is _MAX_PATH * 3 bytes when 'enc' is
++      * UTF-8. */
++     char	buf[_MAX_PATH * 3 + 1];
++ #else
+      char	buf[_MAX_PATH + 1];
++ #endif
+      char	*p;
+  
+!     vim_strncpy((char_u *)buf, (char_u *)name, sizeof(buf) - 1);
+      p = buf + strlen(buf);
+      if (p > buf)
+  	mb_ptr_back(buf, p);
+*** ../vim-7.4.012/src/version.c	2013-08-30 16:44:15.000000000 +0200
+--- src/version.c	2013-08-30 16:47:36.000000000 +0200
+***************
+*** 740,741 ****
+--- 740,743 ----
+  {   /* Add new patch number below this line */
++ /**/
++     13,
+  /**/
+
+-- 
+hundred-and-one symptoms of being an internet addict:
+143. You dream in pallettes of 216 websafe colors.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
+///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\  an exciting new programming language -- http://www.Zimbu.org        ///
+ \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.014 b/pkgs/applications/editors/vim/patches/7.4.014
new file mode 100644
index 000000000000..f6554337f27f
--- /dev/null
+++ b/pkgs/applications/editors/vim/patches/7.4.014
@@ -0,0 +1,102 @@
+To: vim_dev@googlegroups.com
+Subject: Patch 7.4.014
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.4.014
+Problem:    MS-Windows: check for writing to device does not work.
+Solution:   Fix #ifdefs. (Ken Takata)
+Files:	    src/fileio.c
+
+
+*** ../vim-7.4.013/src/fileio.c	2013-08-25 17:46:05.000000000 +0200
+--- src/fileio.c	2013-08-30 16:56:46.000000000 +0200
+***************
+*** 428,440 ****
+  	}
+      }
+  
+- #ifdef UNIX
+-     /*
+-      * On Unix it is possible to read a directory, so we have to
+-      * check for it before the mch_open().
+-      */
+      if (!read_stdin && !read_buffer)
+      {
+  	perm = mch_getperm(fname);
+  	if (perm >= 0 && !S_ISREG(perm)		    /* not a regular file ... */
+  # ifdef S_ISFIFO
+--- 428,440 ----
+  	}
+      }
+  
+      if (!read_stdin && !read_buffer)
+      {
++ #ifdef UNIX
++ 	/*
++ 	 * On Unix it is possible to read a directory, so we have to
++ 	 * check for it before the mch_open().
++ 	 */
+  	perm = mch_getperm(fname);
+  	if (perm >= 0 && !S_ISREG(perm)		    /* not a regular file ... */
+  # ifdef S_ISFIFO
+***************
+*** 457,464 ****
+  	    msg_scroll = msg_save;
+  	    return FAIL;
+  	}
+! 
+! # if defined(MSDOS) || defined(MSWIN) || defined(OS2)
+  	/*
+  	 * MS-Windows allows opening a device, but we will probably get stuck
+  	 * trying to read it.
+--- 457,464 ----
+  	    msg_scroll = msg_save;
+  	    return FAIL;
+  	}
+! #endif
+! #if defined(MSDOS) || defined(MSWIN) || defined(OS2)
+  	/*
+  	 * MS-Windows allows opening a device, but we will probably get stuck
+  	 * trying to read it.
+***************
+*** 470,478 ****
+  	    msg_scroll = msg_save;
+  	    return FAIL;
+  	}
+- # endif
+-     }
+  #endif
+  
+      /* Set default or forced 'fileformat' and 'binary'. */
+      set_file_options(set_options, eap);
+--- 470,477 ----
+  	    msg_scroll = msg_save;
+  	    return FAIL;
+  	}
+  #endif
++     }
+  
+      /* Set default or forced 'fileformat' and 'binary'. */
+      set_file_options(set_options, eap);
+*** ../vim-7.4.013/src/version.c	2013-08-30 16:51:15.000000000 +0200
+--- src/version.c	2013-08-30 16:54:33.000000000 +0200
+***************
+*** 740,741 ****
+--- 740,743 ----
+  {   /* Add new patch number below this line */
++ /**/
++     14,
+  /**/
+
+-- 
+Drink wet cement and get really stoned.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
+///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\  an exciting new programming language -- http://www.Zimbu.org        ///
+ \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.015 b/pkgs/applications/editors/vim/patches/7.4.015
new file mode 100644
index 000000000000..e8b284d12b37
--- /dev/null
+++ b/pkgs/applications/editors/vim/patches/7.4.015
@@ -0,0 +1,106 @@
+To: vim_dev@googlegroups.com
+Subject: Patch 7.4.015
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.4.015
+Problem:    MS-Windows: Detecting node type does not work for multi-byte
+	    characters.
+Solution:   Use wide character function when needed. (Ken Takata)
+Files:	    src/os_win32.c
+
+
+*** ../vim-7.4.014/src/os_win32.c	2013-08-10 12:39:12.000000000 +0200
+--- src/os_win32.c	2013-08-30 17:09:47.000000000 +0200
+***************
+*** 3107,3112 ****
+--- 3107,3115 ----
+  {
+      HANDLE	hFile;
+      int		type;
++ #ifdef FEAT_MBYTE
++     WCHAR	*wn = NULL;
++ #endif
+  
+      /* We can't open a file with a name "\\.\con" or "\\.\prn" and trying to
+       * read from it later will cause Vim to hang.  Thus return NODE_WRITABLE
+***************
+*** 3114,3127 ****
+      if (STRNCMP(name, "\\\\.\\", 4) == 0)
+  	return NODE_WRITABLE;
+  
+!     hFile = CreateFile(name,		/* file name */
+! 		GENERIC_WRITE,		/* access mode */
+! 		0,			/* share mode */
+! 		NULL,			/* security descriptor */
+! 		OPEN_EXISTING,		/* creation disposition */
+! 		0,			/* file attributes */
+! 		NULL);			/* handle to template file */
+  
+      if (hFile == INVALID_HANDLE_VALUE)
+  	return NODE_NORMAL;
+  
+--- 3117,3157 ----
+      if (STRNCMP(name, "\\\\.\\", 4) == 0)
+  	return NODE_WRITABLE;
+  
+! #ifdef FEAT_MBYTE
+!     if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
+!     {
+! 	wn = enc_to_utf16(name, NULL);
+! 	if (wn != NULL)
+! 	{
+! 	    hFile = CreateFileW(wn,	/* file name */
+! 			GENERIC_WRITE,	/* access mode */
+! 			0,		/* share mode */
+! 			NULL,		/* security descriptor */
+! 			OPEN_EXISTING,	/* creation disposition */
+! 			0,		/* file attributes */
+! 			NULL);		/* handle to template file */
+! 	    if (hFile == INVALID_HANDLE_VALUE
+! 			      && GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
+! 	    {
+! 		/* Retry with non-wide function (for Windows 98). */
+! 		vim_free(wn);
+! 		wn = NULL;
+! 	    }
+! 	}
+!     }
+!     if (wn == NULL)
+! #endif
+! 	hFile = CreateFile(name,	/* file name */
+! 		    GENERIC_WRITE,	/* access mode */
+! 		    0,			/* share mode */
+! 		    NULL,		/* security descriptor */
+! 		    OPEN_EXISTING,	/* creation disposition */
+! 		    0,			/* file attributes */
+! 		    NULL);		/* handle to template file */
+  
++ #ifdef FEAT_MBYTE
++     vim_free(wn);
++ #endif
+      if (hFile == INVALID_HANDLE_VALUE)
+  	return NODE_NORMAL;
+  
+*** ../vim-7.4.014/src/version.c	2013-08-30 17:06:56.000000000 +0200
+--- src/version.c	2013-08-30 17:09:35.000000000 +0200
+***************
+*** 740,741 ****
+--- 740,743 ----
+  {   /* Add new patch number below this line */
++ /**/
++     15,
+  /**/
+
+-- 
+hundred-and-one symptoms of being an internet addict:
+144. You eagerly await the update of the "Cool Site of the Day."
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
+///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\  an exciting new programming language -- http://www.Zimbu.org        ///
+ \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.016 b/pkgs/applications/editors/vim/patches/7.4.016
new file mode 100644
index 000000000000..c58c605f5c15
--- /dev/null
+++ b/pkgs/applications/editors/vim/patches/7.4.016
@@ -0,0 +1,221 @@
+To: vim_dev@googlegroups.com
+Subject: Patch 7.4.016
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.4.016
+Problem:    MS-Windows: File name completion doesn't work properly with
+	    Chinese characters. (Yue Wu)
+Solution:   Add fname_casew(). (Ken Takata)
+Files:	    src/os_win32.c
+
+
+*** ../vim-7.4.015/src/os_win32.c	2013-08-30 17:11:29.000000000 +0200
+--- src/os_win32.c	2013-08-30 17:28:30.000000000 +0200
+***************
+*** 2500,2508 ****
+--- 2500,2624 ----
+  }
+  
+  
++ #ifdef FEAT_MBYTE
++ /*
++  * fname_casew(): Wide version of fname_case().  Set the case of the file name,
++  * if it already exists.  When "len" is > 0, also expand short to long
++  * filenames.
++  * Return FAIL if wide functions are not available, OK otherwise.
++  * NOTE: much of this is identical to fname_case(), keep in sync!
++  */
++     static int
++ fname_casew(
++     WCHAR	*name,
++     int		len)
++ {
++     WCHAR		szTrueName[_MAX_PATH + 2];
++     WCHAR		szTrueNameTemp[_MAX_PATH + 2];
++     WCHAR		*ptrue, *ptruePrev;
++     WCHAR		*porig, *porigPrev;
++     int			flen;
++     WIN32_FIND_DATAW	fb;
++     HANDLE		hFind;
++     int			c;
++     int			slen;
++ 
++     flen = (int)wcslen(name);
++     if (flen > _MAX_PATH)
++ 	return OK;
++ 
++     /* slash_adjust(name) not needed, already adjusted by fname_case(). */
++ 
++     /* Build the new name in szTrueName[] one component at a time. */
++     porig = name;
++     ptrue = szTrueName;
++ 
++     if (iswalpha(porig[0]) && porig[1] == L':')
++     {
++ 	/* copy leading drive letter */
++ 	*ptrue++ = *porig++;
++ 	*ptrue++ = *porig++;
++ 	*ptrue = NUL;	    /* in case nothing follows */
++     }
++ 
++     while (*porig != NUL)
++     {
++ 	/* copy \ characters */
++ 	while (*porig == psepc)
++ 	    *ptrue++ = *porig++;
++ 
++ 	ptruePrev = ptrue;
++ 	porigPrev = porig;
++ 	while (*porig != NUL && *porig != psepc)
++ 	{
++ 	    *ptrue++ = *porig++;
++ 	}
++ 	*ptrue = NUL;
++ 
++ 	/* To avoid a slow failure append "\*" when searching a directory,
++ 	 * server or network share. */
++ 	wcscpy(szTrueNameTemp, szTrueName);
++ 	slen = (int)wcslen(szTrueNameTemp);
++ 	if (*porig == psepc && slen + 2 < _MAX_PATH)
++ 	    wcscpy(szTrueNameTemp + slen, L"\\*");
++ 
++ 	/* Skip "", "." and "..". */
++ 	if (ptrue > ptruePrev
++ 		&& (ptruePrev[0] != L'.'
++ 		    || (ptruePrev[1] != NUL
++ 			&& (ptruePrev[1] != L'.' || ptruePrev[2] != NUL)))
++ 		&& (hFind = FindFirstFileW(szTrueNameTemp, &fb))
++ 						      != INVALID_HANDLE_VALUE)
++ 	{
++ 	    c = *porig;
++ 	    *porig = NUL;
++ 
++ 	    /* Only use the match when it's the same name (ignoring case) or
++ 	     * expansion is allowed and there is a match with the short name
++ 	     * and there is enough room. */
++ 	    if (_wcsicoll(porigPrev, fb.cFileName) == 0
++ 		    || (len > 0
++ 			&& (_wcsicoll(porigPrev, fb.cAlternateFileName) == 0
++ 			    && (int)(ptruePrev - szTrueName)
++ 					   + (int)wcslen(fb.cFileName) < len)))
++ 	    {
++ 		wcscpy(ptruePrev, fb.cFileName);
++ 
++ 		/* Look for exact match and prefer it if found.  Must be a
++ 		 * long name, otherwise there would be only one match. */
++ 		while (FindNextFileW(hFind, &fb))
++ 		{
++ 		    if (*fb.cAlternateFileName != NUL
++ 			    && (wcscoll(porigPrev, fb.cFileName) == 0
++ 				|| (len > 0
++ 				    && (_wcsicoll(porigPrev,
++ 						   fb.cAlternateFileName) == 0
++ 				    && (int)(ptruePrev - szTrueName)
++ 					 + (int)wcslen(fb.cFileName) < len))))
++ 		    {
++ 			wcscpy(ptruePrev, fb.cFileName);
++ 			break;
++ 		    }
++ 		}
++ 	    }
++ 	    FindClose(hFind);
++ 	    *porig = c;
++ 	    ptrue = ptruePrev + wcslen(ptruePrev);
++ 	}
++ 	else if (hFind == INVALID_HANDLE_VALUE
++ 		&& GetLastError() == ERROR_CALL_NOT_IMPLEMENTED)
++ 	    return FAIL;
++     }
++ 
++     wcscpy(name, szTrueName);
++     return OK;
++ }
++ #endif
++ 
+  /*
+   * fname_case(): Set the case of the file name, if it already exists.
+   * When "len" is > 0, also expand short to long filenames.
++  * NOTE: much of this is identical to fname_casew(), keep in sync!
+   */
+      void
+  fname_case(
+***************
+*** 2520,2530 ****
+      int			slen;
+  
+      flen = (int)STRLEN(name);
+!     if (flen == 0 || flen > _MAX_PATH)
+  	return;
+  
+      slash_adjust(name);
+  
+      /* Build the new name in szTrueName[] one component at a time. */
+      porig = name;
+      ptrue = szTrueName;
+--- 2636,2679 ----
+      int			slen;
+  
+      flen = (int)STRLEN(name);
+!     if (flen == 0)
+  	return;
+  
+      slash_adjust(name);
+  
++ #ifdef FEAT_MBYTE
++     if (enc_codepage >= 0 && (int)GetACP() != enc_codepage)
++     {
++ 	WCHAR	*p = enc_to_utf16(name, NULL);
++ 
++ 	if (p != NULL)
++ 	{
++ 	    char_u	*q;
++ 	    WCHAR	buf[_MAX_PATH + 2];
++ 
++ 	    wcscpy(buf, p);
++ 	    vim_free(p);
++ 
++ 	    if (fname_casew(buf, (len > 0) ? _MAX_PATH : 0) == OK)
++ 	    {
++ 		q = utf16_to_enc(buf, NULL);
++ 		if (q != NULL)
++ 		{
++ 		    vim_strncpy(name, q, (len > 0) ? len - 1 : flen);
++ 		    vim_free(q);
++ 		    return;
++ 		}
++ 	    }
++ 	}
++ 	/* Retry with non-wide function (for Windows 98). */
++     }
++ #endif
++ 
++     /* If 'enc' is utf-8, flen can be larger than _MAX_PATH.
++      * So we should check this after calling wide function. */
++     if (flen > _MAX_PATH)
++ 	return;
++ 
+      /* Build the new name in szTrueName[] one component at a time. */
+      porig = name;
+      ptrue = szTrueName;
+*** ../vim-7.4.015/src/version.c	2013-08-30 17:11:29.000000000 +0200
+--- src/version.c	2013-08-30 17:15:06.000000000 +0200
+***************
+*** 740,741 ****
+--- 740,743 ----
+  {   /* Add new patch number below this line */
++ /**/
++     16,
+  /**/
+
+-- 
+Fingers not found - Pound head on keyboard to continue.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
+///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\  an exciting new programming language -- http://www.Zimbu.org        ///
+ \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.017 b/pkgs/applications/editors/vim/patches/7.4.017
new file mode 100644
index 000000000000..7d7fad83fe79
--- /dev/null
+++ b/pkgs/applications/editors/vim/patches/7.4.017
@@ -0,0 +1,78 @@
+To: vim_dev@googlegroups.com
+Subject: Patch 7.4.017
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.4.017
+Problem:    ":help !!" does not find the "!!" tag in the help file. (Ben
+	    Fritz)
+Solution:   When reading the start of the tags file do parse lines that are
+	    not header lines.
+Files:	    src/tag.c
+
+
+*** ../vim-7.4.016/src/tag.c	2013-06-15 22:26:26.000000000 +0200
+--- src/tag.c	2013-09-05 12:03:38.000000000 +0200
+***************
+*** 1797,1809 ****
+  	     */
+  	    if (state == TS_START)
+  	    {
+! 		/* The header ends when the line sorts below "!_TAG_".
+! 		 * There may be non-header items before the header though,
+! 		 * e.g. "!" itself. When case is folded lower case letters
+! 		 * sort before "_". */
+  		if (STRNCMP(lbuf, "!_TAG_", 6) <= 0
+  				|| (lbuf[0] == '!' && ASCII_ISLOWER(lbuf[1])))
+  		{
+  		    /*
+  		     * Read header line.
+  		     */
+--- 1797,1812 ----
+  	     */
+  	    if (state == TS_START)
+  	    {
+! 		/* The header ends when the line sorts below "!_TAG_".  When
+! 		 * case is folded lower case letters sort before "_". */
+  		if (STRNCMP(lbuf, "!_TAG_", 6) <= 0
+  				|| (lbuf[0] == '!' && ASCII_ISLOWER(lbuf[1])))
+  		{
++ 		    if (STRNCMP(lbuf, "!_TAG_", 6) != 0)
++ 			/* Non-header item before the header, e.g. "!" itself.
++ 			 */
++ 			goto parse_line;
++ 
+  		    /*
+  		     * Read header line.
+  		     */
+***************
+*** 1898,1903 ****
+--- 1901,1907 ----
+  #endif
+  	    }
+  
++ parse_line:
+  	    /*
+  	     * Figure out where the different strings are in this line.
+  	     * For "normal" tags: Do a quick check if the tag matches.
+*** ../vim-7.4.016/src/version.c	2013-08-30 17:29:10.000000000 +0200
+--- src/version.c	2013-09-05 12:02:01.000000000 +0200
+***************
+*** 740,741 ****
+--- 740,743 ----
+  {   /* Add new patch number below this line */
++ /**/
++     17,
+  /**/
+
+-- 
+An error has occurred.  Hit any user to continue.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
+///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\  an exciting new programming language -- http://www.Zimbu.org        ///
+ \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.018 b/pkgs/applications/editors/vim/patches/7.4.018
new file mode 100644
index 000000000000..2214c30b2b8a
--- /dev/null
+++ b/pkgs/applications/editors/vim/patches/7.4.018
@@ -0,0 +1,45 @@
+To: vim_dev@googlegroups.com
+Subject: Patch 7.4.018
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.4.018
+Problem:    When completing item becomes unselected. (Shougo Matsu)
+Solution:   Revert patch 7.3.1269.
+Files:	    src/edit.c
+
+
+*** ../vim-7.4.017/src/edit.c	2013-07-04 20:22:25.000000000 +0200
+--- src/edit.c	2013-09-05 12:39:53.000000000 +0200
+***************
+*** 3467,3473 ****
+      }
+  
+      compl_enter_selects = !compl_used_match;
+-     compl_shown_match = compl_curr_match = compl_first_match;
+  
+      /* Show the popup menu with a different set of matches. */
+      ins_compl_show_pum();
+--- 3467,3472 ----
+*** ../vim-7.4.017/src/version.c	2013-09-05 12:06:26.000000000 +0200
+--- src/version.c	2013-09-05 12:40:34.000000000 +0200
+***************
+*** 740,741 ****
+--- 740,743 ----
+  {   /* Add new patch number below this line */
++ /**/
++     18,
+  /**/
+
+-- 
+hundred-and-one symptoms of being an internet addict:
+169. You hire a housekeeper for your home page.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
+///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\  an exciting new programming language -- http://www.Zimbu.org        ///
+ \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.019 b/pkgs/applications/editors/vim/patches/7.4.019
new file mode 100644
index 000000000000..b1532c19c81c
--- /dev/null
+++ b/pkgs/applications/editors/vim/patches/7.4.019
@@ -0,0 +1,61 @@
+To: vim_dev@googlegroups.com
+Subject: Patch 7.4.019
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.4.019
+Problem:    MS-Windows: File name completion doesn't work properly with
+	    Chinese characters. (Yue Wu)
+Solution:   Take care of multi-byte characters when looking for the start of
+	    the file name. (Ken Takata)
+Files:	    src/edit.c
+
+
+*** ../vim-7.4.018/src/edit.c	2013-09-05 12:49:48.000000000 +0200
+--- src/edit.c	2013-09-05 13:45:27.000000000 +0200
+***************
+*** 5183,5190 ****
+  	}
+  	else if (ctrl_x_mode == CTRL_X_FILES)
+  	{
+! 	    while (--startcol >= 0 && vim_isfilec(line[startcol]))
+! 		;
+  	    compl_col += ++startcol;
+  	    compl_length = (int)curs_col - startcol;
+  	    compl_pattern = addstar(line + compl_col, compl_length,
+--- 5183,5196 ----
+  	}
+  	else if (ctrl_x_mode == CTRL_X_FILES)
+  	{
+! 	    char_u	*p = line + startcol;
+! 
+! 	    /* Go back to just before the first filename character. */
+! 	    mb_ptr_back(line, p);
+! 	    while (vim_isfilec(PTR2CHAR(p)) && p >= line)
+! 		mb_ptr_back(line, p);
+! 	    startcol = p - line;
+! 
+  	    compl_col += ++startcol;
+  	    compl_length = (int)curs_col - startcol;
+  	    compl_pattern = addstar(line + compl_col, compl_length,
+*** ../vim-7.4.018/src/version.c	2013-09-05 12:49:48.000000000 +0200
+--- src/version.c	2013-09-05 13:41:47.000000000 +0200
+***************
+*** 740,741 ****
+--- 740,743 ----
+  {   /* Add new patch number below this line */
++ /**/
++     19,
+  /**/
+
+-- 
+        Very funny, Scotty.  Now beam down my clothes.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
+///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\  an exciting new programming language -- http://www.Zimbu.org        ///
+ \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.020 b/pkgs/applications/editors/vim/patches/7.4.020
new file mode 100644
index 000000000000..942d82fe2554
--- /dev/null
+++ b/pkgs/applications/editors/vim/patches/7.4.020
@@ -0,0 +1,82 @@
+To: vim_dev@googlegroups.com
+Subject: Patch 7.4.020
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.4.020
+Problem:    NFA engine matches too much with \@>. (John McGowan)
+Solution:   When a whole pattern match is found stop searching.
+Files:	    src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok
+
+
+*** ../vim-7.4.019/src/regexp_nfa.c	2013-08-25 17:01:36.000000000 +0200
+--- src/regexp_nfa.c	2013-09-05 15:59:44.000000000 +0200
+***************
+*** 5322,5328 ****
+  		log_subsexpr(m);
+  #endif
+  		nfa_match = TRUE;
+! 		break;
+  
+  	    case NFA_START_INVISIBLE:
+  	    case NFA_START_INVISIBLE_FIRST:
+--- 5322,5331 ----
+  		log_subsexpr(m);
+  #endif
+  		nfa_match = TRUE;
+! 		/* See comment above at "goto nextchar". */
+! 		if (nextlist->n == 0)
+! 		    clen = 0;
+! 		goto nextchar;
+  
+  	    case NFA_START_INVISIBLE:
+  	    case NFA_START_INVISIBLE_FIRST:
+*** ../vim-7.4.019/src/testdir/test64.in	2013-08-14 13:31:03.000000000 +0200
+--- src/testdir/test64.in	2013-09-05 15:35:44.000000000 +0200
+***************
+*** 427,432 ****
+--- 427,433 ----
+  :""""" \@>
+  :call add(tl, [2, '\(a*\)\@>a', 'aaaa'])
+  :call add(tl, [2, '\(a*\)\@>b', 'aaab', 'aaab', 'aaa'])
++ :call add(tl, [2, '^\(.\{-}b\)\@>.', '  abcbd', '  abc', '  ab'])
+  :" TODO: BT engine does not restore submatch after failure
+  :call add(tl, [1, '\(a*\)\@>a\|a\+', 'aaaa', 'aaaa'])
+  :"
+*** ../vim-7.4.019/src/testdir/test64.ok	2013-08-14 13:31:03.000000000 +0200
+--- src/testdir/test64.ok	2013-09-05 16:03:34.000000000 +0200
+***************
+*** 983,988 ****
+--- 983,991 ----
+  OK 0 - \(a*\)\@>b
+  OK 1 - \(a*\)\@>b
+  OK 2 - \(a*\)\@>b
++ OK 0 - ^\(.\{-}b\)\@>.
++ OK 1 - ^\(.\{-}b\)\@>.
++ OK 2 - ^\(.\{-}b\)\@>.
+  OK 0 - \(a*\)\@>a\|a\+
+  OK 2 - \(a*\)\@>a\|a\+
+  OK 0 - \_[^8-9]\+
+*** ../vim-7.4.019/src/version.c	2013-09-05 13:50:49.000000000 +0200
+--- src/version.c	2013-09-05 16:04:32.000000000 +0200
+***************
+*** 740,741 ****
+--- 740,743 ----
+  {   /* Add new patch number below this line */
++ /**/
++     20,
+  /**/
+
+-- 
+hundred-and-one symptoms of being an internet addict:
+173. You keep tracking down the email addresses of all your friends
+     (even childhood friends).
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
+///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\  an exciting new programming language -- http://www.Zimbu.org        ///
+ \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.021 b/pkgs/applications/editors/vim/patches/7.4.021
new file mode 100644
index 000000000000..0936d9a194b6
--- /dev/null
+++ b/pkgs/applications/editors/vim/patches/7.4.021
@@ -0,0 +1,86 @@
+To: vim_dev@googlegroups.com
+Subject: Patch 7.4.021
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.4.021
+Problem:    NFA regexp: Using \ze in one branch which doesn't match may cause
+	    end of another branch to be wrong. (William Fugh)
+Solution:   Set end position if it wasn't set yet.
+Files:	    src/regexp_nfa.c, src/testdir/test64.in, src/testdir/test64.ok
+
+
+*** ../vim-7.4.020/src/regexp_nfa.c	2013-09-05 16:05:32.000000000 +0200
+--- src/regexp_nfa.c	2013-09-05 20:56:25.000000000 +0200
+***************
+*** 4209,4218 ****
+  	    break;
+  
+  	case NFA_MCLOSE:
+! 	    if (nfa_has_zend)
+  	    {
+! 		/* Do not overwrite the position set by \ze. If no \ze
+! 		 * encountered end will be set in nfa_regtry(). */
+  		subs = addstate(l, state->out, subs, pim, off);
+  		break;
+  	    }
+--- 4209,4219 ----
+  	    break;
+  
+  	case NFA_MCLOSE:
+! 	    if (nfa_has_zend && (REG_MULTI
+! 			? subs->norm.list.multi[0].end.lnum >= 0
+! 			: subs->norm.list.line[0].end != NULL))
+  	    {
+! 		/* Do not overwrite the position set by \ze. */
+  		subs = addstate(l, state->out, subs, pim, off);
+  		break;
+  	    }
+*** ../vim-7.4.020/src/testdir/test64.in	2013-09-05 16:05:32.000000000 +0200
+--- src/testdir/test64.in	2013-09-05 20:55:18.000000000 +0200
+***************
+*** 328,333 ****
+--- 328,334 ----
+  :call add(tl, [2, 'abc \zsmatch\ze abc', 'abc abc abc match abc abc', 'match'])
+  :call add(tl, [2, '\v(a \zsif .*){2}', 'a if then a if last', 'if last', 'a if last'])
+  :call add(tl, [2, '\>\zs.', 'aword. ', '.'])
++ :call add(tl, [2, '\s\+\ze\[/\|\s\zs\s\+', 'is   [a t', '  '])
+  :"
+  :"""" Tests for \@= and \& features
+  :call add(tl, [2, 'abc\@=', 'abc', 'ab'])
+*** ../vim-7.4.020/src/testdir/test64.ok	2013-09-05 16:05:32.000000000 +0200
+--- src/testdir/test64.ok	2013-09-05 21:09:56.000000000 +0200
+***************
+*** 752,757 ****
+--- 752,760 ----
+  OK 0 - \>\zs.
+  OK 1 - \>\zs.
+  OK 2 - \>\zs.
++ OK 0 - \s\+\ze\[/\|\s\zs\s\+
++ OK 1 - \s\+\ze\[/\|\s\zs\s\+
++ OK 2 - \s\+\ze\[/\|\s\zs\s\+
+  OK 0 - abc\@=
+  OK 1 - abc\@=
+  OK 2 - abc\@=
+*** ../vim-7.4.020/src/version.c	2013-09-05 16:05:32.000000000 +0200
+--- src/version.c	2013-09-05 21:11:38.000000000 +0200
+***************
+*** 740,741 ****
+--- 740,743 ----
+  {   /* Add new patch number below this line */
++ /**/
++     21,
+  /**/
+
+-- 
+hundred-and-one symptoms of being an internet addict:
+174. You know what a listserv is.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
+///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\  an exciting new programming language -- http://www.Zimbu.org        ///
+ \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.022 b/pkgs/applications/editors/vim/patches/7.4.022
new file mode 100644
index 000000000000..81a0901f5b55
--- /dev/null
+++ b/pkgs/applications/editors/vim/patches/7.4.022
@@ -0,0 +1,148 @@
+To: vim_dev@googlegroups.com
+Subject: Patch 7.4.022
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.4.022
+Problem:    Deadlock while exiting, because of allocating memory.
+Solution:   Do not use gettext() in deathtrap(). (James McCoy)
+Files:	    src/os_unix.c, src/misc1.c
+
+
+*** ../vim-7.4.021/src/os_unix.c	2013-07-03 16:32:32.000000000 +0200
+--- src/os_unix.c	2013-09-05 21:40:06.000000000 +0200
+***************
+*** 957,964 ****
+  
+  /*
+   * This function handles deadly signals.
+!  * It tries to preserve any swap file and exit properly.
+   * (partly from Elvis).
+   */
+      static RETSIGTYPE
+  deathtrap SIGDEFARG(sigarg)
+--- 957,966 ----
+  
+  /*
+   * This function handles deadly signals.
+!  * It tries to preserve any swap files and exit properly.
+   * (partly from Elvis).
++  * NOTE: Avoid unsafe functions, such as allocating memory, they can result in
++  * a deadlock.
+   */
+      static RETSIGTYPE
+  deathtrap SIGDEFARG(sigarg)
+***************
+*** 1090,1107 ****
+      }
+      if (entered == 2)
+      {
+! 	OUT_STR(_("Vim: Double signal, exiting\n"));
+  	out_flush();
+  	getout(1);
+      }
+  
+  #ifdef SIGHASARG
+!     sprintf((char *)IObuff, _("Vim: Caught deadly signal %s\n"),
+  							 signal_info[i].name);
+  #else
+!     sprintf((char *)IObuff, _("Vim: Caught deadly signal\n"));
+  #endif
+!     preserve_exit();		    /* preserve files and exit */
+  
+  #ifdef NBDEBUG
+      reset_signals();
+--- 1092,1114 ----
+      }
+      if (entered == 2)
+      {
+! 	/* No translation, it may call malloc(). */
+! 	OUT_STR("Vim: Double signal, exiting\n");
+  	out_flush();
+  	getout(1);
+      }
+  
++     /* No translation, it may call malloc(). */
+  #ifdef SIGHASARG
+!     sprintf((char *)IObuff, "Vim: Caught deadly signal %s\n",
+  							 signal_info[i].name);
+  #else
+!     sprintf((char *)IObuff, "Vim: Caught deadly signal\n");
+  #endif
+! 
+!     /* Preserve files and exit.  This sets the really_exiting flag to prevent
+!      * calling free(). */
+!     preserve_exit();
+  
+  #ifdef NBDEBUG
+      reset_signals();
+*** ../vim-7.4.021/src/misc1.c	2013-08-03 17:29:33.000000000 +0200
+--- src/misc1.c	2013-09-05 21:34:04.000000000 +0200
+***************
+*** 9174,9179 ****
+--- 9174,9181 ----
+  /*
+   * Preserve files and exit.
+   * When called IObuff must contain a message.
++  * NOTE: This may be called from deathtrap() in a signal handler, avoid unsafe
++  * functions, such as allocating memory.
+   */
+      void
+  preserve_exit()
+***************
+*** 9196,9202 ****
+      {
+  	if (buf->b_ml.ml_mfp != NULL && buf->b_ml.ml_mfp->mf_fname != NULL)
+  	{
+! 	    OUT_STR(_("Vim: preserving files...\n"));
+  	    screen_start();	    /* don't know where cursor is now */
+  	    out_flush();
+  	    ml_sync_all(FALSE, FALSE);	/* preserve all swap files */
+--- 9198,9204 ----
+      {
+  	if (buf->b_ml.ml_mfp != NULL && buf->b_ml.ml_mfp->mf_fname != NULL)
+  	{
+! 	    OUT_STR("Vim: preserving files...\n");
+  	    screen_start();	    /* don't know where cursor is now */
+  	    out_flush();
+  	    ml_sync_all(FALSE, FALSE);	/* preserve all swap files */
+***************
+*** 9206,9212 ****
+  
+      ml_close_all(FALSE);	    /* close all memfiles, without deleting */
+  
+!     OUT_STR(_("Vim: Finished.\n"));
+  
+      getout(1);
+  }
+--- 9208,9214 ----
+  
+      ml_close_all(FALSE);	    /* close all memfiles, without deleting */
+  
+!     OUT_STR("Vim: Finished.\n");
+  
+      getout(1);
+  }
+*** ../vim-7.4.021/src/version.c	2013-09-05 21:15:38.000000000 +0200
+--- src/version.c	2013-09-05 21:30:18.000000000 +0200
+***************
+*** 740,741 ****
+--- 740,743 ----
+  {   /* Add new patch number below this line */
++ /**/
++     22,
+  /**/
+
+-- 
+hundred-and-one symptoms of being an internet addict:
+175. You send yourself e-mail before you go to bed to remind you
+     what to do when you wake up.
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
+///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\  an exciting new programming language -- http://www.Zimbu.org        ///
+ \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/editors/vim/patches/7.4.023 b/pkgs/applications/editors/vim/patches/7.4.023
new file mode 100644
index 000000000000..03005213ea45
--- /dev/null
+++ b/pkgs/applications/editors/vim/patches/7.4.023
@@ -0,0 +1,53 @@
+To: vim_dev@googlegroups.com
+Subject: Patch 7.4.023
+Fcc: outbox
+From: Bram Moolenaar <Bram@moolenaar.net>
+Mime-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+------------
+
+Patch 7.4.023
+Problem:    Compiler warning on 64 bit windows.
+Solution:   Add type cast. (Mike Williams)
+Files:	    src/edit.c
+
+
+*** ../vim-7.4.022/src/edit.c	2013-09-05 13:50:49.000000000 +0200
+--- src/edit.c	2013-09-06 17:32:55.000000000 +0200
+***************
+*** 5189,5195 ****
+  	    mb_ptr_back(line, p);
+  	    while (vim_isfilec(PTR2CHAR(p)) && p >= line)
+  		mb_ptr_back(line, p);
+! 	    startcol = p - line;
+  
+  	    compl_col += ++startcol;
+  	    compl_length = (int)curs_col - startcol;
+--- 5189,5195 ----
+  	    mb_ptr_back(line, p);
+  	    while (vim_isfilec(PTR2CHAR(p)) && p >= line)
+  		mb_ptr_back(line, p);
+! 	    startcol = (int)(p - line);
+  
+  	    compl_col += ++startcol;
+  	    compl_length = (int)curs_col - startcol;
+*** ../vim-7.4.022/src/version.c	2013-09-05 21:41:35.000000000 +0200
+--- src/version.c	2013-09-06 17:33:41.000000000 +0200
+***************
+*** 740,741 ****
+--- 740,743 ----
+  {   /* Add new patch number below this line */
++ /**/
++     23,
+  /**/
+
+-- 
+Wizards had always known that the act of observation changed the thing that
+was observed, and sometimes forgot that it also changed the observer too.
+			Terry Pratchett  -  Interesting times
+
+ /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
+///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
+\\\  an exciting new programming language -- http://www.Zimbu.org        ///
+ \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
diff --git a/pkgs/applications/graphics/ImageMagick/default.nix b/pkgs/applications/graphics/ImageMagick/default.nix
index b96d1bc84f74..c2a661c82fdf 100644
--- a/pkgs/applications/graphics/ImageMagick/default.nix
+++ b/pkgs/applications/graphics/ImageMagick/default.nix
@@ -2,7 +2,6 @@
 , fetchurl
 , bzip2
 , freetype
-, graphviz
 , ghostscript ? null
 , libjpeg
 , libpng
@@ -17,16 +16,23 @@
 }:
 
 let
-  version = "6.7.5-3";
+  version = "6.8.6-9";
 in
 stdenv.mkDerivation rec {
   name = "ImageMagick-${version}";
 
   src = fetchurl {
     url = "mirror://imagemagick/${name}.tar.xz";
-    sha256 = "0m0sa4jxsvm8pf9nfvkzlbzq13d1lj15lfz6jif12l6ywyh2c1cs";
+    sha256 = "1bpj8676mph5cvyjsdgf27i6yg2iw9iskk5c69mvpxkyawgjw1vg";
   };
 
+  enableParallelBuilding = true;
+
+  preConfigure = if tetex != null then
+    ''
+      export DVIDecodeDelegate=${tetex}/bin/dvips
+    '' else "";
+
   configureFlags = "" + stdenv.lib.optionalString (ghostscript != null && stdenv.system != "x86_64-darwin") ''
     --with-gs-font-dir=${ghostscript}/share/ghostscript/fonts
     --with-gslib
@@ -37,14 +43,12 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs =
     [ bzip2 freetype libjpeg libpng libtiff libxml2 zlib librsvg
-    libtool jasper libX11 ] ++ stdenv.lib.optional (ghostscript != null && stdenv.system != "x86_64-darwin") ghostscript;
+      libtool jasper libX11
+    ] ++ stdenv.lib.optional (ghostscript != null && stdenv.system != "x86_64-darwin") ghostscript;
 
-  buildInputs = [ tetex graphviz ];
+  buildInputs = [ tetex ];
 
-  preConfigure = if tetex != null then
-    ''
-      export DVIDecodeDelegate=${tetex}/bin/dvips
-    '' else "";
+  postInstall = ''(cd "$out/include" && ln -s ImageMagick* ImageMagick)'';
 
   meta = {
     homepage = http://www.imagemagick.org/;
diff --git a/pkgs/applications/graphics/darktable/default.nix b/pkgs/applications/graphics/darktable/default.nix
index 315e101857eb..766696265812 100644
--- a/pkgs/applications/graphics/darktable/default.nix
+++ b/pkgs/applications/graphics/darktable/default.nix
@@ -1,19 +1,20 @@
-{ stdenv, fetchurl
+{ stdenv, fetchurl, libsoup, graphicsmagick, SDL, json_glib
 , GConf, atk, cairo, cmake, curl, dbus_glib, exiv2, glib
-, libgnome_keyring, gphoto2, gtk, ilmbase, intltool, lcms, lcms2
+, libgnome_keyring, gtk, ilmbase, intltool, lcms, lcms2
 , lensfun, libXau, libXdmcp, libexif, libglade, libgphoto2, libjpeg
 , libpng, libpthreadstubs, libraw1394, librsvg, libtiff, libxcb
-, openexr, pixman, pkgconfig, sqlite, bash, libxslt }:
+, openexr, pixman, pkgconfig, sqlite, bash, libxslt, openjpeg
+, mesa }:
 
 assert stdenv ? glibc;
 
 stdenv.mkDerivation rec {
-  version = "1.2.2";
+  version = "1.2.3";
   name = "darktable-${version}";
 
   src = fetchurl {
     url = "mirror://sourceforge/darktable/darktable/1.2/darktable-${version}.tar.xz";
-    sha256 = "0nf85wjhlisbgwkfkc1wb8y7dpnx3v8zk9g3ghbd51gi7s62x40j";
+    sha256 = "05kkkz13a5rhb246rq1nxv7h91pcvm15filvik8n8gn143h64sv8";
   };
 
   buildInputs =
@@ -21,6 +22,7 @@ stdenv.mkDerivation rec {
       ilmbase intltool lcms lcms2 lensfun libXau libXdmcp libexif
       libglade libgphoto2 libjpeg libpng libpthreadstubs libraw1394
       librsvg libtiff libxcb openexr pixman pkgconfig sqlite libxslt
+      libsoup graphicsmagick SDL json_glib openjpeg mesa
     ];
 
   preConfigure = ''
@@ -30,16 +32,16 @@ stdenv.mkDerivation rec {
     export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${atk}/include/atk-1.0"
     export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${ilmbase}/include/OpenEXR"
     export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${openexr}/include/OpenEXR"
-
-    substituteInPlace tools/create_preferences.sh.in --replace '#!/usr/bin/env bash' '#!${bash}/bin/bash'
   '';
 
   cmakeFlags = [
     "-DPTHREAD_INCLUDE_DIR=${stdenv.glibc}/include"
     "-DPTHREAD_LIBRARY=${stdenv.glibc}/lib/libpthread.so"
     "-DCMAKE_BUILD_TYPE=Release"
+    "-DBINARY_PACKAGE_BUILD=1"
     "-DGTK2_GLIBCONFIG_INCLUDE_DIR=${glib}/lib/glib-2.0/include"
     "-DGTK2_GDKCONFIG_INCLUDE_DIR=${gtk}/lib/gtk-2.0/include"
+    "-DBUILD_USERMANUAL=False"
   ];
 
   meta = with stdenv.lib; {
@@ -47,6 +49,6 @@ stdenv.mkDerivation rec {
     homepage = http://darktable.sourceforge.net;
     license = licenses.gpl3Plus;
     platforms = platforms.linux;
-    maintainers = [ maintainers.goibhniu ];
+    maintainers = [ maintainers.goibhniu maintainers.rickynils ];
   };
 }
diff --git a/pkgs/applications/graphics/gpicview/default.nix b/pkgs/applications/graphics/gpicview/default.nix
new file mode 100644
index 000000000000..4d01bbd126b3
--- /dev/null
+++ b/pkgs/applications/graphics/gpicview/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, fetchurl, intltool, pkgconfig, gtk2 }:
+
+stdenv.mkDerivation {
+  name = "gpicview-0.2.4";
+
+  src = fetchurl {
+    url    = "mirror://sourceforge/lxde/gpicview-0.2.4.tar.gz";
+    sha256 = "1svcy1c8bgk0pl12yhyv16h2fl52x5vzzcv57z6qdcv5czgvgglr";
+  };
+
+  meta = with stdenv.lib; {
+    description = "A simple and fast image viewer for X";
+    homepage    = http://lxde.sourceforge.net/gpicview/;
+    repositories.git = git://lxde.git.sourceforge.net/gitroot/lxde/gpicview;
+    license     = licenses.gpl2;
+    maintainers = with maintainers; [ lovek323 ];
+    platforms   = platforms.unix;
+  };
+
+  buildInputs = [ intltool pkgconfig gtk2 ];
+}
diff --git a/pkgs/applications/graphics/jbrout/default.nix b/pkgs/applications/graphics/jbrout/default.nix
index dc397a614d3d..2207e8884f0c 100644
--- a/pkgs/applications/graphics/jbrout/default.nix
+++ b/pkgs/applications/graphics/jbrout/default.nix
@@ -34,5 +34,6 @@ buildPythonPackage {
   meta = {
     homepage = "http://code.google.com/p/jbrout";
     description = "jBrout is a photo manager";
+    platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/applications/graphics/openscad/default.nix b/pkgs/applications/graphics/openscad/default.nix
index cf4e7e635d09..d34eeba207ce 100644
--- a/pkgs/applications/graphics/openscad/default.nix
+++ b/pkgs/applications/graphics/openscad/default.nix
@@ -1,9 +1,8 @@
-{stdenv, fetchurl, qt4, bison, flex, eigen, boost, mesa, glew, opencsg, cgal
-  , mpfr, gmp
-  }:
+{ stdenv, fetchurl, qt4, bison, flex, eigen, boost, mesa, glew, opencsg, cgal
+, mpfr, gmp }:
 
 stdenv.mkDerivation rec {
-  version = "2013.01";
+  version = "2013.06";
   name = "openscad-${version}";
 
   src = fetchurl {
@@ -11,7 +10,7 @@ stdenv.mkDerivation rec {
     sha256 = "01r013l8zyfkgmqn05axh3rlfsjwd6j403w5ffl7nby4i2spiw1f";
   };
 
-  buildInputs = [qt4 bison flex eigen boost mesa glew opencsg cgal gmp mpfr];
+  buildInputs = [ qt4 bison flex eigen boost mesa glew opencsg cgal gmp mpfr ];
 
   configurePhase = ''
     export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I$(echo ${eigen}/include/eigen*) "
@@ -35,9 +34,8 @@ stdenv.mkDerivation rec {
     '';
     homepage = "http://openscad.org/";
     license = stdenv.lib.licenses.gpl2;
-    platforms = with stdenv.lib.platforms;
-      linux;
+    platforms = stdenv.lib.platforms.linux;
     maintainers = with stdenv.lib.maintainers; 
-      [raskin bjornfor];
+      [ bjornfor raskin the-kenny ];
   };
 }
diff --git a/pkgs/applications/graphics/paraview/default.nix b/pkgs/applications/graphics/paraview/default.nix
index b647c07368ef..cc42e1c40466 100644
--- a/pkgs/applications/graphics/paraview/default.nix
+++ b/pkgs/applications/graphics/paraview/default.nix
@@ -7,10 +7,10 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "paraview-3.98.1";
+  name = "paraview-4.0.1";
   src = fetchurl {
-    url = "http://paraview.org/files/v3.98/ParaView-3.98.1-source.tar.gz";
-    sha256 = "0i7q3jc4lc40l1zw3fdzv108rpxxfmg3dmmq855fpqyp2g2w9nxp";
+    url = "http://paraview.org/files/v4.0/ParaView-v4.0.1-source.tgz";
+    sha256 = "1qj8dq8gqpsw75sv4sdc7xm1xcpv0ilsddnrcfhha0zfhp0gq10y";
   };
 
   # [  5%] Generating vtkGLSLShaderLibrary.h
diff --git a/pkgs/applications/graphics/sane/backends.nix b/pkgs/applications/graphics/sane/backends.nix
index 0fcfca747410..a53466ae8188 100644
--- a/pkgs/applications/graphics/sane/backends.nix
+++ b/pkgs/applications/graphics/sane/backends.nix
@@ -16,6 +16,8 @@ stdenv.mkDerivation rec {
 
   udevSupport = hotplugSupport;
 
+  configureFlags = stdenv.lib.optional (libusb != null) "--enable-libusb_1_0";
+
   buildInputs = []
     ++ stdenv.lib.optional (libusb != null) libusb
     ++ stdenv.lib.optional (libv4l != null) libv4l
diff --git a/pkgs/applications/ike/default.nix b/pkgs/applications/ike/default.nix
new file mode 100644
index 000000000000..52330b57b8fa
--- /dev/null
+++ b/pkgs/applications/ike/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchurl, cmake, openssl, libedit, flex, bison, qt4, makeWrapper, gcc }:
+
+# NOTE: use $out/etc/iked.conf as sample configuration and also set: dhcp_file "/etc/iked.dhcp";
+# launch with "iked -f /etc/iked.conf"
+
+stdenv.mkDerivation rec {
+  name = "ike-2.2.1";
+
+  src = fetchurl {
+    url = "https://www.shrew.net/download/ike/${name}-release.tgz";
+    sha256 = "0fhyr2psd93b0zf7yfb72q3nqnh65mymgq5jpjcsj9jv5kfr6l8y";
+  };
+
+  buildInputs = [ cmake openssl libedit flex bison qt4 makeWrapper ];
+
+  configurePhase = ''
+    mkdir -p $out/{bin,sbin,lib}
+    cmake -DQTGUI=YES -DETCDIR=$out/etc -DLIBDIR=$out/lib -DSBINDIR=$out/sbin -DBINDIR=$out/bin -DMANDIR=$out/man -DNATT=YES -DCMAKE_INSTALL_PREFIX:BOOL=$out
+  '';
+
+  buildPhase = ''
+    make
+  '';
+
+  installPhase = ''
+    make install
+    for file in "$out"/bin/* "$out"/sbin/*; do
+        wrapProgram $file --prefix LD_LIBRARY_PATH ":" "$out/lib:${openssl}/lib:${gcc.gcc}/lib:${libedit}/lib:${qt4}/lib"
+    done
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://www.shrew.net/software;
+    description = "IPsec Client for FreeBSD, NetBSD and many Linux based operating systems";
+    platforms = platforms.unix;
+    maintainers = [ maintainers.iElectric ];
+    license = "sleepycat";
+  };
+}
diff --git a/pkgs/applications/misc/abook/default.nix b/pkgs/applications/misc/abook/default.nix
index 09345576487e..3d187d92f5c6 100644
--- a/pkgs/applications/misc/abook/default.nix
+++ b/pkgs/applications/misc/abook/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     homepage = "http://abook.sourceforge.net/";
-    description = "Abook is a text-based addressbook program designed to use with mutt mail client.";
+    description = "Text-based addressbook program designed to use with mutt mail client";
     license = "GPLv2";
     maintainers = [ stdenv.lib.maintainers.edwtjo ];
     platforms = with stdenv.lib.platforms; linux;
diff --git a/pkgs/applications/misc/bitcoin/default.nix b/pkgs/applications/misc/bitcoin/default.nix
index a4048e6f40b2..a6a289168c4a 100644
--- a/pkgs/applications/misc/bitcoin/default.nix
+++ b/pkgs/applications/misc/bitcoin/default.nix
@@ -1,12 +1,12 @@
 { fetchurl, stdenv, openssl, db4, boost, zlib, miniupnpc, qt4 }:
 
 stdenv.mkDerivation rec {
-  version = "0.8.1";
+  version = "0.8.5";
   name = "bitcoin-${version}";
 
   src = fetchurl {
     url = "mirror://sourceforge/bitcoin/${name}-linux.tar.gz";
-    sha256 = "161arfkzpya5anh6vh5i9ydvwqpia7bpqgz83p2kd97iklx04zvd";
+    sha256 = "0qqzwx1lihlrj7r08alsyznjfqvwncfm0nnxi1pcx0jyvq83ym44";
   };
 
   buildInputs = [ openssl db4 boost zlib miniupnpc qt4 ];
diff --git a/pkgs/applications/misc/calibre/default.nix b/pkgs/applications/misc/calibre/default.nix
index c2a48ffb6e10..10d92e4d517a 100644
--- a/pkgs/applications/misc/calibre/default.nix
+++ b/pkgs/applications/misc/calibre/default.nix
@@ -4,11 +4,11 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "calibre-1.2.0";
+  name = "calibre-1.8.0";
 
   src = fetchurl {
     url = "mirror://sourceforge/calibre/${name}.tar.xz";
-    sha256 = "0h6afn57pw3rb03ffbnss774gdx7ldirr43hbhzsc2k2h7lxnzyj";
+    sha256 = "0awh24n5bvypmiylngmz0w0126yz1jxlrjfy9b4w5aflg7vgr0qq";
   };
 
   inherit python;
diff --git a/pkgs/applications/misc/djvulibre/default.nix b/pkgs/applications/misc/djvulibre/default.nix
index 4a51ec2d1acd..59dfd2d891e7 100644
--- a/pkgs/applications/misc/djvulibre/default.nix
+++ b/pkgs/applications/misc/djvulibre/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libjpeg, libtiff, librsvg }:
+{ stdenv, fetchurl, libjpeg, libtiff, librsvg, libintlOrEmpty }:
 
 stdenv.mkDerivation rec {
   name = "djvulibre-3.5.25.3";
@@ -8,7 +8,9 @@ stdenv.mkDerivation rec {
     sha256 = "1q5i5ha4zmj2ahjfhi8cv1rah80vm43m9ads46ji38rgvpb7x3c9";
   };
 
-  buildInputs = [ libjpeg libtiff librsvg ];
+  buildInputs = [ libjpeg libtiff librsvg ] ++ libintlOrEmpty;
+
+  NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-lintl";
 
   meta = {
     description = "A library and viewer for the DJVU file format for scanned images";
diff --git a/pkgs/applications/misc/fbreader/default.nix b/pkgs/applications/misc/fbreader/default.nix
new file mode 100644
index 000000000000..fa361308ff1a
--- /dev/null
+++ b/pkgs/applications/misc/fbreader/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, fetchurl, pkgconfig, bzip2, curl, expat, fribidi
+, libunibreak, qt4, sqlite, zlib }:
+
+stdenv.mkDerivation {
+  name = "fbreader-0.99.4";
+
+  src = fetchurl {
+    url = http://fbreader.org/files/desktop/fbreader-sources-0.99.4.tgz;
+    sha256 = "1sdq3vvwkq4bkyrvh0p884d66gaddz8hlab3m798ji9ixbak2z1x";
+  };
+
+  buildInputs = [
+    pkgconfig bzip2 curl expat fribidi libunibreak
+    qt4 sqlite zlib
+  ];
+
+  makeFlags = "INSTALLDIR=$(out)";
+
+  patchPhase = ''
+    # don't try to use ccache
+    substituteInPlace makefiles/arch/desktop.mk \
+      --replace "CCACHE = " "# CCACHE = "
+  
+    substituteInPlace fbreader/desktop/Makefile \
+      --replace "/usr/share" "$out/share"
+  '';
+
+  meta = {
+    description = "An e-book reader for Linux";
+    homepage = http://www.fbreader.org/;
+    license = "GPL";
+    maintainer = [ stdenv.lib.maintainers.coroa ];
+  }; 
+}
diff --git a/pkgs/applications/misc/freicoin/default.nix b/pkgs/applications/misc/freicoin/default.nix
index bce6d1f639cb..d5ed057f56b8 100644
--- a/pkgs/applications/misc/freicoin/default.nix
+++ b/pkgs/applications/misc/freicoin/default.nix
@@ -1,12 +1,12 @@
 { fetchurl, stdenv, db4, boost, gmp, mpfr, miniupnpc, qt4, unzip }:
 
 stdenv.mkDerivation rec {
-  version = "0.0.2";
+  version = "0.8.3-1";
   name = "freicoin-${version}";
 
   src = fetchurl {
     url = "https://github.com/freicoin/freicoin/archive/v${version}.zip";
-    sha256 = "09izmm85rb64d5hd0hz9hkfvv3qag55sb3mdyp8z4103icqwd6d7";
+    sha256 = "0v3mh8a96nnb86mkyaylyjj7qfdrl7i9gvybh7f8w2hrl9paszfh";
   };
 
   # I think that openssl and zlib are required, but come through other
diff --git a/pkgs/applications/misc/gkrellm/default.nix b/pkgs/applications/misc/gkrellm/default.nix
index f1c26b27262d..af10ca9800d0 100644
--- a/pkgs/applications/misc/gkrellm/default.nix
+++ b/pkgs/applications/misc/gkrellm/default.nix
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
      make install PREFIX="$out" '';
 
   meta = {
-    description = "GKrellM, a themeable process stack of system monitors.";
+    description = "Themeable process stack of system monitors";
     longDescription =
       '' GKrellM is a single process stack of system monitors which supports
          applying themes to match its appearance to your window manager, Gtk,
diff --git a/pkgs/applications/misc/gmrun/default.nix b/pkgs/applications/misc/gmrun/default.nix
index 0b19eef3c8ca..dbff65d36518 100644
--- a/pkgs/applications/misc/gmrun/default.nix
+++ b/pkgs/applications/misc/gmrun/default.nix
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
     ];
 
   meta = {
-    description = "Gnome Completion-Run Utility.";
+    description = "Gnome Completion-Run Utility";
     longDescription = ''
       A simple program which provides a "run program" window, featuring a bash-like TAB completion.
       It uses GTK+ interface.
diff --git a/pkgs/applications/misc/gnome_terminator/default.nix b/pkgs/applications/misc/gnome_terminator/default.nix
index cbd0819e2401..b394719611de 100644
--- a/pkgs/applications/misc/gnome_terminator/default.nix
+++ b/pkgs/applications/misc/gnome_terminator/default.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
   '';
 
   meta = {
-    description = "Gnome terminal emulator with support for tiling and tabs.";
+    description = "Gnome terminal emulator with support for tiling and tabs";
     homepage = http://www.tenshu.net/p/terminator.html;
     license = "GPLv2";
   };
diff --git a/pkgs/applications/misc/lyx/default.nix b/pkgs/applications/misc/lyx/default.nix
index 31c00626847b..fd2e7c3ac426 100644
--- a/pkgs/applications/misc/lyx/default.nix
+++ b/pkgs/applications/misc/lyx/default.nix
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
   doCheck = true;
 
   meta = {
-    description = "WYSIWYM frontend for LaTeX, DocBook, etc.";
+    description = "WYSIWYM frontend for LaTeX, DocBook";
     homepage = "http://www.lyx.org";
     license = "GPL2";
     maintainers = [ stdenv.lib.maintainers.vcunat ];
diff --git a/pkgs/applications/misc/mysql-workbench/default.nix b/pkgs/applications/misc/mysql-workbench/default.nix
index c2f80570673b..91fd1da10149 100644
--- a/pkgs/applications/misc/mysql-workbench/default.nix
+++ b/pkgs/applications/misc/mysql-workbench/default.nix
@@ -66,7 +66,7 @@ exec 19> $FIFOCTL
   '';
 
   meta = with stdenv.lib; {
-    description = "A MySQL visual database modeling, administration and querying tool.";
+    description = "Visual MySQL database modeling, administration and querying tool";
     longDescription = ''
       MySQL Workbench is a modeling tool that allows you to design
       and generate MySQL databases graphically. It also has administration
diff --git a/pkgs/applications/misc/navit/default.nix b/pkgs/applications/misc/navit/default.nix
index 576647555abe..ef1e777f55fd 100644
--- a/pkgs/applications/misc/navit/default.nix
+++ b/pkgs/applications/misc/navit/default.nix
@@ -1,24 +1,19 @@
 { stdenv, fetchsvn, pkgconfig, gtk, SDL, fontconfig, freetype, imlib2, SDL_image, mesa,
-libXmu, freeglut, python, gettext, quesoglc, gd, postgresql, autoconf, automake, libtool, cvs }:
+libXmu, freeglut, python, gettext, quesoglc, gd, postgresql, cmake, qt4, SDL_ttf, fribidi}:
 stdenv.mkDerivation rec {
   name = "navit-svn-3537";
 
   src = fetchsvn {
-    url = https://navit.svn.sourceforge.net/svnroot/navit/trunk/navit;
-    rev = 3537;
-    sha256 = "1ajd439i7z8xm16kqh20qalvafy9miyy4accc8j7w30c4qgc2bb7";
+    url = svn://svn.code.sf.net/p/navit/code/trunk/navit;
+    rev = 5576;
+    sha256 = "1xx62l5srfhh9cfi7n3pxj8hpcgr1rpa0hzfmbrqadzv09z36723";
   };
 
   # 'cvs' is only for the autogen
   buildInputs = [ pkgconfig gtk SDL fontconfig freetype imlib2 SDL_image mesa
-    libXmu freeglut python gettext quesoglc gd postgresql
-    autoconf automake libtool cvs ];
+    libXmu freeglut python gettext quesoglc gd postgresql cmake qt4 SDL_ttf fribidi ];
 
-  preConfigure = ''
-    sh ./autogen.sh
-  '';
-
-  configureFlags = [ "--disable-samplemap" ];
+  cmakeFlags = [ "-DSAMPLE_MAP=n" ];
 
   meta = {
     homepage = http://www.navit-project.org/;
diff --git a/pkgs/applications/misc/redshift/default.nix b/pkgs/applications/misc/redshift/default.nix
index e9fe255aea83..3bed6e1a2d76 100644
--- a/pkgs/applications/misc/redshift/default.nix
+++ b/pkgs/applications/misc/redshift/default.nix
@@ -1,18 +1,32 @@
-{ fetchurl, stdenv,
-  libX11, libXrandr, libXxf86vm, libxcb, pkgconfig, python,
-  randrproto, xcbutil, xf86vidmodeproto }:
+{ fetchurl, stdenv, libX11, libXrandr, libXxf86vm, libxcb, pkgconfig, python
+, randrproto, xcbutil, xf86vidmodeproto, autoconf, automake, gettext, glib
+, GConf, dbus, dbus_glib, makeWrapper, gtk, pygtk, pyxdg, geoclue }:
 
 stdenv.mkDerivation rec {
-  pname = "redshift";
-  version = "1.7";
-  name = "${pname}-${version}";
+  version = "1.8";
+  name = "redshift-${version}";
   src = fetchurl {
-    url = "http://launchpad.net/${pname}/trunk/${version}/+download/${pname}-${version}.tar.bz2";
-    sha256 = "1j0hs0vnlic90cf4bryn11n4ani1x2s5l8z6ll3fmrlw98ykrylv";
+    url = "https://github.com/jonls/redshift/archive/v${version}.tar.gz";
+    sha256 = "1srj2dwy32h71iqikb4ysv5ipclym80i9lys2ns8vjmclg7hj3vi";
   };
 
-  buildInputs = [ libX11 libXrandr libXxf86vm libxcb pkgconfig python
-                  randrproto xcbutil xf86vidmodeproto ];
+  buildInputs = [
+    libX11 libXrandr libXxf86vm libxcb pkgconfig python randrproto xcbutil
+    xf86vidmodeproto autoconf automake gettext glib GConf dbus dbus_glib
+    makeWrapper gtk pygtk pyxdg geoclue
+  ];
+
+  preConfigure = ''
+    ./bootstrap
+  '';
+
+  preInstall = ''
+    substituteInPlace src/redshift-gtk/redshift-gtk python --replace "/usr/bin/env python" "${python}/bin/${python.executable}"
+  '';
+
+  postInstall = ''
+    wrapProgram "$out/bin/redshift-gtk" --prefix PYTHONPATH : $PYTHONPATH:${pygtk}/lib/${python.libPrefix}/site-packages/gtk-2.0:${pyxdg}/lib/${python.libPrefix}/site-packages/pyxdg:$out/lib/${python.libPrefix}/site-packages
+  '';
 
   meta = {
     description = "changes the color temperature of your screen gradually";
diff --git a/pkgs/applications/misc/rxvt_unicode/default.nix b/pkgs/applications/misc/rxvt_unicode/default.nix
index 2afa6c086961..c05dd028eb34 100644
--- a/pkgs/applications/misc/rxvt_unicode/default.nix
+++ b/pkgs/applications/misc/rxvt_unicode/default.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl, perlSupport, libX11, libXt, libXft, ncurses, perl,
   fontconfig, freetype, pkgconfig, libXrender, gdkPixbufSupport, gdk_pixbuf }:
 
-let 
+let
   name = "rxvt-unicode";
   version = "9.16";
   n = "${name}-${version}";
@@ -17,15 +17,18 @@ stdenv.mkDerivation (rec {
   };
 
   buildInputs =
-    [ libX11 libXt libXft ncurses /* required to build the terminfo file */ 
+    [ libX11 libXt libXft ncurses /* required to build the terminfo file */
       fontconfig freetype pkgconfig libXrender ]
     ++ stdenv.lib.optional perlSupport perl
     ++ stdenv.lib.optional gdkPixbufSupport gdk_pixbuf;
 
+  outputs = [ "out" "terminfo" ];
+
   preConfigure =
     ''
-      configureFlags="--with-terminfo=$out/share/terminfo ${if perlSupport then "--enable-perl" else "--disable-perl"}";
-      export TERMINFO=$out/share/terminfo # without this the terminfo won't be compiled by tic, see man tic
+      mkdir -p $terminfo/share/terminfo
+      configureFlags="--with-terminfo=$terminfo/share/terminfo --enable-256-color ${if perlSupport then "--enable-perl" else "--disable-perl"}";
+      export TERMINFO=$terminfo/share/terminfo # without this the terminfo won't be compiled by tic, see man tic
       NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${freetype}/include/freetype2"
       NIX_LDFLAGS="$NIX_LDFLAGS -lfontconfig -lXrender "
     ''
@@ -35,6 +38,13 @@ stdenv.mkDerivation (rec {
       ln -s $out/{lib/urxvt,lib/perl5/site_perl}
     '';
 
+  # we link the separate terminfo output to the main output
+  # as I don't think there's a usecase for wanting urxvt without its terminfo files
+  # and we don't want users to install them separately
+  postInstall = ''
+    ln -s $terminfo/share/terminfo $out/share
+  '';
+
   meta = {
     description = "A clone of the well-known terminal emulator rxvt";
     homepage = "http://software.schmorp.de/pkg/rxvt-unicode.html";
diff --git a/pkgs/applications/misc/surf/default.nix b/pkgs/applications/misc/surf/default.nix
index d6083da5ce40..42792ba8f91d 100644
--- a/pkgs/applications/misc/surf/default.nix
+++ b/pkgs/applications/misc/surf/default.nix
@@ -27,9 +27,15 @@ stdenv.mkDerivation rec {
   '';
 
   meta = {
-      description = "surf is a simple web browser based on WebKit/GTK+. It is able to display websites and follow links. It supports the XEmbed protocol which makes it possible to embed it in another application. Furthermore, one can point surf to another URI by setting its XProperties.";
-      homepage = http://surf.suckless.org;
-      license = "MIT";
-      platforms = stdenv.lib.platforms.linux;
+    description = "Simple web browser";
+    longDescription = ''
+      Surf is a simple web browser based on WebKit/GTK+. It is able to display
+      websites and follow links. It supports the XEmbed protocol which makes it
+      possible to embed it in another application. Furthermore, one can point
+      surf to another URI by setting its XProperties.
+      '';
+    homepage = http://surf.suckless.org;
+    license = "MIT";
+    platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/applications/misc/synergy/cryptopp.patch b/pkgs/applications/misc/synergy/cryptopp.patch
index f20ef9544a22..d0aebb872610 100644
--- a/pkgs/applications/misc/synergy/cryptopp.patch
+++ b/pkgs/applications/misc/synergy/cryptopp.patch
@@ -20,10 +20,10 @@ index 3b61fc0..2206646 100644
  
  if (WIN32)
  	# add /analyze in order to unconver potential bugs in the source code
-diff --git a/src/lib/synergy/CCryptoMode.h b/src/lib/synergy/CCryptoMode.h
+diff --git a/src/lib/io/CCryptoMode.h b/src/lib/io/CCryptoMode.h
 index 9b7e8ad..0d659ac 100644
---- a/src/lib/synergy/CCryptoMode.h
-+++ b/src/lib/synergy/CCryptoMode.h
+--- a/src/lib/io/CCryptoMode.h
++++ b/src/lib/io/CCryptoMode.h
 @@ -17,9 +17,9 @@
  
  #pragma once
@@ -37,10 +37,10 @@ index 9b7e8ad..0d659ac 100644
  #include "ECryptoMode.h"
  #include "CString.h"
  
-diff --git a/src/lib/synergy/CCryptoStream.h b/src/lib/synergy/CCryptoStream.h
+diff --git a/src/lib/io/CCryptoStream.h b/src/lib/io/CCryptoStream.h
 index 104b1f6..09c4dc4 100644
---- a/src/lib/synergy/CCryptoStream.h
-+++ b/src/lib/synergy/CCryptoStream.h
+--- a/src/lib/io/CCryptoStream.h
++++ b/src/lib/io/CCryptoStream.h
 @@ -20,8 +20,8 @@
  #include "BasicTypes.h"
  #include "CStreamFilter.h"
diff --git a/pkgs/applications/misc/synergy/default.nix b/pkgs/applications/misc/synergy/default.nix
index 0b3734ea147a..c01d67943e57 100644
--- a/pkgs/applications/misc/synergy/default.nix
+++ b/pkgs/applications/misc/synergy/default.nix
@@ -7,11 +7,11 @@ assert !stdenv.isLinux -> unzip != null;
 with stdenv.lib;
 
 stdenv.mkDerivation rec {
-  name = "synergy-1.4.12";
+  name = "synergy-1.4.15";
 
   src = fetchurl {
-  	url = "http://synergy.googlecode.com/files/${name}-Source.tar.gz";
-  	sha256 = "0j884skwqy8r8ckj9a4rlwsbjwb1yrj9wqma1nwhr2inff6hrdim";
+    url = "http://synergy.googlecode.com/files/${name}-Source.tar.gz";
+    sha256 = "0l1mxxky9hacyva0npzkgkwg4wkmihzq3abdrds0w5f6is44adv4";
   };
 
   patches = optional stdenv.isLinux ./cryptopp.patch;
diff --git a/pkgs/applications/misc/taskjuggler/default.nix b/pkgs/applications/misc/taskjuggler/default.nix
index b8edd93455dd..77acc511fe42 100644
--- a/pkgs/applications/misc/taskjuggler/default.nix
+++ b/pkgs/applications/misc/taskjuggler/default.nix
@@ -63,7 +63,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "http://www.taskjuggler.org";
     license = "GPLv2";
-    description = "Project management tool.";
+    description = "Project management tool";
     longDescription = ''
       TaskJuggler is a modern and powerful, Open Source project management
       tool. Its new approach to project planing and tracking is more
diff --git a/pkgs/applications/misc/urlview/default.nix b/pkgs/applications/misc/urlview/default.nix
new file mode 100644
index 000000000000..02d26f660019
--- /dev/null
+++ b/pkgs/applications/misc/urlview/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchurl, ncurses, automake111x, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  version    = "0.9";
+  patchLevel = "19";
+
+  name = "urlview-${version}-${patchLevel}";
+
+  urlBase = "mirror://debian/pool/main/u/urlview/";
+
+  src = fetchurl {
+    url = urlBase + "urlview_${version}.orig.tar.gz";
+    sha256 = "746ff540ccf601645f500ee7743f443caf987d6380e61e5249fc15f7a455ed42";
+  };
+
+  buildInputs = [ ncurses automake111x autoreconfHook ];
+
+  preAutoreconf = ''
+    touch NEWS
+  '';
+
+  preConfigure = ''
+    mkdir -p $out/share/man/man1
+  '';
+
+  debianPatches = fetchurl {
+    url = urlBase + "urlview_${version}-${patchLevel}.diff.gz";
+    sha256 = "056883c17756f849fb9235596d274fbc5bc0d944fcc072bdbb13d1e828301585";
+  };
+
+  patches = debianPatches;
+
+  meta = {
+    description = "Extract URLs from text";
+    homepage = http://packages.qa.debian.org/u/urlview.html;
+    licencse = stdenv.lib.licenses.gpl2;
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/applications/misc/xca/default.nix b/pkgs/applications/misc/xca/default.nix
new file mode 100644
index 000000000000..fb6b011f30a4
--- /dev/null
+++ b/pkgs/applications/misc/xca/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, fetchurl, pkgconfig, which, openssl, qt4, libtool }:
+
+stdenv.mkDerivation rec {
+  name = "xca-${version}";
+  version = "0.9.3";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/xca/${name}.tar.gz";
+    sha256 = "1fn6kh8mdy65rrgjif7j9wn3mxg1mrrcnhzpi86hfy24ic6bahk8";
+  };
+
+  configurePhase = ''
+    export PATH=$PATH:${which}/bin
+    export QTDIR=${qt4}
+    prefix=$out ./configure ${openssl} ${libtool}
+  '';
+
+  buildInputs = [ openssl qt4 libtool ];
+  nativeBuildInputs = [ pkgconfig ];
+
+  meta = with stdenv.lib; {
+    description = "Interface for managing asymetric keys like RSA or DSA";
+    homepage = http://xca.sourceforge.net/;
+    platforms = platforms.all;
+    license = licenses.bsd3;
+  };
+}
diff --git a/pkgs/applications/misc/xfe/default.nix b/pkgs/applications/misc/xfe/default.nix
index bd00d91e23d3..9b1385d9d6ad 100644
--- a/pkgs/applications/misc/xfe/default.nix
+++ b/pkgs/applications/misc/xfe/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
   enableParallelBuilding = true;
 
   meta = {
-    description = "X File Explorer (Xfe) is an MS-Explorer like file manager for X.";
+    description = "X File Explorer (Xfe) is an MS-Explorer like file manager for X";
     longDescription = ''
       X File Explorer (Xfe) is an MS-Explorer like file manager for X.
       It is based on the popular, but discontinued, X Win Commander, which was developed by Maxim Baranov.
@@ -26,6 +26,6 @@ stdenv.mkDerivation rec {
     homepage = "http://sourceforge.net/projects/xfe/";
     license = "GPLv2";
     maintainers = [ stdenv.lib.maintainers.bbenoist ];
-    platforms = stdenv.lib.platforms.all;
+    platforms = stdenv.lib.platforms.mesaPlatforms;
   };
 }
diff --git a/pkgs/applications/misc/xmobar/default.nix b/pkgs/applications/misc/xmobar/default.nix
index 42d11308267a..273998dde5d1 100644
--- a/pkgs/applications/misc/xmobar/default.nix
+++ b/pkgs/applications/misc/xmobar/default.nix
@@ -4,8 +4,8 @@
 
 cabal.mkDerivation (self: {
   pname = "xmobar";
-  version = "0.18";
-  sha256 = "08kk0yjx51vjrvvvd34hv8v80dsh8kjv150qf413ikaff0i28v7w";
+  version = "0.19";
+  sha256 = "1lwbww9vpqscip16lqiax2qvfyksxms5xx4n0s61mzw7v61hyxq2";
   isLibrary = false;
   isExecutable = true;
   buildDepends = [
diff --git a/pkgs/applications/misc/xpdf/default.nix b/pkgs/applications/misc/xpdf/default.nix
index 5218df775955..fdcdd4770d0e 100644
--- a/pkgs/applications/misc/xpdf/default.nix
+++ b/pkgs/applications/misc/xpdf/default.nix
@@ -18,26 +18,20 @@ stdenv.mkDerivation {
   };
 
   buildInputs =
-    (if enableGUI then [x11 motif] else []) ++
-    (if useT1Lib then [t1lib] else []);
+    stdenv.lib.optionals enableGUI [x11 motif] ++
+    stdenv.lib.optional useT1Lib t1lib ++
+    stdenv.lib.optional enablePDFtoPPM freetype;
 
   # Debian uses '-fpermissive' to bypass some errors on char* constantness.
   CXXFLAGS = "-O2 -fpermissive";
 
-  configureFlags =
-    "--infodir=$out/share/info --mandir=$out/share/man --enable-a4-paper"
-    + (if enablePDFtoPPM then
-         " --with-freetype2-library=${freetype}/lib"
-         + " --with-freetype2-includes=${freetype}/include/freetype2"
-       else "");
-
-  postInstall = "
-    if test -n \"${base14Fonts}\"; then
-      substituteInPlace $out/etc/xpdfrc \\
-        --replace /usr/local/share/ghostscript/fonts ${base14Fonts} \\
-        --replace '#fontFile' fontFile
-    fi
-  ";
+  configureFlags = "--enable-a4-paper";
+
+  postInstall = stdenv.lib.optionalString (base14Fonts != null) ''
+    substituteInPlace $out/etc/xpdfrc \
+      --replace /usr/local/share/ghostscript/fonts ${base14Fonts} \
+      --replace '#fontFile' fontFile
+  '';
 
   meta = {
     homepage = "http://www.foolabs.com/xpdf/";
diff --git a/pkgs/applications/networking/bittorrentsync/default.nix b/pkgs/applications/networking/bittorrentsync/default.nix
index 25a23b019d84..c2d2f28751a7 100644
--- a/pkgs/applications/networking/bittorrentsync/default.nix
+++ b/pkgs/applications/networking/bittorrentsync/default.nix
@@ -40,7 +40,7 @@ in stdenv.mkDerivation {
 
   meta = {
     homepage = "http://labs.bittorrent.com/experiments/sync.html";
-    description = "Automatically sync files via secure, distributed technology.";
+    description = "Automatically sync files via secure, distributed technology";
     license = stdenv.lib.licenses.unfree;
     maintainers = [ stdenv.lib.maintainers.iElectric ];
   };
diff --git a/pkgs/applications/networking/browsers/chromium/default.nix b/pkgs/applications/networking/browsers/chromium/default.nix
index 087bde000eda..fa91a877fdc0 100644
--- a/pkgs/applications/networking/browsers/chromium/default.nix
+++ b/pkgs/applications/networking/browsers/chromium/default.nix
@@ -7,8 +7,8 @@
 , xdg_utils, yasm, zlib
 , libusb1, libexif, pciutils
 
-, python, perl, pkgconfig
-, nspr, udev, krb5
+, python, pythonPackages, perl, pkgconfig
+, nspr, udev, krb5, file
 , utillinux, alsaLib
 , gcc, bison, gperf
 , glib, gtk, dbus_glib
@@ -18,9 +18,6 @@
 # optional dependencies
 , libgcrypt ? null # gnomeSupport || cupsSupport
 
-# dependency for version 30
-, file
-
 # package customization
 , channel ? "stable"
 , enableSELinux ? false, libselinux ? null
@@ -36,7 +33,65 @@
 with stdenv.lib;
 
 let
-  sourceInfo = builtins.getAttr channel (import ./sources.nix);
+  src = with getAttr channel (import ./sources.nix); stdenv.mkDerivation {
+    name = "chromium-source-${version}";
+
+    src = fetchurl {
+      inherit url sha256;
+    };
+
+    phases = [ "unpackPhase" "patchPhase" "installPhase" ];
+
+    opensslPatches = optional useOpenSSL openssl.patches;
+
+    prePatch = "patchShebangs .";
+
+    patches = singleton (
+      if versionOlder version "31.0.0.0"
+      then ./sandbox_userns_30.patch
+      else ./sandbox_userns_31.patch
+    );
+
+    postPatch = ''
+      sed -i -r -e 's/-f(stack-protector)(-all)?/-fno-\1/' build/common.gypi
+      sed -i -e 's|/usr/bin/gcc|gcc|' third_party/WebKit/Source/core/core.gypi
+    '' + optionalString useOpenSSL ''
+      cat $opensslPatches | patch -p1 -d third_party/openssl/openssl
+    '';
+
+    outputs = [ "out" "sandbox" "bundled" "main" ];
+    installPhase = ''
+      ensureDir "$out" "$sandbox" "$bundled" "$main"
+
+      header "copying browser main sources to $main"
+      find . -mindepth 1 -maxdepth 1 \
+        \! -path ./sandbox \
+        \! -path ./third_party \
+        \! -path ./build \
+        \! -path ./tools \
+        \! -name '.*' \
+        -print | xargs cp -rt "$main"
+      stopNest
+
+      header "copying sandbox components to $sandbox"
+      cp -rt "$sandbox" sandbox/*
+      stopNest
+
+      header "copying third party sources to $bundled"
+      cp -rt "$bundled" third_party/*
+      stopNest
+
+      header "copying build requisites to $out"
+      cp -rt "$out" build tools
+      stopNest
+
+      rm -rf "$out/tools/gyp" # XXX: Don't even copy it in the first place.
+    '';
+
+    passthru = {
+      inherit version;
+    };
+  };
 
   mkGypFlags =
     let
@@ -81,27 +136,22 @@ let
     libusb1 libexif
   ];
 
+  sandbox = import ./sandbox.nix {
+    inherit stdenv;
+    src = src.sandbox;
+    binary = "${packageName}_sandbox";
+  };
+
   # build paths and release info
   packageName = "chromium";
   buildType = "Release";
   buildPath = "out/${buildType}";
   libExecPath = "$out/libexec/${packageName}";
-
-  # user namespace sandbox patch
-  userns_patch = if versionOlder sourceInfo.version "30.0.0.0"
-                 then ./sandbox_userns_29.patch
-                 else ./sandbox_userns_30.patch;
+  sandboxPath = "${sandbox}/bin/${packageName}_sandbox";
 
 in stdenv.mkDerivation rec {
-  name = "${packageName}-${version}";
-  inherit packageName;
-
-  version = sourceInfo.version;
-
-  src = fetchurl {
-    url = sourceInfo.url;
-    sha256 = sourceInfo.sha256;
-  };
+  name = "${packageName}-${src.version}";
+  inherit packageName src;
 
   buildInputs = defaultDependencies ++ [
     which makeWrapper
@@ -110,32 +160,31 @@ in stdenv.mkDerivation rec {
     (if useOpenSSL then openssl else nss)
     utillinux alsaLib
     gcc bison gperf
-    krb5
+    krb5 file
     glib gtk dbus_glib
     libXScrnSaver libXcursor libXtst mesa
     pciutils protobuf speechd libXdamage
+    pythonPackages.gyp
   ] ++ optional gnomeKeyringSupport libgnome_keyring
     ++ optionals gnomeSupport [ gconf libgcrypt ]
     ++ optional enableSELinux libselinux
     ++ optional cupsSupport libgcrypt
-    ++ optional pulseSupport pulseaudio
-    ++ optional (!versionOlder sourceInfo.version "30.0.0.0") file;
-
-  opensslPatches = optional useOpenSSL openssl.patches;
-
-  prePatch = "patchShebangs .";
-
-  patches = [ userns_patch ];
+    ++ optional pulseSupport pulseaudio;
+
+  prePatch = ''
+    # XXX: Figure out a way how to split these properly.
+    #cpflags="-dsr --no-preserve=mode"
+    cpflags="-dr"
+    cp $cpflags "${src.main}"/* .
+    cp $cpflags "${src.bundled}" third_party
+    cp $cpflags "${src.sandbox}" sandbox
+    chmod -R u+w . # XXX!
+  '';
 
   postPatch = ''
-    sed -i -r -e 's/-f(stack-protector)(-all)?/-fno-\1/' build/common.gypi
-    sed -i -e 's|/usr/bin/gcc|gcc|' third_party/WebKit/Source/core/core.gypi
-  '' + optionalString useOpenSSL ''
-    cat $opensslPatches | patch -p1 -d third_party/openssl/openssl
-  '' + optionalString (!versionOlder sourceInfo.version "30.0.0.0") ''
     sed -i -e '/base::FilePath exe_dir/,/^ *} *$/c \
       sandbox_binary = \
-        base::FilePath("'"${libExecPath}/${packageName}_sandbox"'");
+        base::FilePath("'"${sandboxPath}"'");
     ' content/browser/browser_main_loop.cc
   '';
 
@@ -151,7 +200,7 @@ in stdenv.mkDerivation rec {
     use_openssl = useOpenSSL;
     selinux = enableSELinux;
     use_cups = cupsSupport;
-    linux_sandbox_path="${libExecPath}/${packageName}_sandbox";
+    linux_sandbox_path="${sandboxPath}";
     linux_sandbox_chrome_path="${libExecPath}/${packageName}";
     werror = "";
 
@@ -173,7 +222,7 @@ in stdenv.mkDerivation rec {
   });
 
   configurePhase = ''
-    GYP_GENERATORS=ninja python build/gyp_chromium --depth "$(pwd)" ${gypFlags}
+    python build/gyp_chromium -f ninja --depth "$(pwd)" ${gypFlags}
   '';
 
   buildPhase = let
@@ -183,13 +232,13 @@ in stdenv.mkDerivation rec {
     CC="${CC}" CC_host="${CC}"     \
     CXX="${CXX}" CXX_host="${CXX}" \
     LINK_host="${CXX}"             \
-      "${ninja}/bin/ninja" -C "out/${buildType}" \
-        -j$NIX_BUILD_CORES -l$NIX_BUILD_CORES    \
+      "${ninja}/bin/ninja" -C "${buildPath}"  \
+        -j$NIX_BUILD_CORES -l$NIX_BUILD_CORES \
         chrome ${optionalString (!enableSELinux) "chrome_sandbox"}
   '';
 
   installPhase = ''
-    mkdir -vp "${libExecPath}"
+    ensureDir "${libExecPath}"
     cp -v "${buildPath}/"*.pak "${libExecPath}/"
     cp -vR "${buildPath}/locales" "${buildPath}/resources" "${libExecPath}/"
     cp -v ${buildPath}/libffmpegsumo.so "${libExecPath}/"
@@ -198,7 +247,6 @@ in stdenv.mkDerivation rec {
 
     mkdir -vp "$out/bin"
     makeWrapper "${libExecPath}/${packageName}" "$out/bin/${packageName}"
-    cp -v "${buildPath}/chrome_sandbox" "${libExecPath}/${packageName}_sandbox"
 
     mkdir -vp "$out/share/man/man1"
     cp -v "${buildPath}/chrome.1" "$out/share/man/man1/${packageName}.1"
@@ -214,6 +262,10 @@ in stdenv.mkDerivation rec {
     done
   '';
 
+  passthru = {
+    inherit sandbox;
+  };
+
   meta = {
     description = "An open source web browser from Google";
     homepage = http://www.chromium.org/;
diff --git a/pkgs/applications/networking/browsers/chromium/sandbox.nix b/pkgs/applications/networking/browsers/chromium/sandbox.nix
new file mode 100644
index 000000000000..b43385e86338
--- /dev/null
+++ b/pkgs/applications/networking/browsers/chromium/sandbox.nix
@@ -0,0 +1,20 @@
+{ stdenv, src, binary }:
+
+stdenv.mkDerivation {
+  name = "chromium-sandbox-${src.version}";
+  inherit src;
+
+  patchPhase = ''
+    sed -i -e '/#include.*base_export/c \
+      #define BASE_EXPORT __attribute__((visibility("default")))
+    ' linux/suid/*.[hc]
+  '';
+
+  buildPhase = ''
+    gcc -Wall -std=gnu99 -o sandbox linux/suid/*.c
+  '';
+
+  installPhase = ''
+    install -svD sandbox "$out/bin/${binary}"
+  '';
+}
diff --git a/pkgs/applications/networking/browsers/chromium/sandbox_userns_29.patch b/pkgs/applications/networking/browsers/chromium/sandbox_userns_31.patch
index c1987c43e150..490c1a9cebe9 100644
--- a/pkgs/applications/networking/browsers/chromium/sandbox_userns_29.patch
+++ b/pkgs/applications/networking/browsers/chromium/sandbox_userns_31.patch
@@ -1,4 +1,4 @@
-commit 557daf9cc9c02b8f17e6ee84f9b1ae6e6132d478
+commit ff4e8b4af04c58fc4c58ee7ed108aefcdc26a960
 Author: aszlig <aszlig@redmoonstudios.org>
 Date:   Thu May 16 14:17:56 2013 +0200
 
@@ -20,19 +20,23 @@ Date:   Thu May 16 14:17:56 2013 +0200
     
     Signed-off-by: aszlig <aszlig@redmoonstudios.org>
 
-diff --git a/base/process_util.h b/base/process_util.h
-index 0bec8e0..6b6f566 100644
---- a/base/process_util.h
-+++ b/base/process_util.h
-@@ -175,6 +175,7 @@ struct LaunchOptions {
-         new_process_group(false)
+diff --git a/base/process/launch.cc b/base/process/launch.cc
+index 1329a5a..ec28fdf 100644
+--- a/base/process/launch.cc
++++ b/base/process/launch.cc
+@@ -24,6 +24,7 @@ LaunchOptions::LaunchOptions()
+       new_process_group(false)
  #if defined(OS_LINUX)
-         , clone_flags(0)
-+        , new_user_namespace(false)
+       , clone_flags(0)
++      , new_user_namespace(false)
  #endif  // OS_LINUX
  #if defined(OS_CHROMEOS)
-         , ctrl_terminal_fd(-1)
-@@ -249,6 +250,9 @@ struct LaunchOptions {
+       , ctrl_terminal_fd(-1)
+diff --git a/base/process/launch.h b/base/process/launch.h
+index ac2df5e..34a3851 100644
+--- a/base/process/launch.h
++++ b/base/process/launch.h
+@@ -100,6 +100,9 @@ struct BASE_EXPORT LaunchOptions {
  #if defined(OS_LINUX)
    // If non-zero, start the process using clone(), using flags as provided.
    int clone_flags;
@@ -42,11 +46,11 @@ index 0bec8e0..6b6f566 100644
  #endif  // defined(OS_LINUX)
  
  #if defined(OS_CHROMEOS)
-diff --git a/base/process_util_posix.cc b/base/process_util_posix.cc
-index 83afe44..e529b2b 100644
---- a/base/process_util_posix.cc
-+++ b/base/process_util_posix.cc
-@@ -34,6 +34,13 @@
+diff --git a/base/process/launch_posix.cc b/base/process/launch_posix.cc
+index de6286d..9333494 100644
+--- a/base/process/launch_posix.cc
++++ b/base/process/launch_posix.cc
+@@ -37,6 +37,13 @@
  #include "base/threading/platform_thread.h"
  #include "base/threading/thread_restrictions.h"
  
@@ -60,12 +64,11 @@ index 83afe44..e529b2b 100644
  #if defined(OS_CHROMEOS)
  #include <sys/ioctl.h>
  #endif
-@@ -621,8 +628,19 @@ bool LaunchProcess(const std::vector<std::string>& argv,
+@@ -294,13 +301,23 @@ bool LaunchProcess(const std::vector<std::string>& argv,
  
    pid_t pid;
  #if defined(OS_LINUX)
 -  if (options.clone_flags) {
--    pid = syscall(__NR_clone, options.clone_flags, 0, 0, 0);
 +  int map_pipe_fd[2];
 +  int flags = options.clone_flags;
 +
@@ -78,11 +81,18 @@ index 83afe44..e529b2b 100644
 +  }
 +
 +  if (options.clone_flags || options.new_user_namespace) {
+     // Signal handling in this function assumes the creation of a new
+     // process, so we check that a thread is not being created by mistake
+     // and that signal handling follows the process-creation rules.
+-    RAW_CHECK(
+-        !(options.clone_flags & (CLONE_SIGHAND | CLONE_THREAD | CLONE_VM)));
+-    pid = syscall(__NR_clone, options.clone_flags, 0, 0, 0);
++    RAW_CHECK(!(flags & (CLONE_SIGHAND | CLONE_THREAD | CLONE_VM)));
 +    pid = syscall(__NR_clone, flags, 0, 0, 0);
    } else
  #endif
    {
-@@ -635,6 +653,21 @@ bool LaunchProcess(const std::vector<std::string>& argv,
+@@ -318,6 +335,21 @@ bool LaunchProcess(const std::vector<std::string>& argv,
    } else if (pid == 0) {
      // Child process
  
@@ -104,7 +114,7 @@ index 83afe44..e529b2b 100644
      // DANGER: fork() rule: in the child, if you don't end up doing exec*(),
      // you call _exit() instead of exit(). This is because _exit() does not
      // call any previously-registered (in the parent) exit handlers, which
-@@ -749,6 +782,40 @@ bool LaunchProcess(const std::vector<std::string>& argv,
+@@ -433,6 +465,40 @@ bool LaunchProcess(const std::vector<std::string>& argv,
      _exit(127);
    } else {
      // Parent process
@@ -146,10 +156,10 @@ index 83afe44..e529b2b 100644
        // While this isn't strictly disk IO, waiting for another process to
        // finish is the sort of thing ThreadRestrictions is trying to prevent.
 diff --git a/content/browser/zygote_host/zygote_host_impl_linux.cc b/content/browser/zygote_host/zygote_host_impl_linux.cc
-index 130f44a..c1232d4 100644
+index fea43b5..95cbe07 100644
 --- a/content/browser/zygote_host/zygote_host_impl_linux.cc
 +++ b/content/browser/zygote_host/zygote_host_impl_linux.cc
-@@ -118,25 +118,31 @@ void ZygoteHostImpl::Init(const std::string& sandbox_cmd) {
+@@ -121,25 +121,31 @@ void ZygoteHostImpl::Init(const std::string& sandbox_cmd) {
  
    sandbox_binary_ = sandbox_cmd.c_str();
  
@@ -188,7 +198,7 @@ index 130f44a..c1232d4 100644
      } else {
        LOG(FATAL) << "The SUID sandbox helper binary was found, but is not "
                      "configured correctly. Rather than run without sandboxing "
-@@ -160,7 +166,19 @@ void ZygoteHostImpl::Init(const std::string& sandbox_cmd) {
+@@ -163,7 +169,19 @@ void ZygoteHostImpl::Init(const std::string& sandbox_cmd) {
    base::ProcessHandle process = -1;
    base::LaunchOptions options;
    options.fds_to_remap = &fds_to_map;
@@ -209,10 +219,10 @@ index 130f44a..c1232d4 100644
  
    if (using_suid_sandbox_) {
 diff --git a/content/zygote/zygote_main_linux.cc b/content/zygote/zygote_main_linux.cc
-index 7d01722..2f445ef 100644
+index 567b305..1089233 100644
 --- a/content/zygote/zygote_main_linux.cc
 +++ b/content/zygote/zygote_main_linux.cc
-@@ -395,6 +395,13 @@ static bool EnterSandbox(sandbox::SetuidSandboxClient* setuid_sandbox,
+@@ -426,6 +426,13 @@ static bool EnterSuidSandbox(LinuxSandbox* linux_sandbox,
        *has_started_new_init = true;
      }
  
diff --git a/pkgs/applications/networking/browsers/chromium/sources.nix b/pkgs/applications/networking/browsers/chromium/sources.nix
index e83f99485358..aae71e8dfb60 100644
--- a/pkgs/applications/networking/browsers/chromium/sources.nix
+++ b/pkgs/applications/networking/browsers/chromium/sources.nix
@@ -1,18 +1,18 @@
 # This file is autogenerated from update.sh in the same directory.
 {
   dev = {
-    version = "31.0.1612.0";
-    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-31.0.1612.0.tar.xz";
-    sha256 = "19h6i8jdnpzbvyq8pk9jq89lghnydpij9yj8xfs7qdgqgyxxcl5w";
+    version = "32.0.1671.3";
+    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-32.0.1671.3.tar.xz";
+    sha256 = "0bv86ig3mrd95zh78880bcyh9b8w46s7slxq3mwwmrmqp0s8qaq0";
   };
   beta = {
-    version = "30.0.1599.22";
-    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-30.0.1599.22.tar.xz";
-    sha256 = "0955q7fz6nfr7nbxa8hp9q7mgljlan42rjg8ql5x2vn6c80sjji8";
+    version = "31.0.1650.34";
+    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-31.0.1650.34.tar.xz";
+    sha256 = "0c73kvp09cmq4x42rcf45v0mnbyb8rcyi5i4pj0pvfn451vbngdq";
   };
   stable = {
-    version = "29.0.1547.65";
-    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-29.0.1547.65.tar.xz";
-    sha256 = "0vmb5dsh61jyr68838pnczlc2mhvvil4hjkrmwklzlfz30c8s2w6";
+    version = "30.0.1599.114";
+    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-30.0.1599.114.tar.xz";
+    sha256 = "0q5pq8bj4y0c7hd121db1fa9g3apkpkhb6cf14ag7abgrda2pzw2";
   };
 }
diff --git a/pkgs/applications/networking/browsers/dwb/default.nix b/pkgs/applications/networking/browsers/dwb/default.nix
new file mode 100644
index 000000000000..0421a8a6c6a8
--- /dev/null
+++ b/pkgs/applications/networking/browsers/dwb/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchgit, pkgconfig, makeWrapper, libsoup, webkit, gtk3, gnutls, json_c,
+  m4, glib_networking, gsettings_desktop_schemas }:
+
+stdenv.mkDerivation {
+  name = "dwb-0.1";
+
+  src = fetchgit {
+    url = "https://bitbucket.org/portix/dwb.git";
+    rev = "84a8621787baded72e84afdd5cdda278cb81e007";
+    sha256 = "5a32f3c21ad59b43935a16108244f84d260fafaea9b93d41e8de9ba9089ee7b0";
+  };
+
+  buildInputs = [ pkgconfig makeWrapper libsoup webkit gtk3 gnutls json_c m4  ];
+
+  # There are Xlib and gtk warnings therefore I have set Wno-error
+  preBuild=''
+    makeFlagsArray=(CPPFLAGS="-Wno-error" GTK=3 PREFIX=$out);
+  '';
+
+  postInstall=''
+    wrapProgram "$out/bin/dwb" \
+     --prefix GIO_EXTRA_MODULES : "${glib_networking}/lib/gio/modules" \
+     --prefix XDG_DATA_DIRS : "${gsettings_desktop_schemas}/share:$out/share"
+    wrapProgram "$out/bin/dwbem" \
+     --prefix GIO_EXTRA_MODULES : "${glib_networking}/lib/gio/modules"
+  '';
+
+  meta = {
+    homepage = http://portix.bitbucket.org/dwb/;
+    description = "A lightweight web browser based on the webkit web browser engine and the gtk toolkit";
+    platforms = stdenv.lib.platforms.mesaPlatforms;
+    maintainers = [ stdenv.lib.maintainers.pSub ];
+    license = "GPL";
+  };
+}
diff --git a/pkgs/applications/networking/browsers/firefox/default.nix b/pkgs/applications/networking/browsers/firefox/default.nix
index fe4360463398..45606c9af825 100644
--- a/pkgs/applications/networking/browsers/firefox/default.nix
+++ b/pkgs/applications/networking/browsers/firefox/default.nix
@@ -3,8 +3,8 @@
 , freetype, fontconfig, file, alsaLib, nspr, nss, libnotify
 , yasm, mesa, sqlite, unzip, makeWrapper, pysqlite
 , hunspell, libevent, libstartup_notification, libvpx
-, cairo ? null
-, useSystemCairo ? false
+, cairo, gstreamer, gst_plugins_base
+, debugBuild ? false
 , # If you want the resulting program to call itself "Firefox" instead
   # of "Shiretoko" or whatever, enable this option.  However, those
   # binaries may not be distributed without permission from the
@@ -14,14 +14,13 @@
 }:
 
 assert stdenv.gcc ? libc && stdenv.gcc.libc != null;
-assert useSystemCairo -> cairo != null;
 
 let optional = stdenv.lib.optional;
 in rec {
 
-  firefoxVersion = "23.0.1";
+  firefoxVersion = "25.0";
 
-  xulVersion = "23.0.1"; # this attribute is used by other packages
+  xulVersion = "25.0"; # this attribute is used by other packages
 
 
   src = fetchurl {
@@ -29,15 +28,15 @@ in rec {
         # It is better to use this url for official releases, to take load off Mozilla's ftp server.
         "http://releases.mozilla.org/pub/mozilla.org/firefox/releases/${firefoxVersion}/source/firefox-${firefoxVersion}.source.tar.bz2"
         # Fall back to this url for versions not available at releases.mozilla.org.
-        "ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${firefoxVersion}/source/firefox-${firefoxVersion}.source.tar.bz2"
+        "http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${firefoxVersion}/source/firefox-${firefoxVersion}.source.tar.bz2"
     ];
-    sha1 = "66361fcvyl9liyh41gvgysiim90wsywk";
+    sha1 = "854722e283659d2b6b2eacd38f757b3c5b63a448";
   };
 
   commonConfigureFlags =
     [ "--enable-optimize"
       #"--enable-profiling"
-      "--disable-debug"
+      (if debugBuild then "--enable-debug" else "--disable-debug")
       "--enable-strip"
       "--with-system-jpeg"
       "--with-system-zlib"
@@ -52,12 +51,13 @@ in rec {
       "--enable-system-hunspell"
       "--enable-system-pixman"
       "--enable-system-sqlite"
+      "--enable-system-cairo"
       "--disable-crashreporter"
       "--disable-tests"
       "--disable-necko-wifi" # maybe we want to enable this at some point
       "--disable-installer"
       "--disable-updater"
-    ] ++ optional useSystemCairo "--enable-system-cairo";
+    ];
 
 
   xulrunner = stdenv.mkDerivation rec {
@@ -72,8 +72,9 @@ in rec {
         alsaLib nspr nss libnotify xlibs.pixman yasm mesa
         xlibs.libXScrnSaver xlibs.scrnsaverproto pysqlite
         xlibs.libXext xlibs.xextproto sqlite unzip makeWrapper
-        hunspell libevent libstartup_notification libvpx
-      ] ++ optional useSystemCairo cairo;
+        hunspell libevent libstartup_notification libvpx cairo
+        gstreamer gst_plugins_base
+      ];
 
     configureFlags =
       [ "--enable-application=xulrunner"
@@ -82,8 +83,6 @@ in rec {
 
     enableParallelBuilding = true;
 
-    patches = optional useSystemCairo ./system-cairo.patch;
-
     preConfigure =
       ''
         export NIX_LDFLAGS="$NIX_LDFLAGS -L$out/lib/xulrunner-${xulVersion}"
@@ -139,8 +138,9 @@ in rec {
       [ pkgconfig libpng gtk perl zip libIDL libjpeg zlib bzip2 python
         dbus dbus_glib pango freetype fontconfig alsaLib nspr nss libnotify
         xlibs.pixman yasm mesa sqlite file unzip pysqlite
-        hunspell libevent libstartup_notification libvpx
-      ] ++ optional useSystemCairo cairo;
+        hunspell libevent libstartup_notification libvpx cairo
+        gstreamer gst_plugins_base
+      ];
 
     patches = [
       ./disable-reporter.patch # fixes "search box not working when built on xulrunner"
diff --git a/pkgs/applications/networking/browsers/firefox/system-cairo.patch b/pkgs/applications/networking/browsers/firefox/system-cairo.patch
deleted file mode 100644
index 76cf4d51c9cb..000000000000
--- a/pkgs/applications/networking/browsers/firefox/system-cairo.patch
+++ /dev/null
@@ -1,73 +0,0 @@
-# HG changeset patch
-# From: https://hg.mozilla.org/mozilla-central/rev/52b02042b27f
-# User Connor Behan <connor.behan@gmail.com>
-# Date 1370038985 -7200
-# Node ID 52b02042b27f75acbcb2bd4822bedb00ab680e67
-# Parent  08ed531fed70978385cf9253bbc8389b0abe76ca
-Bug 722975: Unbreak builds using --with-system-cairo. r=bas
-
-diff --git a/gfx/thebes/gfxPlatform.cpp b/gfx/thebes/gfxPlatform.cpp
---- a/gfx/thebes/gfxPlatform.cpp
-+++ b/gfx/thebes/gfxPlatform.cpp
-@@ -548,23 +548,31 @@ struct SourceSurfaceUserData
-   BackendType mBackendType;
- };
- 
- void SourceBufferDestroy(void *srcSurfUD)
- {
-   delete static_cast<SourceSurfaceUserData*>(srcSurfUD);
- }
- 
-+#if MOZ_TREE_CAIRO
- void SourceSnapshotDetached(cairo_surface_t *nullSurf)
- {
-   gfxImageSurface* origSurf =
-     static_cast<gfxImageSurface*>(cairo_surface_get_user_data(nullSurf, &kSourceSurface));
- 
-   origSurf->SetData(&kSourceSurface, NULL, NULL);
- }
-+#else
-+void SourceSnapshotDetached(void *nullSurf)
-+{
-+  gfxImageSurface* origSurf = static_cast<gfxImageSurface*>(nullSurf);
-+  origSurf->SetData(&kSourceSurface, NULL, NULL);
-+}
-+#endif
- 
- RefPtr<SourceSurface>
- gfxPlatform::GetSourceSurfaceForSurface(DrawTarget *aTarget, gfxASurface *aSurface)
- {
-   void *userData = aSurface->GetData(&kSourceSurface);
- 
-   if (userData) {
-     SourceSurfaceUserData *surf = static_cast<SourceSurfaceUserData*>(userData);
-@@ -667,24 +675,28 @@ gfxPlatform::GetSourceSurfaceForSurface(
-       }
- 
-       srcBuffer = Factory::CreateWrappingDataSourceSurface(imgSurface->Data(),
-                                                            imgSurface->Stride(),
-                                                            size, format);
- 
-     }
- 
-+#if MOZ_TREE_CAIRO
-     cairo_surface_t *nullSurf =
- 	cairo_null_surface_create(CAIRO_CONTENT_COLOR_ALPHA);
-     cairo_surface_set_user_data(nullSurf,
-                                 &kSourceSurface,
-                                 imgSurface,
-                                 NULL);
-     cairo_surface_attach_snapshot(imgSurface->CairoSurface(), nullSurf, SourceSnapshotDetached);
-     cairo_surface_destroy(nullSurf);
-+#else
-+    cairo_surface_set_mime_data(imgSurface->CairoSurface(), "mozilla/magic", (const unsigned char*) "data", 4, SourceSnapshotDetached, imgSurface.get());
-+#endif
-   }
- 
-   SourceSurfaceUserData *srcSurfUD = new SourceSurfaceUserData;
-   srcSurfUD->mBackendType = aTarget->GetType();
-   srcSurfUD->mSrcSurface = srcBuffer;
-   aSurface->SetData(&kSourceSurface, srcSurfUD, SourceBufferDestroy);
- 
-   return srcBuffer;
-
diff --git a/pkgs/applications/networking/browsers/firefox/wrapper.nix b/pkgs/applications/networking/browsers/firefox/wrapper.nix
index f8d2c2d0e8cd..bf4c7f3e7d22 100644
--- a/pkgs/applications/networking/browsers/firefox/wrapper.nix
+++ b/pkgs/applications/networking/browsers/firefox/wrapper.nix
@@ -1,4 +1,4 @@
-{ stdenv, browser, makeDesktopItem, makeWrapper, plugins, libs, gtk_modules
+{ stdenv, lib, browser, makeDesktopItem, makeWrapper, plugins, libs, gtk_modules
 , browserName, desktopName, nameSuffix, icon
 }:
 
@@ -50,8 +50,7 @@ stdenv.mkDerivation {
     description =
       browser.meta.description
       + " (with plugins: "
-      + (let lib = import ../../../../lib;
-        in lib.concatStrings (lib.intersperse ", " (map (x: x.name) plugins)))
+      + lib.concatStrings (lib.intersperse ", " (map (x: x.name) plugins))
       + ")";
   };
 }
diff --git a/pkgs/applications/networking/browsers/midori/default.nix b/pkgs/applications/networking/browsers/midori/default.nix
index 4d561737d276..e39e377147a3 100644
--- a/pkgs/applications/networking/browsers/midori/default.nix
+++ b/pkgs/applications/networking/browsers/midori/default.nix
@@ -43,7 +43,7 @@ rec {
 
   name = "midori-${version}.${release}";
   meta = {
-    description = "Light WebKit-based web browser with GTK GUI.";
+    description = "Light WebKit-based web browser with GTK GUI";
     maintainers = [args.lib.maintainers.raskin];
     platforms = with args.lib.platforms;
       linux;
diff --git a/pkgs/applications/networking/browsers/mozilla-plugins/fribid/builder.sh b/pkgs/applications/networking/browsers/mozilla-plugins/fribid/builder.sh
new file mode 100644
index 000000000000..fb36125b3a17
--- /dev/null
+++ b/pkgs/applications/networking/browsers/mozilla-plugins/fribid/builder.sh
@@ -0,0 +1,4 @@
+source $stdenv/setup
+export PREFIX=$out
+configureFlags="--plugin-path=$out/lib/mozilla/plugins"
+genericBuild
diff --git a/pkgs/applications/networking/browsers/mozilla-plugins/fribid/default.nix b/pkgs/applications/networking/browsers/mozilla-plugins/fribid/default.nix
new file mode 100644
index 000000000000..7422654ec985
--- /dev/null
+++ b/pkgs/applications/networking/browsers/mozilla-plugins/fribid/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchurl, pkgconfig, openssl, glib, libX11, gtk3, gettext, intltool }:
+
+let version = "1.0.2"; in
+stdenv.mkDerivation rec {
+  name = "fribid-${version}";
+  builder = ./builder.sh;
+
+  src = fetchurl {
+    url = "https://fribid.se/releases/source/${name}.tar.bz2";
+    sha256 = "d7cd9adf04fedf50b266a5c14ddb427cbb263d3bc160ee0ade03aca9d5356e5c";
+  };
+
+  buildInputs = [ pkgconfig openssl libX11 gtk3 glib gettext intltool ];
+  patches = [
+    ./translation-xgettext-to-intltool.patch
+    ./plugin-linkfix.patch
+    ./emulated-version.patch
+    ./ipc-lazytrace.patch
+    ];
+
+  passthru.mozillaPlugin = "/lib/mozilla/plugins";
+
+  meta = {
+    description = "A browser plugin to manage Swedish BankID:s";
+    homepage = http://fribid.se;
+    licenses = [ "GPLv2" "MPLv1" ];
+    maintainers = [ stdenv.lib.maintainers.edwtjo ];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
+
diff --git a/pkgs/applications/networking/browsers/mozilla-plugins/fribid/emulated-version.patch b/pkgs/applications/networking/browsers/mozilla-plugins/fribid/emulated-version.patch
new file mode 100644
index 000000000000..f730ad017b1d
--- /dev/null
+++ b/pkgs/applications/networking/browsers/mozilla-plugins/fribid/emulated-version.patch
@@ -0,0 +1,12 @@
+--- a/common/defines.h  2012-11-14 18:02:43.000000000 +0100
++++ b/common/defines.h  2013-09-20 19:17:45.669290630 +0200
+@@ -39,7 +39,7 @@
+ #define RELEASE_TIME        1352912534
+ #define IPCVERSION          "10"
+ 
+-#define EMULATED_VERSION    "4.15.0.14"
++#define EMULATED_VERSION    "4.17.0.11" // Was 4.15.0.14
+ #define DNSVERSION          "2"
+ #define STATUSDOMAIN        ".status.fribid.se"
+ 
+
diff --git a/pkgs/applications/networking/browsers/mozilla-plugins/fribid/ipc-lazytrace.patch b/pkgs/applications/networking/browsers/mozilla-plugins/fribid/ipc-lazytrace.patch
new file mode 100644
index 000000000000..b7d05ddd0ef5
--- /dev/null
+++ b/pkgs/applications/networking/browsers/mozilla-plugins/fribid/ipc-lazytrace.patch
@@ -0,0 +1,10 @@
+--- a/plugin/ipc.c	2012-11-14 18:02:43.000000000 +0100
++++ b/plugin/ipc.c	2013-09-21 08:55:39.960265058 +0200
+@@ -74,6 +74,7 @@
+         //close(pipeOut[PIPE_READ_END]);
+
+         execvp(mainBinary, (char *const *)argv);
++        fprintf(stderr, "Wanted signing executable\t<%s>\n", mainBinary);
+         perror(BINNAME ": Failed to execute main binary");
+         exit(1);
+     } else {
diff --git a/pkgs/applications/networking/browsers/mozilla-plugins/fribid/plugin-linkfix.patch b/pkgs/applications/networking/browsers/mozilla-plugins/fribid/plugin-linkfix.patch
new file mode 100644
index 000000000000..1128381238b4
--- /dev/null
+++ b/pkgs/applications/networking/browsers/mozilla-plugins/fribid/plugin-linkfix.patch
@@ -0,0 +1,11 @@
+--- a/plugin/Makefile	2013-09-18 13:55:11.091652553 +0200
++++ b/plugin/Makefile	2013-09-18 13:58:27.513618750 +0200
+@@ -60,7 +60,7 @@
+ 	for path in $(NPAPI_PLUGIN_PATHS); do \
+ 	    (../configure --internal--remove-link $(DESTDIR)$$path/libfribidplugin.so $(NPAPI_PLUGIN_LIB) || exit 1) && \
+ 	    install -d $(DESTDIR)$$path && \
+-	    ln -sf $(NPAPI_PLUGIN_LIB) $(DESTDIR)$$path/libfribidplugin.so; \
++	    ln -sf $(DESTDIR)$(NPAPI_PLUGIN_LIB) $(DESTDIR)$$path/libfribidplugin.so; \
+ 	done
+
+ uninstall:
diff --git a/pkgs/applications/networking/browsers/mozilla-plugins/fribid/translation-xgettext-to-intltool.patch b/pkgs/applications/networking/browsers/mozilla-plugins/fribid/translation-xgettext-to-intltool.patch
new file mode 100644
index 000000000000..dcac4f17928b
--- /dev/null
+++ b/pkgs/applications/networking/browsers/mozilla-plugins/fribid/translation-xgettext-to-intltool.patch
@@ -0,0 +1,16 @@
+--- a/translations/Makefile	2013-09-18 07:25:16.503800613 +0200
++++ b/translations/Makefile	2013-09-18 07:25:29.495869405 +0200
+@@ -38,7 +38,7 @@
+ all: template.pot $(MOFILES)
+
+ template.pot: $(POTFILES) $(DEFINES)
+-	xgettext -k_ -ktranslatable -d $(DOMAIN) --package-name=$(PACKAGENAME) --package-version=$(PACKAGEVERSION) --copyright-holder='YOUR NAME' -o $@ $(POTFILES)
++	intltool-update --gettext-package=$(PACKAGENAME) -o $@ sv
+
+ .po.mo:
+ 	msgfmt $< -o $@
+--- a/translations/POTFILES.in	2013-09-16 20:28:56.766106014 +0200
++++ b/translations/POTFILES.in	2013-09-18 13:15:05.252689648 +0200
+@@ -0,0 +1,2 @@
++client/gtk.c
++client/gtk/sign.glade
diff --git a/pkgs/applications/networking/dropbox-cli/default.nix b/pkgs/applications/networking/dropbox-cli/default.nix
index 34fe6db8932b..194b7d92c403 100644
--- a/pkgs/applications/networking/dropbox-cli/default.nix
+++ b/pkgs/applications/networking/dropbox-cli/default.nix
@@ -1,7 +1,8 @@
 { stdenv, coreutils, fetchurl, python, dropbox }:
 
 stdenv.mkDerivation {
-  name = "dropbox-cli";
+  # 1.6.0 because it's the only version mentioned in the script
+  name = "dropbox-cli-1.6.0";
 
   src = fetchurl {
     # Note: dropbox doesn't version this file. Annoying.
@@ -29,7 +30,7 @@ stdenv.mkDerivation {
 
   meta = {
     homepage = http://dropbox.com;
-    description = "Command line client for the dropbox daemon.";
+    description = "Command line client for the dropbox daemon";
     license = stdenv.lib.licenses.gpl3;
     maintainers = with stdenv.lib.maintainers; [ the-kenny ];
     # NOTE: Dropbox itself only works on linux, so this is ok.
diff --git a/pkgs/applications/networking/dropbox/default.nix b/pkgs/applications/networking/dropbox/default.nix
index 4e911bc33452..99589a3d71b5 100644
--- a/pkgs/applications/networking/dropbox/default.nix
+++ b/pkgs/applications/networking/dropbox/default.nix
@@ -2,7 +2,7 @@
 , libSM, libX11, libXext, libXcomposite, libXcursor, libXdamage
 , libXfixes, libXi, libXinerama, libXrandr, libXrender
 , dbus, dbus_glib, fontconfig, gcc, patchelf
-, atk, glib, gdk_pixbuf, gtk, pango
+, atk, glib, gdk_pixbuf, gtk, pango, zlib
 }:
 
 # this package contains the daemon version of dropbox
@@ -20,14 +20,14 @@ let
   arch = if stdenv.system == "x86_64-linux" then "x86_64"
     else if stdenv.system == "i686-linux" then "x86"
     else throw "Dropbox client for: ${stdenv.system} not supported!";
-    
+
   interpreter = if stdenv.system == "x86_64-linux" then "ld-linux-x86-64.so.2"
     else if stdenv.system == "i686-linux" then "ld-linux.so.2"
     else throw "Dropbox client for: ${stdenv.system} not supported!";
 
-  version = "1.4.21";
-  sha256 = if stdenv.system == "x86_64-linux" then "94073842f4a81feee80bca590e1df73fc3cab47ba879407ceba2de48f30d84e2"
-    else if stdenv.system == "i686-linux" then "121v92m20l73xjmzng3vmcp4zsp9mlbcfia73f5py5y74kndb2ap"
+  version = "2.4.3";
+  sha256 = if stdenv.system == "x86_64-linux" then "0g8iqgc18qbw8fvdjf0fhbal34rvwr5izrf5acfzqjg99dgih81r"
+    else if stdenv.system == "i686-linux" then "1nhmk319whj6cil6wg9hrfln9bxin3fnf6sxb0zg2ycfpnnqi0la"
     else throw "Dropbox client for: ${stdenv.system} not supported!";
 
   # relative location where the dropbox libraries are stored
@@ -40,7 +40,7 @@ let
       libSM libX11 libXext libXcomposite libXcursor libXdamage
       libXfixes libXi libXinerama libXrandr libXrender
       atk dbus dbus_glib glib fontconfig gcc gdk_pixbuf
-      gtk pango
+      gtk pango zlib
     ];
 
   desktopItem = makeDesktopItem {
diff --git a/pkgs/applications/networking/ids/bro/default.nix b/pkgs/applications/networking/ids/bro/default.nix
index 6e70e106d26e..d60d39ac028d 100644
--- a/pkgs/applications/networking/ids/bro/default.nix
+++ b/pkgs/applications/networking/ids/bro/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
   enableParallelBuilding = true;
   
   meta = {
-    description = "Bro is a powerful network analysis framework that is much different from the typical IDS you may know.";
+    description = "Powerful network analysis framework that is much different from the typical IDS you may know";
     homepage = http://www.bro.org/;
     license = "BSD";
   };
diff --git a/pkgs/applications/networking/instant-messengers/amsn/default.nix b/pkgs/applications/networking/instant-messengers/amsn/default.nix
index 07aa20ff1f31..fc7906b3e402 100644
--- a/pkgs/applications/networking/instant-messengers/amsn/default.nix
+++ b/pkgs/applications/networking/instant-messengers/amsn/default.nix
@@ -16,6 +16,7 @@ stdenv.mkDerivation {
   '';
 
   meta = {
+    description = "Instant messaging (MSN Messenger clone)";
     homepage = http://amsn-project.net;
   };
 }
diff --git a/pkgs/applications/networking/instant-messengers/oneteam/default.nix b/pkgs/applications/networking/instant-messengers/oneteam/default.nix
index 3549d7f14996..14d01de32458 100644
--- a/pkgs/applications/networking/instant-messengers/oneteam/default.nix
+++ b/pkgs/applications/networking/instant-messengers/oneteam/default.nix
@@ -76,8 +76,6 @@ rec {
     [
       raskin
     ];
-    platforms = with a.lib.platforms;
-      linux;
     license = a.lib.licenses.gpl2;
     homepage="http://oneteam.im";
   };
diff --git a/pkgs/applications/networking/instant-messengers/pidgin-plugins/msn-pecan/default.nix b/pkgs/applications/networking/instant-messengers/pidgin-plugins/msn-pecan/default.nix
index cdbf63dbd9f1..2e1b745790a4 100644
--- a/pkgs/applications/networking/instant-messengers/pidgin-plugins/msn-pecan/default.nix
+++ b/pkgs/applications/networking/instant-messengers/pidgin-plugins/msn-pecan/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation {
   };
 
   meta = {
-    description = "Alternative MSN protocol plug-in for Pidgin IM.";
+    description = "Alternative MSN protocol plug-in for Pidgin IM";
     homepage = http://code.google.com/p/msn-pecan/;
   };
 
diff --git a/pkgs/applications/networking/instant-messengers/pidgin-plugins/sipe/default.nix b/pkgs/applications/networking/instant-messengers/pidgin-plugins/sipe/default.nix
index e8afdb37cbc4..9c787867e5a1 100644
--- a/pkgs/applications/networking/instant-messengers/pidgin-plugins/sipe/default.nix
+++ b/pkgs/applications/networking/instant-messengers/pidgin-plugins/sipe/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation {
   };
 
   meta = {
-    description = "SIPE plugin for Pidgin IM.";
+    description = "SIPE plugin for Pidgin IM";
     homepage = http://sipe.sourceforge.net/;
     license = "GPLv2";
   };
diff --git a/pkgs/applications/networking/instant-messengers/pidgin-plugins/tox-prpl/default.nix b/pkgs/applications/networking/instant-messengers/pidgin-plugins/tox-prpl/default.nix
new file mode 100644
index 000000000000..b87db662f45e
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/pidgin-plugins/tox-prpl/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchurl, libtoxcore, pidgin, autoconf, automake, libtool, libsodium } :
+
+let
+  version = "17a3fd9199";
+  date = "20131012";
+in
+stdenv.mkDerivation rec {
+  name = "tox-prpl-${date}-${version}";
+
+  src = fetchurl {
+    url = "https://github.com/jin-eld/tox-prpl/tarball/${version}";
+    name = "${name}.tar.gz";
+    sha256 = "0sz5wkyfwmhaj652xpsxq4p252cmmfa1vy6mp3jfyn145c758v9n";
+  };
+
+  NIX_LDFLAGS = "-lssp -lsodium";
+
+  preConfigure = "autoreconf -vfi";
+
+  postInstall = "mv $out/lib/purple-2 $out/lib/pidgin";
+
+  buildInputs = [ libtoxcore pidgin autoconf automake libtool libsodium ];
+
+  meta = {
+    homepage = http://tox.dhs.org/;
+    description = "Tox plugin for Pidgin / libpurple";
+    license = "GPLv3";
+  };
+}
diff --git a/pkgs/applications/networking/instant-messengers/pidgin/default.nix b/pkgs/applications/networking/instant-messengers/pidgin/default.nix
index 00fba657d8a4..d0652adcb0d6 100644
--- a/pkgs/applications/networking/instant-messengers/pidgin/default.nix
+++ b/pkgs/applications/networking/instant-messengers/pidgin/default.nix
@@ -52,7 +52,7 @@ stdenv.mkDerivation rec {
   + (lib.optionalString (gnutls != null) " --enable-gnutls=yes --enable-nss=no")
   ;
   meta = {
-    description = "Pidgin IM - XMPP(Jabber), AIM/ICQ, IRC, SIP etc client.";
+    description = "Pidgin IM - XMPP(Jabber), AIM/ICQ, IRC, SIP etc client";
     homepage = http://pidgin.im;
   };
 }
diff --git a/pkgs/applications/networking/instant-messengers/skype/default.nix b/pkgs/applications/networking/instant-messengers/skype/default.nix
index aa90c8e70261..ebd84ff47b89 100644
--- a/pkgs/applications/networking/instant-messengers/skype/default.nix
+++ b/pkgs/applications/networking/instant-messengers/skype/default.nix
@@ -48,6 +48,7 @@ stdenv.mkDerivation rec {
 
     cat > $out/bin/skype << EOF
     #!${stdenv.shell}
+    export PULSE_LATENCY_MSEC=60  # workaround for pulseaudio glitches
     export LD_LIBRARY_PATH=$fullPath:$LD_LIBRARY_PATH
     $dynlinker $out/libexec/skype/skype --resources=$out/libexec/skype "\$@"
     EOF
diff --git a/pkgs/applications/networking/instant-messengers/torchat/default.nix b/pkgs/applications/networking/instant-messengers/torchat/default.nix
index 5a82cf9d6407..06bcd7a0400e 100644
--- a/pkgs/applications/networking/instant-messengers/torchat/default.nix
+++ b/pkgs/applications/networking/instant-messengers/torchat/default.nix
@@ -2,18 +2,17 @@
 stdenv.mkDerivation rec {
 
   name = "torchat-${version}";
-  version = "0.9.9.550";
+  version = "0.9.9.553";
 
   src = fetchurl {
-    url = "http://torchat.googlecode.com/files/torchat-source-${version}.zip";
-    sha256 = "01z0vrmflcmb146m04b66zihkd22aqnxz2vr4x23z1q5mlwylmq2";
+    url = "https://github.com/prof7bit/TorChat/archive/${version}.tar.gz";
+    sha256 = "0rb4lvv40pz6ab5kxq40ycvh7kh1yxn7swzgv2ff2nbhi62xnzp0";
   };
 
   buildInputs = [ python unzip wxPython wrapPython ];
   pythonPath = [ wxPython ];
 
-  preConfigure = "rm portable.txt";
-  preUnpack = "sourceRoot=`pwd`/src";
+  preConfigure = "cd torchat/src; rm portable.txt";
 
   installPhase = ''
     substituteInPlace "Tor/tor.sh" --replace "tor -f" "${tor}/bin/tor -f"
@@ -29,8 +28,8 @@ stdenv.mkDerivation rec {
   '';
 
   meta = with stdenv.lib; {
-    homepage = http://code.google.com/p/torchat/;
-    description = "instant messaging application on top of the Tor network and it's location hidden services";
+    homepage = https://github.com/prof7bit/TorChat;
+    description = "Instant messaging application on top of the Tor network and it's location hidden services";
     license = licenses.gpl3;
     maintainers = [ maintainers.phreedom ];
     platforms = platforms.unix;
diff --git a/pkgs/applications/networking/instant-messengers/toxic/default.nix b/pkgs/applications/networking/instant-messengers/toxic/default.nix
new file mode 100644
index 000000000000..c2af1274a24c
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/toxic/default.nix
@@ -0,0 +1,40 @@
+{ stdenv, fetchurl, autoconf, libtool, automake, libsodium, ncurses
+, libtoxcore, pkgconfig }:
+
+let
+  version = "75d356e52a";
+  date = "20131011";
+in
+stdenv.mkDerivation rec {
+  name = "toxic-${date}-${version}";
+
+  src = fetchurl {
+    url = "https://github.com/Tox/toxic/tarball/${version}";
+    name = "${name}.tar.gz";
+    sha256 = "14wyvms8l07sl88g8y6g2jv95sq7cnhbaqf4n32xxilch8rymq47";
+  };
+
+  preConfigure = ''
+    autoreconf -i
+  '';
+
+  NIX_LDFLAGS = "-lsodium";
+
+  configureFlags = [
+    "--with-libtoxcore-headers=${libtoxcore}/include"
+    "--with-libtoxcore-libs=${libtoxcore}/lib" 
+    "--with-libsodium-headers=${libtoxcore}/include"
+    "--with-libsodium-libs=${libtoxcore}/lib" 
+  ];
+
+  buildInputs = [ autoconf libtool automake libtoxcore libsodium ncurses pkgconfig ];
+
+  doCheck = true;
+
+  meta = {
+    description = "Reference CLI for Tox";
+    license = "GPLv3+";
+    maintainers = with stdenv.lib.maintainers; [ viric ];
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/applications/networking/irc/kvirc/default.nix b/pkgs/applications/networking/irc/kvirc/default.nix
new file mode 100644
index 000000000000..f4b451e66e07
--- /dev/null
+++ b/pkgs/applications/networking/irc/kvirc/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchurl, cmake, qt4, perl, gettext, kdelibs, openssl, zlib}:
+
+let
+  pn = "kvirc";
+  v = "4.2.0";
+in
+
+stdenv.mkDerivation {
+  name = "${pn}-${v}";
+
+  src = fetchurl {
+    url = "ftp://ftp.kvirc.de/pub/${pn}/${v}/source/${pn}-${v}.tar.bz2";
+    sha256 = "9a547d52d804e39c9635c8dc58bccaf4d34341ef16a9a652a5eb5568d4d762cb";
+  };
+
+  buildInputs = [ cmake qt4 perl gettext kdelibs openssl zlib ];
+
+  meta = with stdenv.lib; {
+    description = "Graphic IRC client with Qt";
+    license = licenses.gpl3;
+    homepage = http://www.kvirc.net/;
+    platforms   = platforms.linux;
+  };
+}
diff --git a/pkgs/applications/networking/irc/quassel/default.nix b/pkgs/applications/networking/irc/quassel/default.nix
index 16aaf3d9f3b2..67ff1ca02c43 100644
--- a/pkgs/applications/networking/irc/quassel/default.nix
+++ b/pkgs/applications/networking/irc/quassel/default.nix
@@ -1,7 +1,7 @@
 { monolithic ? true # build monolithic Quassel
 , daemon ? false # build Quassel daemon
 , client ? false # build Quassel client
-, withKDE ? true # enable KDE integration
+, withKDE ? stdenv.isLinux # enable KDE integration
 , ssl ? true # enable SSL support
 , previews ? false # enable webpage previews on hovering over URLs
 , stdenv, fetchurl, cmake, qt4, kdelibs, automoc4, phonon }:
@@ -11,11 +11,11 @@ let
 
 in with stdenv; mkDerivation rec {
 
-  name = "quassel-0.7.4";
+  name = "quassel-0.9.0";
 
   src = fetchurl {
     url = "http://quassel-irc.org/pub/${name}.tar.bz2";
-    sha256 = "08f4m35bkmp9p1n560a3fg711s9izb25ddx2az03xzf1jl8qdrg7";
+    sha256 = "09v0igjkzan3hllk47w39hkav6v1419vpxn2lfd8473kwdmf0grf";
   };
 
   buildInputs = [ cmake qt4 ]
@@ -48,6 +48,7 @@ in with stdenv; mkDerivation rec {
     '';
     license = "GPLv3";
     maintainers = [ maintainers.phreedom ];
+    repositories.git = https://github.com/quassel/quassel.git;
     inherit (qt4.meta) platforms;
   };
 }
diff --git a/pkgs/applications/networking/irc/weechat/default.nix b/pkgs/applications/networking/irc/weechat/default.nix
index a523089e0ed1..01ba8c97d988 100644
--- a/pkgs/applications/networking/irc/weechat/default.nix
+++ b/pkgs/applications/networking/irc/weechat/default.nix
@@ -3,12 +3,12 @@
 , pythonPackages, cacert, cmake, makeWrapper }:
 
 stdenv.mkDerivation rec {
-  version = "0.4.1";
+  version = "0.4.2";
   name = "weechat-${version}";
 
   src = fetchurl {
     url = "http://weechat.org/files/src/${name}.tar.gz";
-    sha256 = "0gsn0mp921j7jpvrxc74h0gs0bn0w808j2zqghm1w7xbjw9hl49w";
+    sha256 = "03ypji34kb5yrxqyn8dbrjm3j00pc8v7wfsip7d3l63nyx79df9v";
   };
 
   buildInputs = 
@@ -18,17 +18,16 @@ stdenv.mkDerivation rec {
     ];
 
   postInstall = ''
-       wrapProgram "$out/bin/weechat-curses" \
+       wrapProgram "$out/bin/weechat" \
          --prefix PYTHONPATH : "$PYTHONPATH" \
          --prefix PYTHONPATH : "$out/lib/${python.libPrefix}/site-packages"
   '';
 
   meta = {
-    homepage = http://http://www.weechat.org/;
+    homepage = http://www.weechat.org/;
     description = "A fast, light and extensible chat client";
     license = stdenv.lib.licenses.gpl3;
-    maintainers = [ stdenv.lib.maintainers.garbas ];
+    maintainers = with stdenv.lib.maintainers; [ garbas the-kenny ];
     platforms = stdenv.lib.platforms.linux;
   };
 }
-
diff --git a/pkgs/applications/networking/jmeter/default.nix b/pkgs/applications/networking/jmeter/default.nix
new file mode 100644
index 000000000000..c3212f6aa560
--- /dev/null
+++ b/pkgs/applications/networking/jmeter/default.nix
@@ -0,0 +1,27 @@
+{ fetchurl, stdenv, ant }:
+
+stdenv.mkDerivation rec {
+  name = "jmeter-2.9";
+  src = fetchurl {
+    url = "http://ftp.unicamp.br/pub/apache//jmeter/binaries/apache-jmeter-2.9.tgz";
+    sha256 = "14r3zn910m97jqrf6k5c4lwy214snaap2242qg76h65zk9qr20ni";
+  };
+
+  installPhase = ''
+    mkdir $out
+    cp ./* $out/ -R
+  '';
+
+  meta = {
+    description = "Apache JMeter is a 100% pure Java desktop application designed to load test functional behavior and measure performance.";
+    longDescription = ''
+      The Apache JMeter desktop application is open source software, a 100%
+      pure Java application designed to load test functional behavior and
+      measure performance. It was originally designed for testing Web
+      Applications but has since expanded to other test functions.
+    '';
+    license = stdenv.lib.licenses.asl20;
+    maintainers = [ stdenv.lib.maintainers.garbas ];
+    priority = 1;
+  };
+}
diff --git a/pkgs/applications/networking/mailreaders/sup/default.nix b/pkgs/applications/networking/mailreaders/sup/default.nix
index 058335370266..dd2837da40a6 100644
--- a/pkgs/applications/networking/mailreaders/sup/default.nix
+++ b/pkgs/applications/networking/mailreaders/sup/default.nix
@@ -1,9 +1,10 @@
 { stdenv, fetchurl, ruby, rake, rubygems, makeWrapper, ncursesw_sup
-, xapian_ruby, gpgme, libiconvOrEmpty, rmail, mime_types, chronic, trollop
-, lockfile, gettext, iconv, locale, text, highline }:
+, xapian_ruby, gpgme, libiconvOrEmpty, mime_types, chronic, trollop, lockfile
+, gettext, iconv, locale, text, highline, rmail_sup, unicode, gnupg, which }:
 
-stdenv.mkDerivation {
-  name = "sup-896ab66c0263e5ce0fa45857fb08e0fb78fcb6bd";
+stdenv.mkDerivation rec {
+  version = "f27661b1656ae1f0d28fd89595b5a16f268d8d3d";
+  name    = "sup-${version}";
   
   meta = {
     homepage = http://supmua.org;
@@ -16,8 +17,8 @@ stdenv.mkDerivation {
   dontStrip = true;
 
   src = fetchurl {
-    url = "https://github.com/sup-heliotrope/sup/archive/896ab66c0263e5ce0fa45857fb08e0fb78fcb6bd.tar.gz";
-    sha256 = "0sknf4ha13m2478fa27qnm43bcn59g6qbd8f2nmv64k2zs7xnwmk";
+    url    = "https://github.com/sup-heliotrope/sup/archive/${version}.tar.gz";
+    sha256 = "08fxf1knji3260d0mrp86x6yayp43iq7kc5rfay3hga8i2sckdia";
   };
 
   buildInputs =
@@ -26,8 +27,6 @@ stdenv.mkDerivation {
 
   buildPhase = "rake gem";
 
-  # TODO: Move gem dependencies out
-
   installPhase = ''
     export HOME=$TMP/home; mkdir -pv "$HOME"
 
@@ -35,16 +34,17 @@ stdenv.mkDerivation {
     GEM_PATH="$GEM_PATH:${chronic}/${ruby.gemPath}"
     GEM_PATH="$GEM_PATH:${gettext}/${ruby.gemPath}"
     GEM_PATH="$GEM_PATH:${gpgme}/${ruby.gemPath}"
+    GEM_PATH="$GEM_PATH:${highline}/${ruby.gemPath}"
     GEM_PATH="$GEM_PATH:${iconv}/${ruby.gemPath}"
     GEM_PATH="$GEM_PATH:${locale}/${ruby.gemPath}"
     GEM_PATH="$GEM_PATH:${lockfile}/${ruby.gemPath}"
     GEM_PATH="$GEM_PATH:${mime_types}/${ruby.gemPath}"
     GEM_PATH="$GEM_PATH:${ncursesw_sup}/${ruby.gemPath}"
-    GEM_PATH="$GEM_PATH:${rmail}/${ruby.gemPath}"
+    GEM_PATH="$GEM_PATH:${rmail_sup}/${ruby.gemPath}"
     GEM_PATH="$GEM_PATH:${text}/${ruby.gemPath}"
     GEM_PATH="$GEM_PATH:${trollop}/${ruby.gemPath}"
+    GEM_PATH="$GEM_PATH:${unicode}/${ruby.gemPath}"
     GEM_PATH="$GEM_PATH:${xapian_ruby}/${ruby.gemPath}"
-    GEM_PATH="$GEM_PATH:${highline}/${ruby.gemPath}"
 
     # Don't install some dependencies -- we have already installed
     # the dependencies but gem doesn't acknowledge this
@@ -52,8 +52,13 @@ stdenv.mkDerivation {
         --bindir "$out/bin" --no-rdoc --no-ri pkg/sup-999.gem \
         --ignore-dependencies
 
+    # specify ruby interpreter explicitly
+    sed -i '1 s|^.*$|#!${ruby}/bin/ruby|' bin/sup-sync-back-maildir
+
+    cp bin/sup-sync-back-maildir "$out"/bin
+
     for prog in $out/bin/*; do
-      wrapProgram "$prog" --prefix GEM_PATH : "$GEM_PATH"
+      wrapProgram "$prog" --prefix GEM_PATH : "$GEM_PATH" --prefix PATH : "${gnupg}/bin:${which}/bin"
     done
 
     for prog in $out/gems/*/bin/*; do
@@ -61,4 +66,3 @@ stdenv.mkDerivation {
     done
   '';
 }
-
diff --git a/pkgs/applications/networking/p2p/gnunet/svn.nix b/pkgs/applications/networking/p2p/gnunet/svn.nix
index b6b9db99f907..ed6c348706b9 100644
--- a/pkgs/applications/networking/p2p/gnunet/svn.nix
+++ b/pkgs/applications/networking/p2p/gnunet/svn.nix
@@ -1,10 +1,11 @@
 { stdenv, fetchsvn, libextractor, libmicrohttpd, libgcrypt
 , zlib, gmp, curl, libtool, adns, sqlite, pkgconfig
 , libxml2, ncurses, gettext, libunistring, libidn
-, makeWrapper, autoconf, automake }:
+, makeWrapper, autoconf, automake
+, withVerbose ? false }:
 
 let
-  rev = "27775";
+  rev = "27840";
 in
 stdenv.mkDerivation rec {
   name = "gnunet-svn-${rev}";
@@ -12,7 +13,7 @@ stdenv.mkDerivation rec {
   src = fetchsvn {
     url =  https://gnunet.org/svn/gnunet;
     inherit rev;
-    sha256 = "1fa2g63rrn0mmim9v62gnm2hqr556mbcafb7cs7afycbinix4spf";
+    sha256 = "0zhxvvj5rbhca2ykfx3g93dv94xyhqsnj011a6gql7zd5vfhaf6v";
   };
 
   buildInputs = [
@@ -22,6 +23,8 @@ stdenv.mkDerivation rec {
     autoconf automake
   ];
 
+  configureFlags = stdenv.lib.optional withVerbose "--enable-logging=verbose ";
+
   preConfigure = ''
     # Brute force: since nix-worker chroots don't provide
     # /etc/{resolv.conf,hosts}, replace all references to `localhost'
diff --git a/pkgs/applications/networking/p2p/transmission/2.60.nix b/pkgs/applications/networking/p2p/transmission/2.60.nix
deleted file mode 100644
index c59fddf6364b..000000000000
--- a/pkgs/applications/networking/p2p/transmission/2.60.nix
+++ /dev/null
@@ -1,41 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, openssl, curl, intltool, libevent,
-  file, inotifyTools, gtk ? null }:
-
-stdenv.mkDerivation rec {
-  name = "transmission-2.60"; # transmission >= 2.61 requires gtk3
-
-  src = fetchurl {
-    url = "http://download.transmissionbt.com/files/${name}.tar.xz";
-    sha256 = "1ramdliyy8j7qqpkxg643lda11ynxwfhq6qcs31fr3h9x72l0rg4";
-  };
-
-  buildInputs = [ pkgconfig openssl curl intltool libevent
-                  file inotifyTools gtk ];
-
-  preConfigure = ''
-    sed -i -e 's|/usr/bin/file|${file}/bin/file|g' configure
-  '';
-
-  postInstall = ''
-    rm -f $out/share/icons/hicolor/icon-theme.cache
-  '';
-
-  meta = {
-    description = "A fast, easy and free BitTorrent client";
-    longDescription = ''
-      Transmission is a BitTorrent client which features a simple interface
-      on top of a cross-platform back-end.
-      Feature spotlight:
-        * Uses fewer resources than other clients
-        * Native Mac, GTK+ and Qt GUI clients
-        * Daemon ideal for servers, embedded systems, and headless use
-        * All these can be remote controlled by Web and Terminal clients
-        * Bluetack (PeerGuardian) blocklists with automatic updates
-        * Full encryption, DHT, and PEX support
-    '';
-    homepage = http://www.transmissionbt.com/;
-    license = [ "GPLv2" ];
-    maintainers = [ stdenv.lib.maintainers.astsmtl ];
-    platforms = stdenv.lib.platforms.linux;
-  };
-}
diff --git a/pkgs/applications/networking/p2p/transmission/default.nix b/pkgs/applications/networking/p2p/transmission/default.nix
index 2c6106d13040..cb439ddb4624 100644
--- a/pkgs/applications/networking/p2p/transmission/default.nix
+++ b/pkgs/applications/networking/p2p/transmission/default.nix
@@ -1,32 +1,39 @@
-{ stdenv, fetchurl, pkgconfig, openssl, curl, intltool, libevent
-, file, inotifyTools
-, enableGtk ? false, gtk ? null }:
+{ stdenv, fetchurl, pkgconfig, intltool, file, makeWrapper
+, openssl, curl, libevent, inotifyTools
+, enableGTK3 ? false, gtk3
+}:
 
-assert enableGtk -> gtk != null;
+let
+  version = "2.82";
+in
+
+with { inherit (stdenv.lib) optional optionals optionalString; };
 
 stdenv.mkDerivation rec {
-  name = "transmission-2.77"; # transmission >= 2.61 requires gtk3
+  name = "transmission-" + optionalString enableGTK3 "gtk-" + version;
 
   src = fetchurl {
-    url = "http://download.transmissionbt.com/files/${name}.tar.xz";
-    sha256 = "1phzhj4wds6r2ziclva1b5l6l9xjsx5ji7s3m4xia44aq4znbcam";
+    url = "http://download.transmissionbt.com/files/transmission-${version}.tar.xz";
+    sha256 = "08imy28hpjxwdzgvhm66hkfyzp8qnnqr4jhv3rgshryzhw86b5ir";
   };
 
-  buildInputs = [ pkgconfig openssl curl intltool libevent
-                  file inotifyTools ]
-    ++ stdenv.lib.optional enableGtk gtk;
+  buildInputs = [ pkgconfig intltool file openssl curl libevent inotifyTools ]
+    ++ optionals enableGTK3 [ gtk3 makeWrapper ];
 
   preConfigure = ''
     sed -i -e 's|/usr/bin/file|${file}/bin/file|g' configure
   '';
 
-  configureFlags = stdenv.lib.optionalString enableGtk "--with-gtk";
+  configureFlags = [ "--with-systemd-daemon" ]
+    ++ optional enableGTK3 "--with-gtk";
 
-  postInstall = ''
-    rm -f $out/share/icons/hicolor/icon-theme.cache
+  postInstall = optionalString enableGTK3 /* gsettings schemas for file dialogues */ ''
+    rm "$out/share/icons/hicolor/icon-theme.cache"
+    wrapProgram "$out/bin/transmission-gtk" \
+      --prefix XDG_DATA_DIRS : "${gtk3}/share"
   '';
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "A fast, easy and free BitTorrent client";
     longDescription = ''
       Transmission is a BitTorrent client which features a simple interface
@@ -40,8 +47,9 @@ stdenv.mkDerivation rec {
         * Full encryption, DHT, and PEX support
     '';
     homepage = http://www.transmissionbt.com/;
-    license = [ "GPLv2" ];
-    maintainers = [ stdenv.lib.maintainers.astsmtl ];
-    platforms = stdenv.lib.platforms.linux;
+    license = licenses.gpl2; # parts are under MIT
+    maintainers = with maintainers; [ astsmtl vcunat ];
+    platforms = platforms.linux;
   };
 }
+
diff --git a/pkgs/applications/networking/remote/ssvnc/default.nix b/pkgs/applications/networking/remote/ssvnc/default.nix
new file mode 100644
index 000000000000..b2c9b7c3e73a
--- /dev/null
+++ b/pkgs/applications/networking/remote/ssvnc/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchurl, imake, zlib, openjdk, libX11, libXt, libXmu, libXaw, libXext, libXpm, openjpeg, openssl }:
+
+let version = "1.0.29"; in
+stdenv.mkDerivation rec {
+  name = "ssvnc-${version}";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/ssvnc/${name}.src.tar.gz";
+    sha256 = "74df32eb8eaa68b07c9693a232ebe42154617c7f3cbe1d4e68d3fe7c557d618d";
+  };
+
+  buildInputs = [ imake zlib openjdk libX11 libXt libXmu libXaw libXext libXpm openjpeg openssl ];
+
+  configurePhase = "makeFlags=PREFIX=$out";
+
+  meta = {
+    description = "VNC viewer that adds encryption security to VNC connections";
+    homepage = "http://www.karlrunge.com/x11vnc/ssvnc.html";
+    license = "GPLv2";
+    maintainers = [ stdenv.lib.maintainers.edwtjo ];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/applications/networking/sniffers/ettercap/default.nix b/pkgs/applications/networking/sniffers/ettercap/default.nix
new file mode 100644
index 000000000000..3994563cf3eb
--- /dev/null
+++ b/pkgs/applications/networking/sniffers/ettercap/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchurl, cmake, libpcap, libnet, zlib, curl, pcre,
+  openssl, ncurses, glib, gtk, atk, pango, flex, bison }:
+
+stdenv.mkDerivation rec {
+  name = "ettercap-${version}";
+  version = "0.8.0";
+
+  src = fetchurl {
+    url = "https://github.com/Ettercap/ettercap/archive/v${version}.tar.gz";
+    sha256 = "1g69782wk2hag8h76jqy81szw5jhvqqnn3m4v0wjkbv9zjxy44w0";
+  };
+
+  buildInputs = [
+    cmake libpcap libnet zlib curl pcre openssl ncurses
+    glib gtk atk pango flex bison
+  ];
+
+  preConfigure = ''
+    substituteInPlace CMakeLists.txt --replace /etc \$\{INSTALL_PREFIX\}/etc
+  '';
+
+  cmakeFlags = [
+    "-DGTK2_GLIBCONFIG_INCLUDE_DIR=${glib}/lib/glib-2.0/include"
+    "-DGTK2_GDKCONFIG_INCLUDE_DIR=${gtk}/lib/gtk-2.0/include"
+  ];
+
+  meta = {
+    description = "Comprehensive suite for man in the middle attacks";
+    homepage = http://ettercap.github.io/ettercap/;
+    license = stdenv.lib.licenses.gpl2;
+    platforms = stdenv.lib.platforms.unix;
+  };
+}
diff --git a/pkgs/applications/networking/znc/default.nix b/pkgs/applications/networking/znc/default.nix
index 13c3977a9799..a43d8fa9d11d 100644
--- a/pkgs/applications/networking/znc/default.nix
+++ b/pkgs/applications/networking/znc/default.nix
@@ -29,5 +29,6 @@ stdenv.mkDerivation rec {
     homepage = http://wiki.znc.in/ZNC;
     maintainers = [ stdenv.lib.maintainers.viric ];
     license = "ASL2.0";
+    platforms = stdenv.lib.platforms.unix;
   };
 }
diff --git a/pkgs/applications/networking/znc/modules.nix b/pkgs/applications/networking/znc/modules.nix
new file mode 100644
index 000000000000..ba6d36a3c76c
--- /dev/null
+++ b/pkgs/applications/networking/znc/modules.nix
@@ -0,0 +1,56 @@
+{ stdenv, fetchurl, fetchgit,  znc }:
+
+let
+
+  zncDerivation = a@{
+    name, src, module_name,
+    buildPhase ? "${znc}/bin/znc-buildmod ${module_name}.cpp",
+    installPhase ? "install -D ${module_name}.so $out/lib/znc/${module_name}.so", ...
+  } : stdenv.mkDerivation (a // {
+    inherit buildPhase;
+    inherit installPhase;
+
+    meta.platforms = stdenv.lib.platforms.unix;
+    passthru.module_name = module_name;
+  });
+
+in rec {
+
+  push = zncDerivation rec {
+    name = "znc-push-${version}";
+    version = "1.0.0";
+    module_name = "push";
+
+    src = fetchurl {
+        url = "https://github.com/jreese/znc-push/archive/v${version}.tar.gz";
+        sha256 = "1v9a16b1d8mfzhddf4drh6rbxa0szr842g7614r8ninmc0gi7a2v";
+    };
+
+    meta = {
+      description = "Push notification service module for ZNC";
+      homepage = https://github.com/jreese/znc-push;
+      repositories.git = https://github.com/jreese/znc-push.git;
+      license = stdenv.lib.license.mit;
+      maintainers = [ stdenv.lib.maintainers.offline ];
+    };
+  };
+
+  fish = zncDerivation rec {
+    name = "znc-fish-8e1f150fda";
+    module_name = "fish";
+
+    src = fetchgit {
+        url = meta.repositories.git;
+        rev = "8e1f150fdaf18dc33e023795584dec8255e6614e";
+        sha256 = "0vpk4336c191irl3g7wibblnbqf3903hjrci4gs0qgg1wvj7fw66";
+    };
+
+    meta = {
+      description = "ZNC FiSH module";
+      homepage = https://github.com/dctrwatson/znc-fish;
+      repositories.git = https://github.com/dctrwatson/znc-fish.git;
+      maintainers = [ stdenv.lib.maintainers.offline ];
+    };
+  };
+
+}
diff --git a/pkgs/applications/office/abiword/default.nix b/pkgs/applications/office/abiword/default.nix
index a500bbaa240b..0e5a6afcdc5f 100644
--- a/pkgs/applications/office/abiword/default.nix
+++ b/pkgs/applications/office/abiword/default.nix
@@ -26,4 +26,8 @@ stdenv.mkDerivation {
     [ pkgconfig gtk libglade librsvg bzip2 libgnomecanvas fribidi libpng popt
       libgsf enchant wv libjpeg
     ];
+
+  meta = {
+    description = "Word processing program, similar to Microsof Word";
+  };
 }
diff --git a/pkgs/applications/office/antiword/default.nix b/pkgs/applications/office/antiword/default.nix
index c4da2b609ce7..f889490a862c 100644
--- a/pkgs/applications/office/antiword/default.nix
+++ b/pkgs/applications/office/antiword/default.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation {
 
   meta = {
     homepage = "http://www.winfield.demon.nl/";
-    description = "convert MS Word documents to plain text or PostScript";
+    description = "Convert MS Word documents to plain text or PostScript";
     license = stdenv.lib.licenses.gpl2;
 
     maintainers = [ stdenv.lib.maintainers.simons ];
diff --git a/pkgs/applications/office/eventlist/default.nix b/pkgs/applications/office/eventlist/default.nix
new file mode 100644
index 000000000000..f126d6bfba65
--- /dev/null
+++ b/pkgs/applications/office/eventlist/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchurl, kdelibs, kdepimlibs, akonadi, gettext, boost }:
+
+stdenv.mkDerivation rec {
+  name = "plasmoid-eventlist-0.6.96";
+
+  src = fetchurl {
+    url = "http://kde-look.org/CONTENT/content-files/107779-plasmoid-eventlist-0.6.96.tar.bz2";
+    sha256 = "26cc7bd1c465bf1379fd0ba1fa8592eaa62f2553734d1b283e17359103908eea";
+  };
+
+  buildInputs = [ kdelibs kdepimlibs akonadi gettext boost ];
+
+  meta = {
+    inherit (kdelibs.meta) platforms;
+    description = "KDE Plasmoid to show events and todos on the desktop";
+    longDescription = ''
+      This is a plasmoid to show the events and todos from Akonadi resources (KOrganizer, Birthdays etc.).
+      With a google resource also Google calendar items can be shown.
+      Also possible with a CalDAV resource.
+      A facebook resource is also available.
+
+      Incidences can be filtered, added, edited, deleted via context menu.
+    '';
+    homepage = "http://kde-look.org/content/show.php/Eventlist?content=107779";
+    license = "GPLv3+";
+
+	  };
+}
diff --git a/pkgs/applications/office/libreoffice/default.nix b/pkgs/applications/office/libreoffice/default.nix
index e07fe69b70cc..8aaf1839f92a 100644
--- a/pkgs/applications/office/libreoffice/default.nix
+++ b/pkgs/applications/office/libreoffice/default.nix
@@ -15,7 +15,7 @@
 , libwpg, dbus_glib, glibc, qt4, kde4, clucene_core, libcdr, lcms, vigra
 , unixODBC, mdds, saneBackends, mythes, libexttextcat, libvisio
 , fontsConf, pkgconfig, libzip, bluez5, libtool, maven
-, langs ? [ "ALL" ]
+, langs ? [ "en-US" "en-GB" "ca" "ru" "eo" "fr" "nl" "de" "sl" ]
 }:
 
 let
@@ -160,6 +160,7 @@ stdenv.mkDerivation rec {
 
     configureFlagsArray=(
       "--with-parallelism=$NIX_BUILD_CORES"
+      "--with-lang=${langsSpaces}"
     );
   '';
 
@@ -192,13 +193,12 @@ stdenv.mkDerivation rec {
 
     ln -s $out/lib/libreoffice/share/xdg $out/share/applications
     for f in $out/share/applications/*.desktop; do
-      substituteInPlace "$f" --replace "Exec=libreoffice4.0" "$out/bin/soffice"
-      substituteInPlace "$f" --replace "Exec=libreoffice" "$out/bin/soffice"
+      substituteInPlace "$f" --replace "Exec=libreoffice4.0" "Exec=$out/bin/soffice"
+      substituteInPlace "$f" --replace "Exec=libreoffice" "Exec=$out/bin/soffice"
     done
   '';
 
   configureFlags = [
-    "--with-lang=${langsSpaces}"
     "--with-vender=NixOS"
 
     # Without these, configure does not finish
diff --git a/pkgs/applications/science/astronomy/gravit/default.nix b/pkgs/applications/science/astronomy/gravit/default.nix
index 820b4fb2979a..a2cc07b0a61c 100644
--- a/pkgs/applications/science/astronomy/gravit/default.nix
+++ b/pkgs/applications/science/astronomy/gravit/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, SDL, SDL_ttf, SDL_image, mesa, lua5_1, automake, autoconf }:
+{ stdenv, fetchurl, SDL, SDL_ttf, SDL_image, mesa, libpng, lua5, automake, autoconf }:
 
 stdenv.mkDerivation rec {
   name = "gravit-0.5.0";
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "0lyw0skrkb04s16vgz7ggswjrdxk1h23v5s85s09gjxzjp1xd3xp";
   };
 
-  buildInputs = [mesa SDL SDL_ttf SDL_image lua5_1 automake autoconf];
+  buildInputs = [mesa SDL SDL_ttf SDL_image lua5 automake autoconf libpng];
 
   preConfigure = "sh autogen.sh";
 
diff --git a/pkgs/applications/science/biology/arb/default.nix b/pkgs/applications/science/biology/arb/default.nix
index 1b4563555c46..279091f21bd2 100644
--- a/pkgs/applications/science/biology/arb/default.nix
+++ b/pkgs/applications/science/biology/arb/default.nix
@@ -75,7 +75,7 @@ stdenv.mkDerivation {
   '';
 
   meta = {
-    description     = "ARB software for sequence database handling and analysis";
+    description     = "Software for sequence database handling and analysis";
     longDescription = ''The ARB software is a graphically oriented package comprising various tools for sequence database handling and data analysis. A central database of processed (aligned) sequences and any type of additional data linked to the respective sequence entries is structured according to phylogeny or other user defined criteria. Note that this package includes its own older versions of clustal etc.''; 
     license     = "non-free";
     pkgMaintainer = "http://BioLib.open-bio.org/";
diff --git a/pkgs/applications/science/biology/plink/default.nix b/pkgs/applications/science/biology/plink/default.nix
new file mode 100644
index 000000000000..fa6dcaa82ede
--- /dev/null
+++ b/pkgs/applications/science/biology/plink/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchurl, zlib, unzip }:
+
+stdenv.mkDerivation {
+  name = "plink-1.07";
+
+  src = fetchurl {
+    url = "http://pngu.mgh.harvard.edu/~purcell/plink/dist/plink-1.07-src.zip";
+    sha256 = "4af56348443d0c6a1db64950a071b1fcb49cc74154875a7b43cccb4b6a7f482b";
+  };
+
+  buildInputs = [ zlib unzip ] ;
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp plink $out/bin
+  '';
+  
+  meta = {
+    description = "Whole genome association toolkit";
+    homepage = "http://pngu.mgh.harvard.edu/~purcell/plink/";
+    license = "GNUv2";
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/applications/science/chemistry/avogadro/default.nix b/pkgs/applications/science/chemistry/avogadro/default.nix
index f4b353296fdc..e45f5b645fd9 100644
--- a/pkgs/applications/science/chemistry/avogadro/default.nix
+++ b/pkgs/applications/science/chemistry/avogadro/default.nix
@@ -15,7 +15,8 @@ stdenv.mkDerivation rec {
   NIX_CFLAGS_COMPILE = "-include ${mesa}/include/GL/glu.h";
 
   meta = {
+    description = "Molecule editor and visualizer";
     maintainers = [ stdenv.lib.maintainers.urkud ];
-    inherit (qt4.meta) platforms;
+    platforms = stdenv.lib.platforms.mesaPlatforms;
   };
 }
diff --git a/pkgs/applications/science/electronics/alliance/default.nix b/pkgs/applications/science/electronics/alliance/default.nix
index 90fd5901cac7..ee22c66dfec0 100644
--- a/pkgs/applications/science/electronics/alliance/default.nix
+++ b/pkgs/applications/science/electronics/alliance/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation {
   '';
 
   meta = {
-      description = "Complete set of free CAD tools and portable libraries for VLSI design.";
+      description = "Complete set of free CAD tools and portable libraries for VLSI design";
       homepage = http://www-asim.lip6.fr/recherche/alliance/;
   };
 }
diff --git a/pkgs/applications/science/electronics/ngspice/default.nix b/pkgs/applications/science/electronics/ngspice/default.nix
index 70153eee61b4..579492248ea3 100644
--- a/pkgs/applications/science/electronics/ngspice/default.nix
+++ b/pkgs/applications/science/electronics/ngspice/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
   configureFlags = [ "--enable-x" "--with-x" "--with-readline" ];
 
   meta = {
-    description = "The Next Generation Spice (Electronic Circuit Simulator).";
+    description = "The Next Generation Spice (Electronic Circuit Simulator)";
     homepage = "http://ngspice.sourceforge.net";
     license = ["BSD" "GPLv2"];
     maintainers = with stdenv.lib.maintainers; [viric];
diff --git a/pkgs/applications/science/logic/ekrhyper/default.nix b/pkgs/applications/science/logic/ekrhyper/default.nix
index 7ff1acb062be..c90099f495a2 100644
--- a/pkgs/applications/science/logic/ekrhyper/default.nix
+++ b/pkgs/applications/science/logic/ekrhyper/default.nix
@@ -3,11 +3,11 @@ let
   s = # Generated upstream information
   rec {
     baseName="ekrhyper";
-    version="1_4_08022013";
+    version="1_4_30072013";
     name="${baseName}-${version}";
-    hash="0vni5pq1p99428ii3g13chiqxcs8k1fm6jlvg1jqh4qdcs42w7yb";
-    url="http://userpages.uni-koblenz.de/~bpelzer/ekrhyper/ekrh_1_4_08022013.tar.gz";
-    sha256="0vni5pq1p99428ii3g13chiqxcs8k1fm6jlvg1jqh4qdcs42w7yb";
+    hash="0ashsblm477r7dmq9f33wajkbr29rbyyc919mifdgrrdy6zlc663";
+    url="http://userpages.uni-koblenz.de/~bpelzer/ekrhyper/ekrh_1_4_30072013.tar.gz";
+    sha256="0ashsblm477r7dmq9f33wajkbr29rbyyc919mifdgrrdy6zlc663";
   };
   buildInputs = [
     ocaml perl
diff --git a/pkgs/applications/science/logic/eprover/default.nix b/pkgs/applications/science/logic/eprover/default.nix
index d36956d1375f..35e70a4b0d73 100644
--- a/pkgs/applications/science/logic/eprover/default.nix
+++ b/pkgs/applications/science/logic/eprover/default.nix
@@ -3,11 +3,11 @@ let
   s = # Generated upstream information
   rec {
     baseName="eprover";
-    version="1.7";
+    version="1.8";
     name="${baseName}-${version}";
-    hash="1prkgjpg8lajcylz9nj2hfjxl3l42cqbfvilg30z9b5br14l36rh";
-    url="http://www4.in.tum.de/~schulz/WORK/E_DOWNLOAD/V_1.7/E.tgz";
-    sha256="1prkgjpg8lajcylz9nj2hfjxl3l42cqbfvilg30z9b5br14l36rh";
+    hash="0bl4dr7k6simwdvdyxhnjkiz4nm5y0nr8bfhc34zk0360i9m6sk3";
+    url="http://www4.in.tum.de/~schulz/WORK/E_DOWNLOAD/V_1.8/E.tgz";
+    sha256="0bl4dr7k6simwdvdyxhnjkiz4nm5y0nr8bfhc34zk0360i9m6sk3";
   };
 in
 stdenv.mkDerivation {
diff --git a/pkgs/applications/science/logic/hol/default.nix b/pkgs/applications/science/logic/hol/default.nix
index 18a16114c507..2e1647b6c71d 100644
--- a/pkgs/applications/science/logic/hol/default.nix
+++ b/pkgs/applications/science/logic/hol/default.nix
@@ -1,8 +1,10 @@
-{stdenv, fetchurl, polyml, experimentalKernel ? false}:
+{stdenv, fetchurl, polyml, graphviz, fontconfig, liberation_ttf,
+ experimentalKernel ? true}:
 
 let
   pname = "hol4";
-  version = "k.7";
+  version = "k.8";
+  holsubdir = "hol-kananaskis-8";
   kernelFlag = if experimentalKernel then "-expk" else "-stdknl";
 in
 
@@ -10,38 +12,51 @@ stdenv.mkDerivation {
   name = "${pname}-${version}";
 
   src = fetchurl {
-    url = mirror://sourceforge/hol/hol/kananaskis-7/kananaskis-7.tar.gz;
-    sha256 = "0gs1nmjvsjhnndama9v7gids2g86iip53v7d7dm3sfq6jxmqkwkl";
+    url = mirror://sourceforge/hol/hol/kananaskis-8/kananaskis-8.tar.gz;
+    sha256 = "5ce4c1e37301dbc38772694e98f1c7eabf69255908de204b280d8b2b1709e9d0";
   };
 
-  buildInputs = [polyml];
+  buildInputs = [polyml graphviz fontconfig liberation_ttf];
 
   buildCommand = ''
+
+    mkdir chroot-fontconfig
+    cat ${fontconfig}/etc/fonts/fonts.conf > chroot-fontconfig/fonts.conf
+    sed -e 's@</fontconfig>@@' -i chroot-fontconfig/fonts.conf
+    echo "<dir>${liberation_ttf}</dir>" >> chroot-fontconfig/fonts.conf
+    echo "</fontconfig>" >> chroot-fontconfig/fonts.conf
+
+    export FONTCONFIG_FILE=$(pwd)/chroot-fontconfig/fonts.conf
+
     mkdir -p "$out/src"
     cd  "$out/src"
 
     tar -xzf "$src"
-    cd hol4.${version}
+    cd ${holsubdir}
 
     substituteInPlace tools/Holmake/Holmake_types.sml \
       --replace "\"/bin/mv\"" "\"mv\"" \
       --replace "\"/bin/cp\"" "\"cp\""
 
+    for f in tools/buildutils.sml help/src-sml/DOT;
+    do
+      substituteInPlace $f --replace "\"/usr/bin/dot\"" "\"${graphviz}/bin/dot\""
+    done
+
     #sed -ie "/compute/,999 d" tools/build-sequence # for testing
 
     poly < tools/smart-configure.sml
-    
+
     bin/build ${kernelFlag} -symlink
 
     mkdir -p "$out/bin"
-    ln -st $out/bin  $out/src/hol4.${version}/bin/*
+    ln -st $out/bin  "$out/src/${holsubdir}/bin/"*
     # ln -s $out/src/hol4.${version}/bin $out/bin
   '';
 
   meta = {
-    description = "HOL4, an interactive theorem prover based on Higher-Order Logic.";
+    description = "Interactive theorem prover based on Higher-Order Logic";
     longDescription = ''
-
       HOL4 is the latest version of the HOL interactive proof
       assistant for higher order logic: a programming environment in
       which theorems can be proved and proof tools
@@ -52,7 +67,6 @@ stdenv.mkDerivation {
       engines. HOL4 is particularly suitable as a platform for
       implementing combinations of deduction, execution and property
       checking.
-
     '';
     homepage = "http://hol.sourceforge.net/";
     license = "BSD";
diff --git a/pkgs/applications/science/logic/hol_light/default.nix b/pkgs/applications/science/logic/hol_light/default.nix
index f9549241a45c..d6c1c0c18781 100644
--- a/pkgs/applications/science/logic/hol_light/default.nix
+++ b/pkgs/applications/science/logic/hol_light/default.nix
@@ -26,15 +26,15 @@ stdenv.mkDerivation {
   '';
 
   meta = {
-    description = "An interactive theorem prover based on Higher-Order Logic.";
+    description = "Interactive theorem prover based on Higher-Order Logic";
     longDescription = ''
-HOL Light is a computer program to help users prove interesting mathematical
-theorems completely formally in Higher-Order Logic.  It sets a very exacting
-standard of correctness, but provides a number of automated tools and
-pre-proved mathematical theorems (e.g., about arithmetic, basic set theory and
-real analysis) to save the user work.  It is also fully programmable, so users
-can extend it with new theorems and inference rules without compromising its
-soundness.
+      HOL Light is a computer program to help users prove interesting
+      mathematical theorems completely formally in Higher-Order Logic.  It sets
+      a very exacting standard of correctness, but provides a number of
+      automated tools and pre-proved mathematical theorems (e.g., about
+      arithmetic, basic set theory and real analysis) to save the user work.
+      It is also fully programmable, so users can extend it with new theorems
+      and inference rules without compromising its soundness.
     '';
     homepage = http://www.cl.cam.ac.uk/~jrh13/hol-light/;
     license = stdenv.lib.licenses.bsd2;
diff --git a/pkgs/applications/science/logic/logisim/default.nix b/pkgs/applications/science/logic/logisim/default.nix
index 009bed3ffe2a..ab46efa9a961 100644
--- a/pkgs/applications/science/logic/logisim/default.nix
+++ b/pkgs/applications/science/logic/logisim/default.nix
@@ -26,7 +26,7 @@ stdenv.mkDerivation {
   
   meta = {
     homepage = "http://ozark.hendrix.edu/~burch/logisim";
-    description = "Logisim is an educational tool for designing and simulating digital logic circuits.";
+    description = "Educational tool for designing and simulating digital logic circuits";
     license = "GPLv2+";
   };
 }
diff --git a/pkgs/applications/science/logic/prover9/default.nix b/pkgs/applications/science/logic/prover9/default.nix
index 93b1657aa14a..d92c7887210e 100644
--- a/pkgs/applications/science/logic/prover9/default.nix
+++ b/pkgs/applications/science/logic/prover9/default.nix
@@ -31,14 +31,12 @@ stdenv.mkDerivation {
   meta = {
     homepage = "http://www.cs.unm.edu/~mccune/mace4/";
     license = "GPL";
-    description = "Prover9 is an automated theorem prover for first-order and equational logic.";
-
+    description = "Automated theorem prover for first-order and equational logic";
     longDescription = ''
       Prover9 is a resolution/paramodulation automated theorem prover
       for first-order and equational logic. Prover9 is a successor of
       the Otter Prover. This is the LADR command-line version.
     '';
-
     platforms = stdenv.lib.platforms.unix;
     maintainers = [];
   };
diff --git a/pkgs/applications/science/math/R/default.nix b/pkgs/applications/science/math/R/default.nix
index 4c8204b37ee3..6c8ec9e68c53 100644
--- a/pkgs/applications/science/math/R/default.nix
+++ b/pkgs/applications/science/math/R/default.nix
@@ -5,11 +5,11 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "R-3.0.1";
+  name = "R-3.0.2";
 
   src = fetchurl {
-    url = "http://ftp5.gwdg.de/pub/misc/cran/src/base/R-3/${name}.tar.gz";
-    sha256 = "0d3iv382bsyz6ad5fk382x7sy3qzgpqvd0fw26r0648lyf54i45g";
+    url = "http://cran.r-project.org/src/base/R-3/${name}.tar.gz";
+    sha256 = "0jq2vk6bgksbvgmdjvv7vfj6llp091d0nhl5j825aya4c2nhavlm";
   };
 
   buildInputs = [ blas bzip2 gfortran liblapack libX11 libXmu libXt
@@ -55,9 +55,11 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
+  setupHook = ./setup-hook.sh;
+
   meta = {
     homepage = "http://www.r-project.org/";
-    description = "a free software environment for statistical computing and graphics";
+    description = "Free software environment for statistical computing and graphics";
     license = stdenv.lib.licenses.gpl2Plus;
 
     longDescription = ''
diff --git a/pkgs/applications/science/math/R/setup-hook.sh b/pkgs/applications/science/math/R/setup-hook.sh
new file mode 100644
index 000000000000..a31289bbfba9
--- /dev/null
+++ b/pkgs/applications/science/math/R/setup-hook.sh
@@ -0,0 +1,5 @@
+addRLibPath () {
+    addToSearchPath R_LIBS_SITE $1/library
+}
+
+envHooks=(${envHooks[@]} addRLibPath)
diff --git a/pkgs/applications/science/math/mathematica/default.nix b/pkgs/applications/science/math/mathematica/default.nix
new file mode 100644
index 000000000000..cedb491cc8b9
--- /dev/null
+++ b/pkgs/applications/science/math/mathematica/default.nix
@@ -0,0 +1,126 @@
+{ stdenv
+, coreutils
+, patchelf
+, requireFile
+, alsaLib
+, fontconfig
+, freetype
+, gcc
+, glib
+, libpng
+, ncurses
+, opencv
+, openssl
+, unixODBC
+, xlibs
+, zlib
+}:
+
+let
+  platform =
+    if stdenv.system == "i686-linux" then
+      "Linux"
+    else if stdenv.system == "x86_64-linux" then
+      "Linux-x86-64"
+    else
+      throw "Mathematica requires i686-linux or x86_64 linux";
+in
+stdenv.mkDerivation rec {
+
+  name = "mathematica-9.0.0";
+
+  src = requireFile rec {
+    name = "Mathematica_9.0.0_LINUX.sh";
+    message = '' 
+      This nix expression requires that Mathematica_9.0.0_LINUX.sh is
+      already part of the store. Find the file on your Mathematica CD
+      and add it to the nix store with nix-store --add-fixed sha256 <FILE>.
+    '';
+    sha256 = "106zfaplhwcfdl9rdgs25x83xra9zcny94gb22wncbfxvrsk3a4q";
+  };
+
+  buildInputs = [
+    coreutils
+    patchelf
+    alsaLib
+    coreutils
+    fontconfig
+    freetype
+    gcc.gcc
+    gcc.libc
+    glib
+    ncurses
+    opencv
+    openssl
+    unixODBC
+  ] ++ (with xlibs; [
+    libX11
+    libXext
+    libXtst
+    libXi
+    libXmu
+    libXrender
+    libxcb
+  ]);
+
+  ldpath = stdenv.lib.makeLibraryPath buildInputs
+    + stdenv.lib.optionalString (stdenv.system == "x86_64-linux")
+      (":" + stdenv.lib.makeSearchPath "lib64" buildInputs);
+
+  phases = "unpackPhase installPhase fixupPhase";
+
+  unpackPhase = ''
+    echo "=== Extracting makeself archive ==="
+    # find offset from file
+    offset=$(${stdenv.shell} -c "$(grep -axm1 -e 'offset=.*' $src); echo \$offset" $src)
+    dd if="$src" ibs=$offset skip=1 | tar -xf -
+    cd Unix
+  '';
+
+  installPhase = ''
+    cd Installer
+    # don't restrict PATH, that has already been done
+    sed -i -e 's/^PATH=/# PATH=/' MathInstaller
+
+    echo "=== Running MathInstaller ==="
+    ./MathInstaller -auto -createdir=y -execdir=$out/bin -targetdir=$out/libexec/Mathematica -platforms=${platform} -silent
+  '';
+
+  preFixup = ''
+    echo "=== PatchElfing away ==="
+    find $out/libexec/Mathematica/SystemFiles -type f -perm +100 | while read f; do
+      type=$(readelf -h "$f" 2>/dev/null | grep 'Type:' | sed -e 's/ *Type: *\([A-Z]*\) (.*/\1/')
+      if [ -z "$type" ]; then
+        :
+      elif [ "$type" == "EXEC" ]; then
+        echo "patching $f executable <<"
+        patchelf \
+            --set-interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
+            --set-rpath "${ldpath}" \
+            "$f"
+        patchelf --shrink-rpath "$f"
+      elif [ "$type" == "DYN" ]; then
+        echo "patching $f library <<"
+        patchelf \
+          --set-rpath "$(patchelf --print-rpath "$f"):${ldpath}" \
+          "$f" \
+          && patchelf --shrink-rpath "$f" \
+          || echo unable to patch ... ignoring 1>&2
+      else
+        echo "not patching $f <<: unknown elf type"
+      fi
+    done
+  '';
+
+  # all binaries are already stripped
+  dontStrip = true;
+
+  # we did this in prefixup already
+  dontPatchELF = true;
+
+  meta = {
+    description = "Wolfram Mathematica computational software system";
+    homepage = "http://www.wolfram.com/mathematica/";
+    license = "unfree";
+  };
+}
diff --git a/pkgs/applications/science/math/maxima/default.nix b/pkgs/applications/science/math/maxima/default.nix
index f5fec36756d3..b8f7f2e65b66 100644
--- a/pkgs/applications/science/math/maxima/default.nix
+++ b/pkgs/applications/science/math/maxima/default.nix
@@ -2,7 +2,7 @@
 
 let
   name    = "maxima";
-  version = "5.30.0";
+  version = "5.31.2";
 
   searchPath =
     stdenv.lib.makeSearchPath "bin"
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "mirror://sourceforge/${name}/${name}-${version}.tar.gz";
-    sha256 = "1mhx7g0kzpiagg97s2zhaplsq1li9ya2764mhwl7jgfw2vp3jlm0";
+    sha256 = "12j5irwfckl5583h7lwh0wrp0c65q7mqzcsri2v086j50xvvv398";
   };
 
   buildInputs = [sbcl texinfo perl makeWrapper];
diff --git a/pkgs/applications/science/math/pssp/default.nix b/pkgs/applications/science/math/pssp/default.nix
new file mode 100644
index 000000000000..587f41fe998b
--- /dev/null
+++ b/pkgs/applications/science/math/pssp/default.nix
@@ -0,0 +1,40 @@
+{ stdenv, fetchurl, libxml2, readline, zlib, perl, cairo, gtk, gsl
+, pkgconfig, gtksourceview, pango, gettext, libglade
+}:
+
+stdenv.mkDerivation rec {
+  name = "pspp-0.8.1";
+
+  src = fetchurl {
+    url = "mirror://gnu/pspp/${name}.tar.gz";
+    sha256 = "0qhxsdbwxd3cn1shc13wxvx2lg32lp4z6sz24kv3jz7p5xfi8j7x";
+  };
+
+  buildInputs = [ libxml2 readline zlib perl cairo gtk gsl pkgconfig
+    gtksourceview pango gettext libglade ];
+
+  doCheck = false;
+
+  enableParallelBuilding = true;
+
+  meta = {
+    homepage = "http://www.gnu.org/software/pspp/";
+    description = "a free replacement for SPSS, a program for statistical analysis of sampled data";
+    license = stdenv.lib.licenses.gpl3Plus;
+
+    longDescription = ''
+      PSPP is a program for statistical analysis of sampled data. It is
+      a Free replacement for the proprietary program SPSS.
+
+      PSPP can perform descriptive statistics, T-tests, anova, linear
+      and logistic regression, cluster analysis, factor analysis,
+      non-parametric tests and more. Its backend is designed to perform
+      its analyses as fast as possible, regardless of the size of the
+      input data. You can use PSPP with its graphical interface or the
+      more traditional syntax commands.
+    '';
+
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.simons ];
+  };
+}
diff --git a/pkgs/applications/science/math/speedcrunch/default.nix b/pkgs/applications/science/math/speedcrunch/default.nix
new file mode 100644
index 000000000000..dee33a04be22
--- /dev/null
+++ b/pkgs/applications/science/math/speedcrunch/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchurl, qt, cmake }:
+
+stdenv.mkDerivation rec {
+  name = "speedcrunch-0.11-alpha";
+
+  src = fetchurl {
+    url = "http://speedcrunch.googlecode.com/files/${name}.tar.gz";
+    sha256 = "c6d6328e0c018cd8b98a0e86fb6c49fedbab5dcc831b47fbbc1537730ff80882";
+  };
+
+  patches = [./speedcrunch-0.11-alpha-dso_linking.patch];
+
+  buildInputs = [cmake qt];
+
+  dontUseCmakeBuildDir = true;
+
+  cmakeDir = "../src";
+
+  preConfigure = ''
+    mkdir -p build
+    cd build
+  '';
+
+  buildFlags = "VERBOSE=1";
+
+  meta = {
+    homepage    = "http://speedcrunch.digitalfanatics.org";
+    license     = "GPLv2+";
+    description = "A fast power user calculator";
+    longDescription = ''
+      SpeedCrunch is a fast, high precision and powerful desktop calculator.
+      Among its distinctive features are a scrollable display, up to 50 decimal
+      precisions, unlimited variable storage, intelligent automatic completion
+      full keyboard-friendly and more than 15 built-in math function.
+    '';
+  };
+
+}
diff --git a/pkgs/applications/science/math/speedcrunch/speedcrunch-0.11-alpha-dso_linking.patch b/pkgs/applications/science/math/speedcrunch/speedcrunch-0.11-alpha-dso_linking.patch
new file mode 100644
index 000000000000..1b03c16b63d1
--- /dev/null
+++ b/pkgs/applications/science/math/speedcrunch/speedcrunch-0.11-alpha-dso_linking.patch
@@ -0,0 +1,23 @@
+diff -up speedcrunch-0.11-alpha/src/CMakeLists.txt.dso_linking speedcrunch-0.11-alpha/src/CMakeLists.txt
+--- speedcrunch-0.11-alpha/src/CMakeLists.txt.dso_linking	2009-11-04 15:37:15.000000000 -0600
++++ speedcrunch-0.11-alpha/src/CMakeLists.txt	2010-06-25 13:25:07.133460528 -0500
+@@ -54,6 +54,10 @@ ENDIF(CMAKE_COMPILER_IS_GNUCXX )
+ SET(QT_USE_QTNETWORK TRUE)
+ #SET(QT_USE_QTXML TRUE)
+ find_package(Qt4 REQUIRED)
++if (Q_WS_X11)
++   find_package(X11 REQUIRED)
++endif (Q_WS_X11)
++
+ include(${QT_USE_FILE})
+ 
+ # build everything
+@@ -80,7 +84,7 @@ ENDIF( APPLE )
+ 
+ ADD_CUSTOM_TARGET( confclean COMMAND rm -rf Makefile CMakeFiles/ CMakeCache.txt cmake_install.cmake DartTestfile.txt install_manifest.txt )
+ 
+-TARGET_LINK_LIBRARIES(${PROGNAME} ${QT_LIBRARIES})
++TARGET_LINK_LIBRARIES(${PROGNAME} ${QT_LIBRARIES} ${X11_X11_LIB} )
+ # only needed for static builds when directx is enabled in qt and you
+ # get a linker error because of missing a directx function
+ #IF(WIN32)
diff --git a/pkgs/applications/science/math/wxmaxima/default.nix b/pkgs/applications/science/math/wxmaxima/default.nix
index e9e6ca7bead7..01be4ba7e6c6 100644
--- a/pkgs/applications/science/math/wxmaxima/default.nix
+++ b/pkgs/applications/science/math/wxmaxima/default.nix
@@ -2,14 +2,14 @@
 
 let
   name    = "wxmaxima";
-  version = "13.04.1";
+  version = "13.04.2";
 in
 stdenv.mkDerivation {
   name = "${name}-${version}";
 
   src = fetchurl {
     url = "mirror://sourceforge/${name}/wxMaxima/${version}/wxMaxima-${version}.tar.gz";
-    sha256 = "0irp1m9vr50ym7wfj1c1vbrzd2pip1vmvn9ykqsdf04afkkwkran";
+    sha256 = "1sylvr0kfdzxxc3qsb0c6ff3lg0bzm1ib5xh78wjgzykbnvjsd99";
   };
 
   buildInputs = [wxGTK maxima makeWrapper];
@@ -26,7 +26,7 @@ stdenv.mkDerivation {
   enableParallelBuilding = true;
 
   meta = {
-    description = "Cross platform GUI for the computer algebra system Maxima.";
+    description = "Cross platform GUI for the computer algebra system Maxima";
     license = "GPL2";
     homepage = http://wxmaxima.sourceforge.net;
     platforms = stdenv.lib.platforms.linux;
diff --git a/pkgs/applications/version-management/bazaar/tools.nix b/pkgs/applications/version-management/bazaar/tools.nix
index 5a4b706f418a..19a00d2b8415 100644
--- a/pkgs/applications/version-management/bazaar/tools.nix
+++ b/pkgs/applications/version-management/bazaar/tools.nix
@@ -15,6 +15,6 @@ rec {
       
   name = "bzr-tools-${version}";
   meta = {
-    description = "Bazaar plugins.";
+    description = "Bazaar plugins";
   };
 }
diff --git a/pkgs/applications/version-management/codeville/0.8.0.nix b/pkgs/applications/version-management/codeville/0.8.0.nix
index d72f753a26e0..5c1910d6c6f6 100644
--- a/pkgs/applications/version-management/codeville/0.8.0.nix
+++ b/pkgs/applications/version-management/codeville/0.8.0.nix
@@ -18,6 +18,6 @@ rec {
       
   name = "codeville-0.8.0";
   meta = {
-    description = "Codeville - RCS with powerful merge.";
+    description = "RCS with powerful merge";
   };
 }
diff --git a/pkgs/applications/version-management/fossil/default.nix b/pkgs/applications/version-management/fossil/default.nix
index 368557e3c2ce..2a669729a9c6 100644
--- a/pkgs/applications/version-management/fossil/default.nix
+++ b/pkgs/applications/version-management/fossil/default.nix
@@ -1,11 +1,11 @@
-{stdenv, fetchurl, zlib, openssl, tcl, readline, sqlite}:
+{stdenv, fetchurl, zlib, openssl, tcl, readline, sqlite, withJson ? true}:
 
 stdenv.mkDerivation {
-  name = "fossil-1.24";
+  name = "fossil-1.27";
 
   src = fetchurl {
-    url = http://www.fossil-scm.org/download/fossil-src-20121022124804.tar.gz;
-    sha256 = "0gcvcrd368acxd79gh7p7caicgqd0f076n0i2if63mg3b8ivz9im";
+    url = http://www.fossil-scm.org/download/fossil-src-20130911114349.tar.gz;
+    sha256 = "0n40z8bx2311i11zjx2x15lw3q8vzjwvfqzikrjlqnpal4vzd72f";
   };
 
   buildInputs = [ zlib openssl readline sqlite ];
@@ -14,6 +14,7 @@ stdenv.mkDerivation {
   doCheck = true;
 
   checkTarget = "test";
+  configureFlags = if withJson then  "--json" else  "";
 
   preBuild=''
     export USER=nonexistent-but-specified-user
@@ -30,7 +31,7 @@ stdenv.mkDerivation {
   };
 
   meta = {
-    description = "Simple, high-reliability, distributed software configuration management.";
+    description = "Simple, high-reliability, distributed software configuration management";
     longDescription = ''
       Fossil is a software configuration management system.  Fossil is
       software that is designed to control and track the development of a
diff --git a/pkgs/applications/version-management/git-and-tools/default.nix b/pkgs/applications/version-management/git-and-tools/default.nix
index d53ca7a01357..af1ab52c04d7 100644
--- a/pkgs/applications/version-management/git-and-tools/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/default.nix
@@ -90,4 +90,6 @@ rec {
   svn2git_kde = callPackage ./svn2git-kde { };
 
   darcsToGit = callPackage ./darcs-to-git { };
+
+  gitflow = callPackage ./gitflow { };
 }
diff --git a/pkgs/applications/version-management/git-and-tools/fast-export/default.nix b/pkgs/applications/version-management/git-and-tools/fast-export/default.nix
index 44e9cd535be6..dcfcce1fcf63 100644
--- a/pkgs/applications/version-management/git-and-tools/fast-export/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/fast-export/default.nix
@@ -5,7 +5,8 @@ stdenv.mkDerivation {
 
   src = fetchgit {
     url = "git://repo.or.cz/fast-export.git";
-    rev = "refs/heads/master";
+    rev = "aaccfba";
+    sha256 = "c9d1498e31d32b8271c1e651175794718611f93b4843dea569d831005de0a750";
   };
 
   buildInputs = [mercurial.python mercurial makeWrapper subversion];
@@ -19,7 +20,6 @@ stdenv.mkDerivation {
     sed -i "s@/usr/bin/env.*@$(type -p python)@" *.py
     l=$out/libexec/git-fast-export
     mkdir -p $out/{bin,doc/git-fast-export} $l
-    mv *.txt $out/doc/git-fast-export
     sed -i "s@ROOT=.*@ROOT=$l@" *.sh
     mv *.sh $out/bin
     mv *.py $l
diff --git a/pkgs/applications/version-management/git-and-tools/git-annex/default.nix b/pkgs/applications/version-management/git-and-tools/git-annex/default.nix
index 38d972aa2434..e32a7dc52b9b 100644
--- a/pkgs/applications/version-management/git-and-tools/git-annex/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/git-annex/default.nix
@@ -1,11 +1,11 @@
 { cabal, aeson, async, blazeBuilder, bloomfilter, bup
-, caseInsensitive, clientsession, cryptoApi, curl, dataDefault
-, dataenc, DAV, dbus, dlist, dns, editDistance
+, caseInsensitive, clientsession, cryptoApi, cryptohash, curl
+, dataDefault, dataenc, DAV, dbus, dlist, dns, editDistance
 , extensibleExceptions, feed, filepath, git, gnupg1, gnutls, hamlet
 , hinotify, hS3, hslogger, HTTP, httpConduit, httpTypes, HUnit
 , IfElse, json, lsof, MissingH, MonadCatchIOTransformers
 , monadControl, mtl, network, networkInfo, networkMulticast
-, networkProtocolXmpp, openssh, QuickCheck, random, regexTdfa
+, networkProtocolXmpp, openssh, perl, QuickCheck, random, regexTdfa
 , rsync, SafeSemaphore, SHA, stm, text, time, transformers
 , unixCompat, utf8String, uuid, wai, waiLogger, warp, which
 , xmlConduit, xmlTypes, yesod, yesodCore, yesodDefault, yesodForm
@@ -14,22 +14,22 @@
 
 cabal.mkDerivation (self: {
   pname = "git-annex";
-  version = "4.20130827";
-  sha256 = "07kfp0d2wg3p8s0v2100r4giw5ay1il5j15lrah43fk2rrszgm5z";
+  version = "4.20131024";
+  sha256 = "1a4mrx8zr5znhcy2cszv5ri9avqj7lcn467nmaj172f00vn4fd5x";
   isLibrary = false;
   isExecutable = true;
   buildDepends = [
     aeson async blazeBuilder bloomfilter caseInsensitive clientsession
-    cryptoApi dataDefault dataenc DAV dbus dlist dns editDistance
-    extensibleExceptions feed filepath gnutls hamlet hinotify hS3
-    hslogger HTTP httpConduit httpTypes HUnit IfElse json MissingH
-    MonadCatchIOTransformers monadControl mtl network networkInfo
-    networkMulticast networkProtocolXmpp QuickCheck random regexTdfa
-    SafeSemaphore SHA stm text time transformers unixCompat utf8String
-    uuid wai waiLogger warp xmlConduit xmlTypes yesod yesodCore
-    yesodDefault yesodForm yesodStatic
+    cryptoApi cryptohash dataDefault dataenc DAV dbus dlist dns
+    editDistance extensibleExceptions feed filepath gnutls hamlet
+    hinotify hS3 hslogger HTTP httpConduit httpTypes HUnit IfElse json
+    MissingH MonadCatchIOTransformers monadControl mtl network
+    networkInfo networkMulticast networkProtocolXmpp QuickCheck random
+    regexTdfa SafeSemaphore SHA stm text time transformers unixCompat
+    utf8String uuid wai waiLogger warp xmlConduit xmlTypes yesod
+    yesodCore yesodDefault yesodForm yesodStatic
   ];
-  buildTools = [ bup curl git gnupg1 lsof openssh rsync which ];
+  buildTools = [ bup curl git gnupg1 lsof openssh perl rsync which ];
   configureFlags = "-fS3
                     -fWebDAV
                     -fInotify
@@ -42,7 +42,7 @@ cabal.mkDerivation (self: {
                     -fProduction
                     -fTDFA";
   preConfigure = "patchShebangs .";
-  installPhase = "make PREFIX=$out CABAL=./Setup docs install";
+  installPhase = "./Setup install";
   checkPhase = ''
     export HOME="$NIX_BUILD_TOP/tmp"
     mkdir "$HOME"
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 d88fad416dd1..fb2e34c7aac9 100644
--- a/pkgs/applications/version-management/git-and-tools/git/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/git/default.nix
@@ -10,7 +10,7 @@
 
 let
 
-  version = "1.8.3.4";
+  version = "1.8.4";
 
   svn = subversionClient.override { perlBindings = true; };
 
@@ -21,7 +21,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "http://git-core.googlecode.com/files/git-${version}.tar.gz";
-    sha256 = "1nfr4hgqs3b6k9wanqcix0wlw71q61h5irxiavlspd4jvzrcv8nz";
+    sha256 = "156bwqqgaw65rsvbb4wih5jfg94bxyf6p16mdwf0ky3f4ln55s2i";
   };
 
   patches = [ ./docbook2texi.patch ./symlinks-in-bin.patch ];
diff --git a/pkgs/applications/version-management/git-and-tools/git/docbook2texi.patch b/pkgs/applications/version-management/git-and-tools/git/docbook2texi.patch
index c89842c180e6..bf36b2d321f3 100644
--- a/pkgs/applications/version-management/git-and-tools/git/docbook2texi.patch
+++ b/pkgs/applications/version-management/git-and-tools/git/docbook2texi.patch
@@ -2,19 +2,19 @@ This patch does two things: (1) use the right name for `docbook2texi',
 and (2) make sure `gitman.info' isn't produced since it's broken (duplicate
 node names).
 
-diff -u -r -w git-1.6.3.3.orig/Documentation/Makefile git-1.6.3.3/Documentation/Makefile
---- git-1.6.3.3.orig/Documentation/Makefile	2009-07-02 17:07:17.000000000 +0200
-+++ git-1.6.3.3/Documentation/Makefile	2009-07-02 17:08:49.000000000 +0200
-@@ -51,7 +51,7 @@
- infodir?=$(prefix)/share/info
- MAKEINFO=makeinfo
- INSTALL_INFO=install-info
--DOCBOOK2X_TEXI=docbook2x-texi
-+DOCBOOK2X_TEXI=docbook2texi
- DBLATEX=dblatex
+diff -ru git-1.8.4-orig/Documentation/Makefile git-1.8.4/Documentation/Makefile
+--- git-1.8.4-orig/Documentation/Makefile	2013-08-23 21:38:43.000000000 +0200
++++ git-1.8.4/Documentation/Makefile	2013-09-30 14:48:51.532890378 +0200
+@@ -101,7 +101,7 @@
+ 
+ MAKEINFO = makeinfo
+ INSTALL_INFO = install-info
+-DOCBOOK2X_TEXI = docbook2x-texi
++DOCBOOK2X_TEXI = docbook2texi
+ DBLATEX = dblatex
  ifndef PERL_PATH
  	PERL_PATH = /usr/bin/perl
-@@ -153,7 +153,7 @@
+@@ -205,7 +205,7 @@
  man5: $(DOC_MAN5)
  man7: $(DOC_MAN7)
  
@@ -23,7 +23,7 @@ diff -u -r -w git-1.6.3.3.orig/Documentation/Makefile git-1.6.3.3/Documentation/
  
  pdf: user-manual.pdf
  
-@@ -169,10 +169,9 @@
+@@ -221,10 +221,9 @@
  
  install-info: info
  	$(INSTALL) -d -m 755 $(DESTDIR)$(infodir)
@@ -35,5 +35,3 @@ diff -u -r -w git-1.6.3.3.orig/Documentation/Makefile git-1.6.3.3/Documentation/
  	else \
  	  echo "No directory found in $(DESTDIR)$(infodir)" >&2 ; \
  	fi
-Only in git-1.6.3.3/Documentation: Makefile.orig
-Only in git-1.6.3.3/Documentation: Makefile.rej
diff --git a/pkgs/applications/version-management/git-and-tools/gitflow/default.nix b/pkgs/applications/version-management/git-and-tools/gitflow/default.nix
new file mode 100644
index 000000000000..26a7826d4f0c
--- /dev/null
+++ b/pkgs/applications/version-management/git-and-tools/gitflow/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "gitflow-${version}";
+  version = "1.6.1";
+
+  src = fetchurl {
+    url = "https://github.com/petervanderdoes/gitflow/archive/${version}.tar.gz";
+    sha256 = "1f4879ahi8diddn7qvhr0dkj96gh527xnfihbf1ha83fn9cvvcls";
+  };
+
+  preBuild = ''
+    makeFlagsArray+=(prefix="$out")
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = https://github.com/petervanderdoes/gitflow;
+    description = "A collection of Git extensions to provide high-level repository operations for Vincent Driessen's branching model";
+    license = licenses.bsd2;
+    platforms = platforms.all;
+    maintainers = [ maintainers.offline ];
+  };
+}
diff --git a/pkgs/applications/version-management/git-and-tools/github-backup/default.nix b/pkgs/applications/version-management/git-and-tools/github-backup/default.nix
index 5f0df6c8ead1..557886a4deb1 100644
--- a/pkgs/applications/version-management/git-and-tools/github-backup/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/github-backup/default.nix
@@ -1,17 +1,18 @@
-{ cabal, extensibleExceptions, filepath, github, hslogger, IfElse
-, MissingH, mtl, network, prettyShow, text
+{ cabal, extensibleExceptions, filepath, git, github, hslogger
+, IfElse, MissingH, mtl, network, prettyShow, text, unixCompat
 }:
 
 cabal.mkDerivation (self: {
   pname = "github-backup";
-  version = "1.20130414";
-  sha256 = "1s8s1kv4kj086kzq8iq28zyrlg65hrzg3563fw3dazfik73cmlcp";
+  version = "1.20131006";
+  sha256 = "0yc2hszi509mc0d6245dc8cq20mjjmr8mgrd8571dy9sgda532pf";
   isLibrary = false;
   isExecutable = true;
   buildDepends = [
     extensibleExceptions filepath github hslogger IfElse MissingH mtl
-    network prettyShow text
+    network prettyShow text unixCompat
   ];
+  buildTools = [ git ];
   meta = {
     homepage = "https://github.com/joeyh/github-backup";
     description = "backs up everything github knows about a repository, to the repository";
diff --git a/pkgs/applications/version-management/subversion/default.nix b/pkgs/applications/version-management/subversion/default.nix
index 95b244e7d91e..b1469038d42d 100644
--- a/pkgs/applications/version-management/subversion/default.nix
+++ b/pkgs/applications/version-management/subversion/default.nix
@@ -21,13 +21,13 @@ assert compressionSupport -> neon.compressionSupport;
 
 stdenv.mkDerivation rec {
 
-  version = "1.7.11";
+  version = "1.7.13";
 
   name = "subversion-${version}";
 
   src = fetchurl {
     url = "mirror://apache/subversion//${name}.tar.bz2";
-    sha1 = "d82e187803043b74c072cd5a861ac02e4a027684";
+    sha1 = "844bb756ec505edaa12b9610832bcd21567139f1";
   };
 
   buildInputs = [ zlib apr aprutil sqlite ]
diff --git a/pkgs/applications/video/gpac/default.nix b/pkgs/applications/video/gpac/default.nix
index 6a863a5e2c4b..84848d587533 100644
--- a/pkgs/applications/video/gpac/default.nix
+++ b/pkgs/applications/video/gpac/default.nix
@@ -4,9 +4,9 @@ stdenv.mkDerivation rec {
   name = "gpac-0.5.0-svn";
 
   src = fetchsvn {
-    url = "https://gpac.svn.sourceforge.net/svnroot/gpac/trunk/gpac";
-    rev = "4253";
-    sha256 = "0z4bd63c805q53hpb09gq0m0apy12z5a90zxx4jjx3ln64xq0pnn";
+    url = "http://svn.code.sf.net/p/gpac/code/trunk/gpac";
+    rev = "4749";
+    sha256 = "0y38pmp64a2l70y1yby90qzxfzx8y7r0cdmgjxzw86jh6si5ndhp";
   };
 
   # this is the bare minimum configuration, as I'm only interested in MP4Box
diff --git a/pkgs/applications/video/miro/default.nix b/pkgs/applications/video/miro/default.nix
new file mode 100644
index 000000000000..5ca6c80dc7c1
--- /dev/null
+++ b/pkgs/applications/video/miro/default.nix
@@ -0,0 +1,76 @@
+{ stdenv, fetchurl, python, buildPythonPackage, pythonPackages, pkgconfig
+, pyrex096, ffmpeg, boost, glib, pygobject, gtk2, webkit_gtk2, libsoup, pygtk
+, taglib, pysqlite, pycurl, mutagen, pycairo, pythonDBus, pywebkitgtk
+, libtorrentRasterbar
+, gst_python, gst_plugins_base, gst_plugins_good, gst_ffmpeg
+}:
+
+buildPythonPackage rec {
+  name = "miro-${version}";
+  namePrefix = "";
+  version = "6.0";
+
+  src = fetchurl {
+    url = "http://ftp.osuosl.org/pub/pculture.org/miro/src/${name}.tar.gz";
+    sha256 = "0sq25w365i1fz95398vxql3yjl5i6mq77mnmlhmn0pgyg111k3am";
+  };
+
+  setSourceRoot = ''
+    sourceRoot=${name}/linux
+  '';
+
+  patches = [ ./gconf.patch ];
+
+  postPatch = ''
+    sed -i -e '2i import os; os.environ["GST_PLUGIN_PATH"] = \\\
+      '"'$GST_PLUGIN_PATH'" miro.real
+
+    sed -i -e 's/\$(shell which python)/python/' Makefile
+    sed -i -e 's|/usr/bin/||' -e 's|/usr||' \
+           -e 's/BUILD_TIME[^,]*/BUILD_TIME=0/' setup.py
+
+    sed -i -e 's|default="/usr/bin/ffmpeg"|default="${ffmpeg}/bin/ffmpeg"|' \
+      plat/options.py
+
+    sed -i -e 's|/usr/share/miro/themes|'"$out/share/miro/themes"'|' \
+           -e 's/gnome-open/xdg-open/g' \
+           -e '/RESOURCE_ROOT =.*(/,/)/ {
+                 c RESOURCE_ROOT = '"'$out/share/miro/resources/'"'
+               }' \
+           plat/resources.py
+  '';
+
+  installCommand = ''
+    python setup.py install --prefix= --root="$out"
+  '';
+
+  # Disabled for now, because it requires networking and even if we skip those
+  # tests, the whole test run takes around 10-20 minutes.
+  doCheck = false;
+  checkPhase = ''
+    HOME="$TEMPDIR" LANG=en_US.UTF-8 python miro.real --unittest
+  '';
+
+  postInstall = ''
+    mv "$out/bin/miro.real" "$out/bin/miro"
+  '';
+
+  buildInputs = [
+    pkgconfig pyrex096 ffmpeg boost glib pygobject gtk2 webkit_gtk2 libsoup
+    pygtk taglib
+  ];
+
+  propagatedBuildInputs = [
+    pygobject pygtk pycurl python.modules.sqlite3 mutagen pycairo pythonDBus
+    pywebkitgtk libtorrentRasterbar
+    gst_python gst_plugins_base gst_plugins_good gst_ffmpeg
+  ];
+
+  meta = {
+    homepage = "http://www.getmiro.com/";
+    description = "Video and audio feed aggregator";
+    license = stdenv.lib.licenses.gpl2Plus;
+    maintainers = [ stdenv.lib.maintainers.aszlig ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/applications/video/miro/gconf.patch b/pkgs/applications/video/miro/gconf.patch
new file mode 100644
index 000000000000..bc516da9cbfa
--- /dev/null
+++ b/pkgs/applications/video/miro/gconf.patch
@@ -0,0 +1,374 @@
+diff --git a/plat/associate.py b/plat/associate.py
+index 0f3cd31..f9b5a76 100644
+--- a/plat/associate.py
++++ b/plat/associate.py
+@@ -31,69 +31,8 @@
+ Holds functions that associate Miro with certain protocols
+ """
+ 
+-import gconf
+-from miro.plat.config import gconf_lock
+-
+ def associate_protocols(command):
+-    _associate_protocol("magnet", command, False)
++    pass
+ 
+ def disassociate_protocols(command):
+-    _disassociate_protocol("magnet", command)
+-
+-def _associate_protocol(name, command, overwrite_existing=False):
+-    url_handlers_key = "/desktop/gnome/url-handlers/" + name + "/"
+-    if not _is_associated(name) or overwrite_existing:
+-        gconf_lock.acquire()
+-        try:
+-            gconf_client = gconf.client_get_default()
+-            if gconf_client.set_string(url_handlers_key + "command", command):
+-                gconf_client.set_bool(url_handlers_key + "needs_terminal", False)
+-                gconf_client.set_bool(url_handlers_key + "enabled", True)
+-                success = True
+-            else:
+-                success = False
+-        finally:
+-            gconf_lock.release()
+-    else:
+-        success = True
+-    return success
+-
+-def _disassociate_protocol(name, command):
+-    url_handlers_key = "/desktop/gnome/url-handlers/" + name + "/"
+-    if _is_associated(name, command):
+-        gconf_lock.acquire()
+-        try:
+-            gconf_client = gconf.client_get_default()
+-            if gconf_client.set_bool(url_handlers_key + "enabled", False):
+-                success = True
+-            else:
+-                success = False
+-        finally:
+-            gconf_lock.release()
+-    else:
+-        success = True
+-    return success
+-
+-def _is_associated(protocol, command=None):
+-    """ Checks whether a protocol currently is
+-        associated with the given command, or,
+-        if none is given, whether the protocol
+-        is associated with anything at all.
+-    """
+-    url_handlers_key = "/desktop/gnome/url-handlers/" + protocol + "/"
+-    gconf_lock.acquire()
+-    try:
+-        gconf_client = gconf.client_get_default()
+-        key = gconf_client.get(url_handlers_key + "command")
+-        if key is None:
+-            associated = False
+-        else:
+-            enabled = gconf_client.get(url_handlers_key + "enabled")
+-            if command:
+-                associated = key.get_string() == command and enabled.get_bool()
+-            else:
+-                associated = key.get_string() != "" and enabled.get_bool()
+-    finally:
+-        gconf_lock.release()
+-    return associated
+-
++    pass
+diff --git a/plat/config.py b/plat/config.py
+index 40895af..24f8815 100644
+--- a/plat/config.py
++++ b/plat/config.py
+@@ -39,51 +39,20 @@ Preferences are listed in miro.pref and also miro.plat.options.
+ import os
+ import logging
+ from miro import prefs
+-import gconf
++import shelve
+ import threading
+ from miro.plat import options
+ from miro.plat import resources
+ 
+-client = gconf.client_get_default()
+-gconf_lock = threading.RLock()
+-
+-
+-def gconf_key(key):
+-    if options.gconf_name is None:
+-        options.gconf_name = "miro"
+-    return '/apps/%s/%s' % (options.gconf_name, key)
+-
+-
+-def _convert_gconf_value(value):
+-    if value.type == gconf.VALUE_STRING:
+-        return value.get_string()
+-    if value.type == gconf.VALUE_INT:
+-        return value.get_int()
+-    if value.type == gconf.VALUE_BOOL:
+-        return value.get_bool()
+-    if value.type == gconf.VALUE_FLOAT:
+-        return value.get_float()
+-    if value.type == gconf.VALUE_LIST:
+-        return [_convert_gconf_value(v) for v in value.get_list()]
+-    raise TypeError("unknown gconf type %s" % value.type)
+-
+-
+-def _get_gconf(fullkey, default=None):
+-    gconf_lock.acquire()
+-    try:
+-        value = client.get(fullkey)
+-        if value != None:
+-            try:
+-                return _convert_gconf_value(value)
+-            except TypeError, e:
+-                logging.warn("type error while getting gconf value %s: %s",
+-                        fullkey, str(e))
+-        return default
+-    finally:
+-        gconf_lock.release()
+-
+-
+-class GconfDict:
++
++class ConfigFile(object):
++    def __init__(self):
++        support_dir = get(prefs.SUPPORT_DIRECTORY)
++        if not os.path.exists(support_dir):
++            os.makedirs(support_dir)
++        path = os.path.join(support_dir, 'config')
++        self.conf = shelve.open(path, 'c', -1, True)
++
+     def get(self, key, default=None):
+         if not isinstance(key, str):
+             raise TypeError()
+@@ -91,19 +56,16 @@ class GconfDict:
+         if "MIRO_%s" % key.upper() in os.environ:
+             return os.environ["MIRO_%s" % key.upper()]
+ 
+-        fullkey = gconf_key(key)
+-        return _get_gconf(fullkey, default)
++        return self.conf.get(key, default)
++
++    def __del__(self):
++        self.conf.close()
+ 
+     def __contains__(self, key):
+         if "MIRO_%s" % key.upper() in os.environ:
+             return True
+ 
+-        gconf_lock.acquire()
+-        try:
+-            fullkey = gconf_key(key)
+-            return client.get(fullkey) is not None
+-        finally:
+-            gconf_lock.release()
++        return key in self.conf
+ 
+     def __getitem__(self, key):
+         rv = self.get(key)
+@@ -116,43 +78,11 @@ class GconfDict:
+         if "MIRO_%s" % key.upper() in os.environ:
+             return
+ 
+-        gconf_lock.acquire()
+-        try:
+-            if not isinstance(key, str):
+-                raise TypeError()
+-
+-            fullkey = gconf_key(key)
+-            if isinstance(value, str):
+-                client.set_string(fullkey, value)
+-            elif isinstance(value, bool):
+-                client.set_bool(fullkey, value)
+-            elif isinstance(value, int):
+-                client.set_int(fullkey, value)
+-            elif isinstance(value, float):
+-                client.set_float(fullkey, value)
+-            elif isinstance(value, list):
+-                # this is lame, but there isn't enough information to
+-                # figure it out another way
+-                if len(value) == 0 or isinstance(value[0], str):
+-                    list_type = gconf.VALUE_STRING
+-                elif isinstance(value[0], int):
+-                    list_type = gconf.VALUE_INT
+-                elif isinstance(value[0], float):
+-                    list_type = gconf.VALUE_FLOAT
+-                elif isinstance(value[0], bool):
+-                    list_type = gconf.VALUE_BOOL
+-                else:
+-                    raise TypeError("unknown gconf type %s" % type(value[0]))
+-
+-                client.set_list(fullkey, list_type, value)
+-            else:
+-                raise TypeError()
+-        finally:
+-            gconf_lock.release()
++        self.conf[key] = value
+ 
+ 
+ def load():
+-    return GconfDict()
++    return ConfigFile()
+ 
+ 
+ def save(data):
+@@ -208,25 +138,4 @@ def get(descriptor):
+         value = get(prefs.SUPPORT_DIRECTORY)
+         value = os.path.join(value, 'miro-helper.log')
+ 
+-    elif descriptor == prefs.HTTP_PROXY_ACTIVE:
+-        return _get_gconf("/system/http_proxy/use_http_proxy")
+-
+-    elif descriptor == prefs.HTTP_PROXY_HOST:
+-        return _get_gconf("/system/http_proxy/host")
+-
+-    elif descriptor == prefs.HTTP_PROXY_PORT:
+-        return _get_gconf("/system/http_proxy/port")
+-
+-    elif descriptor == prefs.HTTP_PROXY_AUTHORIZATION_ACTIVE:
+-        return _get_gconf("/system/http_proxy/use_authentication")
+-
+-    elif descriptor == prefs.HTTP_PROXY_AUTHORIZATION_USERNAME:
+-        return _get_gconf("/system/http_proxy/authentication_user")
+-
+-    elif descriptor == prefs.HTTP_PROXY_AUTHORIZATION_PASSWORD:
+-        return _get_gconf("/system/http_proxy/authentication_password")
+-
+-    elif descriptor == prefs.HTTP_PROXY_IGNORE_HOSTS:
+-        return _get_gconf("/system/http_proxy/ignore_hosts", [])
+-
+     return value
+diff --git a/plat/frontends/widgets/application.py b/plat/frontends/widgets/application.py
+index a1eaaf3..20f4c23 100644
+--- a/plat/frontends/widgets/application.py
++++ b/plat/frontends/widgets/application.py
+@@ -35,7 +35,6 @@ except RuntimeError:
+     sys.exit(1)
+ import gobject
+ import os
+-import gconf
+ import shutil
+ import platform
+ 
+@@ -53,7 +52,6 @@ from miro import prefs
+ from miro.frontends.widgets.application import Application
+ # from miro.plat.frontends.widgets import threads
+ from miro.plat import renderers, options
+-from miro.plat.config import gconf_lock, gconf_key
+ try:
+     from miro.plat.frontends.widgets import miroappindicator
+     APP_INDICATOR_SUPPORT = True
+@@ -77,29 +75,13 @@ import sys
+ 
+ 
+ def _get_pref(key, getter_name):
+-    gconf_lock.acquire()
+-    try:
+-        client = gconf.client_get_default()
+-        fullkey = gconf_key(key)
+-        value = client.get(fullkey)
+-        if value is not None:
+-            getter = getattr(value, getter_name)
+-            return getter()
+-        else:
+-            return None
+-    finally:
+-        gconf_lock.release()
++    # XXX: ugly!
++    return app.config._data.get(key)
+ 
+ 
+ def _set_pref(key, setter_name, value):
+-    gconf_lock.acquire()
+-    try:
+-        client = gconf.client_get_default()
+-        fullkey = gconf_key(key)
+-        setter = getattr(client, setter_name)
+-        setter(fullkey, value)
+-    finally:
+-        gconf_lock.release()
++    # XXX: ugly!
++    app.config._data[key] = value
+ 
+ 
+ def get_int(key):
+diff --git a/plat/options.py b/plat/options.py
+index 4ea1a67..8e75e20 100644
+--- a/plat/options.py
++++ b/plat/options.py
+@@ -69,14 +69,14 @@ USE_RENDERER = LinuxPref(
+ 
+ GSTREAMER_IMAGESINK = LinuxPref(
+     key="DefaultGstreamerImagesink",
+-    default="gconfvideosink",
++    default="autovideosink",
+     alias="gstreamer-imagesink",
+     helptext=("Which GStreamer image sink to use for video.  "
+               "(autovideosink, ximagesink, xvimagesink, gconfvideosink, ...)"))
+ 
+ GSTREAMER_AUDIOSINK = LinuxPref(
+     key="DefaultGstreamerAudiosink",
+-    default="gconfaudiosink",
++    default="autoaudiosink",
+     alias="gstreamer-audiosink",
+     helptext=("Which GStreamer sink to use for audio.  "
+               "(autoaudiosink, osssink, alsasink, gconfaudiosink, ...)"))
+diff --git a/plat/upgrade.py b/plat/upgrade.py
+index 9677e3a..f812ad4 100644
+--- a/plat/upgrade.py
++++ b/plat/upgrade.py
+@@ -30,7 +30,6 @@
+ import os
+ import shutil
+ from miro.plat import resources
+-import gconf
+ 
+ 
+ def upgrade():
+@@ -64,47 +63,3 @@ def upgrade():
+             os.remove(old_file)
+         except OSError:
+             pass
+-
+-    # gconf settings
+-    client = gconf.client_get_default()
+-
+-    def _copy_gconf(src, dst):
+-        for entry in client.all_entries(src):
+-            entry_dst = dst + '/' + entry.key.split('/')[-1]
+-            client.set(entry_dst, entry.value)
+-        for subdir in client.all_dirs(src):
+-            subdir_dst = dst + '/' + subdir.split('/')[-1]
+-            _copy_gconf(subdir, subdir_dst)
+-
+-    if ((client.dir_exists("/apps/democracy/player")
+-         and not client.dir_exists("/apps/miro"))):
+-        _copy_gconf("/apps/democracy/player", "/apps/miro")
+-        client.recursive_unset("/apps/democracy", 1)
+-
+-    # Set the MoviesDirectory and NonVideoDirectory based on the
+-    # possibilities that we've had over the years and what exists on
+-    # the user's system.  This codifies it in the user's gconf so that
+-    # when we change it in future, then the user isn't affected.
+-    from miro.plat import options
+-    if options.gconf_name is None:
+-        options.gconf_name = "miro"
+-    key = "/apps/%s/MoviesDirectory" % options.gconf_name
+-    if client.get(key) is None:
+-        for mem in ["~/.miro/Movies",     # packages
+-                    "~/Videos/Miro",
+-                    "~/Movies/Miro",      # pre 3.5
+-                    "~/Movies/Democracy"  # democracy player
+-                    ]:
+-            mem = os.path.expanduser(mem)
+-            if os.path.exists(mem):
+-                client.set_string(key, mem)
+-                break
+-
+-    key = "/apps/%s/NonVideoDirectory" % options.gconf_name
+-    if client.get(key) is None:
+-        for mem in ["~/.miro/Nonvideo"   # packages
+-                    ]:
+-            mem = os.path.expanduser(mem)
+-            if os.path.exists(mem):
+-                client.set_string(key, mem)
+-                break
diff --git a/pkgs/applications/video/mplayer/default.nix b/pkgs/applications/video/mplayer/default.nix
index 2051590a8197..6d8780d6cf48 100644
--- a/pkgs/applications/video/mplayer/default.nix
+++ b/pkgs/applications/video/mplayer/default.nix
@@ -1,4 +1,5 @@
-{ stdenv, fetchurl, freetype, pkgconfig, yasm, freefont_ttf
+{ stdenv, fetchurl, pkgconfig, freetype, yasm
+, fontconfigSupport ? true, fontconfig ? null, freefont_ttf ? null
 , x11Support ? true, libX11 ? null, libXext ? null, mesa ? null
 , xineramaSupport ? true, libXinerama ? null
 , xvSupport ? true, libXv ? null
@@ -22,6 +23,8 @@
 , useUnfreeCodecs ? false
 }:
 
+assert fontconfigSupport -> (fontconfig != null);
+assert (!fontconfigSupport) -> (freefont_ttf != null);
 assert x11Support -> (libX11 != null && libXext != null && mesa != null);
 assert xineramaSupport -> (libXinerama != null && x11Support);
 assert xvSupport -> (libXv != null && x11Support);
@@ -95,7 +98,8 @@ stdenv.mkDerivation rec {
   '';
 
   buildInputs = with stdenv.lib;
-    [ freetype pkgconfig ]
+    [ pkgconfig freetype ]
+    ++ optional fontconfigSupport fontconfig
     ++ optionals x11Support [ libX11 libXext mesa ]
     ++ optional alsaSupport alsaLib
     ++ optional xvSupport libXv
@@ -125,6 +129,8 @@ stdenv.mkDerivation rec {
 
   configureFlags = with stdenv.lib;
     ''
+      --enable-freetype
+      ${if fontconfigSupport then "--enable-fontconfig" else "--disable-fontconfig"}
       ${if x11Support then "--enable-x11 --enable-gl" else "--disable-x11 --disable-gl"}
       ${if xineramaSupport then "--enable-xinerama" else "--disable-xinerama"}
       ${if xvSupport then "--enable-xv" else "--disable-xv"}
@@ -144,7 +150,6 @@ stdenv.mkDerivation rec {
       ${if pulseSupport then "--enable-pulse" else "--disable-pulse"}
       ${optionalString (useUnfreeCodecs && codecs != null) "--codecsdir=${codecs}"}
       ${optionalString (stdenv.isi686 || stdenv.isx86_64) "--enable-runtime-cpudetection"}
-      --enable-freetype
       --disable-xanim
       --disable-ivtv
       --disable-xvid --disable-xvid-lavc
@@ -153,14 +158,17 @@ stdenv.mkDerivation rec {
       --disable-ossaudio
     '';
 
-  NIX_LDFLAGS = stdenv.lib.optionalString x11Support "-lX11 -lXext";
+  NIX_LDFLAGS = with stdenv.lib;
+       optional  fontconfigSupport "-lfontconfig"
+    ++ optionals x11Support [ "-lX11" "-lXext" ]
+    ;
 
   installTargets = [ "install" ] ++ stdenv.lib.optional x11Support "install-gui";
 
   enableParallelBuilding = true;
 
-  # Provide a reasonable standard font.  Maybe we should symlink here.
-  postInstall =
+  # Provide a reasonable standard font when not using fontconfig. Maybe we should symlink here.
+  postInstall = stdenv.lib.optionalString (!fontconfigSupport)
     ''
       mkdir -p $out/share/mplayer
       cp ${freefont_ttf}/share/fonts/truetype/FreeSans.ttf $out/share/mplayer/subfont.ttf
diff --git a/pkgs/applications/video/ogmtools/default.nix b/pkgs/applications/video/ogmtools/default.nix
index 1a6bc6629993..11a16e3a79d2 100644
--- a/pkgs/applications/video/ogmtools/default.nix
+++ b/pkgs/applications/video/ogmtools/default.nix
@@ -11,11 +11,14 @@ stdenv.mkDerivation rec {
   buildInputs = [libogg libvorbis libdvdread];
 
   meta = {
-    description = "Tools for modifying and inspecting OGG media streams. Includes dvdxchap tool for extracting chapter information from DVD.";
-    longDescription = "These tools allow information about (ogminfo) or extraction from (ogmdemux) or creation of (ogmmerge) OGG media streams.";
+    description = "Tools for modifying and inspecting OGG media streams";
+    longDescription = ''
+      These tools allow information about (ogminfo) or extraction from
+      (ogmdemux) or creation of (ogmmerge) OGG media streams. Includes dvdxchap
+      tool for extracting chapter information from DVD.
+    '';
     homepage = http://www.bunkus.org/videotools/ogmtools/;
     license = "GPLv2";
-
     platforms = stdenv.lib.platforms.all;
   };
 }
diff --git a/pkgs/applications/video/quvi/library.nix b/pkgs/applications/video/quvi/library.nix
index bef755afed46..49207ad06615 100644
--- a/pkgs/applications/video/quvi/library.nix
+++ b/pkgs/applications/video/quvi/library.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ pkgconfig lua5 curl quvi_scripts ];
 
   meta = { 
-    description = "Quvi is a web video downloader.";
+    description = "Web video downloader";
     homepage = http://quvi.sf.net;
     license = "LGPLv2.1+";
     platforms = stdenv.lib.platforms.linux;
diff --git a/pkgs/applications/video/quvi/scripts.nix b/pkgs/applications/video/quvi/scripts.nix
index 9c6cd9d31377..cc82158ae829 100644
--- a/pkgs/applications/video/quvi/scripts.nix
+++ b/pkgs/applications/video/quvi/scripts.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ pkgconfig ];
 
   meta = { 
-    description = "Quvi is a web video downloader.";
+    description = "Web video downloader";
     homepage = http://quvi.sf.net;
     license = "LGPLv2.1+";
     platforms = stdenv.lib.platforms.linux;
diff --git a/pkgs/applications/video/quvi/tool.nix b/pkgs/applications/video/quvi/tool.nix
index b2ddabfa6a8d..f8b6aad43106 100644
--- a/pkgs/applications/video/quvi/tool.nix
+++ b/pkgs/applications/video/quvi/tool.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ pkgconfig lua5 curl quvi_scripts libquvi ];
 
   meta = { 
-    description = "Quvi is a web video downloader.";
+    description = "Web video downloader";
     homepage = http://quvi.sf.net;
     license = "LGPLv2.1+";
     platforms = stdenv.lib.platforms.linux;
diff --git a/pkgs/applications/video/vlc/default.nix b/pkgs/applications/video/vlc/default.nix
index 714a2882d5f1..3d48b296ad9d 100644
--- a/pkgs/applications/video/vlc/default.nix
+++ b/pkgs/applications/video/vlc/default.nix
@@ -10,11 +10,11 @@
 
 stdenv.mkDerivation rec {
   name = "vlc-${version}";
-  version = "2.0.8";
+  version = "2.1.0";
 
   src = fetchurl {
     url = "http://download.videolan.org/pub/videolan/vlc/${version}/${name}.tar.xz";
-    sha256 = "00hpbm0v424yhfzqyxrvrvfjkbvf3f43yqk6h1qhwmnl8n1z4am0";
+    sha256 = "1xs1zsjip6ljqyy5jlqf14ncda4pjx166bqvjqgcyskq66m7s5yj";
   };
 
   buildInputs =
diff --git a/pkgs/applications/video/xbmc/default.nix b/pkgs/applications/video/xbmc/default.nix
index d3b3556baf4d..59537c7dce02 100644
--- a/pkgs/applications/video/xbmc/default.nix
+++ b/pkgs/applications/video/xbmc/default.nix
@@ -19,6 +19,7 @@
 , udev, udevSupport ? true
 , libusb ? null, usbSupport ? false
 , samba ? null, sambaSupport ? true
+, libmicrohttpd
 # TODO: would be nice to have nfsSupport (needs libnfs library)
 # TODO: librtmp
 , libvdpau ? null, vdpauSupport ? true
@@ -43,7 +44,7 @@ stdenv.mkDerivation rec {
     buildInputs = [
       makeWrapper
       pkgconfig cmake gnumake yasm python
-      boost
+      boost libmicrohttpd
       gettext pcre yajl fribidi
       openssl gperf tinyxml2 taglib libssh swig jre
       libX11 xproto inputproto
@@ -75,7 +76,6 @@ stdenv.mkDerivation rec {
 
     configureFlags = [
       "--enable-external-libraries"
-      "--disable-webserver"
     ]
     ++ lib.optional (! sambaSupport) "--disable-samba"
     ++ lib.optional vdpauSupport "--enable-vdpau"
diff --git a/pkgs/applications/virtualization/OVMF/default.nix b/pkgs/applications/virtualization/OVMF/default.nix
index 7d101aac790b..e6d0b7cb40dd 100644
--- a/pkgs/applications/virtualization/OVMF/default.nix
+++ b/pkgs/applications/virtualization/OVMF/default.nix
@@ -12,7 +12,7 @@ let
 in
 
 stdenv.mkDerivation (edk2.setup "OvmfPkg/OvmfPkg${targetArch}.dsc" {
-  name = "OVMF-2012-03-13";
+  name = "OVMF-2012-10-09";
 
   unpackPhase = ''
     for file in \
diff --git a/pkgs/applications/virtualization/virt-manager/default.nix b/pkgs/applications/virtualization/virt-manager/default.nix
index 195ee5d45c01..de3e5c98d36b 100644
--- a/pkgs/applications/virtualization/virt-manager/default.nix
+++ b/pkgs/applications/virtualization/virt-manager/default.nix
@@ -1,4 +1,5 @@
-{ stdenv, fetchurl, pythonPackages, intltool, libvirt, libxml2Python, curl, python, makeWrapper, virtinst, pyGtkGlade, pythonDBus, gnome_python, gtkvnc}:
+{ stdenv, fetchurl, pythonPackages, intltool, libvirt, libxml2Python, curl,
+  python, makeWrapper, virtinst, pyGtkGlade, pythonDBus, gnome_python, gtkvnc, vte}:
 
 with stdenv.lib;
 
@@ -18,7 +19,8 @@ stdenv.mkDerivation rec {
       distutils_extra simplejson readline glance cheetah lockfile httplib2
       # !!! should libvirt be a build-time dependency?  Note that
       # libxml2Python is a dependency of libvirt.py. 
-      libvirt libxml2Python urlgrabber virtinst pyGtkGlade pythonDBus gnome_python gtkvnc
+      libvirt libxml2Python urlgrabber virtinst pyGtkGlade pythonDBus gnome_python
+      gtkvnc vte
     ];
 
   buildInputs =
@@ -78,7 +80,12 @@ stdenv.mkDerivation rec {
 
   meta = {
     homepage = http://virt-manager.org;
-    description = "The 'Virtual Machine Manager' application (virt-manager for short package name) is a desktop user interface for managing virtual machines.";
+    description = "Desktop user interface for managing virtual machines";
+    longDescription = ''
+      The virt-manager application is a desktop user interface for managing
+      virtual machines through libvirt. It primarily targets KVM VMs, but also
+      manages Xen and LXC (linux containers).
+    '';
     license = "GPLv2";
     maintainers = with stdenv.lib.maintainers; [qknight];
   };
diff --git a/pkgs/applications/virtualization/virt-viewer/default.nix b/pkgs/applications/virtualization/virt-viewer/default.nix
index 51ef6c5b39ef..d2e608ba3fa8 100644
--- a/pkgs/applications/virtualization/virt-viewer/default.nix
+++ b/pkgs/applications/virtualization/virt-viewer/default.nix
@@ -1,6 +1,6 @@
 x@{builderDefsPackage
   , gnome, gtk, glib, libxml2, pkgconfig, libvirt, gtkvnc, cyrus_sasl, libtasn1
-  , gnupg, libgcrypt, perl, nettle, yajl
+  , gnupg, libgcrypt, perl, nettle, yajl, libcap_ng
   , ...}:
 builderDefsPackage
 (a :  
diff --git a/pkgs/applications/virtualization/virtinst/default.nix b/pkgs/applications/virtualization/virtinst/default.nix
index 26b16375e659..bb8b7a1d0d99 100644
--- a/pkgs/applications/virtualization/virtinst/default.nix
+++ b/pkgs/applications/virtualization/virtinst/default.nix
@@ -40,6 +40,6 @@ stdenv.mkDerivation rec {
     homepage = http://virt-manager.org;
     license = "GPLv2+";
     maintainers = with stdenv.lib.maintainers; [qknight];
-    description = "The Virt Install tool (virt-install for short command name, virtinst for package name) is a command line tool which provides an easy way to provision operating systems into virtual machines.";
+    description = "Command line tool which provides an easy way to provision operating systems into virtual machines";
   };
 }
diff --git a/pkgs/applications/virtualization/virtualbox/default.nix b/pkgs/applications/virtualization/virtualbox/default.nix
index 09b6e015a931..652b2ed92c10 100644
--- a/pkgs/applications/virtualization/virtualbox/default.nix
+++ b/pkgs/applications/virtualization/virtualbox/default.nix
@@ -11,7 +11,7 @@ with stdenv.lib;
 
 let
 
-  version = "4.2.16"; # changes ./guest-additions as well
+  version = "4.2.18"; # changes ./guest-additions as well
 
   forEachModule = action: ''
     for mod in \
@@ -31,13 +31,13 @@ let
   '';
 
   # See https://github.com/NixOS/nixpkgs/issues/672 for details
-  extpackRevision = "86992";
+  extpackRevision = "88780";
   extensionPack = requireFile rec {
     name = "Oracle_VM_VirtualBox_Extension_Pack-${version}-${extpackRevision}.vbox-extpack";
     # IMPORTANT: Hash must be base16 encoded because it's used as an input to
     # VBoxExtPackHelperApp!
-    # Tip: nix-hash --type sha256 --to-base16 "hash from nix-prefetch-url"
-    sha256 = "8f88b1ebe69b770103e9151bebf6681c5e049eb5fac45ae8d52c43440aa0fa0d";
+    # Tip: see http://dlc.sun.com.edgesuite.net/virtualbox/4.2.18/SHA256SUMS
+    sha256 = "1d1737b59d0f30f5d42beeabaff168bdc0a75b8b28df685979be6173e5adbbba";
     message = ''
       In order to use the extension pack, you need to comply with the VirtualBox Personal Use
       and Evaluation License (PUEL) by downloading the related binaries from:
@@ -56,7 +56,7 @@ in stdenv.mkDerivation {
 
   src = fetchurl {
     url = "http://download.virtualbox.org/virtualbox/${version}/VirtualBox-${version}.tar.bz2";
-    sha256 = "0nnl8qh8j4sk5zn78hrp6ccidmk332p7qg6pv5a0a4irs0b8j3zz";
+    sha256 = "9dbddf393b029c549249f627d12040c1d257972bc09292969b8819a31ab78d74";
   };
 
   buildInputs =
diff --git a/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix b/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix
index cca133685f60..de38843c7f1b 100644
--- a/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix
+++ b/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "http://download.virtualbox.org/virtualbox/${version}/VBoxGuestAdditions_${version}.iso";
-    sha256 = "1id0rb2sdnn34rvjl2v3hp3z9g9c4s4f4kl1lx0myjlqv8i0fayg";
+    sha256 = "f11a7f13dfe7bf9f246fb877144bb467fe6deadcd876568ec79b6ccd3b59d767";
   };
 
   KERN_DIR = "${kernelDev}/lib/modules/*/build";
diff --git a/pkgs/applications/window-managers/compiz/default.nix b/pkgs/applications/window-managers/compiz/default.nix
index 46aa6e4d77eb..02b7b9987bdb 100644
--- a/pkgs/applications/window-managers/compiz/default.nix
+++ b/pkgs/applications/window-managers/compiz/default.nix
@@ -15,10 +15,11 @@ let
   s = # Generated upstream information
   rec {
     baseName="compiz";
-    version="0.9.9.0";
-    name="compiz-${version}";
-    url="https://launchpad.net/compiz/0.9.9/${version}/+download/${name}.tar.bz2";
-    sha256="0nxv9lv0zwzs82p2d5g38sbvzbqgfs837xdgwc26lh5wdv31d93s";
+    version="0.9.10.0";
+    name="${baseName}-${version}";
+    hash="0kvjib0ns02cikpsjq5hlf746yjx2gkfh373pvrb25lzv3rs1qax";
+    url="https://launchpad.net/compiz/0.9.10/0.9.10.0/+download/compiz-0.9.10.0.tar.bz2";
+    sha256="0kvjib0ns02cikpsjq5hlf746yjx2gkfh373pvrb25lzv3rs1qax";
   };
   buildInputs = [cmake pkgconfig
     libXrender renderproto gtk libwnck pango cairo
diff --git a/pkgs/applications/window-managers/ion-3/default.nix b/pkgs/applications/window-managers/ion-3/default.nix
index b4dabb300c19..7a467b1fcdb9 100644
--- a/pkgs/applications/window-managers/ion-3/default.nix
+++ b/pkgs/applications/window-managers/ion-3/default.nix
@@ -3,7 +3,7 @@
 stdenv.mkDerivation {
   name = "ion-3-20090110";
   meta = {
-    description = "Ion is a tiling tabbed window manager designed with keyboard users in mind.";
+    description = "Tiling tabbed window manager designed with keyboard users in mind";
     homepage = http://modeemi.fi/~tuomov/ion;
   };
   src = fetchurl {
diff --git a/pkgs/applications/window-managers/stumpwm/default.nix b/pkgs/applications/window-managers/stumpwm/default.nix
deleted file mode 100644
index ab261a78fb01..000000000000
--- a/pkgs/applications/window-managers/stumpwm/default.nix
+++ /dev/null
@@ -1,61 +0,0 @@
-args : 
-let 
-  lib = args.lib;
-  fetchurl = args.fetchurl;
-  noDepEntry = args.noDepEntry;
-  fullDepEntry = args.fullDepEntry;
-
-  buildInputs = lib.attrVals ["clisp" "texinfo"] args;
-  version = lib.attrByPath ["version"] "0.9.7" args; 
-
-  pkgName = "stumpwm";
-in
-rec {
-  src = fetchurl {
-    url = "mirror://savannah/stumpwm/${pkgName}-${version}.tgz";
-    sha256 = "a0793d22ef90731d34f84e51deafb4bc2095a357c70b9505dc57516f481cdf78";
-  };
-
-  inherit buildInputs;
-  configureFlags = ["--with-lisp=clisp"];
-  envVars = noDepEntry (''
-    export HOME="$NIX_BUILD_TOP";
-  '');
-
-  installation = fullDepEntry (''
-    mkdir -p $out/bin 
-    mkdir -p $out/share/stumpwm/doc
-    mkdir -p $out/share/info 
-    mkdir -p $out/share/stumpwm/lisp
-
-    cp stumpwm $out/bin
-    cp contrib/stumpish $out/bin || true
-    cp sample-stumpwmrc.lisp  $out/share/stumpwm/doc
-    cp stumpwm.info $out/share/info
-
-    cp -r {.,cl-ppcre}/*.{lisp,fas,lib,asd} contrib $out/share/stumpwm/lisp
-    cd $out/share/stumpwm/lisp
-    cat << EOF >init-stumpwm.lisp
-      (require "asdf") 
-      (asdf:operate 'asdf:load-op :cl-ppcre) 
-      (asdf:operate 'asdf:load-op :stumpwm)
-    EOF
-    clisp -K full -i init-stumpwm.lisp
-    cat << EOF >init-stumpwm.lisp
-      (require "asdf") 
-      (asdf:operate 'asdf:load-source-op :cl-ppcre) 
-      (asdf:operate 'asdf:load-source-op :stumpwm)
-    EOF
-    '') ["minInit" "defEnsureDir" "addInputs" "doMake"];
-
-  /* doConfigure should be specified separately */
-  phaseNames = ["envVars" "doConfigure" "doMake" "installation"];
-      
-  name = "${pkgName}-" + version;
-  meta = {
-    description = "Common Lisp-based ratpoison-like window manager.";
-    maintainers = [args.lib.maintainers.raskin];
-    platforms = with args.lib.platforms;
-      linux ++ freebsd;
-  };
-}
diff --git a/pkgs/applications/window-managers/wmii31/default.nix b/pkgs/applications/window-managers/wmii31/default.nix
index 50655a851e2a..dd49cf5ec43e 100644
--- a/pkgs/applications/window-managers/wmii31/default.nix
+++ b/pkgs/applications/window-managers/wmii31/default.nix
@@ -29,7 +29,7 @@ args: with args; stdenv.mkDerivation {
      cp cmd/wmiimenu \$out/bin
   ";
   meta = { homepage = "www.suckless.org";
-           description = "one small tool of the wmii window manger to let the user select an item from a list by filtering..";
+           description = "One small tool of the wmii window manger to let the user select an item from a list by filtering";
            license="MIT";
          };
 }