summary refs log tree commit diff
path: root/pkgs/applications
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications')
-rw-r--r--pkgs/applications/audio/abcde/abcde.patch30
-rw-r--r--pkgs/applications/audio/abcde/cd-paranoia.patch16
-rw-r--r--pkgs/applications/audio/abcde/default.nix31
-rw-r--r--pkgs/applications/audio/abcde/install.patch21
-rw-r--r--pkgs/applications/audio/abcde/which.patch16
-rw-r--r--pkgs/applications/audio/calf/default.nix15
-rw-r--r--pkgs/applications/audio/csound/default.nix34
-rw-r--r--pkgs/applications/audio/distrho/default.nix67
-rw-r--r--pkgs/applications/audio/ncmpcpp/default.nix4
-rw-r--r--pkgs/applications/audio/opus-tools/default.nix17
-rw-r--r--pkgs/applications/audio/swh-lv2/default.nix39
-rw-r--r--pkgs/applications/editors/aewan/default.nix19
-rw-r--r--pkgs/applications/editors/eclipse/default.nix11
-rw-r--r--pkgs/applications/editors/emacs-modes/graphviz-dot/default.nix25
-rw-r--r--pkgs/applications/editors/emacs-modes/magit/default.nix22
-rw-r--r--pkgs/applications/editors/geany/default.nix47
-rw-r--r--pkgs/applications/editors/gobby/default.nix4
-rw-r--r--pkgs/applications/editors/hexedit/default.nix19
-rw-r--r--pkgs/applications/editors/monodevelop/default.nix6
-rw-r--r--pkgs/applications/editors/monodoc/default.nix6
-rw-r--r--pkgs/applications/editors/netbeans/default.nix41
-rw-r--r--pkgs/applications/editors/sublime/default.nix39
-rw-r--r--pkgs/applications/editors/vim/configurable.nix14
-rw-r--r--pkgs/applications/graphics/darktable/default.nix8
-rw-r--r--pkgs/applications/graphics/dia/default.nix2
-rw-r--r--pkgs/applications/graphics/dia/glib-top-level-header.patch471
-rw-r--r--pkgs/applications/graphics/f-spot/default.nix4
-rw-r--r--pkgs/applications/graphics/geeqie/default.nix4
-rw-r--r--pkgs/applications/graphics/gimp/2.8.nix4
-rw-r--r--pkgs/applications/graphics/inkscape/default.nix4
-rw-r--r--pkgs/applications/graphics/pqiv/default.nix6
-rw-r--r--pkgs/applications/misc/adobe-reader/builder.sh27
-rw-r--r--pkgs/applications/misc/adobe-reader/default.nix16
-rw-r--r--pkgs/applications/misc/blender/default.nix4
-rw-r--r--pkgs/applications/misc/calibre/default.nix2
-rw-r--r--pkgs/applications/misc/dmenu/default.nix13
-rw-r--r--pkgs/applications/misc/eaglemode/default.nix14
-rw-r--r--pkgs/applications/misc/epdfview/default.nix1
-rw-r--r--pkgs/applications/misc/epdfview/glib-top-level-header.patch12
-rw-r--r--pkgs/applications/misc/gmrun/default.nix39
-rw-r--r--pkgs/applications/misc/gmrun/gcc43.patch51
-rw-r--r--pkgs/applications/misc/gmrun/gmrun-0.9.2-xdg.patch58
-rw-r--r--pkgs/applications/misc/gphoto2/default.nix14
-rw-r--r--pkgs/applications/misc/grass/default.nix52
-rw-r--r--pkgs/applications/misc/jbidwatcher/default.nix4
-rw-r--r--pkgs/applications/misc/mupdf/default.nix7
-rw-r--r--pkgs/applications/misc/nut/default.nix5
-rw-r--r--pkgs/applications/misc/st/default.nix10
-rw-r--r--pkgs/applications/misc/synergy/default.nix40
-rw-r--r--pkgs/applications/misc/taskwarrior/default.nix29
-rw-r--r--pkgs/applications/misc/wmname/default.nix20
-rw-r--r--pkgs/applications/misc/xfe/default.nix33
-rw-r--r--pkgs/applications/misc/xterm/default.nix16
-rw-r--r--pkgs/applications/networking/browsers/chromium/default.nix113
-rw-r--r--pkgs/applications/networking/browsers/chromium/enable_seccomp.patch20
-rw-r--r--pkgs/applications/networking/browsers/chromium/enable_seccomp22.patch20
-rw-r--r--pkgs/applications/networking/browsers/chromium/sources.nix18
-rwxr-xr-xpkgs/applications/networking/browsers/chromium/update.sh2
-rw-r--r--pkgs/applications/networking/browsers/firefox/15.0.nix44
-rw-r--r--pkgs/applications/networking/browsers/firefox/16.0.nix (renamed from pkgs/applications/networking/browsers/firefox/12.0.nix)94
-rw-r--r--pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-10/builder.sh23
-rw-r--r--pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-10/default.nix88
-rw-r--r--pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-11/default.nix23
-rw-r--r--pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-9/builder.sh14
-rw-r--r--pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-9/default.nix47
-rw-r--r--pkgs/applications/networking/browsers/mozilla-plugins/google-talk-plugin/default.nix6
-rw-r--r--pkgs/applications/networking/browsers/mozilla-plugins/nspluginwrapper/default.nix36
-rw-r--r--pkgs/applications/networking/browsers/mozilla-plugins/nspluginwrapper/default.upstream4
-rw-r--r--pkgs/applications/networking/browsers/opera/default.nix10
-rw-r--r--pkgs/applications/networking/browsers/uzbl/default.nix11
-rw-r--r--pkgs/applications/networking/cluster/hadoop/default.nix4
-rw-r--r--pkgs/applications/networking/esniper/default.nix6
-rw-r--r--pkgs/applications/networking/instant-messengers/baresip/default.nix45
-rw-r--r--pkgs/applications/networking/instant-messengers/gajim/default.nix16
-rw-r--r--pkgs/applications/networking/instant-messengers/pidgin/default.nix4
-rw-r--r--pkgs/applications/networking/instant-messengers/psi/default.nix37
-rw-r--r--pkgs/applications/networking/instant-messengers/psi/glib-2.32.patch54
-rw-r--r--pkgs/applications/networking/instant-messengers/psi/psimedia.nix8
-rw-r--r--pkgs/applications/networking/instant-messengers/salut-a-toi/default.nix45
-rw-r--r--pkgs/applications/networking/instant-messengers/skype/default.nix38
-rw-r--r--pkgs/applications/networking/irc/weechat/default.nix4
-rw-r--r--pkgs/applications/networking/irc/xchat/default.nix2
-rw-r--r--pkgs/applications/networking/irc/xchat/glib-top-level-header.patch75
-rw-r--r--pkgs/applications/networking/mailreaders/mutt/default.nix9
-rw-r--r--pkgs/applications/networking/mailreaders/notmuch/default.nix4
-rw-r--r--pkgs/applications/networking/mailreaders/sylpheed/default.nix28
-rw-r--r--pkgs/applications/networking/mailreaders/thunderbird/default.nix (renamed from pkgs/applications/networking/mailreaders/thunderbird/11.x.nix)47
-rw-r--r--pkgs/applications/networking/p2p/mldonkey/default.nix8
-rw-r--r--pkgs/applications/networking/remote/putty/default.nix16
-rw-r--r--pkgs/applications/networking/sniffers/wireshark/default.nix4
-rw-r--r--pkgs/applications/networking/umurmur/default.nix20
-rw-r--r--pkgs/applications/office/gnucash/default.nix4
-rw-r--r--pkgs/applications/office/openoffice/libreoffice-srcs.nix4
-rw-r--r--pkgs/applications/office/openoffice/libreoffice.nix10
-rw-r--r--pkgs/applications/science/astronomy/gravit/default.nix22
-rw-r--r--pkgs/applications/science/astronomy/stellarium/default.nix14
-rw-r--r--pkgs/applications/science/electronics/kicad/default.nix2
-rw-r--r--pkgs/applications/science/electronics/ngspice/default.nix8
-rw-r--r--pkgs/applications/science/electronics/qfsm/default.nix24
-rw-r--r--pkgs/applications/science/electronics/qfsm/drop-hardcoded-prefix.patch20
-rw-r--r--pkgs/applications/science/electronics/tkgate/1.x.nix38
-rw-r--r--pkgs/applications/science/electronics/tkgate/2.x.nix33
-rw-r--r--pkgs/applications/science/math/maxima/default.nix4
-rw-r--r--pkgs/applications/science/math/wxmaxima/default.nix4
-rw-r--r--pkgs/applications/version-management/darcs/default.nix8
-rw-r--r--pkgs/applications/version-management/fossil/default.nix10
-rw-r--r--pkgs/applications/version-management/git-and-tools/darcs-to-git/default.nix79
-rw-r--r--pkgs/applications/version-management/git-and-tools/default.nix13
-rw-r--r--pkgs/applications/version-management/git-and-tools/git-annex/default.nix40
-rw-r--r--pkgs/applications/version-management/git-and-tools/git/default.nix4
-rw-r--r--pkgs/applications/version-management/git-and-tools/tig/default.nix13
-rw-r--r--pkgs/applications/video/MPlayer/default.nix169
-rw-r--r--pkgs/applications/video/RealPlayer/default.nix6
-rw-r--r--pkgs/applications/video/dvdauthor/build-against-libpng15.patch27
-rw-r--r--pkgs/applications/video/dvdauthor/default.nix18
-rw-r--r--pkgs/applications/video/key-mon/default.nix30
-rw-r--r--pkgs/applications/video/vlc/default.nix4
-rw-r--r--pkgs/applications/virtualization/lxc/default.nix49
-rw-r--r--pkgs/applications/virtualization/lxc/dont-run-ldconfig.patch24
-rw-r--r--pkgs/applications/virtualization/lxc/fix-documentation-build.patch40
-rw-r--r--pkgs/applications/virtualization/lxc/fix-sgml-documentation.patch252
-rw-r--r--pkgs/applications/virtualization/virtualbox/default.nix14
-rw-r--r--pkgs/applications/virtualization/virtualbox/guest-additions/default.nix11
-rw-r--r--pkgs/applications/virtualization/virtualbox/remove_fa_ir.patch30
-rw-r--r--pkgs/applications/window-managers/awesome/default.nix1
-rw-r--r--pkgs/applications/window-managers/i3/default.nix10
-rw-r--r--pkgs/applications/window-managers/i3/status.nix4
-rw-r--r--pkgs/applications/window-managers/icewm/default.nix2
-rw-r--r--pkgs/applications/window-managers/icewm/deprecated.patch23
-rw-r--r--pkgs/applications/window-managers/xmonad/default.nix1
-rw-r--r--pkgs/applications/window-managers/xmonad/xmonad-extras.nix6
131 files changed, 2347 insertions, 1288 deletions
diff --git a/pkgs/applications/audio/abcde/abcde.patch b/pkgs/applications/audio/abcde/abcde.patch
new file mode 100644
index 000000000000..ae187043e6c5
--- /dev/null
+++ b/pkgs/applications/audio/abcde/abcde.patch
@@ -0,0 +1,30 @@
+Two changes:
+
+* Add an alias for `which', so abcde can find things in store
+* Choose the right CDROM reader syntax for `cd-paranoia'
+
+--- abcde-2.5.4/abcde~	2012-09-18 06:09:31.000000000 -0700
++++ abcde-2.5.4/abcde	2012-10-27 00:08:48.000862364 -0700
+@@ -17,6 +17,11 @@
+ 
+ VERSION='2.5.4'
+ 
++which ()
++{
++  type -P $1
++}
++
+ usage ()
+ {
+ echo "This is abcde v$VERSION."
+@@ -3497,6 +3502,10 @@
+ 	for DEFAULT_CDROMREADER in $DEFAULT_CDROMREADERS; do
+ 		if new_checkexec $DEFAULT_CDROMREADER; then
+ 			CDROMREADERSYNTAX=$DEFAULT_CDROMREADER
++                        case "$DEFAULT_CDROMREADER" in
++			  cd-paranoia)  CDROMREADERSYNTAX=cdparanoia;;
++			  *)            CDROMREADERSYNTAX=$DEFAULT_CDROMREADER;;
++			esac
+ 			break
+ 		fi
+ 	done
diff --git a/pkgs/applications/audio/abcde/cd-paranoia.patch b/pkgs/applications/audio/abcde/cd-paranoia.patch
deleted file mode 100644
index 58cada65fb8d..000000000000
--- a/pkgs/applications/audio/abcde/cd-paranoia.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-Choose the right CDROM reader syntax for `cd-paranoia'.
-
---- abcde-2.3.99.6/abcde	2006-08-05 21:14:00.000000000 +0200
-+++ abcde-2.3.99.6/abcde	2008-10-29 22:55:38.000000000 +0100
-@@ -3184,7 +3184,10 @@ if [ -n "$DISCID" ] || [ "$CDROMREADERSY
- if [ "$CDROMREADERSYNTAX" = "" ]; then
- 	for DEFAULT_CDROMREADER in $DEFAULT_CDROMREADERS; do
- 		if new_checkexec $DEFAULT_CDROMREADER; then
--			CDROMREADERSYNTAX=$DEFAULT_CDROMREADER
-+                        case "$DEFAULT_CDROMREADER" in
-+			  cd-paranoia)  CDROMREADERSYNTAX=cdparanoia;;
-+			  *)            CDROMREADERSYNTAX=$DEFAULT_CDROMREADER;;
-+			esac
- 			break
- 		fi
- 	done
diff --git a/pkgs/applications/audio/abcde/default.nix b/pkgs/applications/audio/abcde/default.nix
index e7da594e4bc6..e8c37d25694e 100644
--- a/pkgs/applications/audio/abcde/default.nix
+++ b/pkgs/applications/audio/abcde/default.nix
@@ -1,19 +1,20 @@
-{ stdenv, fetchurl, libcdio, cddiscid, wget, bash, vorbisTools, id3v2, lame
+{ stdenv, fetchurl, libcdio, cddiscid, wget, bash, vorbisTools, id3v2, lame, flac, eject, mkcue
+, perl, DigestSHA, MusicBrainz, MusicBrainzDiscID
 , makeWrapper }:
 
-let version = "2.3.99.6";
+let version = "2.5.4";
 in
   stdenv.mkDerivation {
     name = "abcde-${version}";
     src = fetchurl {
       url = "mirror://debian/pool/main/a/abcde/abcde_${version}.orig.tar.gz";
-      sha256 = "1wl4ygj1cf1d6g05gwwygsd5g83l039fzi011r30ma5lnm763lyb";
+      sha256 = "14g5lsgh53hza9848351kwpygc0yqpvvzp3s923aja77f2wpkdl5";
     };
 
     # FIXME: This package does not support MP3 encoding (only Ogg),
     # nor `distmp3', `eject', etc.
 
-    patches = [ ./install.patch ./which.patch ./cd-paranoia.patch ];
+    patches = [ ./abcde.patch ];
 
     configurePhase = ''
       sed -i "s|^[[:blank:]]*prefix *=.*$|prefix = $out|g ;
@@ -29,25 +30,37 @@ in
 
       substituteInPlace "abcde"					\
 	--replace "/etc/abcde.conf" "$out/etc/abcde.conf"
+
     '';
 
+    # no ELFs in this package, only scripts
+    dontStrip = true;
+    dontPatchELF = true;
+
     buildInputs = [ makeWrapper ];
 
     postInstall = ''
-      substituteInPlace "$out/bin/cddb-tool" \
-         --replace '#!/bin/sh' '#!${bash}/bin/sh'
-      substituteInPlace "$out/bin/abcde" \
-         --replace '#!/bin/bash' '#!${bash}/bin/bash'
+    #   substituteInPlace "$out/bin/cddb-tool" \
+    #      --replace '#!/bin/sh' '#!${bash}/bin/sh'
+    #   substituteInPlace "$out/bin/abcde" \
+    #      --replace '#!/bin/bash' '#!${bash}/bin/bash'
+
+      # generic fixup script should be doing this, but it ignores this file for some reason
+      substituteInPlace "$out/bin/abcde-musicbrainz-tool" \
+         --replace '#!/usr/bin/perl' '#!${perl}/bin/perl'
 
       wrapProgram "$out/bin/abcde" --prefix PATH ":" \
         "$out/bin:${libcdio}/bin:${cddiscid}/bin:${wget}/bin:${vorbisTools}/bin:${id3v2}/bin:${lame}/bin"
 
       wrapProgram "$out/bin/cddb-tool" --prefix PATH ":" \
         "${wget}/bin"
+
+      wrapProgram "$out/bin/abcde-musicbrainz-tool" --prefix PATH ":" \
+        "${wget}/bin"
     '';
 
     meta = {
-      homepage = http://www.hispalinux.es/~data/abcde.php;
+      homepage = "http://lly.org/~rcw/abcde/page/";
       licence = "GPLv2+";
       description = "A Better CD Encoder (ABCDE)";
 
diff --git a/pkgs/applications/audio/abcde/install.patch b/pkgs/applications/audio/abcde/install.patch
deleted file mode 100644
index f5ab75f4bb96..000000000000
--- a/pkgs/applications/audio/abcde/install.patch
+++ /dev/null
@@ -1,21 +0,0 @@
---- abcde-2.3.3/Makefile~	2005-08-26 00:43:27.000000000 +0200
-+++ abcde-2.3.3/Makefile	2008-05-26 22:20:17.000000000 +0200
-@@ -14,13 +14,13 @@ clean:
- 
- install:
- 	$(INSTALL) -d -m 755 $(bindir)
--	$(INSTALL) -m 755 -o 0 abcde $(bindir)
--	$(INSTALL) -m 755 -o 0 cddb-tool $(bindir)
-+	$(INSTALL) -m 755 abcde $(bindir)
-+	$(INSTALL) -m 755 cddb-tool $(bindir)
- 	$(INSTALL) -d -m 755 $(mandir)
--	$(INSTALL) -m 644 -o 0 abcde.1 $(mandir)
--	$(INSTALL) -m 644 -o 0 cddb-tool.1 $(mandir)
-+	$(INSTALL) -m 644 abcde.1 $(mandir)
-+	$(INSTALL) -m 644 cddb-tool.1 $(mandir)
- 	$(INSTALL) -d -m 755 $(etcdir)
--	$(INSTALL) -m 644 -o 0 abcde.conf $(etcdir)
-+	$(INSTALL) -m 644 abcde.conf $(etcdir)
- 
- tarball:
- 	@cd .. && tar czvf abcde_$(VERSION).orig.tar.gz \
diff --git a/pkgs/applications/audio/abcde/which.patch b/pkgs/applications/audio/abcde/which.patch
deleted file mode 100644
index 70474000ddd4..000000000000
--- a/pkgs/applications/audio/abcde/which.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-Add an alias for `which'.
-
---- abcde-2.3.99.6/abcde	2006-08-05 21:14:00.000000000 +0200
-+++ abcde-2.3.99.6/abcde	2008-10-29 22:49:16.000000000 +0100
-@@ -15,6 +15,11 @@
- 
- VERSION='2.3.99-$Revision: 222M $'
- 
-+which ()
-+{
-+  type -P $1
-+}
-+
- usage ()
- {
- echo "This is abcde v$VERSION."
diff --git a/pkgs/applications/audio/calf/default.nix b/pkgs/applications/audio/calf/default.nix
index 4b1f6dcd2687..bc7b3c57e60b 100644
--- a/pkgs/applications/audio/calf/default.nix
+++ b/pkgs/applications/audio/calf/default.nix
@@ -1,22 +1,25 @@
-{ stdenv, fetchurl, cairo, expat, glib, gtk, jackaudio, ladspaH
-, libglade, lv2, pkgconfig }:
+{ stdenv, fetchurl, cairo, expat, fftwSinglePrec, fluidsynth, glib
+, gtk, jackaudio, ladspaH , libglade, lv2, pkgconfig }:
 
 stdenv.mkDerivation rec {
   name = "calf-${version}";
-  version = "0.0.18.6";
+  version = "0.0.19-rc7";
 
   src = fetchurl {
     url = "mirror://sourceforge/calf/${name}.tar.gz";
-    sha256 = "03w6jjkrr6w8da6qzd0x4dlkg295c6jxby500x4cj07wpbpk6irh";
+    sha256 = "0515pzc7ishrq0j5hza83s0yp3x34r977h776lpky389whcyf45j";
   };
 
-  buildInputs =
-    [ cairo jackaudio gtk glib expat libglade ladspaH lv2 pkgconfig ];
+  buildInputs = [ 
+    cairo expat fftwSinglePrec fluidsynth glib gtk jackaudio ladspaH
+    libglade lv2 pkgconfig
+  ];
 
   meta = with stdenv.lib; {
     homepage = http://calf.sourceforge.net;
     description = "A set of high quality open source audio plugins for musicians";
     license = licenses.lgpl2;
     maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/applications/audio/csound/default.nix b/pkgs/applications/audio/csound/default.nix
new file mode 100644
index 000000000000..9e4ee01810cd
--- /dev/null
+++ b/pkgs/applications/audio/csound/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, fetchurl, cmake, libsndfile, flex, bison
+, alsaLib ? null
+, pulseaudio ? null
+, tcltk ? null
+
+# maybe csound can be compiled with support for those, see configure output
+# , ladspa ? null
+# , fluidsynth ? null
+# , jack ? null
+# , gmm ? null
+# , wiiuse ? null
+}:
+
+stdenv.mkDerivation {
+  name = "csound5.18.02";
+
+  enableParallelBuilding = true;
+
+  src = fetchurl {
+    url = http://netcologne.dl.sourceforge.net/project/csound/csound5/csound5.18/Csound5.18.02.tar.gz;
+    sha256 = "4c461cf3bf60b83671224949dd33805379b7121bf2c0ad6af5e191e7f6f8adc8";
+  };
+
+  buildInputs = [ cmake libsndfile flex bison alsaLib pulseaudio tcltk ];
+
+  meta = {
+    description = "sound design, audio synthesis, and signal processing system, providing facilities for music composition and performance on all major operating systems and platforms";
+    homepage = http://www.csounds.com/;
+    license = stdenv.lib.licenses.gpl2;
+    maintainers = [stdenv.lib.maintainers.marcweber];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
+
diff --git a/pkgs/applications/audio/distrho/default.nix b/pkgs/applications/audio/distrho/default.nix
new file mode 100644
index 000000000000..7a1d24844b6a
--- /dev/null
+++ b/pkgs/applications/audio/distrho/default.nix
@@ -0,0 +1,67 @@
+{ stdenv, fetchgit, alsaLib, fftwSinglePrec, freetype, jackaudio
+, libxslt, lv2, pkgconfig, premake, xlibs }:
+
+let
+  rev = "7815b3545978e";
+in
+stdenv.mkDerivation rec {
+  name = "distrho-${rev}";
+
+  src = fetchgit {
+    url = "git://distrho.git.sf.net/gitroot/distrho/distrho";
+    inherit rev;
+    sha256 = "2e260f16ee67b1166c39e2d55c8dd5593902c8b3d8d86485545ef83139e1e844";
+  };
+
+  patchPhase = ''
+    sed -e "s#xsltproc#${libxslt}/bin/xsltproc#" -i Makefile
+    sed -e "s#PREFIX = /usr/local#PREFIX = $out#" -i Makefile
+    sed -e "s#/etc/HybridReverb2#$out/etc/Hybridreverb2#" \
+      -i ports/hybridreverb2/source/SystemConfig.cpp
+    sed -e "s#/usr#$out#" -i ports/hybridreverb2/data/HybridReverb2.conf
+  '';
+
+  buildInputs = [
+    alsaLib fftwSinglePrec freetype jackaudio pkgconfig premake
+    xlibs.libX11 xlibs.libXcomposite xlibs.libXcursor xlibs.libXext
+    xlibs.libXinerama xlibs.libXrender
+  ];
+
+  buildPhase = ''
+    sh ./scripts/premake-update.sh linux
+    make standalone
+    make lv2
+
+    # generate lv2 ttl
+    sh scripts/generate-ttl.sh
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp bin/standalone/* $out/bin/
+    mkdir -p $out/lib/lv2
+    cp -a bin/lv2/* $out/lib/lv2/
+
+    # HybridReverb2 data
+    mkdir -p $out/etc/HybridReverb2
+    cp ports/hybridreverb2/data/HybridReverb2.conf $out/etc/HybridReverb2/
+    mkdir -p $out/share
+    cp -a ports/hybridreverb2/data/HybridReverb2 $out/share/
+  '';
+
+  meta = with stdenv.lib; {
+    homepage = http://distrho.sourceforge.net;
+    description = "A collection of cross-platform audio effects and plugins";
+    longDescription = ''
+      Includes:
+      3BandEQ bitmangler drowaudio-distortion drowaudio-flanger
+      drowaudio-tremolo eqinox HybridReverb2 juce_pitcher sDelay
+      TAL-Filter TAL-NoiseMaker TAL-Reverb-2 TAL-Vocoder-2 ThePilgrim
+      Wolpertinger argotlunar capsaicin drowaudio-distortionshaper
+      drowaudio-reverb drumsynth highlife JuceDemoPlugin PingPongPan
+      TAL-Dub-3 TAL-Filter-2 TAL-Reverb TAL-Reverb-3 TheFunction vex
+    '';
+    maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/applications/audio/ncmpcpp/default.nix b/pkgs/applications/audio/ncmpcpp/default.nix
index 3af9bc7690ff..a7fca8cabf1b 100644
--- a/pkgs/applications/audio/ncmpcpp/default.nix
+++ b/pkgs/applications/audio/ncmpcpp/default.nix
@@ -1,12 +1,12 @@
 {stdenv, fetchurl, ncurses, curl, taglib, fftw, mpd_clientlib, pkgconfig}:
 
 stdenv.mkDerivation rec {
-  version = "0.5.8";
+  version = "0.5.10";
   name = "ncmpcpp-${version}";
 
   src = fetchurl {
     url = "http://ncmpcpp.rybczak.net/stable/ncmpcpp-${version}.tar.bz2";
-    sha256 = "1kbkngs4fhf9z53awskqiwdl94i5slvxmjiajkrayi99373fallx";
+    sha256 = "ff6d5376a2d9caba6f5bb78e68af77cefbdb2f04cd256f738e39f8ac9a79a4a8";
   };
 
   buildInputs = [ ncurses curl taglib fftw mpd_clientlib pkgconfig ];
diff --git a/pkgs/applications/audio/opus-tools/default.nix b/pkgs/applications/audio/opus-tools/default.nix
new file mode 100644
index 000000000000..6b7e1e2aeff6
--- /dev/null
+++ b/pkgs/applications/audio/opus-tools/default.nix
@@ -0,0 +1,17 @@
+{stdenv, fetchurl, libogg, libao, pkgconfig, libopus}:
+
+stdenv.mkDerivation rec {
+  name = "opus-tools-0.1.5";
+  src = fetchurl {
+    url = "http://downloads.xiph.org/releases/opus/${name}.tar.gz";
+    sha256 = "0184zfamg3qcjknk4liz4smws3mbv77gjhq2pn9xgcx9nw78srvn";
+  };
+
+  buildInputs = [ libogg libao pkgconfig libopus ];
+
+  meta = {
+    description = "Tools to work with opus encoded audio streams";
+    homepage = http://www.opus-codec.org/;
+    license = "BSD";
+  };
+}
diff --git a/pkgs/applications/audio/swh-lv2/default.nix b/pkgs/applications/audio/swh-lv2/default.nix
new file mode 100644
index 000000000000..9b18ab31abf4
--- /dev/null
+++ b/pkgs/applications/audio/swh-lv2/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchgit, fftwSinglePrec, libxslt, lv2, pkgconfig }:
+
+let
+  rev = "ec6b85e19e24ed";
+in
+stdenv.mkDerivation rec {
+  name = "swh-lv2-${rev}";
+
+  src = fetchgit {
+    url = "git://github.com/swh/lv2.git";
+    inherit rev;
+    sha256 = "d0d918ee642cd9649215737fcc008ce2bf55f4ea893a1897138b33775ea60d17";
+  };
+
+  patchPhase = ''
+    sed -e "s#xsltproc#${libxslt}/bin/xsltproc#" -i Makefile
+    sed -e "s#PREFIX = /usr/local#PREFIX = $out#" -i Makefile
+  '';
+
+  buildInputs = [ fftwSinglePrec lv2 pkgconfig ];
+
+  installPhase = "make install-system";
+
+  meta = with stdenv.lib; {
+    homepage = http://plugin.org.uk;
+    description = "LV2 version of Steve Harris' SWH plugins";
+    longDescription = ''
+      SWH plugins include:
+      amp, fast overdrive, overdrive (with colourisation), comb
+      filter, waveshaper, ringmod, divider, diode, decliper, pitch
+      scaler, 16 band equaliser, sinus wavewrapper, hermes filter,
+      chorus, flanger, decimater, oscillator, gverb, phasers, harmonic
+      generators, surround encoders and more.
+    '';
+    license = licenses.gpl3;
+    maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/pkgs/applications/editors/aewan/default.nix b/pkgs/applications/editors/aewan/default.nix
new file mode 100644
index 000000000000..3e11f78e4028
--- /dev/null
+++ b/pkgs/applications/editors/aewan/default.nix
@@ -0,0 +1,19 @@
+{ stdenv, fetchurl, zlib, ncurses }:
+
+stdenv.mkDerivation rec {
+  name = "aewan-${version}";
+  version = "1.0.01";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/aewan/${name}.tar.gz";
+    sha256 = "5266dec5e185e530b792522821c97dfa5f9e3892d0dca5e881d0c30ceac21817";
+  };
+
+  buildInputs = [ zlib ncurses ];
+
+  meta = {
+    description = "Ascii-art Editor Without A Name";
+    homepage = "http://aewan.sourceforge.net/";
+    license = stdenv.lib.licenses.gpl2Plus;
+  };
+}
diff --git a/pkgs/applications/editors/eclipse/default.nix b/pkgs/applications/editors/eclipse/default.nix
index af71e89a4166..a9ee85d905e0 100644
--- a/pkgs/applications/editors/eclipse/default.nix
+++ b/pkgs/applications/editors/eclipse/default.nix
@@ -49,6 +49,8 @@ let
         # Create desktop item.
         mkdir -p $out/share/applications
         cp ${desktopItem}/share/applications/* $out/share/applications
+        mkdir -p $out/share/pixmaps
+        ln -s $out/eclipse/icon.xpm $out/share/pixmaps/eclipse.xpm
       ''; # */
 
       meta = {
@@ -164,14 +166,13 @@ in {
     src =
       if stdenv.system == "x86_64-linux" then
         fetchurl {
-          url = http://eclipse.ialto.com/eclipse/downloads/drops4/R-4.2-201206081400/eclipse-SDK-4.2-linux-gtk-x86_64.tar.gz;
-          sha256 = "1vcr49qm6rsbgzi9d43ggmby68pdigqcy55l5vy1gmixqks3g6s0";
+          url = http://eclipse.ialto.com/eclipse/downloads/drops4/R-4.2.1-201209141800/eclipse-SDK-4.2.1-linux-gtk-x86_64.tar.gz;
+          sha256 = "1mlyy90lk08lb2971ynglgi3nqvqfq1k70md2kb39jk160wd1xrk";
         }
       else
         fetchurl {
-          url = http://eclipse.ialto.com/eclipse/downloads/drops4/R-4.2-201206081400/eclipse-SDK-4.2-linux-gtk.tar.gz;
-          sha256 = "1zlv80idkkdda05ks4biknbkczp24b2xki81ik5nygrjg29jqgnz";
+          url = http://eclipse.ialto.com/eclipse/downloads/drops4/R-4.2.1-201209141800/eclipse-SDK-4.2.1-linux-gtk.tar.gz;
+          sha256 = "1av6qm9wkbyk123qqf38f0jq4jv2bj9wp6fmpnl55zg6qr463c1w";
         };
     };
 }
-
diff --git a/pkgs/applications/editors/emacs-modes/graphviz-dot/default.nix b/pkgs/applications/editors/emacs-modes/graphviz-dot/default.nix
new file mode 100644
index 000000000000..c1291126a1e9
--- /dev/null
+++ b/pkgs/applications/editors/emacs-modes/graphviz-dot/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchurl, emacs }:
+
+stdenv.mkDerivation rec {
+  name = "graphviz-dot-mode-0.3.3";
+
+  src = fetchurl {
+    url = "http://www.graphviz.org/Misc/graphviz-dot-mode.el";
+    sha256 = "6465c18cfaa519a063cf664207613f70b0a17ac5eabcfaa949b3c4c289842953";
+  };
+
+  buildInputs = [ emacs ];
+
+  unpackPhase = ":";
+
+  installPhase = ''
+    mkdir -p "$out/share/emacs/site-lisp"
+    cp -v ${src} "$out/share/emacs/site-lisp/graphviz-dot-mode.el"
+    emacs -batch --eval '(setq load-path (cons "." load-path))' -f batch-byte-compile "$out/share/emacs/site-lisp/graphviz-dot-mode.el"
+  '';
+
+  meta = {
+    homepage = "http://www.graphviz.org/";
+    description = "An emacs mode for the DOT Language, used by graphviz";
+  };
+}
diff --git a/pkgs/applications/editors/emacs-modes/magit/default.nix b/pkgs/applications/editors/emacs-modes/magit/default.nix
index f096d3b0057d..580b2761fa97 100644
--- a/pkgs/applications/editors/emacs-modes/magit/default.nix
+++ b/pkgs/applications/editors/emacs-modes/magit/default.nix
@@ -1,22 +1,32 @@
-{ stdenv, fetchurl, emacs, texinfo }:
+{ stdenv, fetchurl, emacs, texinfo, unzip }:
 
 let
-  version = "1.1.1";
+  version = "1.2.0";
 in
 stdenv.mkDerivation {
   name = "magit-${version}";
 
   src = fetchurl {
-    url = "http://github.com/downloads/magit/magit/magit-${version}.tar.gz";
-    sha256 = "0zp5qxippmalin2fr73w2alf2w7ilcahmybzdvgn4ch2s3dgvzcz";
+    url = "https://github.com/magit/magit/zipball/${version}";
+    sha256 = "1877s8ikvcb457mmljmw366h6pgg4zzx98qfazhqj8snl4yqsj4i";
+    name = "magit-${version}.zip";
   };
 
-  buildInputs = [emacs texinfo];
+  buildInputs = [ emacs texinfo unzip ];
 
   configurePhase = "makeFlagsArray=( PREFIX=$out SYSCONFDIR=$out/etc )";
 
+  # Add (require 'magit-site-init) to your ~/.emacs file to set-up magit mode.
+  postInstall = ''
+    mv $out/etc/emacs/site-start.d/50magit.el $out/share/emacs/site-lisp/magit-site-init.el
+    sed -i -e 's|50magit|magit-site-init|' $out/share/emacs/site-lisp/magit-site-init.el
+    rmdir $out/etc/emacs/site-start.d $out/etc/emacs $out/etc
+  '';
+
   meta = {
+    homepage = "https://github.com/magit/magit";
     description = "Magit, an Emacs interface to Git";
+    license = "GPLv3+";
 
     longDescription = ''
       With Magit, you can inspect and modify your Git repositories with
@@ -30,8 +40,6 @@ stdenv.mkDerivation {
       save you from learning Git itself.
     '';
 
-    license = "GPLv3+";
-    homepage = "https://github.com/magit/magit";
     platforms = stdenv.lib.platforms.all;
     maintainers = with stdenv.lib.maintainers; [ simons ludo ];
   };
diff --git a/pkgs/applications/editors/geany/default.nix b/pkgs/applications/editors/geany/default.nix
new file mode 100644
index 000000000000..1c08dc6db8d7
--- /dev/null
+++ b/pkgs/applications/editors/geany/default.nix
@@ -0,0 +1,47 @@
+{ stdenv, fetchurl, gtk2, which, pkgconfig, intltool }:
+
+let
+  version = "1.22";
+in
+
+stdenv.mkDerivation rec {
+  name = "geany-${version}";
+
+  src = fetchurl {
+    url = "http://download.geany.org/${name}.tar.gz";
+    md5 = "1cb7f6cea8e301c416211786cec474fa";
+  };
+
+  buildInputs = [ gtk2 which pkgconfig intltool ];
+
+  doCheck = true;
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "A GTK2 small and ligthweight 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.
+      Another goal was to be as independent as possible from a special Desktop Environment like KDE or GNOME.
+      Geany only requires the GTK2 runtime libraries.
+      Some basic features of Geany:
+      - Syntax highlighting
+      - Code folding
+      - Symbol name auto-completion
+      - Construct completion/snippets
+      - Auto-closing of XML and HTML tags
+      - Call tips
+      - Many supported filetypes including C, Java, PHP, HTML, Python, Perl, Pascal (full list)
+      - Symbol lists
+      - Code navigation
+      - Build system to compile and execute your code
+      - Simple project management
+      - Plugin interface
+    '';
+    homepage = "http://www.geany.org/";
+    license = "GPL";
+    maintainers = [ stdenv.lib.maintainers.bbenoist ];
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/applications/editors/gobby/default.nix b/pkgs/applications/editors/gobby/default.nix
index badd18b8915b..4d48ba69086e 100644
--- a/pkgs/applications/editors/gobby/default.nix
+++ b/pkgs/applications/editors/gobby/default.nix
@@ -9,10 +9,10 @@ let
   
 in stdenv.mkDerivation rec {
 
-  name = "gobby-0.4.93";
+  name = "gobby-0.4.94";
   src = fetchurl {
     url = "http://releases.0x539.de/gobby/${name}.tar.gz";
-    sha256 = "1zk6p0kdp9vcvrr3kx0kw106ln309hd7bbsq8li1g0pcnkgrf4q4";
+    sha256 = "b9798808447cd94178430f0fb273d0e45d0ca30ab04560e3790bac469e03bb00";
   };
 
   buildInputs = [ pkgconfig gtkmm gsasl gtksourceview libxmlxx libinf intltool ]
diff --git a/pkgs/applications/editors/hexedit/default.nix b/pkgs/applications/editors/hexedit/default.nix
new file mode 100644
index 000000000000..07985dc214ae
--- /dev/null
+++ b/pkgs/applications/editors/hexedit/default.nix
@@ -0,0 +1,19 @@
+{ stdenv, fetchurl, ncurses }:
+
+stdenv.mkDerivation rec {
+  name = "hexedit-${version}";
+  version = "1.2.12";
+
+  src = fetchurl {
+    url = "http://rigaux.org/${name}.src.tgz";
+    sha256 = "bcffbf3d128516cc4e1da64485866fbb5f62754f2af8327e7a527855186ba10f";
+  };
+
+  buildInputs = [ ncurses ];
+
+  meta = {
+    description = "View and edit files in hexadecimal or in ASCII";
+    homepage = "http://prigaux.chez.com/hexedit.html";
+    license = stdenv.lib.licenses.gpl2Plus;
+  };
+}
diff --git a/pkgs/applications/editors/monodevelop/default.nix b/pkgs/applications/editors/monodevelop/default.nix
index e4dc00ff0a13..c823ecfdf83e 100644
--- a/pkgs/applications/editors/monodevelop/default.nix
+++ b/pkgs/applications/editors/monodevelop/default.nix
@@ -2,7 +2,7 @@
 , gtkmozembedsharp, monodoc
 , perl, perlXMLParser, pkgconfig
 , glib, gtk, GConf, gnome_vfs, libbonobo, libglade, libgnome
-, mozilla
+, mozilla, makeWrapper
 }:
 
 stdenv.mkDerivation {
@@ -14,8 +14,6 @@ stdenv.mkDerivation {
     md5 = "8c33df5629b0676b7ab552854c1de6fd";
   };
 
-  makeWrapper = ../../../build-support/make-wrapper/make-wrapper.sh;
-  
   patches = [./prefix.patch];
   
   buildInputs = [
@@ -24,5 +22,5 @@ stdenv.mkDerivation {
     gtkmozembedsharp monodoc
   ];
   
-  inherit mozilla monodoc gtksharp gtkmozembedsharp gtksourceviewsharp;
+  inherit mozilla monodoc gtksharp gtkmozembedsharp gtksourceviewsharp makeWrapper;
 }
diff --git a/pkgs/applications/editors/monodoc/default.nix b/pkgs/applications/editors/monodoc/default.nix
index db8b2e478846..8f6b6d6024c5 100644
--- a/pkgs/applications/editors/monodoc/default.nix
+++ b/pkgs/applications/editors/monodoc/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, mono, gtksharp, pkgconfig}:
+{stdenv, fetchurl, mono, gtksharp, pkgconfig, makeWrapper}:
 
 stdenv.mkDerivation {
   name = "monodoc-1.0.6";
@@ -9,9 +9,7 @@ stdenv.mkDerivation {
     md5 = "f2fc27e8e4717d90dc7efa2450625693";
   };
 
-  makeWrapper = ../../../build-support/make-wrapper/make-wrapper.sh;
-
   buildInputs = [mono gtksharp pkgconfig];
 
-  inherit gtksharp;
+  inherit gtksharp makeWrapper;
 }
diff --git a/pkgs/applications/editors/netbeans/default.nix b/pkgs/applications/editors/netbeans/default.nix
new file mode 100644
index 000000000000..f1fd9adbe86a
--- /dev/null
+++ b/pkgs/applications/editors/netbeans/default.nix
@@ -0,0 +1,41 @@
+{stdenv, fetchurl, jdk, unzip, which, makeWrapper, makeDesktopItem}:
+
+let
+  desktopItem = makeDesktopItem {
+    name = "netbeans";
+    exec = "netbeans";
+    comment = "Integrated Development Environment";
+    desktopName = "Netbeans IDE";
+    genericName = "Integrated Development Environment";
+    categories = "Application;Development;";
+  };
+in
+stdenv.mkDerivation {
+  name = "netbeans-7.2";
+  src = fetchurl {
+    url = http://download.netbeans.org/netbeans/7.2/final/zip/netbeans-7.2-201207171143-ml.zip;
+    sha256 = "18ya1w291hdnc35vb12yqnai82wmqm7351wn82fax12kzha5fmci";
+  };
+  buildCommand = ''
+    # Unpack and copy the stuff
+    unzip $src
+    mkdir -p $out
+    cp -a netbeans $out
+    
+    # Create a wrapper capable of starting it
+    mkdir -p $out/bin
+    makeWrapper $out/netbeans/bin/netbeans $out/bin/netbeans \
+      --prefix PATH : ${jdk}/bin:${which}/bin
+      
+    # Create desktop item, so we can pick it from the KDE/GNOME menu
+    mkdir -p $out/share/applications
+    cp ${desktopItem}/share/applications/* $out/share/applications
+  '';
+  
+  buildInputs = [ unzip makeWrapper ];
+  
+  meta = {
+    description = "An integrated development environment for Java, C, C++ and PHP";
+    maintainers = [ stdenv.lib.maintainers.sander ];
+  };
+}
diff --git a/pkgs/applications/editors/sublime/default.nix b/pkgs/applications/editors/sublime/default.nix
new file mode 100644
index 000000000000..22fc42c6c59f
--- /dev/null
+++ b/pkgs/applications/editors/sublime/default.nix
@@ -0,0 +1,39 @@
+{ fetchurl, stdenv, glib, xlibs, cairo, gtk}:
+let
+  libPath = stdenv.lib.makeLibraryPath [glib xlibs.libX11 gtk cairo];
+in
+assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
+
+stdenv.mkDerivation rec {
+  name = "sublimetext-2.0.1";
+  src = 
+    if stdenv.system == "i686-linux" then
+      fetchurl {
+        name = "sublimetext-2.0.1.tar.bz2";
+        url = http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%202.0.1.tar.bz2;
+        sha256 = "1x6vmlfn5mdbf23nyfr7dhhi6y60lnpcmqj59svl3bzvayijsxaf";
+      }
+    else
+      fetchurl {
+        name = "sublimetext-2.0.1.tar.bz2";
+        url = http://c758482.r82.cf2.rackcdn.com/Sublime%20Text%202.0.1%20x64.tar.bz2;
+        sha256 = "0174dnp9zika5as25mcls5y0qzhh8mnc5ajxsxz7qjrk4lrzk3c5";
+      };
+  buildCommand = ''
+    tar xvf ${src}
+    mkdir -p $out/bin
+    mv Sublime* $out/sublime
+    ln -s $out/sublime/sublime_text $out/bin/sublime
+
+    echo ${libPath}
+    patchelf \
+      --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
+      --set-rpath ${libPath}:${stdenv.gcc.gcc}/lib${stdenv.lib.optionalString stdenv.is64bit "64"} \
+      $out/sublime/sublime_text
+  '';
+
+  meta = {
+    description = "Sublime Text is a 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 7e03fd6b7b30..9e6b700f9efa 100644
--- a/pkgs/applications/editors/vim/configurable.nix
+++ b/pkgs/applications/editors/vim/configurable.nix
@@ -46,14 +46,14 @@ composableDerivation {} {
       ;
 
   cfg = {
-    pythonSupport    = getConfig [ "vim" "python" ] true;
-    darwinSupport    = getConfig [ "vim" "darwin" ] false;
-    nlsSupport       = getConfig [ "vim" "nls" ] false;
-    tclSupport       = getConfig [ "vim" "tcl" ] false;
-    multibyteSupport = getConfig [ "vim" "multibyte" ] false;
-    cscopeSupport    = getConfig [ "vim" "cscope" ] false;
+    pythonSupport    = config.vim.python or true;
+    darwinSupport    = config.vim.darwin or false;
+    nlsSupport       = config.vim.nls or false;
+    tclSupport       = config.vim.tcl or false;
+    multibyteSupport = config.vim.multibyte or false;
+    cscopeSupport    = config.vim.cscope or false;
     # add .nix filetype detection and minimal syntax highlighting support
-    ftNixSupport     = getConfig [ "vim" "ftNix" ] true;
+    ftNixSupport     = config.vim.ftNix or true;
   };
 
   #--enable-gui=OPTS     X11 GUI default=auto OPTS=auto/no/gtk/gtk2/gnome/gnome2/motif/athena/neXtaw/photon/carbon
diff --git a/pkgs/applications/graphics/darktable/default.nix b/pkgs/applications/graphics/darktable/default.nix
index 4d3b1a12b62b..15d7042e7dd8 100644
--- a/pkgs/applications/graphics/darktable/default.nix
+++ b/pkgs/applications/graphics/darktable/default.nix
@@ -3,17 +3,17 @@
 , libgnome_keyring, gphoto2, gtk, ilmbase, intltool, lcms, lcms2
 , lensfun, libXau, libXdmcp, libexif, libglade, libgphoto2, libjpeg
 , libpng, libpthreadstubs, libraw1394, librsvg, libtiff, libxcb
-, openexr, pixman, pkgconfig, sqlite }:
+, openexr, pixman, pkgconfig, sqlite, bash }:
 
 assert stdenv ? glibc;
 
 stdenv.mkDerivation rec {
-  version = "1.0";
+  version = "1.0.5";
   name = "darktable-${version}";
 
   src = fetchurl {
     url = "mirror://sourceforge/darktable/darktable-${version}.tar.gz";
-    sha256 = "0wjv2x62kf25db61ivbn8y8xr9hr8hdlcjq6l1qxfqn2bn8a3qkm";
+    sha256 = "0c18530446d2f2459fe533a1ef6fc2711300efe7466f36c23168ec2230fb5fbd";
   };
 
   buildInputs =
@@ -30,6 +30,8 @@ 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 = [
diff --git a/pkgs/applications/graphics/dia/default.nix b/pkgs/applications/graphics/dia/default.nix
index f0c666b14ea0..7662d64e9de7 100644
--- a/pkgs/applications/graphics/dia/default.nix
+++ b/pkgs/applications/graphics/dia/default.nix
@@ -20,6 +20,8 @@ stdenv.mkDerivation rec {
 
   configureFlags = stdenv.lib.optionalString withGNOME "--enable-gnome";
 
+  patches = [ ./glib-top-level-header.patch ];
+
   meta = {
     description = "Gnome Diagram drawing software";
     homepage = http://live.gnome.org/Dia;
diff --git a/pkgs/applications/graphics/dia/glib-top-level-header.patch b/pkgs/applications/graphics/dia/glib-top-level-header.patch
new file mode 100644
index 000000000000..80460ae9d722
--- /dev/null
+++ b/pkgs/applications/graphics/dia/glib-top-level-header.patch
@@ -0,0 +1,471 @@
+diff -Naur dia-0.97.2-orig/app/app_procs.c dia-0.97.2/app/app_procs.c
+--- dia-0.97.2-orig/app/app_procs.c	2011-03-20 07:18:13.000000000 -0400
++++ dia-0.97.2/app/app_procs.c	2012-07-15 10:49:08.192726306 -0400
+@@ -50,7 +50,7 @@
+ #include <libxml/parser.h>
+ #include <libxml/xmlerror.h>
+ 
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #include "intl.h"
+ #include "app_procs.h"
+diff -Naur dia-0.97.2-orig/app/dia-win-remote.c dia-0.97.2/app/dia-win-remote.c
+--- dia-0.97.2-orig/app/dia-win-remote.c	2010-08-03 11:35:35.000000000 -0400
++++ dia-0.97.2/app/dia-win-remote.c	2012-07-15 10:49:08.159726316 -0400
+@@ -35,7 +35,7 @@
+ #include <shellapi.h>
+ #include <Shlwapi.h>
+ #include <glib.h>
+-#include <glib/gprintf.h>
++#include <glib.h>
+ 
+ /**
+  * PROTOTYPES:
+diff -Naur dia-0.97.2-orig/app/filedlg.c dia-0.97.2/app/filedlg.c
+--- dia-0.97.2-orig/app/filedlg.c	2009-11-07 12:13:53.000000000 -0500
++++ dia-0.97.2/app/filedlg.c	2012-07-15 10:49:08.227726294 -0400
+@@ -28,7 +28,7 @@
+ #include <unistd.h>
+ #endif
+ #include <stdio.h>
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #undef GTK_DISABLE_DEPRECATED /* gtk_file_chooser_dialog_new_with_backend */
+ #include <gtk/gtk.h>
+diff -Naur dia-0.97.2-orig/app/load_save.c dia-0.97.2/app/load_save.c
+--- dia-0.97.2-orig/app/load_save.c	2011-09-25 07:55:11.000000000 -0400
++++ dia-0.97.2/app/load_save.c	2012-07-15 10:49:08.203726303 -0400
+@@ -30,7 +30,7 @@
+ #include <string.h>
+ 
+ #include <glib.h>
+-#include <glib/gstdio.h> /* g_access() and friends */
++#include <glib.h> /* g_access() and friends */
+ #include <errno.h>
+ 
+ #ifndef W_OK
+diff -Naur dia-0.97.2-orig/app/sheets_dialog_callbacks.c dia-0.97.2/app/sheets_dialog_callbacks.c
+--- dia-0.97.2-orig/app/sheets_dialog_callbacks.c	2009-11-07 12:13:53.000000000 -0500
++++ dia-0.97.2/app/sheets_dialog_callbacks.c	2012-07-15 10:49:08.201726302 -0400
+@@ -44,7 +44,7 @@
+ #endif
+ #endif
+ 
+-#include <glib/gstdio.h>
++#include <glib.h>
+ #include <gmodule.h>
+ 
+ #undef GTK_DISABLE_DEPRECATED /* GtkOptionMenu */
+diff -Naur dia-0.97.2-orig/ChangeLog.pre-git dia-0.97.2/ChangeLog.pre-git
+--- dia-0.97.2-orig/ChangeLog.pre-git	2009-11-07 09:28:34.000000000 -0500
++++ dia-0.97.2/ChangeLog.pre-git	2012-07-15 10:49:08.384726247 -0400
+@@ -4137,7 +4137,7 @@
+ 	  plug-ins/vdx/vdx-export.c plug-ins/vdx/vdx-import.c 
+ 	  plug-ins/wmf/wmf.cpp plug-ins/wpg/wpg.c 
+ 	  plug-ins/xfig/xfig-export.c plug-ins/xfig/xfig-import.c
+-	  plug-ins/xslt/xslt.c : use <glib/gstdio.h> to match GLib's filename
++	  plug-ins/xslt/xslt.c : use <glib.h> to match GLib's filename
+ 	encoding to the io functions used, that is: g_open, g_fopen, g_stat, 
+ 	g_unlink, g_mkdir, g_rename (, g_access, g_lstat, g_remove, g_freopen, 
+ 	g_chdir, g_rmdir). Also replace gzopen() with gzdopen(g_open(), ...)
+@@ -5995,7 +5995,7 @@
+ 	Also special case strings starting with \tex - i.e. dont escape them -
+ 	to keep the use-case of direct tex input.
+ 	
+-	* lib/debug.c : #include <glib/gprintf.h> not just <gprintf.h>
++	* lib/debug.c : #include <glib.h>
+ 
+ 
+ 2006-01-14  Hans Breuer  <hans@breuer.org>
+@@ -6207,7 +6207,7 @@
+ 	* lib/makefile.msc : build debug.obj
+ 
+ 	* plug-ins/makefile.msc : building pgf in the right alphabetical order
+-	* plug-ins/pgf/render_pgf.c : include <glib/gprintf.h>
++	* plug-ins/pgf/render_pgf.c : include <glib.h>
+ 	
+ 2005-12-08  Lars Clausen  <lars@raeder.dk>
+ 
+diff -Naur dia-0.97.2-orig/lib/debug.c dia-0.97.2/lib/debug.c
+--- dia-0.97.2-orig/lib/debug.c	2009-11-07 09:28:34.000000000 -0500
++++ dia-0.97.2/lib/debug.c	2012-07-15 10:49:06.813726730 -0400
+@@ -21,7 +21,7 @@
+ #include <config.h>
+ 
+ #include <stdio.h>
+-#include <glib/gprintf.h>
++#include <glib.h>
+ #include <stdarg.h>
+ 
+ #include "debug.h"
+diff -Naur dia-0.97.2-orig/lib/dia_dirs.c dia-0.97.2/lib/dia_dirs.c
+--- dia-0.97.2-orig/lib/dia_dirs.c	2009-11-07 12:13:53.000000000 -0500
++++ dia-0.97.2/lib/dia_dirs.c	2012-07-15 10:49:06.740726750 -0400
+@@ -30,7 +30,7 @@
+ #include <sys/stat.h>
+ #include <sys/types.h>
+ #endif
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ /** Get the name of a subdirectory of our data directory.
+  *  This function does not create the subdirectory, just make the correct name.
+diff -Naur dia-0.97.2-orig/lib/dia_xml.c dia-0.97.2/lib/dia_xml.c
+--- dia-0.97.2-orig/lib/dia_xml.c	2009-11-07 09:28:34.000000000 -0500
++++ dia-0.97.2/lib/dia_xml.c	2012-07-15 10:49:06.770726743 -0400
+@@ -25,7 +25,7 @@
+ #include <fcntl.h>
+ 
+ #include <glib.h>
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #include <libxml/parser.h>
+ #include <libxml/parserInternals.h>
+diff -Naur dia-0.97.2-orig/objects/custom/shape_typeinfo.c dia-0.97.2/objects/custom/shape_typeinfo.c
+--- dia-0.97.2-orig/objects/custom/shape_typeinfo.c	2009-11-07 09:28:34.000000000 -0500
++++ dia-0.97.2/objects/custom/shape_typeinfo.c	2012-07-15 10:49:06.639726783 -0400
+@@ -27,8 +27,8 @@
+ #include "custom_util.h"
+ #include <string.h>
+ #include <stdarg.h>
+-#include <glib/gstrfuncs.h>
+-#include <glib/gstdio.h>
++#include <glib.h>
++#include <glib.h>
+ #include <libxml/parser.h>
+ 
+ /*
+diff -Naur dia-0.97.2-orig/objects/SISSI/sissi.c dia-0.97.2/objects/SISSI/sissi.c
+--- dia-0.97.2-orig/objects/SISSI/sissi.c	2009-11-07 09:28:34.000000000 -0500
++++ dia-0.97.2/objects/SISSI/sissi.c	2012-07-15 10:49:06.570726804 -0400
+@@ -42,7 +42,7 @@
+ #include "dia_xml_libxml.h"
+ 
+ #include <string.h>
+-#include <glib/gprintf.h>
++#include <glib.h>
+ 
+ #define DEFAULT_WIDTH  1.0
+ #define DEFAULT_HEIGHT 1.0
+diff -Naur dia-0.97.2-orig/objects/standard/image.c dia-0.97.2/objects/standard/image.c
+--- dia-0.97.2-orig/objects/standard/image.c	2009-11-07 12:13:53.000000000 -0500
++++ dia-0.97.2/objects/standard/image.c	2012-07-15 10:49:06.683726770 -0400
+@@ -25,7 +25,7 @@
+ #ifdef HAVE_UNIST_H
+ #include <unistd.h>
+ #endif
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #include "intl.h"
+ #include "message.h"
+diff -Naur dia-0.97.2-orig/plug-ins/cairo/diacairo.c dia-0.97.2/plug-ins/cairo/diacairo.c
+--- dia-0.97.2-orig/plug-ins/cairo/diacairo.c	2009-11-07 12:13:53.000000000 -0500
++++ dia-0.97.2/plug-ins/cairo/diacairo.c	2012-07-15 10:49:06.433726846 -0400
+@@ -28,7 +28,7 @@
+ #include <errno.h>
+ #define G_LOG_DOMAIN "DiaCairo"
+ #include <glib.h>
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ /*
+  * To me the following looks rather suspicious. Why do we need to compile
+diff -Naur dia-0.97.2-orig/plug-ins/cairo/diacairo-renderer.c dia-0.97.2/plug-ins/cairo/diacairo-renderer.c
+--- dia-0.97.2-orig/plug-ins/cairo/diacairo-renderer.c	2011-01-07 06:54:21.000000000 -0500
++++ dia-0.97.2/plug-ins/cairo/diacairo-renderer.c	2012-07-15 10:49:06.435726846 -0400
+@@ -28,7 +28,7 @@
+ #include <errno.h>
+ #define G_LOG_DOMAIN "DiaCairo"
+ #include <glib.h>
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #ifdef HAVE_PANGOCAIRO_H
+ #include <pango/pangocairo.h>
+diff -Naur dia-0.97.2-orig/plug-ins/cgm/cgm.c dia-0.97.2/plug-ins/cgm/cgm.c
+--- dia-0.97.2-orig/plug-ins/cgm/cgm.c	2009-12-27 11:22:38.000000000 -0500
++++ dia-0.97.2/plug-ins/cgm/cgm.c	2012-07-15 10:49:06.425726846 -0400
+@@ -31,7 +31,7 @@
+ #include <glib.h>
+ #include <errno.h>
+ 
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #include "intl.h"
+ #include "message.h"
+diff -Naur dia-0.97.2-orig/plug-ins/drs/dia-render-script.c dia-0.97.2/plug-ins/drs/dia-render-script.c
+--- dia-0.97.2-orig/plug-ins/drs/dia-render-script.c	2009-11-07 12:13:53.000000000 -0500
++++ dia-0.97.2/plug-ins/drs/dia-render-script.c	2012-07-15 10:49:06.427726848 -0400
+@@ -54,7 +54,7 @@
+ 
+ #define G_LOG_DOMAIN "DiaRenderScript"
+ #include <glib.h>
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #include "intl.h"
+ #include "filter.h"
+diff -Naur dia-0.97.2-orig/plug-ins/dxf/dxf-export.c dia-0.97.2/plug-ins/dxf/dxf-export.c
+--- dia-0.97.2-orig/plug-ins/dxf/dxf-export.c	2009-11-07 09:28:34.000000000 -0500
++++ dia-0.97.2/plug-ins/dxf/dxf-export.c	2012-07-15 10:49:06.421726850 -0400
+@@ -29,7 +29,7 @@
+ #include <math.h>
+ #include <glib.h>
+ #include <errno.h>
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #include "autocad_pal.h"
+ 
+diff -Naur dia-0.97.2-orig/plug-ins/dxf/dxf-import.c dia-0.97.2/plug-ins/dxf/dxf-import.c
+--- dia-0.97.2-orig/plug-ins/dxf/dxf-import.c	2009-11-07 09:28:34.000000000 -0500
++++ dia-0.97.2/plug-ins/dxf/dxf-import.c	2012-07-15 10:49:06.419726851 -0400
+@@ -30,7 +30,7 @@
+ #include <string.h>
+ #include <math.h>
+ #include <glib.h>
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #include "intl.h"
+ #include "message.h"
+diff -Naur dia-0.97.2-orig/plug-ins/hpgl/hpgl.c dia-0.97.2/plug-ins/hpgl/hpgl.c
+--- dia-0.97.2-orig/plug-ins/hpgl/hpgl.c	2009-11-07 09:28:34.000000000 -0500
++++ dia-0.97.2/plug-ins/hpgl/hpgl.c	2012-07-15 10:49:06.487726830 -0400
+@@ -37,7 +37,7 @@
+ #include <errno.h>
+ 
+ #include <glib.h>
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #include "intl.h"
+ #include "message.h"
+diff -Naur dia-0.97.2-orig/plug-ins/libart/export_png.c dia-0.97.2/plug-ins/libart/export_png.c
+--- dia-0.97.2-orig/plug-ins/libart/export_png.c	2011-07-03 06:56:08.000000000 -0400
++++ dia-0.97.2/plug-ins/libart/export_png.c	2012-07-15 10:49:06.415726849 -0400
+@@ -29,7 +29,7 @@
+ #include <errno.h>
+ #include <stdlib.h>
+ 
+-#include <glib/gstdio.h>
++#include <glib.h>
+ #include <gtk/gtk.h>
+ 
+ #include "intl.h"
+diff -Naur dia-0.97.2-orig/plug-ins/metapost/render_metapost.c dia-0.97.2/plug-ins/metapost/render_metapost.c
+--- dia-0.97.2-orig/plug-ins/metapost/render_metapost.c	2009-11-07 09:28:34.000000000 -0500
++++ dia-0.97.2/plug-ins/metapost/render_metapost.c	2012-07-15 10:49:06.396726857 -0400
+@@ -43,7 +43,7 @@
+ #endif
+ #include <errno.h>
+ 
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #include "intl.h"
+ #include "render_metapost.h"
+diff -Naur dia-0.97.2-orig/plug-ins/pgf/render_pgf.c dia-0.97.2/plug-ins/pgf/render_pgf.c
+--- dia-0.97.2-orig/plug-ins/pgf/render_pgf.c	2011-01-07 07:11:34.000000000 -0500
++++ dia-0.97.2/plug-ins/pgf/render_pgf.c	2012-07-15 10:49:06.445726842 -0400
+@@ -61,8 +61,8 @@
+ #endif
+ #include <errno.h>
+ 
+-#include <glib/gprintf.h>
+-#include <glib/gstdio.h>
++#include <glib.h>
++#include <glib.h>
+ 
+ #include "intl.h"
+ #include "render_pgf.h"
+diff -Naur dia-0.97.2-orig/plug-ins/postscript/paginate_psprint.c dia-0.97.2/plug-ins/postscript/paginate_psprint.c
+--- dia-0.97.2-orig/plug-ins/postscript/paginate_psprint.c	2009-11-07 09:28:34.000000000 -0500
++++ dia-0.97.2/plug-ins/postscript/paginate_psprint.c	2012-07-15 10:49:06.451726838 -0400
+@@ -31,7 +31,7 @@
+ #include <errno.h>
+ #include <sys/stat.h>
+ 
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #include "intl.h"
+ #include "message.h"
+diff -Naur dia-0.97.2-orig/plug-ins/postscript/render_eps.c dia-0.97.2/plug-ins/postscript/render_eps.c
+--- dia-0.97.2-orig/plug-ins/postscript/render_eps.c	2009-11-07 09:28:34.000000000 -0500
++++ dia-0.97.2/plug-ins/postscript/render_eps.c	2012-07-15 10:49:06.451726838 -0400
+@@ -55,7 +55,7 @@
+ #include <locale.h>
+ #include <errno.h>
+ 
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #include "intl.h"
+ #include "render_eps.h"
+diff -Naur dia-0.97.2-orig/plug-ins/pstricks/render_pstricks.c dia-0.97.2/plug-ins/pstricks/render_pstricks.c
+--- dia-0.97.2-orig/plug-ins/pstricks/render_pstricks.c	2011-01-07 07:11:34.000000000 -0500
++++ dia-0.97.2/plug-ins/pstricks/render_pstricks.c	2012-07-15 10:49:06.410726853 -0400
+@@ -50,7 +50,7 @@
+ #endif
+ #include <errno.h>
+ 
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #include "intl.h"
+ #include "render_pstricks.h"
+diff -Naur dia-0.97.2-orig/plug-ins/python/pydia-render.c dia-0.97.2/plug-ins/python/pydia-render.c
+--- dia-0.97.2-orig/plug-ins/python/pydia-render.c	2009-11-07 09:28:34.000000000 -0500
++++ dia-0.97.2/plug-ins/python/pydia-render.c	2012-07-15 10:49:06.503726822 -0400
+@@ -21,7 +21,7 @@
+ 
+ #include <Python.h>
+ #include <glib.h>
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #include <locale.h>
+ 
+diff -Naur dia-0.97.2-orig/plug-ins/shape/shape-export.c dia-0.97.2/plug-ins/shape/shape-export.c
+--- dia-0.97.2-orig/plug-ins/shape/shape-export.c	2009-11-08 06:14:56.000000000 -0500
++++ dia-0.97.2/plug-ins/shape/shape-export.c	2012-07-15 10:49:06.489726827 -0400
+@@ -40,7 +40,7 @@
+ #include <unistd.h>
+ #endif
+ 
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ /* the dots per centimetre to render this diagram at */
+ /* this matches the setting `100%' setting in dia. */
+diff -Naur dia-0.97.2-orig/plug-ins/svg/render_svg.c dia-0.97.2/plug-ins/svg/render_svg.c
+--- dia-0.97.2-orig/plug-ins/svg/render_svg.c	2011-12-17 11:30:38.000000000 -0500
++++ dia-0.97.2/plug-ins/svg/render_svg.c	2012-07-15 10:49:06.392726859 -0400
+@@ -30,7 +30,7 @@
+ #endif
+ 
+ #include <glib.h>
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #include <libxml/entities.h>
+ #include <libxml/tree.h>
+diff -Naur dia-0.97.2-orig/plug-ins/vdx/vdx-export.c dia-0.97.2/plug-ins/vdx/vdx-export.c
+--- dia-0.97.2-orig/plug-ins/vdx/vdx-export.c	2009-12-27 11:22:38.000000000 -0500
++++ dia-0.97.2/plug-ins/vdx/vdx-export.c	2012-07-15 10:55:17.066579728 -0400
+@@ -32,11 +32,12 @@
+ 
+ #include <string.h>
+ #include <math.h>
++#include <sys/stat.h>
+ #include <glib.h>
+ #include <stdlib.h>
+ #include <errno.h>
+ #include <locale.h>
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #include "intl.h"
+ #include "message.h"
+diff -Naur dia-0.97.2-orig/plug-ins/vdx/vdx-import.c dia-0.97.2/plug-ins/vdx/vdx-import.c
+--- dia-0.97.2-orig/plug-ins/vdx/vdx-import.c	2009-12-27 11:22:38.000000000 -0500
++++ dia-0.97.2/plug-ins/vdx/vdx-import.c	2012-07-15 10:49:06.466726836 -0400
+@@ -28,7 +28,7 @@
+ #include <string.h>
+ #include <math.h>
+ #include <glib.h>
+-#include <glib/gstdio.h>
++#include <glib.h>
+ #include <stdlib.h>
+ #include <ctype.h>
+ #include <libxml/tree.h>
+diff -Naur dia-0.97.2-orig/plug-ins/wmf/wmf.cpp dia-0.97.2/plug-ins/wmf/wmf.cpp
+--- dia-0.97.2-orig/plug-ins/wmf/wmf.cpp	2011-03-13 09:07:48.000000000 -0400
++++ dia-0.97.2/plug-ins/wmf/wmf.cpp	2012-07-15 10:49:06.482726831 -0400
+@@ -25,7 +25,7 @@
+ #include <string.h>
+ #include <math.h>
+ #include <glib.h>
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #include "intl.h"
+ #include "message.h"
+diff -Naur dia-0.97.2-orig/plug-ins/wpg/wpg.c dia-0.97.2/plug-ins/wpg/wpg.c
+--- dia-0.97.2-orig/plug-ins/wpg/wpg.c	2009-11-07 09:28:34.000000000 -0500
++++ dia-0.97.2/plug-ins/wpg/wpg.c	2012-07-15 10:49:06.406726855 -0400
+@@ -40,7 +40,7 @@
+ #include <errno.h>
+ 
+ #include <glib.h>
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #include "intl.h"
+ #include "message.h"
+diff -Naur dia-0.97.2-orig/plug-ins/xfig/xfig-export.c dia-0.97.2/plug-ins/xfig/xfig-export.c
+--- dia-0.97.2-orig/plug-ins/xfig/xfig-export.c	2011-12-17 11:30:38.000000000 -0500
++++ dia-0.97.2/plug-ins/xfig/xfig-export.c	2012-07-15 10:49:06.400726856 -0400
+@@ -16,7 +16,7 @@
+ #include <locale.h>
+ 
+ #include <glib.h>
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #include "intl.h"
+ #include "message.h"
+diff -Naur dia-0.97.2-orig/plug-ins/xfig/xfig-import.c dia-0.97.2/plug-ins/xfig/xfig-import.c
+--- dia-0.97.2-orig/plug-ins/xfig/xfig-import.c	2009-11-07 12:13:53.000000000 -0500
++++ dia-0.97.2/plug-ins/xfig/xfig-import.c	2012-07-15 10:49:06.402726853 -0400
+@@ -40,7 +40,7 @@
+ #include <locale.h>
+ 
+ #include <glib.h>
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #include "intl.h"
+ #include "message.h"
+diff -Naur dia-0.97.2-orig/plug-ins/xslt/xslt.c dia-0.97.2/plug-ins/xslt/xslt.c
+--- dia-0.97.2-orig/plug-ins/xslt/xslt.c	2009-11-07 12:13:53.000000000 -0500
++++ dia-0.97.2/plug-ins/xslt/xslt.c	2012-07-15 10:49:06.440726844 -0400
+@@ -27,7 +27,7 @@
+ #include <string.h>
+ #include <errno.h>
+ 
+-#include <glib/gstdio.h>
++#include <glib.h>
+ 
+ #include "filter.h"
+ #include "intl.h"
+diff -Naur dia-0.97.2-orig/tests/test-boundingbox.c dia-0.97.2/tests/test-boundingbox.c
+--- dia-0.97.2-orig/tests/test-boundingbox.c	2009-11-07 09:28:35.000000000 -0500
++++ dia-0.97.2/tests/test-boundingbox.c	2012-07-15 10:49:06.986726677 -0400
+@@ -29,7 +29,7 @@
+ #include <glib-object.h>
+ 
+ #if GLIB_CHECK_VERSION(2,16,0)
+-#include <glib/gtestutils.h>
++#include <glib.h>
+ #endif
+ #include "dialib.h"
+ 
+diff -Naur dia-0.97.2-orig/tests/test-objects.c dia-0.97.2/tests/test-objects.c
+--- dia-0.97.2-orig/tests/test-objects.c	2009-11-07 09:28:35.000000000 -0500
++++ dia-0.97.2/tests/test-objects.c	2012-07-15 10:49:06.985726677 -0400
+@@ -29,7 +29,7 @@
+ #include <glib-object.h>
+ 
+ #if GLIB_CHECK_VERSION(2,16,0)
+-#include <glib/gtestutils.h>
++#include <glib.h>
+ #endif
+ 
+ #include "object.h"
diff --git a/pkgs/applications/graphics/f-spot/default.nix b/pkgs/applications/graphics/f-spot/default.nix
index 17a3cd22a5fa..856795ea3562 100644
--- a/pkgs/applications/graphics/f-spot/default.nix
+++ b/pkgs/applications/graphics/f-spot/default.nix
@@ -1,14 +1,16 @@
 { stdenv, fetchurl, perl, perlXMLParser, pkgconfig, mono, libexif
 , libgnome, libgnomeui, gtksharp, libjpeg, sqlite, lcms, libgphoto2
 , monoDLLFixer
+, makeWrapper
 }:
 
 stdenv.mkDerivation {
   name = "f-spot-0.0.10";
 
   builder = ./builder.sh;
-  makeWrapper = ../../../build-support/make-wrapper/make-wrapper.sh;
   
+  inherit makeWrapper;
+
   src = fetchurl {
     url = http://nixos.org/tarballs/f-spot-0.0.10.tar.bz2;
     md5 = "19cc6e067ccc261b0502ff6189b79832";
diff --git a/pkgs/applications/graphics/geeqie/default.nix b/pkgs/applications/graphics/geeqie/default.nix
index a166fc7010e1..2506b26e238a 100644
--- a/pkgs/applications/graphics/geeqie/default.nix
+++ b/pkgs/applications/graphics/geeqie/default.nix
@@ -2,11 +2,11 @@
 , intltool, gettext, libchamplain_0_6, fbida }:
 
 stdenv.mkDerivation rec {
-  name = "geeqie-1.0";
+  name = "geeqie-1.1";
 
   src = fetchurl {
     url = "mirror://sourceforge/geeqie/${name}.tar.gz";
-    sha256 = "1p8z47cqdqqkn8b0fr5bqsfinz4dgqk4353s8f8d9ha6cik69bfi";
+    sha256 = "1kzy39z9505xkayyx7rjj2wda76xy3ch1s5z35zn8yli54ffhi2m";
   };
 
   preConfigure =
diff --git a/pkgs/applications/graphics/gimp/2.8.nix b/pkgs/applications/graphics/gimp/2.8.nix
index bf29ae13e5e7..44d9330043fb 100644
--- a/pkgs/applications/graphics/gimp/2.8.nix
+++ b/pkgs/applications/graphics/gimp/2.8.nix
@@ -4,11 +4,11 @@
 , python, pygtk, libart_lgpl, libexif, gettext, xlibs }:
 
 stdenv.mkDerivation rec {
-  name = "gimp-2.8.0";
+  name = "gimp-2.8.2";
   
   src = fetchurl {
     url = "ftp://ftp.gimp.org/pub/gimp/v2.8/${name}.tar.bz2";
-    md5 = "28997d14055f15db063eb92e1c8a7ebb";
+    md5 = "b542138820ca3a41cbd63fc331907955";
   };
   
   buildInputs = 
diff --git a/pkgs/applications/graphics/inkscape/default.nix b/pkgs/applications/graphics/inkscape/default.nix
index 9ef5382eaf96..150bb071cb16 100644
--- a/pkgs/applications/graphics/inkscape/default.nix
+++ b/pkgs/applications/graphics/inkscape/default.nix
@@ -4,11 +4,11 @@
 , gsl, python, pyxml, lxml, poppler, imagemagick, libwpg }:
 
 stdenv.mkDerivation rec {
-  name = "inkscape-0.48.2";
+  name = "inkscape-0.48.3.1";
 
   src = fetchurl {
     url = "mirror://sourceforge/inkscape/${name}.tar.bz2";
-    sha256 = "10v7ixdz7f8vgk2wv0m81zli9p0f446cm1f4aqlvni1ndsx44fi2";
+    sha256 = "126vfsafkfj6z65i5vp6g5dg9hvp3dd1zppjhms78257ns2zafq7";
   };
 
   patches = [ ./configure-python-libs.patch ./libpng-1.5.patch ];
diff --git a/pkgs/applications/graphics/pqiv/default.nix b/pkgs/applications/graphics/pqiv/default.nix
index e13ea97cab86..3fd9d47374a3 100644
--- a/pkgs/applications/graphics/pqiv/default.nix
+++ b/pkgs/applications/graphics/pqiv/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, getopt, which, pkgconfig, gtk } :
 
 stdenv.mkDerivation (rec {
-  name = "pqiv-0.8";
+  name = "pqiv-0.12";
 
   src = fetchurl {
-    url = "http://www.pberndt.com/raw/Programme/Linux/pqiv/_download/${name}.tbz";
-    sha256 = "365332bab4b13ca56da6935e7155af20658e67d323808942dce23e880466f66d";
+    url = "https://github.com/downloads/phillipberndt/pqiv/${name}.tbz";
+    sha256 = "646c69f2f4e7289913f6b8e8ae984befba9debf0d2b4cc8af9955504a1fccf1e";
   };
 
   buildInputs = [ getopt which pkgconfig gtk ];
diff --git a/pkgs/applications/misc/adobe-reader/builder.sh b/pkgs/applications/misc/adobe-reader/builder.sh
index 174dd70ab04d..6024734dc444 100644
--- a/pkgs/applications/misc/adobe-reader/builder.sh
+++ b/pkgs/applications/misc/adobe-reader/builder.sh
@@ -3,35 +3,40 @@ source $stdenv/setup
 echo "unpacking $src..."
 tar xvfa $src
 
-mkdir -p $out/Adobe/Reader9
-
 echo "unpacking reader..."
-set +e
+p=$out/libexec/adobe-reader
+mkdir -p $out/libexec
 tar xvf AdobeReader/COMMON.TAR -C $out
 tar xvf AdobeReader/ILINXR.TAR -C $out
-set -e
+mv $out/Adobe/Reader9 $p
+rmdir $out/Adobe
 
 # Disable this plugin for now (it needs LDAP, and I'm too lazy to add it).
-rm $out/Adobe/Reader*/Reader/intellinux/plug_ins/PPKLite.api
+rm $p/Reader/intellinux/plug_ins/PPKLite.api
+
+# More pointless files.
+rm $p/bin/UNINSTALL
 
 patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
     --set-rpath $libPath \
-    $out/Adobe/Reader*/Reader/intellinux/bin/acroread
+    $p/Reader/intellinux/bin/acroread
 
 # The "xargs -r" is to shut up a warning when Mozilla can't be found.
-substituteInPlace $out/Adobe/Reader*/bin/acroread \
+substituteInPlace $p/bin/acroread \
     --replace /bin/pwd $(type -P pwd) \
     --replace /bin/ls $(type -P ls) \
     --replace xargs "xargs -r"
 
 mkdir -p $out/bin
-ln -s $out/Adobe/Reader*/bin/acroread $out/bin/acroread
+ln -s $p/bin/acroread $out/bin/acroread
 
 mkdir -p $out/share/applications
-mv $out/Adobe/Reader9/Resource/Support/AdobeReader.desktop $out/share/applications/
+mv $p/Resource/Support/AdobeReader.desktop $out/share/applications/
+icon=$p/Resource/Icons/128x128/AdobeReader9.png
+[ -e $icon ]
 sed -i $out/share/applications/AdobeReader.desktop \
-    -e "s|Icon=.*|Icon=$out/Adobe/Reader9/Resource/Icons/128x128/AdobeReader9.png|"
+    -e "s|Icon=.*|Icon=$icon|"
 
 # Not sure if this works.
 mkdir -p $out/share/mimelnk/application
-mv $out/Adobe/Reader9/Resource/Support/vnd*.desktop $out/share/mimelnk/application
+mv $p/Resource/Support/vnd*.desktop $out/share/mimelnk/application
diff --git a/pkgs/applications/misc/adobe-reader/default.nix b/pkgs/applications/misc/adobe-reader/default.nix
index 6eaf976faa46..46ccdb399467 100644
--- a/pkgs/applications/misc/adobe-reader/default.nix
+++ b/pkgs/applications/misc/adobe-reader/default.nix
@@ -3,23 +3,25 @@
 
 assert stdenv.system == "i686-linux";
 
+let version = "9.5.1"; in
+
 stdenv.mkDerivation {
-  name = "adobe-reader-9.4.7-1";
-  
+  name = "adobe-reader-${version}-1";
+
   builder = ./builder.sh;
-  
+
   src = fetchurl {
-    url = http://ardownload.adobe.com/pub/adobe/reader/unix/9.x/9.4.7/enu/AdbeRdr9.4.7-1_i486linux_enu.tar.bz2;
-    sha256 = "0bzx1rcwc9bi5jkh8f8hjb354zxlvvx37lhm0l2r0mjxj8fimfb5";
+    url = "http://ardownload.adobe.com/pub/adobe/reader/unix/9.x/${version}/enu/AdbeRdr${version}-1_i486linux_enu.tar.bz2";
+    sha256 = "19mwhbfsivb21zmrz2hllf0kh4i225ac697y026bakyysn0vig56";
   };
 
   # !!! Adobe Reader contains copies of OpenSSL, libcurl, and libicu.
   # We should probably remove those and use the regular Nixpkgs
   # versions.
-  
+
   libPath = stdenv.lib.makeLibraryPath
     [ stdenv.gcc.gcc libX11 zlib libxml2 cups pango atk gtk glib gdk_pixbuf ];
-  
+
   meta = {
     description = "Adobe Reader, a viewer for PDF documents";
     homepage = http://www.adobe.com/products/reader;
diff --git a/pkgs/applications/misc/blender/default.nix b/pkgs/applications/misc/blender/default.nix
index e8307a79cf75..828d55ad4789 100644
--- a/pkgs/applications/misc/blender/default.nix
+++ b/pkgs/applications/misc/blender/default.nix
@@ -20,7 +20,9 @@ stdenv.mkDerivation rec {
     "-DPYTHON_LIBPATH=${python}/lib"
   ];
 
-  NIX_CFLAGS_COMPILE = "-iquote ${ilmbase}/include/OpenEXR -I${python}/include/${python.libPrefix}";
+  NIX_CFLAGS_COMPILE = "-I${ilmbase}/include/OpenEXR -I${python}/include/${python.libPrefix}";
+
+  enableParallelBuilding = true;
 
   meta = {
     description = "3D Creation/Animation/Publishing System";
diff --git a/pkgs/applications/misc/calibre/default.nix b/pkgs/applications/misc/calibre/default.nix
index d902fe3ffa13..b9b148483702 100644
--- a/pkgs/applications/misc/calibre/default.nix
+++ b/pkgs/applications/misc/calibre/default.nix
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
     [ python pyqt4 sip popplerQt4 libpng imagemagick libjpeg
       fontconfig podofo qt4 pil chmlib icu
       pythonPackages.mechanize pythonPackages.lxml pythonPackages.dateutil
-      pythonPackages.cssutils pythonPackages.beautifulsoap
+      pythonPackages.cssutils pythonPackages.beautifulsoup
       pythonPackages.sqlite3 sqlite
     ];
 
diff --git a/pkgs/applications/misc/dmenu/default.nix b/pkgs/applications/misc/dmenu/default.nix
index eae0b0ff233a..048514ad4aa2 100644
--- a/pkgs/applications/misc/dmenu/default.nix
+++ b/pkgs/applications/misc/dmenu/default.nix
@@ -1,4 +1,6 @@
-{stdenv, fetchurl, libX11, libXinerama}:
+{stdenv, fetchurl, libX11, libXinerama, enableXft, libXft, zlib}:
+
+with stdenv.lib;
 
 stdenv.mkDerivation rec {
   name = "dmenu-4.5";
@@ -8,7 +10,14 @@ stdenv.mkDerivation rec {
     sha256 = "0l58jpxrr80fmyw5pgw5alm5qry49aw6y049745wl991v2cdcb08";
   };
 
-  buildInputs = [ libX11 libXinerama ];
+  xftPatch = fetchurl {
+    url = "http://tools.suckless.org/dmenu/patches/${name}-xft.diff";
+    sha256 = "efb4095d65e5e86f9dde97294732174409c24f319bdd4824cc22fa1404972b4f";
+  };
+
+  buildInputs = [ libX11 libXinerama ] ++ optionals enableXft [zlib libXft];
+
+  patches = optional enableXft xftPatch;
 
   preConfigure = [ ''sed -i "s@PREFIX = /usr/local@PREFIX = $out@g" config.mk'' ];
 
diff --git a/pkgs/applications/misc/eaglemode/default.nix b/pkgs/applications/misc/eaglemode/default.nix
index 519db53ea18f..b9c8acb0d070 100644
--- a/pkgs/applications/misc/eaglemode/default.nix
+++ b/pkgs/applications/misc/eaglemode/default.nix
@@ -1,20 +1,20 @@
-{ stdenv, fetchurl, perl, libX11, xineLib, libjpeg, libpng, libtiff, pkgconfig,
+{ stdenv, fetchurl, perl, libX11, libjpeg, libpng, libtiff, pkgconfig,
 librsvg, glib, gtk, libXext, libXxf86vm, poppler }:
 
 stdenv.mkDerivation {
   name = "eaglemode-0.84.0";
- 
+
   src = fetchurl {
     url = mirror://sourceforge/eaglemode/eaglemode-0.84.0.tar.bz2;
     sha256 = "0n20b419j0l7h7jr4s3f3n09ka0ysg9nqs8mcwsrx24rcq7nv0cs";
   };
- 
-  buildInputs = [ perl libX11 xineLib libjpeg libpng libtiff pkgconfig 
+
+  buildInputs = [ perl libX11 libjpeg libpng libtiff pkgconfig
     librsvg glib gtk libXxf86vm libXext poppler ];
- 
+
   # The program tries to dlopen both Xxf86vm and Xext, so we use the
   # trick on NIX_LDFLAGS and dontPatchELF to make it find them.
-  # I use 'yes y' to skip a build error linking with xineLib, 
+  # I use 'yes y' to skip a build error linking with xineLib,
   # because xine stopped exporting "_x_vo_new_port"
   #  http://sourceforge.net/projects/eaglemode/forums/forum/808824/topic/5115261
   buildPhase = ''
@@ -30,7 +30,7 @@ stdenv.mkDerivation {
     # Run 'eaglemode.sh', not 'eaglemode'.
     ln -s $out/eaglemode.sh $out/bin/eaglemode.sh
   '';
- 
+
   meta = {
     homepage = "http://eaglemode.sourceforge.net";
     description = "Zoomable User Interface";
diff --git a/pkgs/applications/misc/epdfview/default.nix b/pkgs/applications/misc/epdfview/default.nix
index 3ce652c1a332..6941e8df626a 100644
--- a/pkgs/applications/misc/epdfview/default.nix
+++ b/pkgs/applications/misc/epdfview/default.nix
@@ -6,6 +6,7 @@ stdenv.mkDerivation rec {
     sha256 = "1w7qybh8ssl4dffi5qfajq8mndw7ipsd92vkim03nywxgjp4i1ll";
   };
   buildInputs = [ pkgconfig gtk poppler ];
+  patches = [ ./glib-top-level-header.patch ];
   meta = {
     homepage = http://trac.emma-soft.com/epdfview/;
     description = "A lightweight PDF document viewer using Poppler and GTK+";
diff --git a/pkgs/applications/misc/epdfview/glib-top-level-header.patch b/pkgs/applications/misc/epdfview/glib-top-level-header.patch
new file mode 100644
index 000000000000..a321ad3a2b67
--- /dev/null
+++ b/pkgs/applications/misc/epdfview/glib-top-level-header.patch
@@ -0,0 +1,12 @@
+diff -Naur epdfview-0.1.8-orig/src/gtk/StockIcons.h epdfview-0.1.8/src/gtk/StockIcons.h
+--- epdfview-0.1.8-orig/src/gtk/StockIcons.h	2011-05-28 06:24:57.000000000 -0400
++++ epdfview-0.1.8/src/gtk/StockIcons.h	2012-07-15 11:02:43.946339253 -0400
+@@ -18,7 +18,7 @@
+ #if !defined (__STOCK_ICONS_H__)
+ #define __STOCK_ICONS_H__
+ 
+-#include <glib/gmacros.h>
++#include <glib.h>
+ 
+ G_BEGIN_DECLS
+ 
diff --git a/pkgs/applications/misc/gmrun/default.nix b/pkgs/applications/misc/gmrun/default.nix
new file mode 100644
index 000000000000..930df87214ad
--- /dev/null
+++ b/pkgs/applications/misc/gmrun/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchurl, glib, gtk2, pkgconfig, popt }:
+
+let
+  version = "0.9.2";
+in
+
+stdenv.mkDerivation rec {
+  name = "gmrun-${version}";
+
+  src = fetchurl {
+    url = "http://downloads.sourceforge.net/project/gmrun/gmrun/${version}/${name}.tar.gz";
+    md5 = "6cef37a968006d9496fc56a7099c603c";
+  };
+
+  buildInputs = [ glib gtk2 pkgconfig popt ];
+
+  doCheck = true;
+
+  enableParallelBuilding = true;
+
+  patches = [
+      ./gcc43.patch
+      ./gmrun-0.9.2-xdg.patch
+    ];
+
+  meta = {
+    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.
+      Also, supports CTRL-R / CTRL-S / "!" for searching through history.
+      Running commands in a terminal with CTRL-Enter. URL handlers.
+    '';
+    homepage = "http://sourceforge.net/projects/gmrun/";
+    license = "GPL";
+    maintainers = [ stdenv.lib.maintainers.bbenoist ];
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/applications/misc/gmrun/gcc43.patch b/pkgs/applications/misc/gmrun/gcc43.patch
new file mode 100644
index 000000000000..60e4338e893d
--- /dev/null
+++ b/pkgs/applications/misc/gmrun/gcc43.patch
@@ -0,0 +1,51 @@
+--- a/src/gtkcompletionline.cc.orig	2003-11-16 11:55:07.000000000 +0100
++++ a/src/gtkcompletionline.cc	2008-05-08 08:51:22.000000000 +0200
+@@ -29,6 +29,7 @@
+ #include <set>
+ #include <sstream>
+ #include <string>
++#include <cstring>
+ #include <vector>
+ using namespace std;
+ 
+--- a/src/ci_string.h.orig	2001-05-16 16:39:31.000000000 +0200
++++ a/src/ci_string.h	2008-05-08 08:51:33.000000000 +0200
+@@ -7,6 +7,7 @@
+ #define __CI_STRING_H__
+ 
+ #include <string>
++#include <cstring>
+ #include <ctype.h>
+ 
+ struct ci_char_traits : public std::char_traits<char>
+--- a/src/prefs.cc.orig	2002-08-16 12:48:22.000000000 +0200
++++ a/src/prefs.cc	2008-05-08 08:51:54.000000000 +0200
+@@ -13,6 +13,7 @@
+ #include <fstream>
+ #include <iostream>
+ #include <stdio.h>
++#include <stdlib.h>
+ 
+ #include <list>
+ 
+--- a/src/main.cc.orig	2003-11-16 11:55:07.000000000 +0100
++++ a/src/main.cc	2008-05-08 09:03:11.000000000 +0200
+@@ -14,6 +14,7 @@
+ #include <gdk/gdkkeysyms.h>
+ 
+ #include <string>
++#include <cstring>
+ #include <iostream>
+ #include <sstream>
+ #include <vector>
+
+--- a/src/gtkcompletionline.cc.orig	2009-06-19 22:38:14.000000000 +0400
++++ a/src/gtkcompletionline.cc	2009-06-19 22:37:14.000000000 +0400
+@@ -376,7 +377,7 @@
+   return 0;
+ }
+ 
+-int my_alphasort(const void* va, const void* vb) {
++int my_alphasort(const dirent** va, const dirent** vb) {
+   const struct dirent** a = (const struct dirent**)va;
+   const struct dirent** b = (const struct dirent**)vb;
diff --git a/pkgs/applications/misc/gmrun/gmrun-0.9.2-xdg.patch b/pkgs/applications/misc/gmrun/gmrun-0.9.2-xdg.patch
new file mode 100644
index 000000000000..b5cd41a3c5b4
--- /dev/null
+++ b/pkgs/applications/misc/gmrun/gmrun-0.9.2-xdg.patch
@@ -0,0 +1,58 @@
+diff -ur a/src/history.cc src/history.cc
+--- a/src/history.cc	2002-08-17 15:19:31.000000000 +0200
++++ a/src/history.cc	2012-06-04 23:42:35.314653414 +0200
+@@ -24,8 +24,15 @@
+ HistoryFile::HistoryFile()
+ {
+   m_file_entries = 0;
+-  m_filename = g_get_home_dir();
+-  m_filename += "/.gmrun_history";
++  const char* filename = getenv("XDG_CACHE_HOME");
++  if (filename != 0 && *filename != '\0') {
++    m_filename = filename;
++    m_filename += "/gmrun_history";
++  }
++  else {
++    m_filename = g_get_home_dir();
++    m_filename += "/.gmrun_history";
++  }
+   m_current = 0;
+   m_default_set = false;
+   read_the_file();
+diff -ur a/src/prefs.cc src/prefs.cc
+--- a/src/prefs.cc	2012-06-04 22:35:00.671949439 +0200
++++ a/src/prefs.cc	2012-06-04 23:24:24.184445962 +0200
+@@ -35,12 +35,29 @@
+   file_name += GMRUNRC;
+   init(file_name);
+ 
+-  file_name = getenv("HOME");
+-  if (!file_name.empty()) {
++  file_name.clear();
++  const char* filename = getenv("XDG_CONFIG_HOME");
++  if (filename != 0 && *filename != '\0') {
++    file_name = filename;
+     string::iterator i = file_name.end() - 1;
+-    if (*i == '/') file_name.erase(i);
+-    file_name += "/.";
++    if (*i != '/') {
++      file_name += '/';
++    }
+     file_name += GMRUNRC;
++  }
++  else {
++    filename = getenv("HOME");
++    if (filename != 0 && *filename != '\0') {
++      file_name = filename;
++      string::iterator i = file_name.end() - 1;
++      if (*i != '/') {
++        file_name += '/';
++      }
++      file_name += '.';
++      file_name += GMRUNRC;
++    }
++  }
++  if (!file_name.empty()) {
+     init(file_name);
+   }
+ }
diff --git a/pkgs/applications/misc/gphoto2/default.nix b/pkgs/applications/misc/gphoto2/default.nix
index 9fff2943d305..022cb437c698 100644
--- a/pkgs/applications/misc/gphoto2/default.nix
+++ b/pkgs/applications/misc/gphoto2/default.nix
@@ -3,17 +3,27 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "gphoto2-2.4.11";
+  name = "gphoto2-2.4.14";
   
   src = fetchurl {
     url = "mirror://sourceforge/gphoto/${name}.tar.bz2";
-    sha256 = "0ah42b7rnqh0z8bb96z7cdycxdh5k19h6lmfc02kdhrhqdr3q81y";
+    sha256 = "08x1p8xhl65r79a6gn1fi63z1lspd5j55l05diiyzcwfxvqwsm47";
   };
   
   buildNativeInputs = [ pkgconfig gettext ];
   buildInputs = [ libgphoto2 libexif popt libjpeg readline libtool ];
   
   meta = {
+    description = "a ready to use set of digital camera software applications";
+    longDescription = ''
+
+      A set of command line utilities for manipulating over 1400 different
+      digital cameras. Through libgphoto2, it supports PTP, MTP, and much more..
+
+    '';
     homepage = http://www.gphoto.org/;
+    license = stdenv.lib.licenses.gpl2Plus;
+    platforms = with stdenv.lib.platforms; unix;
+    maintainers = with stdenv.lib.maintainers; [ jcumming ];
   };
 }
diff --git a/pkgs/applications/misc/grass/default.nix b/pkgs/applications/misc/grass/default.nix
index 067e43545737..6abf6da4a69f 100644
--- a/pkgs/applications/misc/grass/default.nix
+++ b/pkgs/applications/misc/grass/default.nix
@@ -1,4 +1,4 @@
-{getConfig, ...}@a:
+{ config, ... }@a:
 
 # You can set gui by exporting GRASS_GUI=..
 # see http://grass.itc.it/gdp/html_grass64/g.gui.html
@@ -36,31 +36,31 @@ a.composableDerivation.composableDerivation {} (fix: {
   ];
 
   cfg = {
-    _64bitSupport = getConfig ["grass" "64bitSupport"] true;
-    cursesSupport = getConfig ["grass" "curses"] true;
-    gdalSupport = getConfig ["grass" "gdal"] true;
-    pythonSupport = getConfig ["grass" "python"] true;
-    wxwidgetsSupport = getConfig ["grass" "wxwidgets"] true;
-    readlineSupport = getConfig ["grass" "readline"] true;
-    jpegSupport = getConfig ["grass" "jpeg"] true;
-    tiffSupport = getConfig ["grass" "tiff"] true;
-    pngSupport = getConfig ["grass" "png"] true;
-    tcltkSupport = getConfig ["grass" "tcltk"] true;
-    postgresSupport = getConfig ["grass" "postgres"] true;
-    mysqlSupport = getConfig ["grass" "mysql"] true;
-    sqliteSupport = getConfig ["grass" "sqlite"] true;
-    ffmpegSupport = getConfig ["grass" "ffmpeg"] true;
-    openglSupport = getConfig ["grass" "opengl"] true;
-    odbcSupport = getConfig ["grass" "odbc"] false; # fails to find libodbc - why ?
-    fftwSupport = getConfig ["grass" "fftw"] true;
-    blasSupport = getConfig ["grass" "blas"] true;
-    lapackSupport = getConfig ["grass" "lapack"] true;
-    cairoSupport = getConfig ["grass" "cairo"] true;
-    motifSupport = getConfig ["grass" "motif"] true;
-    freetypeSupport = getConfig ["grass" "freetype"] true;
-    projSupport = getConfig ["grass" "proj"] true;
-    opendwgSupport = getConfig ["grass" "dwg"] false;
-    largefileSupport = getConfig ["grass" "largefile"] true;
+    _64bitSupport = config.grass."64bitSupport" or true;
+    cursesSupport = config.grass.curses or true;
+    gdalSupport = config.grass.gdal or true;
+    pythonSupport = config.grass.python or true;
+    wxwidgetsSupport = config.grass.wxwidgets or true;
+    readlineSupport = config.grass.readline or true;
+    jpegSupport = config.grass.jpeg or true;
+    tiffSupport = config.grass.tiff or true;
+    pngSupport = config.grass.png or true;
+    tcltkSupport = config.grass.tcltk or true;
+    postgresSupport = config.grass.postgres or true;
+    mysqlSupport = config.grass.mysql or true;
+    sqliteSupport = config.grass.sqlite or true;
+    ffmpegSupport = config.grass.ffmpeg or true;
+    openglSupport = config.grass.opengl or true;
+    odbcSupport = config.grass.odbc or false; # fails to find libodbc - why ?
+    fftwSupport = config.grass.fftw or true;
+    blasSupport = config.grass.blas or true;
+    lapackSupport = config.grass.lapack or true;
+    cairoSupport = config.grass.cairo or true;
+    motifSupport = config.grass.motif or true;
+    freetypeSupport = config.grass.freetype or true;
+    projSupport = config.grass.proj or true;
+    opendwgSupport = config.grass.dwg or false;
+    largefileSupport = config.grass.largefile or true;
   };
 
   # ?? NLS support:                no
diff --git a/pkgs/applications/misc/jbidwatcher/default.nix b/pkgs/applications/misc/jbidwatcher/default.nix
index 70cd5d3faf4b..9b74b0c93a97 100644
--- a/pkgs/applications/misc/jbidwatcher/default.nix
+++ b/pkgs/applications/misc/jbidwatcher/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "jbidwatcher";
-  version = "2.1.5";
+  version = "2.5.2";
 
   name = "${pname}-${version}";
 
   src = fetchurl {
     url = "http://www.jbidwatcher.com/download/JBidwatcher-${version}.jar";
-    sha256 = "0nrs9ly56cqn33dm1sjm53pzj1cf7jncwn4c8v0xyva4jqyz2y5p";
+    sha256 = "07w75ryn8inm5i1829gabr8lifbycz40ynzsyaw22yzqk5if1n9l";
   };
 
   buildInputs = [ java ];
diff --git a/pkgs/applications/misc/mupdf/default.nix b/pkgs/applications/misc/mupdf/default.nix
index 20ded9486f77..eccd11f6041a 100644
--- a/pkgs/applications/misc/mupdf/default.nix
+++ b/pkgs/applications/misc/mupdf/default.nix
@@ -1,17 +1,18 @@
 { stdenv, fetchurl, pkgconfig, zlib, freetype, libjpeg, jbig2dec, openjpeg
 , libX11, libXext }:
 stdenv.mkDerivation rec {
-  name = "mupdf-0.7";
+  name = "mupdf-1.1";
 
   src = fetchurl {
-    url = "http://mupdf.com/download/archive/${name}.tar.gz";
-    sha256 = "e7f6307fa472575d27fe893e787ddb3fc927f03ba4ae23105f917189e81960a6";
+    url = "http://mupdf.com/download/archive/${name}-source.tar.gz";
+    sha256 = "e54666bbe1d9f0a5464349bfbeffcf676c4a0fcad3efb89eba1f20d4ac991f34";
   };
 
   buildInputs = [ pkgconfig zlib freetype libjpeg jbig2dec openjpeg libX11 libXext ];
 
   preBuild = ''
     export makeFlags="prefix=$out"
+    export NIX_CFLAGS_COMPILE=" $NIX_CFLAGS_COMPILE -I$(echo ${openjpeg}/include/openjpeg-*) "
   '';
 
   meta = {
diff --git a/pkgs/applications/misc/nut/default.nix b/pkgs/applications/misc/nut/default.nix
index 3d4e51360212..51ae8633a7c0 100644
--- a/pkgs/applications/misc/nut/default.nix
+++ b/pkgs/applications/misc/nut/default.nix
@@ -1,13 +1,14 @@
-{stdenv, fetchurl, pkgconfig, neon, libusb, hal, openssl, udev}:
+{ stdenv, fetchurl, pkgconfig, neon, libusb, openssl, udev }:
 
 stdenv.mkDerivation {
   name = "nut-2.6.1";
+
   src = fetchurl {
     url = http://www.networkupstools.org/source/2.6/nut-2.6.1.tar.gz;
     sha256 = "f5c46b856c0cf5b7f0e4b22d82b670af64cc98717a90eaac8723dd402a181c00";
   };
 
-  buildInputs = [pkgconfig neon libusb hal openssl udev];
+  buildInputs = [ pkgconfig neon libusb openssl udev ];
 
   configureFlags = [
     "--with-all"
diff --git a/pkgs/applications/misc/st/default.nix b/pkgs/applications/misc/st/default.nix
index 5ac2ad6b9ad8..86b24e7e4018 100644
--- a/pkgs/applications/misc/st/default.nix
+++ b/pkgs/applications/misc/st/default.nix
@@ -1,14 +1,14 @@
-{ stdenv, fetchurl, libX11, ncurses}:
+{ stdenv, fetchurl, libX11, ncurses, libXext, libXft }:
 
 stdenv.mkDerivation rec {
-  name = "st-0.2.1";
+  name = "st-0.3";
   
   src = fetchurl {
-    url = http://hg.suckless.org/st/archive/0.2.1.tar.gz;
-    sha256 = "15yqyys69ifjc4vrzvamrg7x0pwa60mnjpi0kap4y9ykhds83xab";
+    url = http://hg.suckless.org/st/archive/0.3.tar.gz;
+    sha256 = "12ypldjjpsq3nvhszgjsk4wgqkwcvz06qiqw8k5npv3rd1nbx9cl";
   };
   
-  buildInputs = [ libX11 ncurses ];
+  buildInputs = [ libX11 ncurses libXext libXft ];
 
   installPhase = ''
     TERMINFO=$out/share/terminfo make install PREFIX=$out
diff --git a/pkgs/applications/misc/synergy/default.nix b/pkgs/applications/misc/synergy/default.nix
index cb79bf592fe4..a267a29c7e2e 100644
--- a/pkgs/applications/misc/synergy/default.nix
+++ b/pkgs/applications/misc/synergy/default.nix
@@ -1,31 +1,29 @@
-{ stdenv, fetchurl, x11, xextproto, libXtst, inputproto, libXi
-, automake, autoconf, sourceFromHead }:
+{ stdenv, fetchurl, cmake, x11, libX11, libXi, libXtst }:
 
-stdenv.mkDerivation {
-  name = "synergy-cvs";
+stdenv.mkDerivation rec {
+  name = "synergy-1.4.10";
 
-  # note: There is a fork:
-  # http://code.google.com/p/synergy-plus
-
-  # REGION AUTO UPDATE:            { name="synergy"; type = "cvs"; cvsRoot = ":pserver:anonymous@synergy2.cvs.sourceforge.net:/cvsroot/synergy2"; module="syngery"; }
-  src= sourceFromHead "synergy-F_23-55-02.tar.gz"
-               (fetchurl { url = "http://mawercer.de/~nix/repos/synergy-F_23-55-02.tar.gz"; sha256 = "ae16a9b59039a32e383e71397405d7b610de6c6902c03177c2496bac440d3e28"; });
-  # END
-
-  buildInputs = [ x11 xextproto libXtst inputproto libXi automake autoconf ];
+  src = fetchurl {
+  	url = "http://synergy.googlecode.com/files/${name}-Source.tar.gz";
+  	sha256 = "1ghgf96gbk4sdw8sqlc3pjschkmmqybihi12mg6hi26gnk7a5m86";
+  };
 
-  preConfigure = "autoreconf";
+  buildInputs = [ cmake x11 libX11 libXi libXtst ];
+  
+  # At this moment make install doesn't work for synergy
+  # http://synergy-foss.org/spit/issues/details/3317/
 
-  patches =
-    [ (fetchurl {
-        url = http://mawercer.de/~nix/synergy-gcc43-r2.patch.gz;
-        sha256 = "0wnj5k93ybj7jg8ml1i1brwsnszfh41117q2qh7r8xr9m37997b7";
-      })
-    ];
+  
+  installPhase = ''
+    ensureDir $out/bin
+    cp ../bin/synergyc $out/bin
+    cp ../bin/synergys $out/bin
+    cp ../bin/synergyd $out/bin
+  '';
 
   meta = { 
     description = "Tool to share the mouse keyboard and the clipboard between computers";
-    homepage = http://synergy2.sourceforge.net;
+    homepage = http://synergy-foss.org;
     license = "GPL";
   };
 }
diff --git a/pkgs/applications/misc/taskwarrior/default.nix b/pkgs/applications/misc/taskwarrior/default.nix
index 95f9de2f42b8..cab0c2b07de1 100644
--- a/pkgs/applications/misc/taskwarrior/default.nix
+++ b/pkgs/applications/misc/taskwarrior/default.nix
@@ -1,29 +1,22 @@
-{ stdenv, fetchurl, cmake, lua5 }:
+{stdenv, fetchurl, cmake}:
 
 stdenv.mkDerivation {
-  name = "task-warrior-2.0.0";
+  name = "taskwarrior-2.1.2";
+
+  enableParallelBuilding = true;
 
   src = fetchurl {
-    url = http://www.taskwarrior.org/download/task-2.0.0.tar.gz;
-    sha256 = "1gbmcynj2n2c9dcykxn27ffk034mvm0zri5hqhfdx593dhv1x5vq";
+    url = http://www.taskwarrior.org/download/task-2.1.2.tar.gz;
+    sha256 = "0diy72sgiyvfl6bdy7k3qwv3ijx2z1y477smkk6jsbbd9fsp2lfg";
   };
 
-  NIX_LDFLAGS = "-ldl";
-
   buildNativeInputs = [ cmake ];
-  buildInputs = [ lua5 ];
-
-  crossAttrs = {
-    preConfigure = ''
-      export NIX_CROSS_LDFLAGS="$NIX_CROSS_LDFLAGS -ldl"
-    '';
-  };
-
-  enableParallelBuilding = true;
 
   meta = {
-    description = "Command-line todo list manager";
-    homepage = http://taskwarrior.org/;
-    license = "GPLv2+";
+    description = "GTD (getting things done) implementation";
+    homepage = http://taskwarrior.org;
+    license = stdenv.lib.licenses.mit;
+    maintainers = [stdenv.lib.maintainers.marcweber];
+    platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/applications/misc/wmname/default.nix b/pkgs/applications/misc/wmname/default.nix
new file mode 100644
index 000000000000..417d4a5ae683
--- /dev/null
+++ b/pkgs/applications/misc/wmname/default.nix
@@ -0,0 +1,20 @@
+{ stdenv, fetchurl, libX11 }:
+
+stdenv.mkDerivation rec {
+  name = "wmname-0.1";
+
+  src = fetchurl {
+    url = "http://dl.suckless.org/tools/${name}.tar.gz";
+    sha256 = "559ad188b2913167dcbb37ecfbb7ed474a7ec4bbcb0129d8d5d08cb9208d02c5";
+  };
+
+  buildInputs = [ libX11 ];
+
+  preConfigure = [ ''sed -i "s@PREFIX = /usr/local@PREFIX = $out@g" config.mk'' ];
+
+  meta = {
+      description = "Prints or set the window manager name property of the root window";
+      homepage = "http://tools.suckless.org/wmname";
+      license = "MIT";
+  };
+}
diff --git a/pkgs/applications/misc/xfe/default.nix b/pkgs/applications/misc/xfe/default.nix
new file mode 100644
index 000000000000..67ff2ec55411
--- /dev/null
+++ b/pkgs/applications/misc/xfe/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchurl, fox_1_6, pkgconfig, gettext, x11, gcc, intltool, file, libpng }:
+
+let
+  version = "1.33";
+in
+
+stdenv.mkDerivation rec {
+  name = "xfe-${version}";
+
+  src = fetchurl {
+    url = "http://downloads.sourceforge.net/project/xfe/xfe/${version}/${name}.tar.gz";
+    md5 = "fb089ba73add411b08a6560eeb51742d";
+  };
+
+  buildInputs = [ fox_1_6 pkgconfig gettext x11 gcc intltool file libpng ];
+
+  doCheck = false;
+
+  enableParallelBuilding = true;
+
+  meta = {
+    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.
+      Xfe aims to be the filemanager of choice for all the Unix addicts!
+    '';
+    homepage = "http://sourceforge.net/projects/xfe/";
+    license = "GPLv2";
+    maintainers = [ stdenv.lib.maintainers.bbenoist ];
+    platforms = stdenv.lib.platforms.all;
+  };
+}
diff --git a/pkgs/applications/misc/xterm/default.nix b/pkgs/applications/misc/xterm/default.nix
index b4fab591ef47..ef2d846dd2e4 100644
--- a/pkgs/applications/misc/xterm/default.nix
+++ b/pkgs/applications/misc/xterm/default.nix
@@ -1,18 +1,18 @@
-{ stdenv, fetchurl, xorg, ncurses, freetype, pkgconfig }:
+{ stdenv, fetchurl, xorg, ncurses, freetype, fontconfig, pkgconfig }:
 
 stdenv.mkDerivation rec {
-  name = "xterm-276";
-  
+  name = "xterm-281";
+
   src = fetchurl {
     url = "ftp://invisible-island.net/xterm/${name}.tgz";
-    sha256 = "1k3k025z3vl91sc8i7f5lmnsb1rsblpbijri9vnxgpynw4wgrc7b";
+    sha256 = "1yrjjya7z5s3fi0iiaxgna35jh0ib2zx1yafyng35jma6qbwhxx7";
   };
-  
+
   buildInputs =
     [ xorg.libXaw xorg.xproto xorg.libXt xorg.libXext xorg.libX11 xorg.libSM xorg.libICE
-      ncurses freetype pkgconfig xorg.libXft xorg.luit
+      ncurses freetype fontconfig pkgconfig xorg.libXft xorg.luit
     ];
-    
+
   configureFlags =
     ''
       --enable-wide-chars --enable-256-color
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
     '';
 
   # Work around broken "plink.sh".
-  NIX_LDFLAGS = "-lXmu -lXt -lICE -lX11";
+  NIX_LDFLAGS = "-lXmu -lXt -lICE -lX11 -lfontconfig";
 
   # Hack to get xterm built with the feature of releasing a possible setgid of 'utmp',
   # decided by the sysadmin to allow the xterm reporting to /var/run/utmp
diff --git a/pkgs/applications/networking/browsers/chromium/default.nix b/pkgs/applications/networking/browsers/chromium/default.nix
index 7a3c387dedad..7d41f72df207 100644
--- a/pkgs/applications/networking/browsers/chromium/default.nix
+++ b/pkgs/applications/networking/browsers/chromium/default.nix
@@ -1,10 +1,11 @@
-{ stdenv, getConfig, fetchurl, makeWrapper, which
+{ stdenv, config, fetchurl, makeWrapper, which
 
 # default dependencies
 , bzip2, flac, speex
 , libevent, expat, libjpeg
 , libpng, libxml2, libxslt
 , xdg_utils, yasm, zlib
+, libusb1, libexif, pciutils
 
 , python, perl, pkgconfig
 , nspr, udev, krb5
@@ -22,10 +23,12 @@
 , libselinux # config.selinux
 }:
 
+with stdenv.lib;
+
 let
-  mkConfigurable = stdenv.lib.mapAttrs (flag: default: getConfig ["chromium" flag] default);
+  mkConfigurable = mapAttrs (flag: default: attrByPath ["chromium" flag] default config);
 
-  config = mkConfigurable {
+  cfg = mkConfigurable {
     channel = "stable";
     selinux = false;
     nacl = false;
@@ -34,39 +37,42 @@ let
     gnomeKeyring = false;
     proprietaryCodecs = true;
     cups = false;
-    pulseaudio = getConfig ["pulseaudio"] true;
+    pulseaudio = config.pulseaudio or true;
   };
 
-  sourceInfo = builtins.getAttr config.channel (import ./sources.nix);
+  sourceInfo = builtins.getAttr cfg.channel (import ./sources.nix);
 
-  mkGypFlags = with stdenv.lib; let
-    sanitize = value:
-      if value == true then "1"
-      else if value == false then "0"
-      else "${value}";
-    toFlag = key: value: "-D${key}=${sanitize value}";
-  in attrs: concatStringsSep " " (attrValues (mapAttrs toFlag attrs));
+  mkGypFlags =
+    let
+      sanitize = value:
+        if value == true then "1"
+        else if value == false then "0"
+        else "${value}";
+      toFlag = key: value: "-D${key}=${sanitize value}";
+    in attrs: concatStringsSep " " (attrValues (mapAttrs toFlag attrs));
 
   gypFlagsUseSystemLibs = {
     use_system_bzip2 = true;
     use_system_flac = true;
     use_system_libevent = true;
     use_system_libexpat = true;
+    use_system_libexif = true;
     use_system_libjpeg = true;
     use_system_libpng = true;
+    use_system_libusb = true;
     use_system_libxml = true;
     use_system_speex = true;
-    use_system_ssl = config.openssl;
+    use_system_ssl = cfg.openssl;
     use_system_stlport = true;
     use_system_xdg_utils = true;
     use_system_yasm = true;
-    use_system_zlib = true;
+    use_system_zlib = false; # http://crbug.com/143623
 
     use_system_harfbuzz = false;
     use_system_icu = false;
-    use_system_libwebp = false; # See chromium issue #133161
+    use_system_libwebp = false; # http://crbug.com/133161
     use_system_skia = false;
-    use_system_sqlite = false; # See chromium issue #22208
+    use_system_sqlite = false; # http://crbug.com/22208
     use_system_v8 = false;
   };
 
@@ -75,23 +81,16 @@ let
     libevent expat libjpeg
     libpng libxml2 libxslt
     xdg_utils yasm zlib
+    libusb1 libexif
   ];
 
-  seccompPatch = let
-    pre22 = stdenv.lib.versionOlder sourceInfo.version "22.0.0.0";
-  in if pre22 then ./enable_seccomp.patch else ./enable_seccomp22.patch;
-
-  # XXX: this reverts r151720 to prevent http://crbug.com/143623
-  maybeRevertZlibChanges = let
-    below22 = stdenv.lib.versionOlder sourceInfo.version "22.0.0.0";
-    patch = fetchurl {
-      name = "revert-r151720";
-      url = "http://git.chromium.org/gitweb/?p=chromium.git;a=commitdiff_plain;"
-          + "hp=4419ec6414b33b6b19bb2e380b4998ed5193ecab;"
-          + "h=0fabb4fda7059a8757422e8a44e70deeab28e698";
-      sha256 = "0n0d6mkg89g8q63cifapzpg9dxfs2n6xvk4k13szhymvf67b77pf";
-    };
-  in stdenv.lib.optional (!below22) patch;
+  post23 = !versionOlder sourceInfo.version "24.0.0.0";
+  post24 = !versionOlder sourceInfo.version "25.0.0.0";
+
+  maybeFixPulseAudioBuild = optional (post23 && cfg.pulseaudio) (fetchurl {
+    url = http://archrepo.jeago.com/sources/chromium-dev/pulse_audio_fix.patch;
+    sha256 = "1w91mirrkqigdhsj892mqxlc0nlv1dsp5shc46w9xf8nl96jxgfb";
+  });
 
 in stdenv.mkDerivation rec {
   name = "${packageName}-${version}";
@@ -108,28 +107,28 @@ in stdenv.mkDerivation rec {
     which makeWrapper
     python perl pkgconfig
     nspr udev
-    (if config.openssl then openssl else nss)
+    (if cfg.openssl then openssl else nss)
     utillinux alsaLib
     gcc bison gperf
     krb5
     glib gtk dbus_glib
     libXScrnSaver libXcursor mesa
-  ] ++ stdenv.lib.optional config.gnomeKeyring libgnome_keyring
-    ++ stdenv.lib.optionals config.gnome [ gconf libgcrypt ]
-    ++ stdenv.lib.optional config.selinux libselinux
-    ++ stdenv.lib.optional config.cups libgcrypt
-    ++ stdenv.lib.optional config.pulseaudio pulseaudio;
+  ] ++ optional cfg.gnomeKeyring libgnome_keyring
+    ++ optionals cfg.gnome [ gconf libgcrypt ]
+    ++ optional cfg.selinux libselinux
+    ++ optional cfg.cups libgcrypt
+    ++ optional cfg.pulseaudio pulseaudio
+    ++ optional post24 pciutils;
 
-  opensslPatches = stdenv.lib.optional config.openssl openssl.patches;
+  opensslPatches = optional cfg.openssl openssl.patches;
 
   prePatch = "patchShebangs .";
 
-  patches = stdenv.lib.optional (!config.selinux) seccompPatch
-         ++ stdenv.lib.optional config.cups ./cups_allow_deprecated.patch
-         ++ stdenv.lib.optional config.pulseaudio ./pulseaudio_array_bounds.patch
-         ++ maybeRevertZlibChanges;
+  patches = optional cfg.cups ./cups_allow_deprecated.patch
+         ++ optional cfg.pulseaudio ./pulseaudio_array_bounds.patch
+         ++ maybeFixPulseAudioBuild;
 
-  postPatch = stdenv.lib.optionalString config.openssl ''
+  postPatch = optionalString cfg.openssl ''
     cat $opensslPatches | patch -p1 -d third_party/openssl/openssl
   '';
 
@@ -137,21 +136,21 @@ in stdenv.mkDerivation rec {
     linux_use_gold_binary = false;
     linux_use_gold_flags = false;
     proprietary_codecs = false;
-    use_gnome_keyring = config.gnomeKeyring;
-    use_gconf = config.gnome;
-    use_gio = config.gnome;
-    use_pulseaudio = config.pulseaudio;
-    disable_nacl = !config.nacl;
-    use_openssl = config.openssl;
-    selinux = config.selinux;
-    use_cups = config.cups;
-  } // stdenv.lib.optionalAttrs config.proprietaryCodecs {
+    use_gnome_keyring = cfg.gnomeKeyring;
+    use_gconf = cfg.gnome;
+    use_gio = cfg.gnome;
+    use_pulseaudio = cfg.pulseaudio;
+    disable_nacl = !cfg.nacl;
+    use_openssl = cfg.openssl;
+    selinux = cfg.selinux;
+    use_cups = cfg.cups;
+  } // optionalAttrs cfg.proprietaryCodecs {
     # enable support for the H.264 codec
     proprietary_codecs = true;
     ffmpeg_branding = "Chrome";
-  } // stdenv.lib.optionalAttrs (stdenv.system == "x86_64-linux") {
+  } // optionalAttrs (stdenv.system == "x86_64-linux") {
     target_arch = "x64";
-  } // stdenv.lib.optionalAttrs (stdenv.system == "i686-linux") {
+  } // optionalAttrs (stdenv.system == "i686-linux") {
     target_arch = "ia32";
   });
 
@@ -203,11 +202,11 @@ in stdenv.mkDerivation rec {
     done
   '';
 
-  meta =  with stdenv.lib; {
+  meta = {
     description = "Chromium, an open source web browser";
     homepage = http://www.chromium.org/;
-    maintainers = with stdenv.lib.maintainers; [ goibhniu chaoflow ];
+    maintainers = with maintainers; [ goibhniu chaoflow ];
     license = licenses.bsd3;
-    platforms = with stdenv.lib.platforms; linux;
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/applications/networking/browsers/chromium/enable_seccomp.patch b/pkgs/applications/networking/browsers/chromium/enable_seccomp.patch
deleted file mode 100644
index edeee37f19ca..000000000000
--- a/pkgs/applications/networking/browsers/chromium/enable_seccomp.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-diff --git a/content/common/seccomp_sandbox.h b/content/common/seccomp_sandbox.h
-index a07d6f3..a622a35 100644
---- a/content/common/seccomp_sandbox.h
-+++ b/content/common/seccomp_sandbox.h
-@@ -29,15 +29,9 @@ static bool SeccompSandboxEnabled() {
-   // TODO(evan): turn on for release too once we've flushed out all the bugs,
-   // allowing us to delete this file entirely and just rely on the "disabled"
-   // switch.
--#ifdef NDEBUG
--  // Off by default; allow turning on with a switch.
--  return CommandLine::ForCurrentProcess()->HasSwitch(
--      switches::kEnableSeccompSandbox);
--#else
-   // On by default; allow turning off with a switch.
-   return !CommandLine::ForCurrentProcess()->HasSwitch(
-       switches::kDisableSeccompSandbox);
--#endif  // NDEBUG
- }
- #endif  // SECCOMP_SANDBOX
- 
diff --git a/pkgs/applications/networking/browsers/chromium/enable_seccomp22.patch b/pkgs/applications/networking/browsers/chromium/enable_seccomp22.patch
deleted file mode 100644
index f947d796f186..000000000000
--- a/pkgs/applications/networking/browsers/chromium/enable_seccomp22.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-diff --git a/content/common/sandbox_linux.cc b/content/common/sandbox_linux.cc
-index d4618e5..108f846 100644
---- a/content/common/sandbox_linux.cc
-+++ b/content/common/sandbox_linux.cc
-@@ -38,15 +38,9 @@ void LogSandboxStarted(const std::string& sandbox_name) {
- // Implement the command line enabling logic for seccomp-legacy.
- bool IsSeccompLegacyDesired() {
- #if defined(SECCOMP_SANDBOX)
--#if defined(NDEBUG)
--  // Off by default; allow turning on with a switch.
--  return CommandLine::ForCurrentProcess()->HasSwitch(
--      switches::kEnableSeccompSandbox);
--#else
-   // On by default; allow turning off with a switch.
-   return !CommandLine::ForCurrentProcess()->HasSwitch(
-       switches::kDisableSeccompSandbox);
--#endif  // NDEBUG
- #endif  // SECCOMP_SANDBOX
-   return false;
- }
diff --git a/pkgs/applications/networking/browsers/chromium/sources.nix b/pkgs/applications/networking/browsers/chromium/sources.nix
index 7d03c397bdcb..9b6616ec63c3 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 = "23.0.1255.0";
-    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-23.0.1255.0.tar.bz2";
-    sha256 = "12ks55mn6nahdzd5kgiwi9m2cfivb0pwj963g8d4kmdbw5bg017g";
+    version = "25.0.1323.1";
+    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-25.0.1323.1.tar.bz2";
+    sha256 = "1i7ga1qhnjvnw2gynmpmsvvl5pxcb5z9sgldp87d9yalim5sra6s";
   };
   beta = {
-    version = "22.0.1229.39";
-    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-22.0.1229.39.tar.bz2";
-    sha256 = "0v0yz9lkr9xdzh6660y9n2z8m1075ls2r3svafcfa80pq18chzfd";
+    version = "24.0.1312.14";
+    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-24.0.1312.14.tar.bz2";
+    sha256 = "03w8cg4kqmpj82976ax9x6y275y9gcri4vc11cvfjp6r1issxzk8";
   };
   stable = {
-    version = "21.0.1180.89";
-    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-21.0.1180.89.tar.bz2";
-    sha256 = "1i9mjbjj3aywg03hd59m9j5gq5b5fl8nvw56g47q8s9k1bcsik0n";
+    version = "23.0.1271.64";
+    url = "http://commondatastorage.googleapis.com/chromium-browser-official/chromium-23.0.1271.64.tar.bz2";
+    sha256 = "1rzz08sgw07nkmvhhgyrkrcxj3z24lxbx0di6ky6jz3lshibp578";
   };
 }
diff --git a/pkgs/applications/networking/browsers/chromium/update.sh b/pkgs/applications/networking/browsers/chromium/update.sh
index c978ee4adf3a..2d95d466b2a8 100755
--- a/pkgs/applications/networking/browsers/chromium/update.sh
+++ b/pkgs/applications/networking/browsers/chromium/update.sh
@@ -1,6 +1,6 @@
 #!/bin/sh
 
-channels_url="http://omahaproxy.appspot.com/";
+channels_url="http://omahaproxy.appspot.com/all?csv=1";
 bucket_url="http://commondatastorage.googleapis.com/chromium-browser-official/";
 output_file="$(cd "$(dirname "$0")" && pwd)/sources.nix";
 
diff --git a/pkgs/applications/networking/browsers/firefox/15.0.nix b/pkgs/applications/networking/browsers/firefox/15.0.nix
index 549034963914..cb79f4422eb7 100644
--- a/pkgs/applications/networking/browsers/firefox/15.0.nix
+++ b/pkgs/applications/networking/browsers/firefox/15.0.nix
@@ -15,16 +15,16 @@ assert stdenv.gcc ? libc && stdenv.gcc.libc != null;
 
 rec {
 
-  firefoxVersion = "15.0";
-  
-  xulVersion = "15.0"; # this attribute is used by other packages
+  firefoxVersion = "15.0.1";
+
+  xulVersion = "15.0.1"; # this attribute is used by other packages
+
 
-  
   src = fetchurl {
-    url = "http://releases.mozilla.org/pub/mozilla.org/firefox/releases/${firefoxVersion}/source/firefox-${firefoxVersion}.source.tar.bz2";
-    sha256 = "12f7dgcksb9d79hj0a8lxn3s81id6l2gd1pb7ls4d60kmgbg05jl";
+    url = "ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${firefoxVersion}/source/firefox-${firefoxVersion}.source.tar.bz2";
+    sha1 = "bdbc4b6656c59b926e18f99b3335484427d08641";
   };
-  
+
   commonConfigureFlags =
     [ "--enable-optimize"
       "--disable-debug"
@@ -40,14 +40,14 @@ rec {
       "--disable-crashreporter"
       "--disable-tests"
       "--disable-necko-wifi" # maybe we want to enable this at some point
-      "--disable-installer" 
+      "--disable-installer"
       "--disable-updater"
     ];
 
 
   xulrunner = stdenv.mkDerivation rec {
     name = "xulrunner-${xulVersion}";
-    
+
     inherit src;
 
     buildInputs =
@@ -65,7 +65,7 @@ rec {
       ] ++ commonConfigureFlags;
 
     enableParallelBuilding = true;
-      
+
     preConfigure =
       ''
         export NIX_LDFLAGS="$NIX_LDFLAGS -L$out/lib/xulrunner-${xulVersion}"
@@ -85,9 +85,9 @@ rec {
       cd $out/bin
       rm xulrunner
 
-      for i in $out/lib/$libDir/*; do 
+      for i in $out/lib/$libDir/*; do
           file $i;
-          if file $i | grep executable &>/dev/null; then 
+          if file $i | grep executable &>/dev/null; then
               echo -e '#! /bin/sh\n"'"$i"'" "$@"' > "$out/bin/$(basename "$i")";
               chmod a+x "$out/bin/$(basename "$i")";
           fi;
@@ -116,7 +116,7 @@ rec {
     inherit src;
 
     enableParallelBuilding = true;
-      
+
     buildInputs =
       [ pkgconfig gtk perl zip libIDL libjpeg zlib cairo bzip2 python
         dbus dbus_glib pango freetype fontconfig alsaLib nspr nss libnotify
@@ -142,7 +142,7 @@ rec {
     preConfigure =
       ''
         find . -name Makefile.in -execdir sed -i '{}' -e '1ivpath %.so ${
-          stdenv.lib.concatStringsSep ":" 
+          stdenv.lib.concatStringsSep ":"
             (map (s : s + "/lib") (buildInputs ++ [stdenv.gcc.libc]))
         }' ';'
       '';
@@ -150,19 +150,19 @@ rec {
     postInstall =
       ''
         ln -s ${xulrunner}/lib/xulrunner-${xulrunner.version} $(echo $out/lib/firefox-*)/xulrunner
-        for j in $out/bin/*; do 
-	    i="$(readlink "$j")";
+        for j in $out/bin/*; do
+            i="$(readlink "$j")";
             file $i;
-            if file $i | grep executable &>/dev/null; then 
-	        rm "$out/bin/$(basename "$i")"
+            if file $i | grep executable &>/dev/null; then
+                rm "$out/bin/$(basename "$i")"
                 echo -e '#! /bin/sh\nexec "'"$i"'" "$@"' > "$out/bin/$(basename "$i")"
                 chmod a+x "$out/bin/$(basename "$i")"
             fi;
         done;
-	cd "$out/lib/"firefox-*
-	rm firefox
-	echo -e '#!${stdenv.shell}\n${xulrunner}/bin/xulrunner "'"$PWD"'/application.ini" "$@"' > firefox
-	chmod a+x firefox
+        cd "$out/lib/"firefox-*
+        rm firefox
+        echo -e '#!${stdenv.shell}\n${xulrunner}/bin/xulrunner "'"$PWD"'/application.ini" "$@"' > firefox
+        chmod a+x firefox
       ''; # */
 
     meta = {
diff --git a/pkgs/applications/networking/browsers/firefox/12.0.nix b/pkgs/applications/networking/browsers/firefox/16.0.nix
index 97e23d1b8b26..a9a10fbc4ec4 100644
--- a/pkgs/applications/networking/browsers/firefox/12.0.nix
+++ b/pkgs/applications/networking/browsers/firefox/16.0.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl, pkgconfig, gtk, pango, perl, python, zip, libIDL
 , libjpeg, libpng, zlib, cairo, dbus, dbus_glib, bzip2, xlibs
 , freetype, fontconfig, file, alsaLib, nspr, nss, libnotify
-, yasm, mesa, sqlite, unzip
+, yasm, mesa, sqlite, unzip, makeWrapper, pysqlite
 
 , # If you want the resulting program to call itself "Firefox" instead
   # of "Shiretoko" or whatever, enable this option.  However, those
@@ -15,18 +15,24 @@ assert stdenv.gcc ? libc && stdenv.gcc.libc != null;
 
 rec {
 
-  firefoxVersion = "12.0";
-  
-  xulVersion = "12.0"; # this attribute is used by other packages
+  firefoxVersion = "16.0.2";
+
+  xulVersion = "16.0.2"; # this attribute is used by other packages
+
 
-  
   src = fetchurl {
-    url = "ftp://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${firefoxVersion}/source/firefox-${firefoxVersion}.source.tar.bz2";
-    sha1 = "0177185e54b7d63dc36bd5bd5c80ba6afd52e199";
+    urls = [
+        # 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"
+    ];
+    sha1 = "0ffe96896583e92561b341330ab09ddc50140dd1";
   };
-  
+
   commonConfigureFlags =
     [ "--enable-optimize"
+      #"--enable-profiling"
       "--disable-debug"
       "--enable-strip"
       "--with-system-jpeg"
@@ -40,14 +46,14 @@ rec {
       "--disable-crashreporter"
       "--disable-tests"
       "--disable-necko-wifi" # maybe we want to enable this at some point
-      "--disable-installer" 
+      "--disable-installer"
       "--disable-updater"
     ];
 
 
   xulrunner = stdenv.mkDerivation rec {
     name = "xulrunner-${xulVersion}";
-    
+
     inherit src;
 
     buildInputs =
@@ -55,8 +61,8 @@ rec {
         python dbus dbus_glib pango freetype fontconfig xlibs.libXi
         xlibs.libX11 xlibs.libXrender xlibs.libXft xlibs.libXt file
         alsaLib nspr nss libnotify xlibs.pixman yasm mesa
-        xlibs.libXScrnSaver xlibs.scrnsaverproto
-        xlibs.libXext xlibs.xextproto sqlite unzip
+        xlibs.libXScrnSaver xlibs.scrnsaverproto pysqlite
+        xlibs.libXext xlibs.xextproto sqlite unzip makeWrapper
       ];
 
     configureFlags =
@@ -65,49 +71,39 @@ rec {
       ] ++ commonConfigureFlags;
 
     enableParallelBuilding = true;
-      
-    # Hack to work around make's idea of -lbz2 dependency
+
     preConfigure =
       ''
-        find . -name Makefile.in -execdir sed -i '{}' -e '1ivpath %.so ${
-          stdenv.lib.concatStringsSep ":" 
-            (map (s : s + "/lib") (buildInputs ++ [stdenv.gcc.libc]))
-        }' ';'
-
         export NIX_LDFLAGS="$NIX_LDFLAGS -L$out/lib/xulrunner-${xulVersion}"
-      '';
 
-    # !!! Temporary hack.
-    preBuild =
-      ''
-        export NIX_ENFORCE_PURITY=
-      '';
+        mkdir ../objdir
+        cd ../objdir
+        configureScript=../mozilla-release/configure
+      ''; # */
 
-    installFlags = "SKIP_GRE_REGISTRATION=1";
+    #installFlags = "SKIP_GRE_REGISTRATION=1";
 
     postInstall = ''
-      # Fix some references to /bin paths in the Xulrunner shell script.
-      substituteInPlace $out/bin/xulrunner \
-          --replace /bin/pwd "$(type -tP pwd)" \
-          --replace /bin/ls "$(type -tP ls)"
-
       # Fix run-mozilla.sh search
       libDir=$(cd $out/lib && ls -d xulrunner-[0-9]*)
       echo libDir: $libDir
       test -n "$libDir"
       cd $out/bin
-      mv xulrunner ../lib/$libDir/
+      rm xulrunner
 
-      for i in $out/lib/$libDir/*; do 
+      for i in $out/lib/$libDir/*; do
           file $i;
-          if file $i | grep executable &>/dev/null; then 
+          if file $i | grep executable &>/dev/null; then
               echo -e '#! /bin/sh\n"'"$i"'" "$@"' > "$out/bin/$(basename "$i")";
               chmod a+x "$out/bin/$(basename "$i")";
           fi;
-      done;
-      for i in $out/lib/$libDir/{xpcshell,plugin-container,*.so}; do
-              patchelf --set-rpath "$(patchelf --print-rpath "$i"):$out/lib/$libDir" $i || true
-      done;
+      done
+      for i in $out/lib/$libDir/*.so; do
+          patchelf --set-rpath "$(patchelf --print-rpath "$i"):$out/lib/$libDir" $i || true
+      done
+      for i in $out/lib/$libDir/{plugin-container,xulrunner,xulrunner-stub}; do
+          wrapProgram $i --prefix LD_LIBRARY_PATH ':' "$out/lib/$libDir"
+      done
       rm -f $out/bin/run-mozilla.sh
     ''; # */
 
@@ -126,11 +122,11 @@ rec {
     inherit src;
 
     enableParallelBuilding = true;
-      
+
     buildInputs =
       [ pkgconfig gtk perl zip libIDL libjpeg zlib cairo bzip2 python
         dbus dbus_glib pango freetype fontconfig alsaLib nspr nss libnotify
-        xlibs.pixman yasm mesa sqlite file unzip
+        xlibs.pixman yasm mesa sqlite file unzip pysqlite
       ];
 
     propagatedBuildInputs = [xulrunner];
@@ -144,11 +140,15 @@ rec {
       ++ commonConfigureFlags
       ++ stdenv.lib.optional enableOfficialBranding "--enable-official-branding";
 
+    makeFlags = [
+      "SYSTEM_LIBXUL=1"
+    ];
+
     # Hack to work around make's idea of -lbz2 dependency
     preConfigure =
       ''
         find . -name Makefile.in -execdir sed -i '{}' -e '1ivpath %.so ${
-          stdenv.lib.concatStringsSep ":" 
+          stdenv.lib.concatStringsSep ":"
             (map (s : s + "/lib") (buildInputs ++ [stdenv.gcc.libc]))
         }' ';'
       '';
@@ -156,15 +156,19 @@ rec {
     postInstall =
       ''
         ln -s ${xulrunner}/lib/xulrunner-${xulrunner.version} $(echo $out/lib/firefox-*)/xulrunner
-        for j in $out/bin/*; do 
-	    i="$(readlink "$j")";
+        for j in $out/bin/*; do
+            i="$(readlink "$j")";
             file $i;
-            if file $i | grep executable &>/dev/null; then 
-	        rm "$out/bin/$(basename "$i")"
+            if file $i | grep executable &>/dev/null; then
+                rm "$out/bin/$(basename "$i")"
                 echo -e '#! /bin/sh\nexec "'"$i"'" "$@"' > "$out/bin/$(basename "$i")"
                 chmod a+x "$out/bin/$(basename "$i")"
             fi;
         done;
+        cd "$out/lib/"firefox-*
+        rm firefox
+        echo -e '#!${stdenv.shell}\n${xulrunner}/bin/xulrunner "'"$PWD"'/application.ini" "$@"' > firefox
+        chmod a+x firefox
       ''; # */
 
     meta = {
diff --git a/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-10/builder.sh b/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-10/builder.sh
deleted file mode 100644
index b0f8a2638c18..000000000000
--- a/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-10/builder.sh
+++ /dev/null
@@ -1,23 +0,0 @@
-source $stdenv/setup
-
-dontStrip=1
-dontPatchELF=1
-sourceRoot=$TMPDIR
-
-unpackPhase() {
-    tar xvzf $src;
-    for a in *; do
-	if [ -d $a ]; then
-		cd $a
-		break
-	fi
-    done
-}
-
-installPhase() {
-    mkdir -p $out/lib/mozilla/plugins
-    cp -pv libflashplayer.so $out/lib/mozilla/plugins
-    patchelf --set-rpath "$rpath" $out/lib/mozilla/plugins/libflashplayer.so
-}
-
-genericBuild
diff --git a/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-10/default.nix b/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-10/default.nix
deleted file mode 100644
index ad6867ab5be5..000000000000
--- a/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-10/default.nix
+++ /dev/null
@@ -1,88 +0,0 @@
-{ stdenv
-, fetchurl
-, zlib
-, alsaLib
-, curl
-, nss
-, nspr
-, fontconfig
-, freetype
-, expat
-, libX11
-, libXext
-, libXrender
-, libXt
-, gtk 
-, glib
-, pango
-, cairo
-, atk
-, gdk_pixbuf
-, debug ? false
-
-/* you have to add ~/mm.cfg :
-
-    TraceOutputFileEnable=1
-    ErrorReportingEnable=1
-    MaxWarnings=1
-
-  in order to read the flash trace at ~/.macromedia/Flash_Player/Logs/flashlog.txt
-  Then FlashBug (a FireFox plugin) shows the log as well
-*/
-
-}:
-
-let
-
-  src =
-    if stdenv.system == "x86_64-linux" then
-      if debug then
-        # no plans to provide a x86_64 version:
-        # http://labs.adobe.com/technologies/flashplayer10/faq.html
-        throw "no x86_64 debugging version available"
-      else {
-        # -> http://labs.adobe.com/downloads/flashplayer10.html
-        version = "10.3.181.34";
-        url = http://download.macromedia.com/pub/labs/flashplayer10/flashplayer10_2_p3_64bit_linux_111710.tar.gz;
-        sha256 = "1w2zs2f0q1vpx4ia9pj1k4p830dwz7ypyn302mi48wcpz1wzc1gg";
-      }
-    else if stdenv.system == "i686-linux" then
-      if debug then {
-        # The debug version also contains a player
-        version = "10.2_p2-debug-r092710";
-        url = http://download.macromedia.com/pub/labs/flashplayer10/flashplayer_square_p2_32bit_debug_linux_092710.tar.gz;
-        sha256 = "11w3mxa39l4mnlsqzlwbdh1sald549afyqbx2kbid7in5qzamlcc";
-      } else {
-        version = "10.3.183.10";
-        url = http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_10_linux.tar.gz;
-        sha256 = "0fj51dg0aa813b44yn8dvmmvw4qwi8vbi0x8n1bcqrcld3sbpmfz";
-      }
-    else throw "Flash Player is not supported on this platform";
-
-in
-
-stdenv.mkDerivation {
-  name = "flashplayer-${src.version}";
-
-  builder = ./builder.sh;
-  
-  src = fetchurl { inherit (src) url sha256; };
-
-  inherit zlib alsaLib;
-
-  passthru = {
-    mozillaPlugin = "/lib/mozilla/plugins";
-  };
-
-  rpath = stdenv.lib.makeLibraryPath
-    [ zlib alsaLib curl nss nspr fontconfig freetype expat libX11
-      libXext libXrender libXt gtk glib pango atk cairo gdk_pixbuf
-    ];
-
-  buildPhase = ":";
-
-  meta = {
-    description = "Adobe Flash Player browser plugin";
-    homepage = http://www.adobe.com/products/flashplayer/;
-  };
-}
diff --git a/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-11/default.nix b/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-11/default.nix
index 260edd360c65..2eb34f68b8b3 100644
--- a/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-11/default.nix
+++ b/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-11/default.nix
@@ -11,8 +11,9 @@
 , libX11
 , libXext
 , libXrender
+, libXcursor
 , libXt
-, gtk 
+, gtk
 , glib
 , pango
 , cairo
@@ -40,11 +41,11 @@ let
         # no plans to provide a x86_64 version:
         # http://labs.adobe.com/technologies/flashplayer10/faq.html
         throw "no x86_64 debugging version available"
-      else {
+      else rec {
         # -> http://labs.adobe.com/downloads/flashplayer10.html
-        version = "11.1.102.55";
-        url = http://fpdownload.macromedia.com/get/flashplayer/pdc/11.1.102.55/install_flash_player_11_linux.x86_64.tar.gz;
-        sha256 = "09swldv174z23pnixy9fxkw084qkl3bbrxfpf159fbjdgvwihn1l";
+        version = "11.2.202.238";
+        url = "http://fpdownload.macromedia.com/get/flashplayer/pdc/${version}/install_flash_player_11_linux.x86_64.tar.gz";
+        sha256 = "07d09xjnn2hm877psmv9a6c4cfighxw24p0apq2ykawnrjpjc6zn";
       }
     else if stdenv.system == "i686-linux" then
       if debug then {
@@ -52,10 +53,10 @@ let
         version = "11.1";
         url = http://fpdownload.macromedia.com/pub/flashplayer/updaters/11/flashplayer_11_plugin_debug.i386.tar.gz;
         sha256 = "1z3649lv9sh7jnwl8d90a293nkaswagj2ynhsr4xmwiy7c0jz2lk";
-      } else {
-        version = "11.1.102.55";
-        url = "http://fpdownload.macromedia.com/get/flashplayer/pdc/11.1.102.55/install_flash_player_11_linux.i386.tar.gz";
-        sha256 = "08zdnl06lqyk2k3yq4lgphqd3ci2267448mghlv1p0hjrdq253k7";
+      } else rec {
+        version = "11.2.202.238";
+        url = "http://fpdownload.macromedia.com/get/flashplayer/pdc/${version}/install_flash_player_11_linux.i386.tar.gz";
+        sha256 = "0p05pr4vmc4536axjyljhxhqizq4ihslar8g638dj24251byp7ca";
       }
     else throw "Flash Player is not supported on this platform";
 
@@ -65,7 +66,7 @@ stdenv.mkDerivation {
   name = "flashplayer-${src.version}";
 
   builder = ./builder.sh;
-  
+
   src = fetchurl { inherit (src) url sha256; };
 
   inherit zlib alsaLib;
@@ -76,7 +77,7 @@ stdenv.mkDerivation {
 
   rpath = stdenv.lib.makeLibraryPath
     [ zlib alsaLib curl nss nspr fontconfig freetype expat libX11
-      libXext libXrender libXt gtk glib pango atk cairo gdk_pixbuf
+      libXext libXrender libXcursor libXt gtk glib pango atk cairo gdk_pixbuf
     ];
 
   buildPhase = ":";
diff --git a/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-9/builder.sh b/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-9/builder.sh
deleted file mode 100644
index 86ecd2c33453..000000000000
--- a/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-9/builder.sh
+++ /dev/null
@@ -1,14 +0,0 @@
-source $stdenv/setup
-
-dontStrip=1
-dontPatchELF=1
-
-sourceRoot=.
-
-installPhase() {
-    mkdir -p $out/lib/mozilla/plugins
-    cp -p libflashplayer.so $out/lib/mozilla/plugins
-    patchelf --set-rpath $rpath $out/lib/mozilla/plugins/libflashplayer.so
-}
-
-genericBuild
diff --git a/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-9/default.nix b/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-9/default.nix
deleted file mode 100644
index 913aa985583e..000000000000
--- a/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-9/default.nix
+++ /dev/null
@@ -1,47 +0,0 @@
-{ stdenv
-, fetchurl
-, zlib
-, alsaLib
-, nss
-, nspr
-, fontconfig
-, freetype
-, expat
-, libX11
-, libXext
-, libXrender
-, libXt
-, gtk
-, glib
-, pango
-, atk
-
-, customSrc ? null
-}:
-
-assert stdenv.system == "i686-linux";
-
-stdenv.mkDerivation {
-  name = "flashplayer-9.0.124.0";
-
-  builder = ./builder.sh;
-  src = if customSrc == null then
-    fetchurl {
-      url = http://download.macromedia.com/pub/flashplayer/installers/current/9/install_flash_player_9.tar.gz;
-      sha256 = "1cnsjgmy7rwj3spzb5mmpmvzxjp435jisl0dd8s4rf4xskyy6d6r";
-    }
-  else customSrc;
-
-  inherit zlib alsaLib;
-
-  passthru = {
-    mozillaPlugin = "/lib/mozilla/plugins";
-  };
-
-  rpath = stdenv.lib.makeLibraryPath [zlib alsaLib nss nspr fontconfig freetype expat libX11 libXext libXrender libXt gtk glib pango atk] ;
-
-  meta = {
-    description = "Adobe Flash Player browser plugin";
-    homepage = http://www.adobe.com/products/flashplayer/;
-  };
-}
diff --git a/pkgs/applications/networking/browsers/mozilla-plugins/google-talk-plugin/default.nix b/pkgs/applications/networking/browsers/mozilla-plugins/google-talk-plugin/default.nix
index a3f255b5d3e5..811847920c5d 100644
--- a/pkgs/applications/networking/browsers/mozilla-plugins/google-talk-plugin/default.nix
+++ b/pkgs/applications/networking/browsers/mozilla-plugins/google-talk-plugin/default.nix
@@ -45,18 +45,18 @@ in
 
 stdenv.mkDerivation rec {
   name = "google-talk-plugin-${version}";
-  version = "3.5.1.0";
+  version = "3.10.2.0";
 
   src =
     if stdenv.system == "x86_64-linux" then
       fetchurl {
         url = "${baseURL}/google-talkplugin_${version}-1_amd64.deb";
-        sha256 = "0ml4yirzdcladw11fq5d8lwqfqgb1fh9vpbzbzmhplvyj6mvkqrj";
+        sha256 = "0ivjmqrxy3xkwqjp20aqz47smdcdds0i82pfyb5k9jywi8afvchr";
       }
     else if stdenv.system == "i686-linux" then
       fetchurl {
         url = "${baseURL}/google-talkplugin_${version}-1_i386.deb";
-        sha256 = "1kfd26zygb76iqnr8n3f7k7n9h5bz0rf716n80crqzyasv51mn57";
+        sha256 = "1bac95r9721sc7fsklsmv0lq673901zppdgabjjarpnx8z280jvj";
       }
     else throw "Google Talk does not support your platform.";
 
diff --git a/pkgs/applications/networking/browsers/mozilla-plugins/nspluginwrapper/default.nix b/pkgs/applications/networking/browsers/mozilla-plugins/nspluginwrapper/default.nix
new file mode 100644
index 000000000000..5587f3b732ce
--- /dev/null
+++ b/pkgs/applications/networking/browsers/mozilla-plugins/nspluginwrapper/default.nix
@@ -0,0 +1,36 @@
+{stdenv, fetchurl, which, pkgconfig, file, glib, gtk2, gtk3, curl}:
+let
+  srcData = # Generated upstream information 
+  rec {
+    baseName="nspluginwrapper";
+    version="1.4.4";
+    name="${baseName}-${version}";
+    hash="1fxjz9ifhw0drm12havlsl4jpsq1nv930gqa005kgddv5pa99vgj";
+    url="http://nspluginwrapper.org/download/nspluginwrapper-1.4.4.tar.gz";
+  };
+in
+stdenv.mkDerivation rec {
+  inherit (srcData) name version;
+
+  src = fetchurl{
+    inherit (srcData) url;
+    sha256 = srcData.hash;
+  };
+
+  preConfigure = ''
+    sed -e 's@/usr/bin/@@g' -i configure
+    sed -e '/gthread[.]h/d' -i src/npw-player.c
+    export configureFlags="$configureFlags --target-cpu=$(uname -m)"
+  '';
+
+  buildInputs = [which pkgconfig file glib gtk2 gtk3 curl];
+
+  meta = {
+    description = ''A wrapper to run browser plugins out-of-process'';
+    homepage = "http://nspluginwrapper.org/";
+    license = stdenv.lib.licenses.gpl2;
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.raskin ];
+    inherit (srcData) version;
+  };
+}
diff --git a/pkgs/applications/networking/browsers/mozilla-plugins/nspluginwrapper/default.upstream b/pkgs/applications/networking/browsers/mozilla-plugins/nspluginwrapper/default.upstream
new file mode 100644
index 000000000000..62831613a2e2
--- /dev/null
+++ b/pkgs/applications/networking/browsers/mozilla-plugins/nspluginwrapper/default.upstream
@@ -0,0 +1,4 @@
+name nspluginwrapper
+target default.nix
+url http://nspluginwrapper.org/download/
+version_link /nspluginwrapper-[0-9]+
diff --git a/pkgs/applications/networking/browsers/opera/default.nix b/pkgs/applications/networking/browsers/opera/default.nix
index 8c3cd9f11cd5..d7a8ac51a061 100644
--- a/pkgs/applications/networking/browsers/opera/default.nix
+++ b/pkgs/applications/networking/browsers/opera/default.nix
@@ -13,18 +13,18 @@ let
 in
 
 stdenv.mkDerivation rec {
-  name = "opera-12.00-1467";
+  name = "opera-12.11-1661";
 
   src =
     if stdenv.system == "i686-linux" then
       fetchurl {
-        url = "${mirror}/linux/1200/${name}.i386.linux.tar.xz";
-        sha256 = "d5683f5a4cf0cfd9ce715359b77909c7923c85bcec98513907c1844285356fdc";
+        url = "${mirror}/linux/1211/${name}.i386.linux.tar.xz";
+        sha256 = "0ax2kcnl0hb7fz56c9gcjia3dnwabxl2mq2hvszmbky4i399jlkk";
       }
     else if stdenv.system == "x86_64-linux" then
       fetchurl {
-        url = "${mirror}/linux/1200/${name}.x86_64.linux.tar.xz";
-        sha256 = "7c3dbe122b1fd20123f1b48a420dea080cc24ede4183d47d66b383c2b7ca5051";
+        url = "${mirror}/linux/1211/${name}.x86_64.linux.tar.xz";
+        sha256 = "1pnad4kdasrmm27kg6frldipyzcfy1y610rasbqic9frzb9q8dbp";
       }
     else throw "Opera is not supported on ${stdenv.system} (only i686-linux and x86_64 linux are supported)";
 
diff --git a/pkgs/applications/networking/browsers/uzbl/default.nix b/pkgs/applications/networking/browsers/uzbl/default.nix
index b85ad0e085eb..4c6458d909fd 100644
--- a/pkgs/applications/networking/browsers/uzbl/default.nix
+++ b/pkgs/applications/networking/browsers/uzbl/default.nix
@@ -3,15 +3,16 @@ let
   fetchgit = a.fetchgit;
 
   buildInputs = with a; [
-    libsoup pkgconfig webkit gtk3 makeWrapper
-    kbproto
+    libsoup pkgconfig webkit gtk makeWrapper
+    kbproto glib pango cairo gdk_pixbuf atk
+    python3
   ];
 in
 rec {
   src = fetchgit {
     url = "https://github.com/Dieterbe/uzbl.git";
-    rev = "dcb3b4e1fcff682b412cfe5875f7054b97380d08";
-    sha256 = "f7b2b2903c01c9cfbd99bd94783002e1580d8092ff6022bb5aed3f999ff6e468";
+    rev = "refs/tags/2012.05.14";
+    sha256 = "1crvikb0qqsx5qb003i4w7ywh72psl37gjslrj5hx2fd2f215l0l";
   };
 
   name = "uzbl-git";
@@ -35,7 +36,7 @@ rec {
       --prefix GIO_EXTRA_MODULES : ${a.glib_networking}/lib/gio/modules
     '';
 
-  installFlags = "PREFIX=$out";
+  installFlags = "PREFIX=$out PYINSTALL_EXTRA=\"--prefix=$out\"";
       
   meta = {
     description = "Tiny externally controllable webkit browser";
diff --git a/pkgs/applications/networking/cluster/hadoop/default.nix b/pkgs/applications/networking/cluster/hadoop/default.nix
index 7d475a675587..ef2f16e31936 100644
--- a/pkgs/applications/networking/cluster/hadoop/default.nix
+++ b/pkgs/applications/networking/cluster/hadoop/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
 
-  name = "hadoop-2.0.1-alpha";
+  name = "hadoop-2.0.2-alpha";
 
   src = fetchurl {
     url = "mirror://apache/hadoop/common/${name}/${name}.tar.gz";
-    sha256 = "4e5f4fa1574ee58fd6d59a220b66578fc2cf62c229120eeed07f2880c86f0e59";
+    sha256 = "1r7ailmqhny3pl5nb8bcblnhckszy6hb9n58kwa3s4b8qfk87gkb";
   };
 
   buildInputs = [ makeWrapper ];
diff --git a/pkgs/applications/networking/esniper/default.nix b/pkgs/applications/networking/esniper/default.nix
index 327e4c4a9c52..8208da621af0 100644
--- a/pkgs/applications/networking/esniper/default.nix
+++ b/pkgs/applications/networking/esniper/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, openssl, curl, coreutils, gawk, bash, which }:
 
 stdenv.mkDerivation {
-  name = "esniper-2.27.0";
+  name = "esniper-2.28.0";
 
   src = fetchurl {
-    url = "mirror://sourceforge/esniper/esniper-2-27-0.tgz";
-    sha256 = "0ca9946395be8958d3eb28c9abc4a1a4d4c9134e4b6b3c3816f4631e3be25c02";
+    url = "mirror://sourceforge/esniper/esniper-2-28-0.tgz";
+    sha256 = "c2b0ccb757616b32f2d6cf54a4a5e367405fa7bcd6e6ed11835fe4f8a06a016b";
   };
 
   buildInputs = [openssl curl];
diff --git a/pkgs/applications/networking/instant-messengers/baresip/default.nix b/pkgs/applications/networking/instant-messengers/baresip/default.nix
new file mode 100644
index 000000000000..ba530374c71f
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/baresip/default.nix
@@ -0,0 +1,45 @@
+{stdenv, fetchurl, zlib, openssl, libre, librem, pkgconfig
+, cairo, mpg123, gstreamer, gst_ffmpeg, gst_plugins_base, gst_plugins_bad
+, gst_plugins_good, alsaLib, SDL, libv4l, celt, libsndfile, srtp, ffmpeg
+, gsm, speex, portaudio, spandsp, libuuid
+}:
+stdenv.mkDerivation rec {
+  version = "0.4.2";
+  name = "baresip-${version}";
+  src=fetchurl {
+    url = "http://www.creytiv.com/pub/baresip-${version}.tar.gz";
+    sha256 = "3ac15b3d3cf17b2417ba871e7eaaaf41ab10cb30b900adcee357d5e91ea033e7";
+  };
+  buildInputs = [zlib openssl libre librem pkgconfig
+    cairo mpg123 gstreamer gst_ffmpeg gst_plugins_base gst_plugins_bad gst_plugins_good
+    alsaLib SDL libv4l celt libsndfile srtp ffmpeg gsm speex portaudio spandsp libuuid
+    ];
+  makeFlags = [
+    "LIBRE_MK=${libre}/share/re/re.mk"
+    "LIBRE_INC=${libre}/include/re"
+    "LIBRE_SO=${libre}/lib"
+    "LIBREM_PATH=${librem}"
+    ''PREFIX=$(out)''
+    "USE_VIDEO=1"
+
+    "USE_ALSA=1" "USE_AMR=1" "USE_CAIRO=1" "USE_CELT=1" 
+    "USE_CONS=1" "USE_EVDEV=1" "USE_FFMPEG=1"  "USE_GSM=1" "USE_GST=1" 
+    "USE_L16=1" "USE_MPG123=1" "USE_OSS=1" "USE_PLC=1" 
+    "USE_PORTAUDIO=1" "USE_SDL=1" "USE_SNDFILE=1" "USE_SPEEX=1" 
+    "USE_SPEEX_AEC=1" "USE_SPEEX_PP=1" "USE_SPEEX_RESAMP=1" "USE_SRTP=1" 
+    "USE_STDIO=1" "USE_SYSLOG=1" "USE_UUID=1" "USE_V4L2=1" "USE_X11=1"
+
+    "USE_BV32=" "USE_COREAUDIO=" "USE_G711=" "USE_G722=" "USE_G722_1=" 
+    "USE_ILBC=" "USE_OPUS=" "USE_SILK=" 
+  ]
+  ++ stdenv.lib.optional (stdenv.gcc.gcc != null) "SYSROOT_ALT=${stdenv.gcc.gcc}"
+  ++ stdenv.lib.optional (stdenv.gcc.libc != null) "SYSROOT=${stdenv.gcc.libc}"
+  ;
+  NIX_CFLAGS_COMPILE='' -I${librem}/include/rem -I${gsm}/include/gsm '';
+  meta = {
+    homepage = "http://www.creytiv.com/baresip.html";
+    platforms = with stdenv.lib.platforms; linux;
+    maintainers = with stdenv.lib.maintainers; [raskin];
+    license = with stdenv.lib.licenses; bsd3;
+  };
+}
diff --git a/pkgs/applications/networking/instant-messengers/gajim/default.nix b/pkgs/applications/networking/instant-messengers/gajim/default.nix
index bca70d14c008..1def7e2b1f01 100644
--- a/pkgs/applications/networking/instant-messengers/gajim/default.nix
+++ b/pkgs/applications/networking/instant-messengers/gajim/default.nix
@@ -2,19 +2,20 @@ a :
 let 
   fetchurl = a.fetchurl;
 
-  version = a.lib.attrByPath ["version"] "0.14.1" a; 
+  version = a.lib.attrByPath ["version"] "0.15.1" a; 
   buildInputs = with a; [
     python pyGtkGlade gtk perl intltool dbus gettext
     pkgconfig makeWrapper libglade pyopenssl libXScrnSaver
     libXt xproto libXext xextproto libX11 gtkspell aspell
     scrnsaverproto pycrypto pythonDBus pythonSexy 
-    docutils
+    docutils pyasn1 farstream gst_plugins_bad gstreamer
+    gst_ffmpeg gst_python
   ];
 in
 rec {
   src = fetchurl {
-    url = "http://www.gajim.org/downloads/0.14/gajim-${version}.tar.gz";
-    sha256 = "ef757572acf3f3d59408fd95b7ec99bc0e39c5b8c66bc61c78ba65e71c3d8e18";
+    url = "http://www.gajim.org/downloads/0.15/gajim-${version}.tar.gz";
+    sha256 = "b315d4a600da0c5f8248e8f887a41ce2630c49995b36cbad8fb2cd81cc8d2e8b";
   };
 
   inherit buildInputs;
@@ -24,6 +25,7 @@ rec {
     export PYTHONPATH="$PYTHONPATH''${PYTHONPATH:+:}$(toPythonPath ${a.pyGtkGlade})/gtk-2.0"
     export PYTHONPATH="$PYTHONPATH''${PYTHONPATH:+:}$(toPythonPath ${a.pygobject})/gtk-2.0"
     sed -e '/-L[$]x_libraries/d' -i configure
+    sed -e 's@tmpfd.close()@os.close(tmpfd)@' -i src/common/latex.py
   '') ["addInputs" "doUnpack"];
 
   fixScriptNames = a.fullDepEntry (''
@@ -34,11 +36,15 @@ rec {
       name="''${name##*/.}"
       mv "$i" "$out/bin-wrapped/$name"
       sed -e 's^'"$i"'^'"$out/bin-wrapped/$name"'^' -i "$out/bin/$name"
+      sed -e "2aexport LD_LIBRARY_PATH=\"\$LD_LIBRARY_PATH\''${LD_LIBRARY_PATH:+:}${a.gtkspell}/lib:${a.gtkspell}/lib64\"" -i "$out/bin/gajim"
+      sed -e "2aexport NIX_LDFLAGS=\"\$NIX_LDFLAGS -L${a.gtkspell}/lib -L${a.gtkspell}/lib64\"" -i "$out/bin/gajim"
+      sed -e "2aexport GST_PLUGIN_PATH=\"\$GST_PLUGIN_PATH''${GST_PLUGIN_PATH:+:}$(echo ${a.gst_plugins_bad}/lib/gstreamer-*):$(echo ${a.gst_ffmpeg}/lib/gstreamer-*):$(echo ${a.farstream}/lib/gstreamer-*)\"" -i "$out/bin/gajim"
     done
   '') ["wrapBinContentsPython"];
 
   /* doConfigure should be removed if not needed */
-  phaseNames = ["preConfigure" (a.doDump "1") "doConfigure" "doMakeInstall" "wrapBinContentsPython" "fixScriptNames"];
+  phaseNames = ["preConfigure" (a.doDump "1") "doConfigure" "doMakeInstall" 
+    "wrapBinContentsPython" "fixScriptNames"];
 
   name = "gajim-" + version;
   meta = {
diff --git a/pkgs/applications/networking/instant-messengers/pidgin/default.nix b/pkgs/applications/networking/instant-messengers/pidgin/default.nix
index 5e85c4c26b4d..238e7e50f44f 100644
--- a/pkgs/applications/networking/instant-messengers/pidgin/default.nix
+++ b/pkgs/applications/networking/instant-messengers/pidgin/default.nix
@@ -21,10 +21,10 @@
 } :
 
 stdenv.mkDerivation rec {
-  name = "pidgin-2.10.2";
+  name = "pidgin-2.10.6";
   src = fetchurl {
     url = "mirror://sourceforge/pidgin/${name}.tar.bz2";
-    sha256 = "1f1j9pr7zwpxwbv94510brh69pmwn4v3np12h75pfrnkas8d5kg5";
+    sha256 = "3e25a633b97cbfa8326999a30282e7a662a9b9bbf2853be84af0b8fb60392c96";
   };
 
   inherit nss ncurses;
diff --git a/pkgs/applications/networking/instant-messengers/psi/default.nix b/pkgs/applications/networking/instant-messengers/psi/default.nix
index 2c6ba36c44f1..5750476cc5c1 100644
--- a/pkgs/applications/networking/instant-messengers/psi/default.nix
+++ b/pkgs/applications/networking/instant-messengers/psi/default.nix
@@ -1,28 +1,33 @@
-{ stdenv, fetchurl, aspell, qt4, zlib, sox, libX11, xproto, libSM, 
-  libICE, qca2, pkgconfig, qca2_ossl, liboil, speex, callPackage, which, glib }:
+{ stdenv, fetchurl, aspell, qt4, zlib, sox, libX11, xproto, libSM
+, libICE, qca2, pkgconfig, qca2_ossl, liboil, speex, callPackage, which, glib
+, libXScrnSaver, scrnsaverproto
+}:
 
 stdenv.mkDerivation rec {
-  name = "psi-0.14";
-  
+  name = "psi-0.15";
+
   src = fetchurl {
     url = "mirror://sourceforge/psi/${name}.tar.bz2";
-    sha256 = "1h54a1qryfva187sw9qnb4lv1d3h3lysqgw55v727swvslh4l0da";
+    sha256 = "593b5ddd7934af69c245afb0e7290047fd7dedcfd8765baca5a3a024c569c7e6";
   };
 
-  buildInputs = [aspell qt4 zlib sox libX11 xproto libSM libICE 
-    qca2 qca2_ossl pkgconfig which glib];
+  buildInputs =
+    [ aspell qt4 zlib sox libX11 xproto libSM libICE
+      qca2 qca2_ossl pkgconfig which glib scrnsaverproto libXScrnSaver
+    ];
 
   NIX_CFLAGS_COMPILE="-I${qca2}/include/QtCrypto";
-  
-  NIX_LDFLAGS="-lqca";
 
-  configureFlags =
-    [ " --with-zlib-inc=${zlib}/include "
-      " --disable-bundled-qca"
-    ];
+  NIX_LDFLAGS="-lqca";
 
   psiMedia = callPackage ./psimedia.nix { };
 
+  enableParallelBuilding = true;
+
+  configureFlags = [
+    "--with-aspell-inc=${aspell}/include"
+    ];
+
   postInstall = ''
     PSI_PLUGINS="$out/lib/psi/plugins"
     mkdir -p "$PSI_PLUGINS"
@@ -34,9 +39,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     description = "Psi, an XMPP (Jabber) client";
-    maintainers = with stdenv.lib.maintainers;
-      [raskin];
-    platforms = with stdenv.lib.platforms;
-      linux;
+    maintainers = [ stdenv.lib.maintainers.raskin ];
+    platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/applications/networking/instant-messengers/psi/glib-2.32.patch b/pkgs/applications/networking/instant-messengers/psi/glib-2.32.patch
new file mode 100644
index 000000000000..49988c253bdb
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/psi/glib-2.32.patch
@@ -0,0 +1,54 @@
+http://sources2.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/net-im/psimedia/files/psimedia-1.0.3-glib2.32.patch?view=log
+
+Index: psimedia-1.0.3/gstprovider/gstcustomelements/gstcustomelements.h
+===================================================================
+--- psimedia-1.0.3.orig/gstprovider/gstcustomelements/gstcustomelements.h
++++ psimedia-1.0.3/gstprovider/gstcustomelements/gstcustomelements.h
+@@ -21,7 +21,7 @@
+ #ifndef GSTCUSTOMELEMENTS_H
+ #define GSTCUSTOMELEMENTS_H
+ 
+-#include <glib/gthread.h>
++#include <glib.h>
+ #include <gst/gst.h>
+ #include <gst/base/gstpushsrc.h>
+ #include <gst/video/video.h>
+Index: psimedia-1.0.3/gstprovider/gstelements/static/gstelements.h
+===================================================================
+--- psimedia-1.0.3.orig/gstprovider/gstelements/static/gstelements.h
++++ psimedia-1.0.3/gstprovider/gstelements/static/gstelements.h
+@@ -21,7 +21,7 @@
+ #ifndef PSI_GSTELEMENTS_H
+ #define PSI_GSTELEMENTS_H
+ 
+-#include <glib/gmacros.h>
++#include <glib.h>
+ 
+ G_BEGIN_DECLS
+ 
+Index: psimedia-1.0.3/gstprovider/gstthread.h
+===================================================================
+--- psimedia-1.0.3.orig/gstprovider/gstthread.h
++++ psimedia-1.0.3/gstprovider/gstthread.h
+@@ -22,7 +22,7 @@
+ #define PSI_GSTTHREAD_H
+ 
+ #include <QThread>
+-#include <glib/gmain.h>
++#include <glib.h>
+ 
+ namespace PsiMedia {
+ 
+Index: psimedia-1.0.3/gstprovider/rwcontrol.h
+===================================================================
+--- psimedia-1.0.3.orig/gstprovider/rwcontrol.h
++++ psimedia-1.0.3/gstprovider/rwcontrol.h
+@@ -28,7 +28,7 @@
+ #include <QMutex>
+ #include <QWaitCondition>
+ #include <QTimer>
+-#include <glib/gmain.h>
++#include <glib.h>
+ #include "psimediaprovider.h"
+ #include "rtpworker.h"
+ 
diff --git a/pkgs/applications/networking/instant-messengers/psi/psimedia.nix b/pkgs/applications/networking/instant-messengers/psi/psimedia.nix
index df821da42f20..993a018625e8 100644
--- a/pkgs/applications/networking/instant-messengers/psi/psimedia.nix
+++ b/pkgs/applications/networking/instant-messengers/psi/psimedia.nix
@@ -1,5 +1,5 @@
-{stdenv, fetchurl, qt4, gstreamer, gst_plugins_base, liboil, speex, which
-, glib, pkgconfig}:
+{ stdenv, fetchurl, qt4, gstreamer, gst_plugins_base, liboil, speex, which
+, glib, pkgconfig }:
 
 stdenv.mkDerivation rec {
   name = "psimedia";
@@ -9,7 +9,9 @@ stdenv.mkDerivation rec {
     sha256 = "0fxjdz8afh75gfx2msysb1gss6zx578l3224jvc9jhm99w1ii781";
   };
 
-  buildInputs = [qt4 gstreamer gst_plugins_base liboil speex which glib pkgconfig];
+  patches = [ ./glib-2.32.patch ];
+
+  buildInputs = [ qt4 gstreamer gst_plugins_base liboil speex which glib pkgconfig ];
 
   configurePhase = ''./configure'';
 
diff --git a/pkgs/applications/networking/instant-messengers/salut-a-toi/default.nix b/pkgs/applications/networking/instant-messengers/salut-a-toi/default.nix
new file mode 100644
index 000000000000..c35101bb874f
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/salut-a-toi/default.nix
@@ -0,0 +1,45 @@
+{stdenv, fetchurl, python, pythonPackages, pygobject, pythonDBus}: 
+stdenv.mkDerivation rec {
+  url = "ftp://ftp.goffi.org/sat/sat-0.2.0.tar.bz2";
+  name = stdenv.lib.nameFromURL url ".tar";
+  src = fetchurl {
+    inherit url;
+    sha256 = "14qqgsgqns1xcp97nd3jcxrq54z1x5a6kimqxy029hh7ys813mf1";
+  };
+
+  buildInputs = with pythonPackages; 
+    [
+      python twisted urwid beautifulsoup wxPython distribute pygobject
+      wokkel pythonDBus pyfeed wrapPython
+    ];
+
+  configurePhase = ''
+    sed -e "s@sys.prefix@'$out'@g" -i setup.py
+    sed -e "1aexport PATH=\"\$PATH\":\"$out/bin\":\"${pythonPackages.twisted}/bin\"" -i src/sat.sh
+    sed -e "1aexport PYTHONPATH=\"\$PYTHONPATHPATH\":\"$PYTHONPATH\":"$out/lib/${python.libPrefix}/site-packages"" -i src/sat.sh
+
+    echo 'import wokkel.muc' | python 
+  '';
+
+  buildPhase = ''
+    python setup.py build
+  '';
+
+  installPhase = ''
+    python setup.py install --prefix="$out" 
+
+    for i in "$out/bin"/*; do
+      head -n 1 "$i" | grep -E '[/ ]python( |$)' && {
+        wrapProgram "$i" --prefix PYTHONPATH : "$PYTHONPATH:$out/lib/${python.libPrefix}/site-packages"
+      } || true 
+    done
+  '';
+  
+  meta = {
+    homepage = "http://sat.goffi.org/";
+    description = "A multi-frontend XMPP client";
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = with stdenv.lib.maintainers; [raskin];
+    license = stdenv.lib.licenses.gpl3Plus;
+  };
+}
diff --git a/pkgs/applications/networking/instant-messengers/skype/default.nix b/pkgs/applications/networking/instant-messengers/skype/default.nix
index ddbba59e1450..7eee9f37ecca 100644
--- a/pkgs/applications/networking/instant-messengers/skype/default.nix
+++ b/pkgs/applications/networking/instant-messengers/skype/default.nix
@@ -5,21 +5,21 @@
 assert stdenv.system == "i686-linux";
 
 stdenv.mkDerivation rec {
-  name = "skype-4.0.0.7";
+  name = "skype-4.0.0.8";
 
   src = fetchurl {
     url = "http://download.skype.com/linux/${name}.tar.bz2";
-    sha256 = "0mrswawqsv53mfghqlj1bzq0jfswha6b0c06px7snd85pd4gn5fn";
+    sha256 = "0gq24rbmjd05ihraarn45rwr79gidnwgllvprzrh5zqx02xll17p";
   };
 
-  buildInputs = 
+  buildInputs =
     lib.optional usePulseAudio pulseaudio ++ [
     alsaLib
-    stdenv.glibc 
+    stdenv.glibc
     stdenv.gcc.gcc
     libXv
-    libXext 
-    libX11 
+    libXext
+    libX11
     qt4
     libXScrnSaver
     libSM
@@ -36,8 +36,8 @@ stdenv.mkDerivation rec {
   phases = "unpackPhase installPhase";
 
   installPhase = ''
-    mkdir -p $out/{opt/skype/,bin}
-    cp -r * $out/opt/skype/
+    mkdir -p $out/{libexec/skype/,bin}
+    cp -r * $out/libexec/skype/
 
     fullPath=
     for i in $buildNativeInputs; do
@@ -45,29 +45,27 @@ stdenv.mkDerivation rec {
     done
 
     dynlinker="$(cat $NIX_GCC/nix-support/dynamic-linker)"
-          
+
     cat > $out/bin/skype << EOF
     #!${stdenv.shell}
     export LD_LIBRARY_PATH=$fullPath:$LD_LIBRARY_PATH
-    $dynlinker $out/opt/skype/skype --resources=$out/opt/skype "\$@"
+    $dynlinker $out/libexec/skype/skype --resources=$out/libexec/skype "\$@"
     EOF
 
     chmod +x $out/bin/skype
 
-    # Desktop icon for Skype
-    patch skype.desktop << EOF
-    5c5
-    < Icon=skype.png
-    ---
-    > Icon=$out/opt/skype/icons/SkypeBlue_48x48.png
-    EOF
+    # Fixup desktop file
+    substituteInPlace skype.desktop --replace \
+      "Icon=skype.png" "Icon=$out/libexec/skype/icons/SkypeBlue_48x48.png"
+    substituteInPlace skype.desktop --replace \
+      "Terminal=0" "Terminal=false"
     mkdir -p $out/share/applications
     mv skype.desktop $out/share/applications
   '';
 
   meta = {
-      description = "A P2P-VoiceIP client";
-      homepage = http://www.skype.com;
-      license = "skype-eula";
+    description = "A proprietary voice-over-IP (VoIP) client";
+    homepage = http://www.skype.com/;
+    license = "unfree";
   };
 }
diff --git a/pkgs/applications/networking/irc/weechat/default.nix b/pkgs/applications/networking/irc/weechat/default.nix
index a891c145b76d..eb1a9c4474f4 100644
--- a/pkgs/applications/networking/irc/weechat/default.nix
+++ b/pkgs/applications/networking/irc/weechat/default.nix
@@ -2,12 +2,12 @@
 , zlib, curl , pkgconfig, libgcrypt, ruby, lua5, tcl, guile }:
 
 stdenv.mkDerivation rec {
-  version = "0.3.8";
+  version = "0.3.9";
   name = "weechat-${version}";
 
   src = fetchurl {
     url = "http://weechat.org/files/src/${name}.tar.gz";
-    sha256 = "4293eb9d29f11b8ee8c301049d57e535acbea677bc1dc41ab12fe1bb8af0f10e";
+    sha256 = "8666c788cbb212036197365df3ba3cf964a23e4f644d76ea51d66dbe3be593bb";
   };
 
   buildInputs = 
diff --git a/pkgs/applications/networking/irc/xchat/default.nix b/pkgs/applications/networking/irc/xchat/default.nix
index 4b9cef2d5011..1999bd030cbc 100644
--- a/pkgs/applications/networking/irc/xchat/default.nix
+++ b/pkgs/applications/networking/irc/xchat/default.nix
@@ -9,6 +9,8 @@ stdenv.mkDerivation {
   buildInputs = [pkgconfig tcl gtk];
   configureFlags = "--disable-nls";
 
+  patches = [ ./glib-top-level-header.patch ];
+
   meta = {
     description = "IRC client using GTK";
     homepage = http://www.xchat.org;
diff --git a/pkgs/applications/networking/irc/xchat/glib-top-level-header.patch b/pkgs/applications/networking/irc/xchat/glib-top-level-header.patch
new file mode 100644
index 000000000000..b1413b357537
--- /dev/null
+++ b/pkgs/applications/networking/irc/xchat/glib-top-level-header.patch
@@ -0,0 +1,75 @@
+diff -Naur xchat-2.8.8-orig/src/common/dbus/dbus-plugin.c xchat-2.8.8/src/common/dbus/dbus-plugin.c
+--- xchat-2.8.8-orig/src/common/dbus/dbus-plugin.c	2009-08-16 05:40:15.000000000 -0400
++++ xchat-2.8.8/src/common/dbus/dbus-plugin.c	2012-07-15 23:07:33.678948703 -0400
+@@ -24,7 +24,7 @@
+ #include <config.h>
+ #include <dbus/dbus-glib.h>
+ #include <dbus/dbus-glib-lowlevel.h>
+-#include <glib/gi18n.h>
++#include <glib.h>
+ #include "../xchat-plugin.h"
+ 
+ #define PNAME _("remote access")
+diff -Naur xchat-2.8.8-orig/src/common/modes.c xchat-2.8.8/src/common/modes.c
+--- xchat-2.8.8-orig/src/common/modes.c	2010-05-29 21:52:18.000000000 -0400
++++ xchat-2.8.8/src/common/modes.c	2012-07-15 23:07:33.654948723 -0400
+@@ -20,7 +20,7 @@
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <glib.h>
+-#include <glib/gprintf.h>
++#include <glib.h>
+ 
+ #include "xchat.h"
+ #include "xchatc.h"
+diff -Naur xchat-2.8.8-orig/src/common/servlist.c xchat-2.8.8/src/common/servlist.c
+--- xchat-2.8.8-orig/src/common/servlist.c	2010-05-16 03:24:26.000000000 -0400
++++ xchat-2.8.8/src/common/servlist.c	2012-07-15 23:07:33.643948732 -0400
+@@ -24,7 +24,7 @@
+ #include <unistd.h>
+ 
+ #include "xchat.h"
+-#include <glib/ghash.h>
++#include <glib.h>
+ 
+ #include "cfgfiles.h"
+ #include "fe.h"
+diff -Naur xchat-2.8.8-orig/src/common/text.c xchat-2.8.8/src/common/text.c
+--- xchat-2.8.8-orig/src/common/text.c	2010-05-29 22:14:41.000000000 -0400
++++ xchat-2.8.8/src/common/text.c	2012-07-15 23:07:33.671948706 -0400
+@@ -28,7 +28,7 @@
+ #include <sys/mman.h>
+ 
+ #include "xchat.h"
+-#include <glib/ghash.h>
++#include <glib.h>
+ #include "cfgfiles.h"
+ #include "chanopt.h"
+ #include "plugin.h"
+diff -Naur xchat-2.8.8-orig/src/common/util.c xchat-2.8.8/src/common/util.c
+--- xchat-2.8.8-orig/src/common/util.c	2009-08-16 05:40:16.000000000 -0400
++++ xchat-2.8.8/src/common/util.c	2012-07-15 23:07:33.649948724 -0400
+@@ -39,7 +39,7 @@
+ #include <errno.h>
+ #include "xchat.h"
+ #include "xchatc.h"
+-#include <glib/gmarkup.h>
++#include <glib.h>
+ #include <ctype.h>
+ #include "util.h"
+ #include "../../config.h"
+diff -Naur xchat-2.8.8-orig/src/common/xchat.h xchat-2.8.8/src/common/xchat.h
+--- xchat-2.8.8-orig/src/common/xchat.h	2009-08-16 05:40:16.000000000 -0400
++++ xchat-2.8.8/src/common/xchat.h	2012-07-15 23:08:20.855910521 -0400
+@@ -1,10 +1,6 @@
+ #include "../../config.h"
+ 
+-#include <glib/gslist.h>
+-#include <glib/glist.h>
+-#include <glib/gutils.h>
+-#include <glib/giochannel.h>
+-#include <glib/gstrfuncs.h>
++#include <glib.h>
+ #include <time.h>			/* need time_t */
+ 
+ #ifndef XCHAT_H
diff --git a/pkgs/applications/networking/mailreaders/mutt/default.nix b/pkgs/applications/networking/mailreaders/mutt/default.nix
index 5364bd445e67..fa006dc5f0db 100644
--- a/pkgs/applications/networking/mailreaders/mutt/default.nix
+++ b/pkgs/applications/networking/mailreaders/mutt/default.nix
@@ -14,6 +14,13 @@ assert headerCache -> gdbm != null;
 assert sslSupport -> openssl != null;
 assert saslSupport -> cyrus_sasl != null;
 
+let
+  gpgmePatch = fetchurl {
+    # Solution for gpgme >= 1.2: http://dev.mutt.org/trac/ticket/3300
+    url = "http://dev.mutt.org/trac/raw-attachment/ticket/3300/mutt-1.5.21-gpgme-init.patch";
+    sha256 = "1qa1c8gns4q3as1h2lk3x4di2k3hr804ar7xlc6xh9r0zjhzmlk4";
+  };
+in
 stdenv.mkDerivation rec {
   name = "mutt-1.5.21";
   
@@ -22,6 +29,8 @@ stdenv.mkDerivation rec {
     sha256 = "1864cwz240gh0zy56fb47qqzwyf6ghg01037rb4p2kqgimpg6h91";
   };
 
+  patches = [ (if gpgmeSupport then gpgmePatch else null) ];
+
   buildInputs = [
     ncurses which perl
     (if headerCache then gdbm else null)
diff --git a/pkgs/applications/networking/mailreaders/notmuch/default.nix b/pkgs/applications/networking/mailreaders/notmuch/default.nix
index 266035aa1bd3..c518f0430ff3 100644
--- a/pkgs/applications/networking/mailreaders/notmuch/default.nix
+++ b/pkgs/applications/networking/mailreaders/notmuch/default.nix
@@ -3,11 +3,11 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "notmuch-0.13.2";
+  name = "notmuch-0.14";
 
   src = fetchurl {
     url = "http://notmuchmail.org/releases/${name}.tar.gz";
-    sha256 = "75ec5f5d04bb7e3a8cc6224859b691f704a2a35f2f6027ffb674e829268f1d68";
+    sha256 = "0lx7kkrsg401zrgj8s4ziqds1jsha3szsh44v57mq4pkq0fijph9";
   };
 
   buildInputs = [ bash emacs gdb glib gmime gnupg1 pkgconfig talloc xapian ];
diff --git a/pkgs/applications/networking/mailreaders/sylpheed/default.nix b/pkgs/applications/networking/mailreaders/sylpheed/default.nix
index de0465622746..bf9e19642b83 100644
--- a/pkgs/applications/networking/mailreaders/sylpheed/default.nix
+++ b/pkgs/applications/networking/mailreaders/sylpheed/default.nix
@@ -5,25 +5,31 @@
 , gpgme ? null
 }:
 
+with stdenv.lib;
+
 assert sslSupport -> openssl != null;
 assert gpgSupport -> gpgme != null;
 
 stdenv.mkDerivation {
-  name = "sylpheed-2.7.1";
+  name = "sylpheed-3.2";
 
   src = fetchurl {
-    url = http://sylpheed.sraoss.jp/sylpheed/v2.7/sylpheed-2.7.1.tar.bz2;
-    sha256 = "08sfz159y8hi3lky98m6p4nkfiima749lza8gf3s3vp2niylbdlb";
+    url = http://sylpheed.sraoss.jp/sylpheed/v3.2/sylpheed-3.2.0.tar.bz2;
+    sha256 = "1cdjwn1f8rgcxzfxj7j7qvacmaw4zfhnip81q4n5lj5d6rj7rssa";
   };
 
-  buildInputs = [
-    pkgconfig gtk
-    (if sslSupport then openssl else null)
-    (if gpgSupport then gpgme else null)
-  ];
+  buildInputs =
+    [ pkgconfig gtk ]
+    ++ optional sslSupport openssl
+    ++ optional gpgSupport gpgme;
 
-  configureFlags = [
-    (if sslSupport then "--enable-ssl" else null)
-  ];
+  configureFlags = optionalString sslSupport "--enable-ssl";
 
+  meta = {
+    homepage = http://sylpheed.sraoss.jp/en/;
+    description = "A lightweight and user-friendly e-mail client";
+    maintainers = [ maintainers.eelco ];
+    platforms = platforms.linux;
+    license = "GPL";
+  };
 }
diff --git a/pkgs/applications/networking/mailreaders/thunderbird/11.x.nix b/pkgs/applications/networking/mailreaders/thunderbird/default.nix
index 0c8ba4b05ff1..1d5bcfa5b9bb 100644
--- a/pkgs/applications/networking/mailreaders/thunderbird/11.x.nix
+++ b/pkgs/applications/networking/mailreaders/thunderbird/default.nix
@@ -2,6 +2,7 @@
 , libIDL, dbus_glib, bzip2, alsaLib, nspr, yasm, mesa, nss
 , libnotify, cairo, pixman, fontconfig
 , libjpeg
+, pythonPackages
 
 , # If you want the resulting program to call itself "Thunderbird"
   # instead of "Shredder", enable this option.  However, those
@@ -9,47 +10,26 @@
   # Mozilla Foundation, see
   # http://www.mozilla.org/foundation/trademarks/.
   enableOfficialBranding ? false
-
 }:
 
-let version = "11.0.1";
-
-    # This patch may become necessary when we use a more recent version of libpng
-    # for now, it's actually not needed
-    # pngPatch = fetchurl {
-    #   url = http://www.linuxfromscratch.org/patches/blfs/svn/thunderbird-9.0.1-libpng-1.5-1.patch;
-    #   sha256 = "8454bdde3be8dc37c9f5e6f597914f0a585ff4b357d3fc86c6c9f80208b6068d";
-    # };
-in
+let version = "16.0.2"; in
 
 stdenv.mkDerivation {
   name = "thunderbird-${version}";
 
   src = fetchurl {
-    url = "http://releases.mozilla.org/pub/mozilla.org/thunderbird/releases/${version}/source/thunderbird-${version}.source.tar.bz2";
-    sha1 = "037344b451b1c031472d92f96d401b15d8e3e7d3";
+    url = "ftp://ftp.mozilla.org/pub/thunderbird/releases/${version}/source/thunderbird-${version}.source.tar.bz2";
+    sha1 = "842d852b31a388d4cf3ac59bc89e8611474e2ec7";
   };
 
   enableParallelBuilding = true;
 
   buildInputs =
     [ pkgconfig perl python zip unzip bzip2 gtk dbus_glib alsaLib libIDL nspr
-      libnotify cairo pixman fontconfig yasm mesa /* nss */
-      libjpeg
+      libnotify cairo pixman fontconfig yasm mesa nss
+      libjpeg pythonPackages.sqlite3
     ];
 
-  # fix some paths in pngPatch
-  # prePatch = ''
-  #   substitute ${pngPatch} png.patch --replace "mozilla-release/modules/" "comm-release/mozilla/modules/"
-  #   '';
-
-  patches = [
-    # "png.patch" # produced by postUnpack
-
-    # Fix weird dependencies such as a so file which depends on "-lpthread".
-    # ./thunderbird-build-deps.patch
-  ];
-
   configureFlags =
     [ "--enable-application=mail"
       "--enable-optimize"
@@ -58,11 +38,13 @@ stdenv.mkDerivation {
       "--enable-strip"
       "--with-pthreads"
       "--with-system-jpeg"
-      # "--with-system-png"  # png 1.5.x not merged in nixpkgs yet
+      #"--with-system-png"
       "--with-system-zlib"
       "--with-system-bz2"
       "--with-system-nspr"
-      "--enable-system-cairo"
+      "--with-system-nss"
+      # Broken: https://bugzilla.mozilla.org/show_bug.cgi?id=722975
+      #"--enable-system-cairo"
       "--disable-crashreporter"
       "--disable-necko-wifi"
       "--disable-webm"
@@ -84,10 +66,7 @@ stdenv.mkDerivation {
 
   postInstall =
     ''
-      # Fix some references to /bin paths in the Xulrunner shell script.
-      substituteInPlace $out/lib/thunderbird-*/thunderbird \
-          --replace /bin/pwd "$(type -tP pwd)" \
-          --replace /bin/ls "$(type -tP ls)"
+      rm -rf $out/include $out/lib/thunderbird-devel-* $out/share/idl
 
       # Create a desktop item.
       mkdir -p $out/share/applications
@@ -109,7 +88,7 @@ stdenv.mkDerivation {
       # Official branding implies thunderbird name and logo cannot be reuse,
       # see http://www.mozilla.org/foundation/licensing.html
       if enableOfficialBranding then licenses.proprietary else licenses.mpl11;
-    maintainers = with maintainers; [ pierron ];
-    platforms = with platforms; linux;
+    maintainers = maintainers.pierron;
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/applications/networking/p2p/mldonkey/default.nix b/pkgs/applications/networking/p2p/mldonkey/default.nix
index f86901d5ddec..2f739b056d4f 100644
--- a/pkgs/applications/networking/p2p/mldonkey/default.nix
+++ b/pkgs/applications/networking/p2p/mldonkey/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl, ocaml, zlib, bzip2, ncurses, file, gd, libpng }:
 
 stdenv.mkDerivation (rec {
-  name = "mldonkey-3.1.1";
+  name = "mldonkey-3.1.3";
   
   src = fetchurl {
     url = "mirror://sourceforge/mldonkey/${name}.tar.bz2";
-    sha256 = "1cj0xvfx03jnpifcqxcgfjhkl3f70r86d8zn2flj9wvlnam98qlr";
+    sha256 = "1qnr0qzliw4aynf2zhmm5hmrc9bd5vhdq3bi8n88j4nc86gry9bw";
   };
   
   meta = {
@@ -15,9 +15,9 @@ stdenv.mkDerivation (rec {
 
   buildInputs = [ ocaml zlib ncurses bzip2 file gd libpng ];
   configureFlags = [ "--disable-gui" ];
-} // (if (stdenv.system != "i686-linux" && stdenv.system != "x86_64-linux") then
+} // (if !ocaml.nativeCompilers then
 {
-  # Byte code compilation (the ocaml opt compiler is not supported in many platforms)
+  # Byte code compilation (the ocaml opt compiler is not supported in some platforms)
   buildPhase = "make mlnet.byte";
   installPhase = ''
     mkdir -p $out/bin
diff --git a/pkgs/applications/networking/remote/putty/default.nix b/pkgs/applications/networking/remote/putty/default.nix
index 5fa1aefe7b02..e35f8c739c54 100644
--- a/pkgs/applications/networking/remote/putty/default.nix
+++ b/pkgs/applications/networking/remote/putty/default.nix
@@ -1,7 +1,8 @@
-{ stdenv, fetchsvn, ncurses, gtk, pkgconfig, autoconf, automake, perl, halibut }:
+{ stdenv, fetchsvn, ncurses, gtk, pkgconfig, autoconf, automake, perl, halibut
+, libtool }:
  
 let
-  rev = 8934;
+  rev = 9690;
 in
 stdenv.mkDerivation {
   name = "putty-${toString rev}";
@@ -10,10 +11,11 @@ stdenv.mkDerivation {
   preConfigure = ''
     perl mkfiles.pl
     ( cd doc ; make );
+    sed '/AM_PATH_GTK(/d' -i unix/configure.ac
+    sed '/AC_OUTPUT/iAM_PROG_CC_C_O' -i unix/configure.ac
+    sed '/AC_OUTPUT/iAM_PROG_AR' -i unix/configure.ac
+    ./mkauto.sh
     cd unix
-    sed '/AM_PATH_GTK(/d' -i configure.ac
-    cp ${automake}/share/automake-*/install-sh .
-    autoreconf -vf
   '';
   
   # The hash is going to change on new snapshot.
@@ -21,8 +23,8 @@ stdenv.mkDerivation {
   src = fetchsvn {
     url = svn://svn.tartarus.org/sgt/putty;
     rev = rev;
-    sha256 = "f5d9870dde7166afd277f7501914c6515b35ee7bb42965ccd22fe977ee5d1b0d";
+    sha256 = "e1fb49766e0724a12776ec3d6cd0bd420e03ebdc3383a01a12dbfd30983f81ef";
   };
 
-  buildInputs = [ gtk ncurses pkgconfig autoconf automake perl halibut ];
+  buildInputs = [ gtk ncurses pkgconfig autoconf automake perl halibut libtool ];
 }
diff --git a/pkgs/applications/networking/sniffers/wireshark/default.nix b/pkgs/applications/networking/sniffers/wireshark/default.nix
index aca0203ca6c9..a5f0ddea28f6 100644
--- a/pkgs/applications/networking/sniffers/wireshark/default.nix
+++ b/pkgs/applications/networking/sniffers/wireshark/default.nix
@@ -4,14 +4,14 @@
 }:
 
 let
-  version = "1.6.2";
+  version = "1.8.3";
 in
 stdenv.mkDerivation {
   name = "wireshark-${version}";
 
   src = fetchurl {
     url = "mirror://sourceforge/wireshark/wireshark-${version}.tar.bz2";
-    sha256 = "0zqy8ws05xz36y49azf5lrwzgfz26h7f8d27xjc89hlqrqagahsk";
+    sha256 = "1crg59kkxb7lw1wpfg52hd4l00hq56pyg7f40c7sgqmm0vsmza43";
   };
 
   buildInputs = [perl pkgconfig gtk libpcap flex bison gnutls libgcrypt
diff --git a/pkgs/applications/networking/umurmur/default.nix b/pkgs/applications/networking/umurmur/default.nix
new file mode 100644
index 000000000000..7c731874a5f5
--- /dev/null
+++ b/pkgs/applications/networking/umurmur/default.nix
@@ -0,0 +1,20 @@
+{ stdenv, fetchurl, openssl, protobufc, libconfig }:
+
+stdenv.mkDerivation rec {
+  name = "umurmur-0.2.10";
+  
+  src = fetchurl {
+    url = "http://umurmur.googlecode.com/files/${name}.tar.gz";
+    sha256 = "0c990jvm73a6lajr1qlzw0p6nkshkh2nqwjmz2sq79pj0hm9ckvy";
+  };
+  
+  buildInputs = [ openssl protobufc libconfig ];
+
+  configureFlags = "--with-ssl=openssl";
+
+  meta = {
+    description = "Minimalistic Murmur (Mumble server)";
+    license = "BSD";
+    homepage = http://code.google.com/p/umurmur/;
+  };
+}
diff --git a/pkgs/applications/office/gnucash/default.nix b/pkgs/applications/office/gnucash/default.nix
index a2c3ed5d6bae..26879a6f660f 100644
--- a/pkgs/applications/office/gnucash/default.nix
+++ b/pkgs/applications/office/gnucash/default.nix
@@ -9,11 +9,11 @@
  */
 
 stdenv.mkDerivation rec {
-  name = "gnucash-2.4.10";
+  name = "gnucash-2.4.11";
 
   src = fetchurl {
     url = "mirror://sourceforge/gnucash/${name}.tar.bz2";
-    sha256 = "1k76b6hnsmljggxsq5l9w94krfmhx58ij8jcxf72p0ddnlimdrjj";
+    sha256 = "0qbpgd6spclkmwryi66cih0igi5a6pmsnk41mmnscpfpz1mddhwk";
   };
 
   buildInputs = [
diff --git a/pkgs/applications/office/openoffice/libreoffice-srcs.nix b/pkgs/applications/office/openoffice/libreoffice-srcs.nix
index 47630e5cfdf3..357b703d84d6 100644
--- a/pkgs/applications/office/openoffice/libreoffice-srcs.nix
+++ b/pkgs/applications/office/openoffice/libreoffice-srcs.nix
@@ -64,6 +64,10 @@
   md5 = "0be45d54cc5e1c2e3102e32b8c190346";
 }
 {
+  name = "liberation-fonts-ttf-2.00.0.tar.gz";
+  md5 = "cfbf1ac6f61bf6cf45342a0cc9381be5";
+}
+{
   name = "swingExSrc.zip";
   md5 = "35c94d2df8893241173de1d16b6034c0";
 }
diff --git a/pkgs/applications/office/openoffice/libreoffice.nix b/pkgs/applications/office/openoffice/libreoffice.nix
index d336266ccaf1..065f439427cf 100644
--- a/pkgs/applications/office/openoffice/libreoffice.nix
+++ b/pkgs/applications/office/openoffice/libreoffice.nix
@@ -16,10 +16,10 @@ let
   langsSpaces = stdenv.lib.concatStringsSep " " langs;
   major = "3";
   minor = "6";
-  patch = "1";
+  patch = "2";
   tweak = "2";
   subdir = "${major}.${minor}.${patch}";
-  version = "${subdir}.${tweak}";
+  version = "${subdir}${if tweak == "" then "" else "."}${tweak}";
   fetchThirdParty = {name, md5}: fetchurl {
     inherit name md5;
     url = "http://dev-www.libreoffice.org/src/${md5}-${name}";
@@ -36,17 +36,17 @@ let
       }) ] ++ (map fetchThirdParty (import ./libreoffice-srcs.nix));
     translations = fetchSrc {
       name = "translations";
-      sha256 = "0id4ad8h3fl4s2ax6r4w4af74xvagkv0qwy50f483lqq3a3pl7fl";
+      sha256 = "a6ef65d5acfe9be19a3d4d743cd23a1017733f651ffc57f5773a24704a282c33";
     };
 
     help = fetchSrc {
       name = "help";
-      sha256 = "0jd3l3rkhmdvrvgklkmrh9zsg9hlv3vhy6s97fnzhpzr90sjqrs1";
+      sha256 = "55ec6ef5eef4bbf2298c3b864f67c8424ebb5ccbe7bcd6ca59abba2867989e31";
     };
 
     core = fetchSrc {
       name = "core";
-      sha256 = "12zc0zviy1p3gk1v5nm4ks4rzscn68lpnl3kis4q693zhsk8jyh3";
+      sha256 = "5ec07ffacec09c4dcee9246cb132f7a59a618b395835e781735fd61bf47e8d37";
     };
   };
 in
diff --git a/pkgs/applications/science/astronomy/gravit/default.nix b/pkgs/applications/science/astronomy/gravit/default.nix
index 388e65c9f753..820b4fb2979a 100644
--- a/pkgs/applications/science/astronomy/gravit/default.nix
+++ b/pkgs/applications/science/astronomy/gravit/default.nix
@@ -1,24 +1,16 @@
-{ stdenv, fetchurl, SDL, SDL_ttf, SDL_image, mesa, lua5_0 }:
+{ stdenv, fetchurl, SDL, SDL_ttf, SDL_image, mesa, lua5_1, automake, autoconf }:
 
-let
-  name = "gravit-0.4.2";
-in
-stdenv.mkDerivation {
-  inherit name;
+stdenv.mkDerivation rec {
+  name = "gravit-0.5.0";
 
   src = fetchurl {
-    url = "http://gravit.slowchop.com/dist/${name}.tar.gz";
-    sha256 = "f37f3ac256a4acbf575f709addaae8cb01eda4f85537affa28c45f2df6fddb07";
+    url = "http://gravit.slowchop.com/media/downloads/${name}.tgz";
+    sha256 = "0lyw0skrkb04s16vgz7ggswjrdxk1h23v5s85s09gjxzjp1xd3xp";
   };
 
-  buildInputs = [mesa SDL SDL_ttf SDL_image lua5_0];
+  buildInputs = [mesa SDL SDL_ttf SDL_image lua5_1 automake autoconf];
 
-  configureFlags = "CFLAGS=-O3 CXXFLAGS=-O3";
-
-  postInstall = ''
-    mv $out/etc/gravit $out/share/gravit/sample-config
-    rmdir $out/etc
-  '';
+  preConfigure = "sh autogen.sh";
 
   meta = {
     homepage = "http://gravit.slowchop.com";
diff --git a/pkgs/applications/science/astronomy/stellarium/default.nix b/pkgs/applications/science/astronomy/stellarium/default.nix
index b651370db216..e890ee58307c 100644
--- a/pkgs/applications/science/astronomy/stellarium/default.nix
+++ b/pkgs/applications/science/astronomy/stellarium/default.nix
@@ -1,28 +1,24 @@
 {stdenv, fetchurl, cmake, freetype, libpng, mesa, gettext, openssl, qt4, perl, libiconv}:
 
 let
-  name = "stellarium-0.11.3";
+  name = "stellarium-0.11.4";
 in
 stdenv.mkDerivation {
   inherit name;
 
   src = fetchurl {
     url = "mirror://sourceforge/stellarium/${name}.tar.gz";
-    sha256 = "f7c7eeaefcdc54c0fb8766f09e0c838acb742719adcdf12a6c1e12d55ecd6ac3";
+    sha256 = "8ad5e9878eb36c2c27f4754dcfc69279123e0eae02cc388074e3cf9b23746535";
   };
 
   buildInputs = [ cmake freetype libpng mesa gettext openssl qt4 perl libiconv ];
 
-  preConfigure = ''
-    sed -i -e '/typedef void (\*__GLXextFuncPtr)(void);/d' src/core/external/GLee.h
-  '';
-
   enableParallelBuilding = true;
 
   meta = {
-    description = "an free open source planetarium";
-    homepage = http://stellarium.org/;
-    license = "GPL2";
+    description = "Free open-source planetarium";
+    homepage = "http://stellarium.org/";
+    license = stdenv.lib.licenses.gpl2;
 
     platforms = stdenv.lib.platforms.linux; # should be mesaPlatforms, but we don't have qt on darwin
     maintainers = [ stdenv.lib.maintainers.simons ];
diff --git a/pkgs/applications/science/electronics/kicad/default.nix b/pkgs/applications/science/electronics/kicad/default.nix
index 9da451849788..d90c66329162 100644
--- a/pkgs/applications/science/electronics/kicad/default.nix
+++ b/pkgs/applications/science/electronics/kicad/default.nix
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     description = "Free Software EDA Suite";
-    homepage = http://kicad.sourceforge.net;
+    homepage = "http://www.kicad-pcb.org/";
     license = "GPLv2";
     maintainers = with stdenv.lib.maintainers; [viric];
     platforms = with stdenv.lib.platforms; linux;
diff --git a/pkgs/applications/science/electronics/ngspice/default.nix b/pkgs/applications/science/electronics/ngspice/default.nix
index c7ddceb6b87d..70153eee61b4 100644
--- a/pkgs/applications/science/electronics/ngspice/default.nix
+++ b/pkgs/applications/science/electronics/ngspice/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl, readline, bison, libX11, libICE, libXaw, libXext}:
 
 stdenv.mkDerivation {
-  name = "ng-spice-rework-21";
+  name = "ng-spice-rework-24";
 
   src = fetchurl {
-    url = mirror://sourceforge/ngspice/ng-spice-rework-21.tar.gz;
-    sha256 = "1hmvfl33dszy8xgbixx0zmiz4rdzjhl7lwlwm953jibd4dgx42j5";
+    url = "mirror://sourceforge/ngspice/ngspice-24.tar.gz";
+    sha256 = "0rgh75hbqrsljz767whbj65wi6369yc286v0qk8jxnv2da7p9ll6";
   };
 
   buildInputs = [ readline libX11 bison libICE libXaw libXext ];
@@ -14,7 +14,7 @@ stdenv.mkDerivation {
 
   meta = {
     description = "The Next Generation Spice (Electronic Circuit Simulator).";
-    homepage = http://ngspice.sourceforge.net;
+    homepage = "http://ngspice.sourceforge.net";
     license = ["BSD" "GPLv2"];
     maintainers = with stdenv.lib.maintainers; [viric];
     platforms = with stdenv.lib.platforms; linux;
diff --git a/pkgs/applications/science/electronics/qfsm/default.nix b/pkgs/applications/science/electronics/qfsm/default.nix
new file mode 100644
index 000000000000..0f24784e9e57
--- /dev/null
+++ b/pkgs/applications/science/electronics/qfsm/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchurl, qt4, cmake, graphviz, pkgconfig }:
+
+stdenv.mkDerivation rec {
+  name = "qfsm-0.53.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/qfsm/${name}-Source.tar.bz2";
+    sha256 = "1fx99dyai8zhs8s6mbr1i1467mnv1pf0ymh6mr0jm68mzj2jyzx4";
+  };
+
+  buildInputs = [ qt4 cmake graphviz pkgconfig ];
+
+  patches = [ ./drop-hardcoded-prefix.patch ];
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "Graphical editor for finite state machines";
+    homepage = "http://qfsm.sourceforge.net/";
+    license = stdenv.lib.licenses.gpl3Plus;
+    maintainers = [ stdenv.lib.maintainers.simons ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/applications/science/electronics/qfsm/drop-hardcoded-prefix.patch b/pkgs/applications/science/electronics/qfsm/drop-hardcoded-prefix.patch
new file mode 100644
index 000000000000..965d67ac5526
--- /dev/null
+++ b/pkgs/applications/science/electronics/qfsm/drop-hardcoded-prefix.patch
@@ -0,0 +1,20 @@
+diff -ubrw qfsm-0.53.0-Source-orig/CMakeLists.txt qfsm-0.53.0-Source-new/CMakeLists.txt
+--- qfsm-0.53.0-Source-orig/CMakeLists.txt	2012-11-11 20:13:01.935856229 +0100
++++ qfsm-0.53.0-Source-new/CMakeLists.txt	2012-11-11 20:13:24.962930007 +0100
+@@ -406,10 +406,6 @@
+ 
+ 
+ IF(UNIX AND NOT WIN32)
+-  SET(CMAKE_INSTALL_PREFIX "/usr")
+-ENDIF(UNIX AND NOT WIN32)
+-
+-IF(UNIX AND NOT WIN32)
+   ADD_DEFINITIONS(-DQFSM_LANGUAGE_DIR="${CMAKE_INSTALL_PREFIX}/share/qfsm/")
+   ADD_DEFINITIONS(-DQFSM_HELP_DIR="${CMAKE_INSTALL_PREFIX}/share/doc/qfsm/")
+ ELSE(UNIX AND NOT WIN32)
+@@ -472,5 +468,3 @@
+     )
+ 
+ ENDIF(UNIX AND NOT WIN32)
+-
+-
diff --git a/pkgs/applications/science/electronics/tkgate/1.x.nix b/pkgs/applications/science/electronics/tkgate/1.x.nix
new file mode 100644
index 000000000000..7c04c85fdb7e
--- /dev/null
+++ b/pkgs/applications/science/electronics/tkgate/1.x.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchurl, tcl, tk, libX11, libiconvOrLibc, which, yacc, flex, imake, xproto, gccmakedep }:
+
+assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
+
+stdenv.mkDerivation rec {
+  name = "tkgate-1.8.7";
+
+  src = fetchurl {
+    url = "http://www.tkgate.org/downloads/${name}.tgz";
+    sha256 = "1pqywkidfpdbj18i03h97f4cimld4fb3mqfy8jjsxs12kihm18fs";
+  };
+
+  buildInputs = [ tcl tk libX11 libiconvOrLibc which yacc flex imake xproto gccmakedep ];
+
+  patchPhase = ''
+    sed -i config.h \
+      -e 's|.*#define.*TKGATE_TCLTK_VERSIONS.*|#define TKGATE_TCLTK_VERSIONS "8.5"|' \
+      -e 's|.*#define.*TKGATE_INCDIRS.*|#define TKGATE_INCDIRS "${tcl}/include ${tk}/include ${libiconvOrLibc}/include ${libX11}/include"|' \
+      -e 's|.*#define.*TKGATE_LIBDIRS.*|#define TKGATE_LIBDIRS "${tcl}/lib ${tk}/lib ${libiconvOrLibc}/lib ${libX11}/lib"|' \
+      \
+      -e '20 i #define TCL_LIBRARY "${tcl}/lib"' \
+      -e '20 i #define TK_LIBRARY "${tk}/lib/${tk.libPrefix}"' \
+      -e '20 i #define USE_ICONV 1' \
+      \
+      -e "s|.*#define.*TKGATE_HOMEDIRBASE.*|#define TKGATE_HOMEDIRBASE \\\"$out/lib\\\"|" \
+      -e "s|.*#define.*TKGATE_BINDIR.*|#define TKGATE_BINDIR \\\"$out/bin\\\"|" \
+      -e "s|.*#define.*TKGATE_MANDIR.*|#define TKGATE_MANDIR \\\"$out/share/man/man1\\\"|" \
+      -e "s|file:/usr/X11R6/lib/tkgate-|file://$out/lib/tkgate-|"
+  '';
+
+  meta = {
+    description = "Event driven digital circuit simulator with a TCL/TK-based graphical editor";
+    homepage = "http://www.tkgate.org/";
+    license = "GPLv2+";
+    maintainers = [ stdenv.lib.maintainers.simons ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/applications/science/electronics/tkgate/2.x.nix b/pkgs/applications/science/electronics/tkgate/2.x.nix
new file mode 100644
index 000000000000..756fe7052d83
--- /dev/null
+++ b/pkgs/applications/science/electronics/tkgate/2.x.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchurl, tcl, tk, libX11, libiconvOrLibc }:
+
+assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
+
+stdenv.mkDerivation rec {
+  name = "tkgate-2.0-b10";
+
+  src = fetchurl {
+    url = "http://www.tkgate.org/downloads/${name}.tgz";
+    sha256 = "0mr061xcwjmd8nhyjjcw2dzxqi53hv9xym9xsp0cw98knz2skxjf";
+  };
+
+  buildInputs = [ tcl tk libX11 ];
+
+  dontStrip = true;
+
+  patchPhase = ''
+    sed -i configure \
+      -e 's|TKGATE_INCDIRS=.*|TKGATE_INCDIRS="${tcl}/include ${tk}/include ${libiconvOrLibc}/include"|' \
+      -e 's|TKGATE_LIBDIRS=.*|TKGATE_LIBDIRS="${tcl}/lib ${tk}/lib ${libiconvOrLibc}/lib"|'
+    sed -i options.h \
+      -e 's|.* #define TCL_LIBRARY .*|#define TCL_LIBRARY "${tcl}/${tcl.libdir}"|' \
+      -e 's|.* #define TK_LIBRARY .*|#define TK_LIBRARY "${tk}/lib/${tk.libPrefix}"|'
+  '';
+
+  meta = {
+    description = "Event driven digital circuit simulator with a TCL/TK-based graphical editor";
+    homepage = "http://www.tkgate.org/";
+    license = "GPLv2+";
+    maintainers = [ stdenv.lib.maintainers.simons ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/applications/science/math/maxima/default.nix b/pkgs/applications/science/math/maxima/default.nix
index 41c21f94b011..18d145b6dde2 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.27.0";
+  version = "5.28.0";
 
   searchPath =
     stdenv.lib.makeSearchPath "bin"
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "mirror://sourceforge/${name}/${name}-${version}.tar.gz";
-    sha256 = "9006803714f1385221c4395697fad53f125a13d29b50b188d045d08e25f8dca7";
+    sha256 = "d73e925f0116ba361bf4390c80e24d4fa763f647cc1fc4cc06bbf40ceb3facda";
   };
 
   buildInputs = [sbcl texinfo perl makeWrapper];
diff --git a/pkgs/applications/science/math/wxmaxima/default.nix b/pkgs/applications/science/math/wxmaxima/default.nix
index 52048dc9d197..559c4448c316 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 = "12.04.0";
+  version = "12.09.0";
 in
 stdenv.mkDerivation {
   name = "${name}-${version}";
 
   src = fetchurl {
     url = "mirror://sourceforge/${name}/wxMaxima-${version}.tar.gz";
-    sha256 = "60110507e0a63738a1f420b22697eaac9bea3866122e072dcd697077e8744824";
+    sha256 = "5803ab62fc791bcb87f0d0f38357dba6fccc4efa61cb9f709e142c2954b1305d";
   };
 
   buildInputs = [wxGTK maxima makeWrapper];
diff --git a/pkgs/applications/version-management/darcs/default.nix b/pkgs/applications/version-management/darcs/default.nix
index 3fb667b94619..8ac93af8c466 100644
--- a/pkgs/applications/version-management/darcs/default.nix
+++ b/pkgs/applications/version-management/darcs/default.nix
@@ -5,8 +5,8 @@
 
 cabal.mkDerivation (self: {
   pname = "darcs";
-  version = "2.8.2";
-  sha256 = "1gd8028k91hjsd9hvx3pw4h5zsn2ckc7pfp7f1f566dpp1g422v5";
+  version = "2.8.3";
+  sha256 = "0nbg45i5sgbsc488siqirgysy3z912xghqbwm5hcsl37j910hxch";
   isLibrary = true;
   isExecutable = true;
   buildDepends = [
@@ -15,6 +15,10 @@ cabal.mkDerivation (self: {
     zlib
   ];
   extraLibraries = [ curl ];
+  postInstall = ''
+    mkdir -p $out/etc/bash_completion.d
+    mv contrib/darcs_completion $out/etc/bash_completion.d/darcs
+  '';
   meta = {
     homepage = "http://darcs.net/";
     description = "a distributed, interactive, smart revision control system";
diff --git a/pkgs/applications/version-management/fossil/default.nix b/pkgs/applications/version-management/fossil/default.nix
index 325d2e77e1a3..7e842aa72e5f 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.mkDerivation {
-  name = "fossil-1.21";
+  name = "fossil-1.24";
 
   src = fetchurl {
-    url = http://www.fossil-scm.org/download/fossil-src-20111213135356.tar.gz;
-    sha256 = "07g78sf26v7zr4qzcwky4h4zzaaz8apy33d35bhc5ax63z6md1f9";
+    url = http://www.fossil-scm.org/download/fossil-src-20121022124804.tar.gz;
+    sha256 = "0gcvcrd368acxd79gh7p7caicgqd0f076n0i2if63mg3b8ivz9im";
   };
 
   buildInputs = [ zlib openssl readline sqlite ];
@@ -15,6 +15,10 @@ stdenv.mkDerivation {
 
   checkTarget = "test";
 
+  preBuild=''
+    export USER=nonexistent-but-specified-user
+  '';
+
   installPhase = ''
     mkdir -p $out/bin
     INSTALLDIR=$out/bin make install
diff --git a/pkgs/applications/version-management/git-and-tools/darcs-to-git/default.nix b/pkgs/applications/version-management/git-and-tools/darcs-to-git/default.nix
new file mode 100644
index 000000000000..115424ac69c8
--- /dev/null
+++ b/pkgs/applications/version-management/git-and-tools/darcs-to-git/default.nix
@@ -0,0 +1,79 @@
+{ stdenv, fetchgit, ruby, gnugrep, diffutils, git, darcs }:
+
+stdenv.mkDerivation rec {
+  name = "darcs-to-git-${version}";
+  version = "0.2git";
+
+  src = fetchgit {
+    url = "git://github.com/purcell/darcs-to-git.git";
+    rev = "58a55936899c7e391df5ae1326c307fbd4617a25";
+    sha256 = "366aa691920991e21cfeebd4cbd53a6c42d80e2bc46ff398af482d1d15bac4c3";
+  };
+
+  patchPhase = let
+    matchExecution = ''(\<(output_of|system|run)\([^"%]*("|%w\()|^[^"`]*`)'';
+  in ''
+    sed -r -i \
+      -e '1s|^#!.*|#!${ruby}/bin/ruby|' \
+      -e 's!${matchExecution}git\>!\1${git}/bin/git!' \
+      -e 's!${matchExecution}darcs\>!\1${darcs}/bin/darcs!' \
+      -e 's!${matchExecution}diff\>!\1${diffutils}/bin/diff!' \
+      -e 's!\<egrep\>!${gnugrep}/bin/egrep!g' \
+      -e 's!%w\(darcs init\)!%w(${darcs}/bin/darcs init)!' \
+      darcs-to-git
+  '';
+
+  installPhase = ''
+    install -vD darcs-to-git "$out/bin/darcs-to-git"
+  '';
+
+  doCheck = true;
+
+  checkPhase = ''
+    orig_dir="$(pwd)"
+    darcs_repos="$(pwd)/darcs_test_repos"
+    git_repos="$(pwd)/git_test_repos"
+    test_home="$(pwd)/test_home"
+    mkdir "$darcs_repos" "$git_repos" "$test_home"
+    cd "$darcs_repos"
+    ${darcs}/bin/darcs init
+    echo "this is a test file" > new_file1
+    ${darcs}/bin/darcs add new_file1
+    HOME="$test_home" ${darcs}/bin/darcs record -a -m c1 -A none
+    echo "testfile1" > new_file1
+    echo "testfile2" > new_file2
+    ${darcs}/bin/darcs add new_file2
+    HOME="$test_home" ${darcs}/bin/darcs record -a -m c2 -A none
+    ${darcs}/bin/darcs mv new_file2 only_one_file
+    rm -f new_file1
+    HOME="$test_home" ${darcs}/bin/darcs record -a -m c3 -A none
+    cd "$git_repos"
+    HOME="$test_home" PATH= "$orig_dir/darcs-to-git" "$darcs_repos"
+    assertFileContents() {
+      echo -n "File $1 contains '$2'..." >&2
+      if [ "x$(cat "$1")" = "x$2" ]; then
+        echo " passed." >&2
+        return 0
+      else
+        echo " failed: '$(cat "$1")' != '$2'" >&2
+        return 1
+      fi
+    }
+    echo "Checking if converted repository matches original repository:" >&2
+    assertFileContents only_one_file testfile2
+    ${git}/bin/git reset --hard HEAD^
+    assertFileContents new_file1 testfile1
+    assertFileContents new_file2 testfile2
+    ${git}/bin/git reset --hard HEAD^
+    assertFileContents new_file1 "this is a test file"
+    echo "All checks passed." >&2
+    cd "$orig_dir"
+    rm -rf "$darcs_repos" "$git_repos" "$test_home"
+  '';
+
+  meta = {
+    description = "Converts a Darcs repository into a Git repository";
+    homepage = "http://www.sanityinc.com/articles/converting-darcs-repositories-to-git";
+    license = stdenv.lib.licenses.mit;
+  };
+}
diff --git a/pkgs/applications/version-management/git-and-tools/default.nix b/pkgs/applications/version-management/git-and-tools/default.nix
index efe4fcb2d7c9..9f52871547a4 100644
--- a/pkgs/applications/version-management/git-and-tools/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/default.nix
@@ -43,10 +43,13 @@ rec {
   });
 
   gitAnnex = lib.makeOverridable (import ./git-annex) {
-    inherit stdenv fetchurl libuuid rsync findutils curl perl git ikiwiki which coreutils openssh;
-    inherit (haskellPackages) ghc MissingH utf8String pcreLight SHA dataenc
-      HTTP testpack hS3 mtl network hslogger hxt json liftedBase monadControl IfElse
-      QuickCheck bloomfilter editDistance stm hinotify;
+    inherit stdenv fetchurl perl coreutils git libuuid rsync findutils curl ikiwiki which openssh;
+    inherit (haskellPackages_ghc741) ghc bloomfilter dataenc editDistance hinotify hS3 hslogger HTTP
+      blazeBuilder blazeHtml caseInsensitive IfElse json liftedBase MissingH monadControl mtl
+      network pcreLight SHA stm utf8String networkInfo dbus clientsession cryptoApi dataDefault
+      extensibleExceptions filepath hamlet httpTypes networkMulticast text time transformers
+      transformersBase wai waiLogger warp yesod yesodDefault yesodStatic testpack QuickCheck
+      SafeSemaphore networkPprotocolXmpp async dns DAV;
   };
 
   qgit = import ./qgit {
@@ -91,4 +94,6 @@ rec {
   gitSubtree = import ./git-subtree {
     inherit stdenv fetchurl git asciidoc xmlto docbook_xsl docbook_xml_dtd_45 libxslt;
   };
+
+  darcsToGit = callPackage ./darcs-to-git { };
 }
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 86c8e9717b16..713cf0d62a61 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,27 +1,37 @@
-{ stdenv, fetchurl, curl, dataenc, findutils, ghc, git, hS3, hslogger, HTTP, hxt
-, ikiwiki, json, libuuid, MissingH, monadControl, mtl, network, pcreLight, perl
-, QuickCheck, rsync, SHA, testpack, utf8String, which, liftedBase, coreutils
-, IfElse, bloomfilter, editDistance, openssh, stm, hinotify
+{ stdenv, ghc, fetchurl, perl, coreutils, git, libuuid, rsync
+, findutils, curl, ikiwiki, which, openssh
+, blazeBuilder, blazeHtml, bloomfilter, caseInsensitive
+, clientsession, cryptoApi, dataDefault, dataenc, dbus
+, editDistance, extensibleExceptions, filepath, hamlet, hinotify
+, hS3, hslogger, HTTP, httpTypes, IfElse, json, liftedBase
+, MissingH, monadControl, mtl, network, networkInfo
+, networkMulticast, pcreLight, QuickCheck, SHA, stm, text, time
+, transformers, transformersBase, utf8String, wai, waiLogger, warp
+, yesod, yesodDefault, yesodStatic, testpack, SafeSemaphore
+, networkPprotocolXmpp, async, dns, DAV
 }:
 
 let
-  version = "3.20120825";
+  version = "3.20121112-161-gb27d9eb";
 in
 stdenv.mkDerivation {
   name = "git-annex-${version}";
 
   src = fetchurl {
-    url = "http://git.kitenet.net/?p=git-annex.git;a=snapshot;sf=tgz;h=refs/tags/${version}";
-    sha256 = "edffe6a99d07599f62d4d5f6823de8a830abe8977c7671fd6eb21aeaebc0b8d0";
+    url = "http://git.kitenet.net/?p=git-annex.git;a=snapshot;h=b27d9ebd0f63bdc449440f2529224d5b655ddbb3;sf=tgz";
+    sha256 = "507efc50e33566a51a6abf688920d30fc55ce984c9c35be085e6df0767686b3a";
     name = "git-annex-${version}.tar.gz";
   };
 
-  buildInputs = [
-    curl dataenc findutils ghc git hS3 hslogger HTTP hxt ikiwiki json
-    libuuid MissingH monadControl mtl network pcreLight perl QuickCheck
-    rsync SHA testpack utf8String which liftedBase IfElse bloomfilter
-    editDistance openssh stm hinotify
-  ];
+  buildInputs = [ ghc git libuuid rsync findutils curl ikiwiki which
+    openssh blazeBuilder blazeHtml bloomfilter caseInsensitive
+    clientsession cryptoApi dataDefault dataenc dbus editDistance
+    extensibleExceptions filepath hamlet hinotify hS3 hslogger HTTP
+    httpTypes IfElse json liftedBase MissingH monadControl mtl network
+    networkInfo networkMulticast pcreLight QuickCheck SHA stm text time
+    transformers transformersBase utf8String wai waiLogger warp yesod
+    yesodDefault yesodStatic testpack SafeSemaphore networkPprotocolXmpp
+    async dns DAV ];
 
   checkTarget = "test";
   doCheck = true;
@@ -29,8 +39,10 @@ stdenv.mkDerivation {
   # The 'add_url' test fails because it attempts to use the network.
   preConfigure = ''
     makeFlagsArray=( PREFIX=$out )
-    sed -i -e 's|#!/usr/bin/perl|#!${perl}/bin/perl|' mdwn2man
+    sed -i -e 's|#!/usr/bin/perl|#!${perl}/bin/perl|' Build/mdwn2man
     sed -i -e 's|"cp |"${coreutils}/bin/cp |' -e 's|"rm -f |"${coreutils}/bin/rm -f |' test.hs
+    # Remove this patch after the next update!
+    sed -i -e '9i #define WITH_OLD_URI' Utility/Url.hs
   '';
 
   meta = {
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 b48c5f05d9e4..b32299092124 100644
--- a/pkgs/applications/version-management/git-and-tools/git/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/git/default.nix
@@ -9,7 +9,7 @@
 
 let
 
-  version = "1.7.12";
+  version = "1.8.0";
 
   svn = subversionClient.override { perlBindings = true; };
 
@@ -20,7 +20,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "http://git-core.googlecode.com/files/git-${version}.tar.gz";
-    sha256 = "3b8661782dc280d3d4be5193bcb8a1895c1ba272cf02efb70857bbcc4415f505";
+    sha1 = "a03afc33f8f0723ad12649d79f1e8968526b4bf7";
   };
 
   patches = [ ./docbook2texi.patch ];
diff --git a/pkgs/applications/version-management/git-and-tools/tig/default.nix b/pkgs/applications/version-management/git-and-tools/tig/default.nix
index d567e20d7320..8d5c2baa7a50 100644
--- a/pkgs/applications/version-management/git-and-tools/tig/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/tig/default.nix
@@ -1,10 +1,10 @@
 { stdenv, fetchurl, ncurses, asciidoc, xmlto, docbook_xsl }:
 
-stdenv.mkDerivation {
-  name = "tig-1.0";
+stdenv.mkDerivation rec {
+  name = "tig-1.1";
   src = fetchurl {
-    url = "http://jonas.nitro.dk/tig/releases/tig-1.0.tar.gz";
-    md5 = "a2d414d1cebbc9cd4f3d545bc6f225c6";
+    url = "http://jonas.nitro.dk/tig/releases/${name}.tar.gz";
+    md5 = "adeb797a8320962eeb345a615257cbac";
   };
   buildInputs = [ncurses asciidoc xmlto docbook_xsl];
   installPhase = ''
@@ -12,8 +12,9 @@ stdenv.mkDerivation {
     make install-doc
   '';
   meta = {
-    description = "Tig is a git repository browser that additionally can act as a pager for output from various git commands";
     homepage = "http://jonas.nitro.dk/tig/";
-    license = "GPLv2";
+    description = "Tig is a git repository browser that additionally can act as a pager for output from various git commands";
+    maintainers = [ stdenv.lib.maintainers.garbas ];
+    license = stdenv.lib.licenses.gpl2;
   };
 }
diff --git a/pkgs/applications/video/MPlayer/default.nix b/pkgs/applications/video/MPlayer/default.nix
index 566089201cda..944af1c26571 100644
--- a/pkgs/applications/video/MPlayer/default.nix
+++ b/pkgs/applications/video/MPlayer/default.nix
@@ -1,36 +1,43 @@
-{ alsaSupport ? true, xvSupport ? true, theoraSupport ? true, cacaSupport ? true
-, xineramaSupport ? true, randrSupport ? true, dvdnavSupport ? true
-, stdenv, fetchurl, fetchsvn, fetchgit, x11, freetype, fontconfig, zlib
-, alsaLib ? null, libXv ? null, libtheora ? null, libcaca ? null
-, libXinerama ? null, libXrandr ? null, libdvdnav ? null
-, cdparanoia ? null, cddaSupport ? true
-, amrnb ? null, amrwb ? null, amrSupport ? false
-, x11Support ? true, libX11 ? null, libXext ? null
-, jackaudioSupport ? false, jackaudio ? null
-, x264Support ? false, x264 ? null
-, xvidSupport ? false, xvidcore ? null
+{ stdenv, fetchurl, freetype, pkgconfig, yasm, freefont_ttf
+, x11Support ? true, libX11 ? null, libXext ? null, mesa ? null
+, xineramaSupport ? true, libXinerama ? null
+, xvSupport ? true, libXv ? null
+, alsaSupport ? true, alsaLib ? null
+, screenSaverSupport ? true, libXScrnSaver ? null
+, vdpauSupport ? false, libvdpau ? null
+, cddaSupport ? true, cdparanoia ? null
+, dvdnavSupport ? true, libdvdnav ? null
+, bluraySupport ? true, libbluray ? null
+, amrSupport ? false, amrnb ? null, amrwb ? null
+, cacaSupport ? true, libcaca ? null
 , lameSupport ? true, lame ? null
 , speexSupport ? true, speex ? null
-, screenSaverSupport ? true, libXScrnSaver
-, pulseSupport ? false, pulseaudio
-, mesa, pkgconfig, unzip, yasm, freefont_ttf
-, vdpauSupport ? false, libvdpau ? null
+, theoraSupport ? true, libtheora ? null
+, x264Support ? false, x264 ? null
+, jackaudioSupport ? false, jackaudio ? null
+, pulseSupport ? false, pulseaudio ? null
+# For screenshots
+, libpngSupport ? true, libpng ? null
 }:
 
-assert alsaSupport -> alsaLib != null;
-assert x11Support -> libX11 != null;
-assert xvSupport -> (libXv != null && x11Support);
-assert theoraSupport -> libtheora != null;
-assert cacaSupport -> libcaca != null;
+assert x11Support -> (libX11 != null && libXext != null && mesa != null);
 assert xineramaSupport -> (libXinerama != null && x11Support);
-assert randrSupport -> (libXrandr != null && x11Support);
-assert dvdnavSupport -> libdvdnav != null;
-assert cddaSupport -> cdparanoia != null;
-assert jackaudioSupport -> jackaudio != null;
-assert amrSupport -> (amrnb != null && amrwb != null);
+assert xvSupport -> (libXv != null && x11Support);
+assert alsaSupport -> alsaLib != null;
 assert screenSaverSupport -> libXScrnSaver != null;
 assert vdpauSupport -> libvdpau != null;
+assert cddaSupport -> cdparanoia != null;
+assert dvdnavSupport -> libdvdnav != null;
+assert bluraySupport -> libbluray != null;
+assert amrSupport -> (amrnb != null && amrwb != null);
+assert cacaSupport -> libcaca != null;
+assert lameSupport -> lame != null;
 assert speexSupport -> speex != null;
+assert theoraSupport -> libtheora != null;
+assert x264Support -> x264 != null;
+assert jackaudioSupport -> jackaudio != null;
+assert pulseSupport -> pulseaudio != null;
+assert libpngSupport -> libpng != null;
 
 let
 
@@ -64,20 +71,12 @@ let
     };
   } else null;
 
-  ffmpegGit = fetchgit {
-    url = "git://git.videolan.org/ffmpeg.git";
-    rev = "9e53f62be1a171eaf9620958c225d42cf5142a30";
-    sha256 = "be0ef2a394c82a0eee0be66bc0b943d37efb90f74ce1030aa89606109434c943";
-  };
-
-  mplayerRev = "34586";
-
 in
 
 stdenv.mkDerivation rec {
-  name = "mplayer-${mplayerRev}";
+  name = "mplayer-1.1";
 
-  src = fetchsvn {
+  src = fetchurl {
     # Old kind of URL:
     # url = http://nixos.org/tarballs/mplayer-snapshot-20101227.tar.bz2;
     # Snapshot I took on 20110423
@@ -86,64 +85,74 @@ stdenv.mkDerivation rec {
     #url = http://www.mplayerhq.hu/MPlayer/releases/mplayer-export-snapshot.tar.bz2;
     #sha256 = "cc1b3fda75b172f02c3f46581cfb2c17f4090997fe9314ad046e464a76b858bb";
 
-    url = "svn://svn.mplayerhq.hu/mplayer/trunk";
-    rev = "${mplayerRev}";
-    sha256 = "5688add3256b5de8e0410194232aaaeb01531bb507459ffe4f07e69cb2d81bd7";
+    url = "http://www.mplayerhq.hu/MPlayer/releases/MPlayer-1.1.tar.xz";
+    sha256 = "173cmsfz7ckzy1hay9mpnc5as51127cfnxl20b521d2jvgm4gjvn";
   };
 
   prePatch = ''
     sed -i /^_install_strip/d configure
   '';
 
-  buildInputs =
-    [ freetype zlib pkgconfig ]
-    ++ stdenv.lib.optionals x11Support [ libX11 libXext mesa ]
-    ++ stdenv.lib.optional alsaSupport alsaLib
-    ++ stdenv.lib.optional xvSupport libXv
-    ++ stdenv.lib.optional theoraSupport libtheora
-    ++ stdenv.lib.optional cacaSupport libcaca
-    ++ stdenv.lib.optional xineramaSupport libXinerama
-    ++ stdenv.lib.optional randrSupport libXrandr
-    ++ stdenv.lib.optionals dvdnavSupport [ libdvdnav libdvdnav.libdvdread ]
-    ++ stdenv.lib.optional cddaSupport cdparanoia
-    ++ stdenv.lib.optional jackaudioSupport jackaudio
-    ++ stdenv.lib.optionals amrSupport [ amrnb amrwb ]
-    ++ stdenv.lib.optional x264Support x264
-    ++ stdenv.lib.optional xvidSupport xvidcore
-    ++ stdenv.lib.optional pulseSupport pulseaudio
-    ++ stdenv.lib.optional screenSaverSupport libXScrnSaver
-    ++ stdenv.lib.optional lameSupport lame
-    ++ stdenv.lib.optional vdpauSupport libvdpau
-    ++ stdenv.lib.optional speexSupport speex;
+  buildInputs = with stdenv.lib;
+    [ freetype pkgconfig ]
+    ++ optionals x11Support [ libX11 libXext mesa ]
+    ++ optional alsaSupport alsaLib
+    ++ optional xvSupport libXv
+    ++ optional theoraSupport libtheora
+    ++ optional cacaSupport libcaca
+    ++ optional xineramaSupport libXinerama
+    ++ optional dvdnavSupport libdvdnav
+    ++ optional bluraySupport libbluray
+    ++ optional cddaSupport cdparanoia
+    ++ optional jackaudioSupport jackaudio
+    ++ optionals amrSupport [ amrnb amrwb ]
+    ++ optional x264Support x264
+    ++ optional pulseSupport pulseaudio
+    ++ optional screenSaverSupport libXScrnSaver
+    ++ optional lameSupport lame
+    ++ optional vdpauSupport libvdpau
+    ++ optional speexSupport speex
+    ++ optional libpngSupport libpng
+    ;
 
   buildNativeInputs = [ yasm ];
 
-  preConfigure = ''
-    cp -r ${ffmpegGit} ffmpeg
-    chmod u+w -R ffmpeg
-    sed -ie '1i#include "libavutil/intreadwrite.h"' ffmpeg/libavcodec/libmp3lame.c
-  '';
-
   postConfigure = ''
     echo CONFIG_MPEGAUDIODSP=yes >> config.mak
   '';
 
-  configureFlags = ''
-    ${if cacaSupport then "--enable-caca" else "--disable-caca"}
-    ${if dvdnavSupport then "--enable-dvdnav --enable-dvdread --disable-dvdread-internal" else ""}
-    ${if x264Support then "--enable-x264 --extra-libs=-lx264" else ""}
-    ${if codecs != null then "--codecsdir=${codecs}" else ""}
-    ${if (stdenv.isi686 || stdenv.isx86_64) then "--enable-runtime-cpudetection" else ""}
-    ${if x11Support then "--enable-x11" else ""}
-    ${stdenv.lib.optionalString speexSupport "--enable-speex"}
-    --disable-xanim
-    --disable-ivtv
-    --enable-vidix
-    --enable-fbdev
-    --disable-ossaudio
-  '';
+  configureFlags = with stdenv.lib;
+    ''
+      ${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"}
+      ${if alsaSupport then "--enable-alsa" else "--disable-alsa"}
+      ${if screenSaverSupport then "--enable-xss" else "--disable-xss"}
+      ${if vdpauSupport then "--enable-vdpau" else "--disable-vdpau"}
+      ${if cddaSupport then "--enable-cdparanoia" else "--disable-cdparanoia"}
+      ${if dvdnavSupport then "--enable-dvdnav" else "--disable-dvdnav"}
+      ${if bluraySupport then "--enable-bluray" else "--disable-bluray"}
+      ${if amrSupport then "--enable-libopencore_amrnb" else "--disable-libopencore_amrnb"}
+      ${if cacaSupport then "--enable-caca" else "--disable-caca"}
+      ${if lameSupport then "--enable-mp3lame --disable-mp3lame-lavc" else "--disable-mp3lame --enable-mp3lame-lavc"}
+      ${if speexSupport then "--enable-speex" else "--disable-speex"}
+      ${if theoraSupport then "--enable-theora" else "--disable-theora"}
+      ${if x264Support then "--enable-x264 --disable-x264-lavc" else "--disable-x264 --enable-x264-lavc"}
+      ${if jackaudioSupport then "--enable-jack" else "--disable-jack"}
+      ${if pulseSupport then "--enable-pulse" else "--disable-pulse"}
+
+      ${optionalString (codecs != null) "--codecsdir=${codecs}"}
+      ${optionalString (stdenv.isi686 || stdenv.isx86_64) "--enable-runtime-cpudetection"}
+      --enable-freetype
+      --disable-xanim
+      --disable-ivtv
+      --disable-xvid --disable-xvid-lavc
+      --enable-vidix
+      --enable-fbdev
+      --disable-ossaudio
+    '';
 
-  NIX_LDFLAGS = if x11Support then "-lX11 -lXext" else "";
+  NIX_LDFLAGS = stdenv.lib.optionalString x11Support "-lX11 -lXext";
 
   # Provide a reasonable standard font.  Maybe we should symlink here.
   postInstall =
@@ -155,7 +164,7 @@ stdenv.mkDerivation rec {
   crossAttrs = {
     dontSetConfigureCross = true;
     # Some things (vidix) are nanonote specific. Once someone cares, we can make options from them.
-    preConfigure = preConfigure + ''
+    preConfigure = ''
       configureFlags="`echo $configureFlags |
         sed -e 's/--codecsdir[^ ]\+//' \
         -e 's/--enable-runtime-cpudetection//' `"
diff --git a/pkgs/applications/video/RealPlayer/default.nix b/pkgs/applications/video/RealPlayer/default.nix
index 12d98bc3362e..968846f1dcb1 100644
--- a/pkgs/applications/video/RealPlayer/default.nix
+++ b/pkgs/applications/video/RealPlayer/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, libstdcpp5, glib, pango, atk, gtk, libX11}:
+{stdenv, fetchurl, libstdcpp5, glib, pango, atk, gtk, libX11, makeWrapper}:
 
 # Note that RealPlayer 10 need libstdc++.so.5, i.e., GCC 3.3, not 3.4.
 
@@ -13,9 +13,7 @@ assert stdenv.system == "i686-linux";
     md5 = "d28b31261059231a3e93c7466f8153e6";
   };
 
-  makeWrapper = ../../../build-support/make-wrapper/make-wrapper.sh;
-
-  inherit libstdcpp5;
+  inherit libstdcpp5 makeWrapper;
   libPath = [libstdcpp5 glib pango atk gtk libX11];
   
 }) // {mozillaPlugin = "/real/mozilla";}
diff --git a/pkgs/applications/video/dvdauthor/build-against-libpng15.patch b/pkgs/applications/video/dvdauthor/build-against-libpng15.patch
deleted file mode 100644
index 8e62cef35af0..000000000000
--- a/pkgs/applications/video/dvdauthor/build-against-libpng15.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-commit c82aaa4eb1a1c36bf7e2b7ae3c9140d0bf8000b5
-Author: Lawrence D'Oliveiro <ldo@geek-central.gen.nz>
-Date:   Wed Jan 26 00:48:37 2011 +0000
-
-    fix to build against png-1.5 (thanks to Thomas Klausner)
-
-diff --git a/src/spuunmux.c b/src/spuunmux.c
-index 5e565d1..9ad2371 100644
---- a/src/spuunmux.c
-+++ b/src/spuunmux.c
-@@ -39,6 +39,7 @@
- #include <netinet/in.h>
- 
- #include <png.h>
-+#include <zlib.h>
- 
- #include "rgb.h"
- #include "common.h"
-@@ -610,7 +611,7 @@ static int write_png
-         png_destroy_write_struct(&png_ptr, (png_infopp)NULL);
-         return -1;
-       } /*if*/
--    if (setjmp(png_ptr->jmpbuf))
-+    if (setjmp(png_jmpbuf(png_ptr)))
-       {
-         png_destroy_write_struct(&png_ptr, &info_ptr);
-         fclose(fp);
diff --git a/pkgs/applications/video/dvdauthor/default.nix b/pkgs/applications/video/dvdauthor/default.nix
index c72e9b892dba..2e115806315c 100644
--- a/pkgs/applications/video/dvdauthor/default.nix
+++ b/pkgs/applications/video/dvdauthor/default.nix
@@ -1,19 +1,17 @@
-{ stdenv, fetchurl, imagemagick, libdvdread, libxml2, freetype, fribidi, libpng, zlib }:
+{ stdenv, fetchurl, imagemagick, libdvdread, libxml2, freetype, fribidi, libpng, zlib, pkgconfig }:
 
-stdenv.mkDerivation {
-  name = "dvdauthor-0.7.0";
+stdenv.mkDerivation rec{
+  name = "dvdauthor-0.7.1";
 
   src = fetchurl {
-    url = mirror://sourceforge/dvdauthor/dvdauthor-0.7.0.tar.gz;
-    sha256 = "1l1l5zya7lirwa1783pa7h22wrfcq8hibbf5kpx8z8zbk5xsz9mf";
+    url = "mirror://sourceforge/dvdauthor/${name}.tar.gz";
+    sha256 = "1s8zqlim0s3hk5sbdsilip3qqh0yv05l1jwx49d9rsy614dv27sh";
   };
 
-  buildInputs = [ imagemagick libdvdread libxml2 freetype fribidi libpng zlib ];
+  buildInputs = [ libpng freetype libdvdread libxml2 zlib fribidi imagemagick ];
+  buildNativeInputs = [ pkgconfig ];
 
-  # Does not build against recent versions of libpng without patch.
-  patches = [ ./build-against-libpng15.patch ];
-
-  meta = { 
+  meta = {
     description = "Tools for generating DVD files to be played on standalone DVD players";
     homepage = http://dvdauthor.sourceforge.net/;
     license = ["GPLv2"];
diff --git a/pkgs/applications/video/key-mon/default.nix b/pkgs/applications/video/key-mon/default.nix
new file mode 100644
index 000000000000..7d0256ae455d
--- /dev/null
+++ b/pkgs/applications/video/key-mon/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, fetchurl, buildPythonPackage, gnome, librsvg, makeWrapper, pygtk
+, pythonPackages }:
+
+buildPythonPackage rec {
+  name = "key-mon-${version}";
+  version = "1.13";
+  namePrefix = "";
+
+  src = fetchurl {
+    url = "http://key-mon.googlecode.com/files/${name}.tar.gz";
+    sha256 = "02h7lcnyqwyqsycd1vlvl11ms81v0zmr9p0pfyl5gmzry9dj7imj";
+  };
+
+  propagatedBuildInputs =
+    [ gnome.python_rsvg librsvg makeWrapper pygtk pythonPackages.xlib ];
+
+  doCheck = false;
+
+  postInstall = ''
+      wrapProgram $out/bin/key-mon --prefix GDK_PIXBUF_MODULE_FILE : \
+      ${librsvg}/lib/gdk-pixbuf/loaders.cache
+    '';
+
+  meta = with stdenv.lib; {
+    homepage = http://code.google.com/p/key-mon;
+    description = "Utility to show live keyboard and mouse status for teaching and screencasts";
+    license = licenses.asl20;
+    maintainers = [ maintainers.goibhniu ];
+  };
+}
diff --git a/pkgs/applications/video/vlc/default.nix b/pkgs/applications/video/vlc/default.nix
index 65357acf00fd..3341a01101c0 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.3";
+  version = "2.0.4";
 
   src = fetchurl {
     url = "http://download.videolan.org/pub/videolan/vlc/${version}/${name}.tar.xz";
-    sha256 = "1lnjfpizgp8slj6i4fgk5wld6nfw08wfhkb1i1dvzbhmfigq1agv";
+    sha256 = "1dixankckfxf8xixfc32rc9mfsv6mx2lk5h13ym8bp4dsk86w1jf";
   };
 
   buildInputs =
diff --git a/pkgs/applications/virtualization/lxc/default.nix b/pkgs/applications/virtualization/lxc/default.nix
deleted file mode 100644
index 26180b843687..000000000000
--- a/pkgs/applications/virtualization/lxc/default.nix
+++ /dev/null
@@ -1,49 +0,0 @@
-{ stdenv, fetchurl, libcap, perl, docbook2x, docbook_xml_dtd_45 }:
-
-let
-  name = "lxc-0.7.5";
-in
-stdenv.mkDerivation{
-  inherit name;
-
-  src = fetchurl {
-    url = "http://lxc.sf.net/download/lxc/${name}.tar.gz";
-    sha256 = "019ec63f250c874bf7625b1f1bf555b1a6e3a947937a4fca73100abddf829b1c";
-  };
-
-  buildInputs = [ libcap perl docbook2x ];
-
-  patches = [
-   ./dont-run-ldconfig.patch
-   ./fix-documentation-build.patch
-   ./fix-sgml-documentation.patch
-  ];
-
-  preConfigure = "export XML_CATALOG_FILES=${docbook_xml_dtd_45}/xml/dtd/docbook/catalog.xml";
-
-  configureFlags = "--localstatedir=/var";
-
-  postInstall = ''
-    cd "$out/lib"
-    lib=liblxc.so.?.*
-    ln -s $lib $(echo $lib | sed -re 's/(liblxc[.]so[.].)[.].*/\1/')
-  '';
-
-  meta = {
-    homepage = "http://lxc.sourceforge.net";
-    description = "lightweight virtual system mechanism";
-    license = stdenv.lib.licenses.lgpl21Plus;
-
-    longDescription = ''
-      LXC is the userspace control package for Linux Containers, a
-      lightweight virtual system mechanism sometimes described as
-      "chroot on steroids". LXC builds up from chroot to implement
-      complete virtual systems, adding resource management and isolation
-      mechanisms to Linux’s existing process management infrastructure.
-    '';
-
-
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = [ stdenv.lib.maintainers.simons ];
-  };
-}
diff --git a/pkgs/applications/virtualization/lxc/dont-run-ldconfig.patch b/pkgs/applications/virtualization/lxc/dont-run-ldconfig.patch
deleted file mode 100644
index e72ac0250f51..000000000000
--- a/pkgs/applications/virtualization/lxc/dont-run-ldconfig.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff -ubr lxc-0.7.5-orig/src/lxc/Makefile.am lxc-0.7.5/src/lxc/Makefile.am
---- lxc-0.7.5-orig/src/lxc/Makefile.am	2011-07-25 00:27:10.000000000 +0200
-+++ lxc-0.7.5/src/lxc/Makefile.am	2011-09-26 09:58:03.479916848 +0200
-@@ -115,7 +115,7 @@
- 
- install-exec-local: install-soPROGRAMS
- 	mv $(DESTDIR)$(libdir)/liblxc.so $(DESTDIR)$(libdir)/liblxc.so.$(VERSION)
--	/sbin/ldconfig -l $(DESTDIR)$(libdir)/liblxc.so.$(VERSION)
-+	: /sbin/ldconfig -l $(DESTDIR)$(libdir)/liblxc.so.$(VERSION)
- 	cd $(DESTDIR)$(libdir); \
- 	ln -sf liblxc.so.$(firstword $(subst ., ,$(VERSION))) liblxc.so
- 
-diff -ubr lxc-0.7.5-orig/src/lxc/Makefile.in lxc-0.7.5/src/lxc/Makefile.in
---- lxc-0.7.5-orig/src/lxc/Makefile.in	2011-08-11 19:02:19.000000000 +0200
-+++ lxc-0.7.5/src/lxc/Makefile.in	2011-09-26 09:58:18.812685181 +0200
-@@ -1322,7 +1322,7 @@
- 
- install-exec-local: install-soPROGRAMS
- 	mv $(DESTDIR)$(libdir)/liblxc.so $(DESTDIR)$(libdir)/liblxc.so.$(VERSION)
--	/sbin/ldconfig -l $(DESTDIR)$(libdir)/liblxc.so.$(VERSION)
-+	: /sbin/ldconfig -l $(DESTDIR)$(libdir)/liblxc.so.$(VERSION)
- 	cd $(DESTDIR)$(libdir); \
- 	ln -sf liblxc.so.$(firstword $(subst ., ,$(VERSION))) liblxc.so
- 
diff --git a/pkgs/applications/virtualization/lxc/fix-documentation-build.patch b/pkgs/applications/virtualization/lxc/fix-documentation-build.patch
deleted file mode 100644
index 0189b35a33e9..000000000000
--- a/pkgs/applications/virtualization/lxc/fix-documentation-build.patch
+++ /dev/null
@@ -1,40 +0,0 @@
-diff -ubr '--exclude=*sgml*' lxc-0.7.5-orig/doc/Makefile.am lxc-0.7.5/doc/Makefile.am
---- lxc-0.7.5-orig/doc/Makefile.am	2011-02-14 09:14:07.000000000 +0100
-+++ lxc-0.7.5/doc/Makefile.am	2011-09-26 09:53:02.192817940 +0200
-@@ -30,13 +30,13 @@
- 
- 
- %.1 : %.sgml 
--	docbook2man -w all $<
-+	docbook2man $<
- 
- %.5 : %.sgml 
--	docbook2man -w all $<
-+	docbook2man $<
- 
- %.7 : %.sgml 
--	docbook2man -w all $<
-+	docbook2man $<
- 
- lxc-%.sgml : common_options.sgml see_also.sgml
- 
-diff -ubr '--exclude=*sgml*' lxc-0.7.5-orig/doc/Makefile.in lxc-0.7.5/doc/Makefile.in
---- lxc-0.7.5-orig/doc/Makefile.in	2011-08-11 19:02:18.000000000 +0200
-+++ lxc-0.7.5/doc/Makefile.in	2011-09-26 09:53:13.835401448 +0200
-@@ -786,13 +786,13 @@
- 
- 
- @ENABLE_DOCBOOK_TRUE@%.1 : %.sgml 
--@ENABLE_DOCBOOK_TRUE@	docbook2man -w all $<
-+@ENABLE_DOCBOOK_TRUE@	docbook2man $<
- 
- @ENABLE_DOCBOOK_TRUE@%.5 : %.sgml 
--@ENABLE_DOCBOOK_TRUE@	docbook2man -w all $<
-+@ENABLE_DOCBOOK_TRUE@	docbook2man $<
- 
- @ENABLE_DOCBOOK_TRUE@%.7 : %.sgml 
--@ENABLE_DOCBOOK_TRUE@	docbook2man -w all $<
-+@ENABLE_DOCBOOK_TRUE@	docbook2man $<
- 
- @ENABLE_DOCBOOK_TRUE@lxc-%.sgml : common_options.sgml see_also.sgml
- 
diff --git a/pkgs/applications/virtualization/lxc/fix-sgml-documentation.patch b/pkgs/applications/virtualization/lxc/fix-sgml-documentation.patch
deleted file mode 100644
index 4d2cce0dd62e..000000000000
--- a/pkgs/applications/virtualization/lxc/fix-sgml-documentation.patch
+++ /dev/null
@@ -1,252 +0,0 @@
-diff -ubr '--exclude=Makefile*' lxc-0.7.5-orig/doc/lxc-cgroup.sgml.in lxc-0.7.5/doc/lxc-cgroup.sgml.in
---- lxc-0.7.5-orig/doc/lxc-cgroup.sgml.in	2010-06-07 10:51:51.000000000 +0200
-+++ lxc-0.7.5/doc/lxc-cgroup.sgml.in	2011-09-26 10:05:01.753873426 +0200
-@@ -23,7 +23,7 @@
- 
- -->
- 
--<!DOCTYPE refentry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
-+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
- 
- <!ENTITY commonoptions SYSTEM "@builddir@/common_options.sgml">
- <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
-diff -ubr '--exclude=Makefile*' lxc-0.7.5-orig/doc/lxc-checkpoint.sgml.in lxc-0.7.5/doc/lxc-checkpoint.sgml.in
---- lxc-0.7.5-orig/doc/lxc-checkpoint.sgml.in	2011-02-17 10:07:44.000000000 +0100
-+++ lxc-0.7.5/doc/lxc-checkpoint.sgml.in	2011-09-26 10:05:01.753873426 +0200
-@@ -23,7 +23,7 @@
- 
- -->
- 
--<!DOCTYPE refentry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
-+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
- 
- <!ENTITY commonoptions SYSTEM "@builddir@/common_options.sgml">
- <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
-diff -ubr '--exclude=Makefile*' lxc-0.7.5-orig/doc/lxc.conf.sgml.in lxc-0.7.5/doc/lxc.conf.sgml.in
---- lxc-0.7.5-orig/doc/lxc.conf.sgml.in	2011-08-09 16:51:01.000000000 +0200
-+++ lxc-0.7.5/doc/lxc.conf.sgml.in	2011-09-26 10:05:01.754873476 +0200
-@@ -23,7 +23,7 @@
- 
- -->
- 
--<!DOCTYPE refentry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
-+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
- 
- <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
- ]>
-diff -ubr '--exclude=Makefile*' lxc-0.7.5-orig/doc/lxc-console.sgml.in lxc-0.7.5/doc/lxc-console.sgml.in
---- lxc-0.7.5-orig/doc/lxc-console.sgml.in	2010-06-07 10:51:51.000000000 +0200
-+++ lxc-0.7.5/doc/lxc-console.sgml.in	2011-09-26 10:05:01.754873476 +0200
-@@ -23,7 +23,7 @@
- 
- -->
- 
--<!DOCTYPE refentry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
-+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
- 
- <!ENTITY commonoptions SYSTEM "@builddir@/common_options.sgml">
- <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
-diff -ubr '--exclude=Makefile*' lxc-0.7.5-orig/doc/lxc-create.sgml.in lxc-0.7.5/doc/lxc-create.sgml.in
---- lxc-0.7.5-orig/doc/lxc-create.sgml.in	2011-07-25 00:27:10.000000000 +0200
-+++ lxc-0.7.5/doc/lxc-create.sgml.in	2011-09-26 10:05:01.755873526 +0200
-@@ -23,7 +23,7 @@
- 
- -->
- 
--<!DOCTYPE refentry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
-+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
- 
- <!ENTITY commonoptions SYSTEM "@builddir@/common_options.sgml">
- <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
-diff -ubr '--exclude=Makefile*' lxc-0.7.5-orig/doc/lxc-destroy.sgml.in lxc-0.7.5/doc/lxc-destroy.sgml.in
---- lxc-0.7.5-orig/doc/lxc-destroy.sgml.in	2010-10-08 11:54:53.000000000 +0200
-+++ lxc-0.7.5/doc/lxc-destroy.sgml.in	2011-09-26 10:05:01.755873526 +0200
-@@ -23,7 +23,7 @@
- 
- -->
- 
--<!DOCTYPE refentry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
-+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
- 
- <!ENTITY commonoptions SYSTEM "@builddir@/common_options.sgml">
- <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
-diff -ubr '--exclude=Makefile*' lxc-0.7.5-orig/doc/lxc-execute.sgml.in lxc-0.7.5/doc/lxc-execute.sgml.in
---- lxc-0.7.5-orig/doc/lxc-execute.sgml.in	2011-07-25 00:27:10.000000000 +0200
-+++ lxc-0.7.5/doc/lxc-execute.sgml.in	2011-09-26 10:05:01.755873526 +0200
-@@ -23,7 +23,7 @@
- 
- -->
- 
--<!DOCTYPE refentry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
-+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
- 
- <!ENTITY commonoptions SYSTEM "@builddir@/common_options.sgml">
- <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
-diff -ubr '--exclude=Makefile*' lxc-0.7.5-orig/doc/lxc-freeze.sgml.in lxc-0.7.5/doc/lxc-freeze.sgml.in
---- lxc-0.7.5-orig/doc/lxc-freeze.sgml.in	2010-06-07 10:51:51.000000000 +0200
-+++ lxc-0.7.5/doc/lxc-freeze.sgml.in	2011-09-26 10:05:01.755873526 +0200
-@@ -23,7 +23,7 @@
- 
- -->
- 
--<!DOCTYPE refentry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
-+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
- 
- <!ENTITY commonoptions SYSTEM "@builddir@/common_options.sgml">
- <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
-diff -ubr '--exclude=Makefile*' lxc-0.7.5-orig/doc/lxc-kill.sgml.in lxc-0.7.5/doc/lxc-kill.sgml.in
---- lxc-0.7.5-orig/doc/lxc-kill.sgml.in	2010-10-08 11:54:53.000000000 +0200
-+++ lxc-0.7.5/doc/lxc-kill.sgml.in	2011-09-26 10:05:01.756873576 +0200
-@@ -23,7 +23,7 @@
- 
- -->
- 
--<!DOCTYPE refentry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
-+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
- 
- <!ENTITY commonoptions SYSTEM "@builddir@/common_options.sgml">
- <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
-diff -ubr '--exclude=Makefile*' lxc-0.7.5-orig/doc/lxc-ls.sgml.in lxc-0.7.5/doc/lxc-ls.sgml.in
---- lxc-0.7.5-orig/doc/lxc-ls.sgml.in	2010-06-07 10:51:51.000000000 +0200
-+++ lxc-0.7.5/doc/lxc-ls.sgml.in	2011-09-26 10:05:01.756873576 +0200
-@@ -24,7 +24,7 @@
- 
- -->
- 
--<!DOCTYPE refentry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
-+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
- 
- <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
- ]>
-diff -ubr '--exclude=Makefile*' lxc-0.7.5-orig/doc/lxc-monitor.sgml.in lxc-0.7.5/doc/lxc-monitor.sgml.in
---- lxc-0.7.5-orig/doc/lxc-monitor.sgml.in	2010-06-07 10:51:51.000000000 +0200
-+++ lxc-0.7.5/doc/lxc-monitor.sgml.in	2011-09-26 10:05:01.756873576 +0200
-@@ -23,7 +23,7 @@
- 
- -->
- 
--<!DOCTYPE refentry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
-+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
- 
- <!ENTITY commonoptions SYSTEM "@builddir@/common_options.sgml">
- <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
-diff -ubr '--exclude=Makefile*' lxc-0.7.5-orig/doc/lxc-ps.sgml.in lxc-0.7.5/doc/lxc-ps.sgml.in
---- lxc-0.7.5-orig/doc/lxc-ps.sgml.in	2011-08-11 17:54:57.000000000 +0200
-+++ lxc-0.7.5/doc/lxc-ps.sgml.in	2011-09-26 10:05:01.756873576 +0200
-@@ -24,7 +24,7 @@
- 
- -->
- 
--<!DOCTYPE refentry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
-+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
- 
- <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
- ]>
-diff -ubr '--exclude=Makefile*' lxc-0.7.5-orig/doc/lxc-restart.sgml.in lxc-0.7.5/doc/lxc-restart.sgml.in
---- lxc-0.7.5-orig/doc/lxc-restart.sgml.in	2011-02-17 10:07:44.000000000 +0100
-+++ lxc-0.7.5/doc/lxc-restart.sgml.in	2011-09-26 10:05:01.757873626 +0200
-@@ -23,7 +23,7 @@
- 
- -->
- 
--<!DOCTYPE refentry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
-+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
- 
- <!ENTITY commonoptions SYSTEM "@builddir@/common_options.sgml">
- <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
-diff -ubr '--exclude=Makefile*' lxc-0.7.5-orig/doc/lxc.sgml.in lxc-0.7.5/doc/lxc.sgml.in
---- lxc-0.7.5-orig/doc/lxc.sgml.in	2010-10-26 18:07:35.000000000 +0200
-+++ lxc-0.7.5/doc/lxc.sgml.in	2011-09-26 10:05:01.758873676 +0200
-@@ -23,7 +23,7 @@
- 
- -->
- 
--<!DOCTYPE refentry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
-+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
- 
- <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
- ]>
-@@ -280,7 +280,7 @@
-       </para>
- 
-       <programlisting>
--
-+<![CDATA[
-    ---------
-   | STOPPED |<---------------
-    ---------                 |
-@@ -305,7 +305,7 @@
-    ----------                |
-        |                     |
-         ---------------------
--
-+]]>
-       </programlisting>
-     </refsect2>
- 
-@@ -570,7 +570,7 @@
- 	to the background.
- 
- 	<programlisting>
--
-+<![CDATA[
- 	  # launch lxc-wait in background
- 	  lxc-wait -n foo -s STOPPED &
- 	  LXC_WAIT_PID=$!
-@@ -583,7 +583,7 @@
- 	  # is STOPPED
- 	  wait $LXC_WAIT_PID
- 	  echo "'foo' is finished"
--
-+]]>
- 	</programlisting>
-       </para>
-     </refsect2>
-diff -ubr '--exclude=Makefile*' lxc-0.7.5-orig/doc/lxc-start.sgml.in lxc-0.7.5/doc/lxc-start.sgml.in
---- lxc-0.7.5-orig/doc/lxc-start.sgml.in	2011-02-01 15:12:40.000000000 +0100
-+++ lxc-0.7.5/doc/lxc-start.sgml.in	2011-09-26 10:05:01.758873676 +0200
-@@ -23,7 +23,7 @@
- 
- -->
- 
--<!DOCTYPE refentry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
-+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
- 
- <!ENTITY commonoptions SYSTEM "@builddir@/common_options.sgml">
- <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
-diff -ubr '--exclude=Makefile*' lxc-0.7.5-orig/doc/lxc-stop.sgml.in lxc-0.7.5/doc/lxc-stop.sgml.in
---- lxc-0.7.5-orig/doc/lxc-stop.sgml.in	2010-06-07 10:51:51.000000000 +0200
-+++ lxc-0.7.5/doc/lxc-stop.sgml.in	2011-09-26 10:05:01.758873676 +0200
-@@ -23,7 +23,7 @@
- 
- -->
- 
--<!DOCTYPE refentry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
-+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
- 
- <!ENTITY commonoptions SYSTEM "@builddir@/common_options.sgml">
- <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
-diff -ubr '--exclude=Makefile*' lxc-0.7.5-orig/doc/lxc-unfreeze.sgml.in lxc-0.7.5/doc/lxc-unfreeze.sgml.in
---- lxc-0.7.5-orig/doc/lxc-unfreeze.sgml.in	2010-06-07 10:51:51.000000000 +0200
-+++ lxc-0.7.5/doc/lxc-unfreeze.sgml.in	2011-09-26 10:05:01.759873726 +0200
-@@ -23,7 +23,7 @@
- 
- -->
- 
--<!DOCTYPE refentry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
-+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
- 
- <!ENTITY commonoptions SYSTEM "@builddir@/common_options.sgml">
- <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
-diff -ubr '--exclude=Makefile*' lxc-0.7.5-orig/doc/lxc-wait.sgml.in lxc-0.7.5/doc/lxc-wait.sgml.in
---- lxc-0.7.5-orig/doc/lxc-wait.sgml.in	2010-06-07 10:51:51.000000000 +0200
-+++ lxc-0.7.5/doc/lxc-wait.sgml.in	2011-09-26 10:05:01.759873726 +0200
-@@ -24,7 +24,7 @@
- 
- -->
- 
--<!DOCTYPE refentry PUBLIC "-//Davenport//DTD DocBook V3.0//EN" [
-+<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
- 
- <!ENTITY commonoptions SYSTEM "@builddir@/common_options.sgml">
- <!ENTITY seealso SYSTEM "@builddir@/see_also.sgml">
diff --git a/pkgs/applications/virtualization/virtualbox/default.nix b/pkgs/applications/virtualization/virtualbox/default.nix
index 56387f9e5c40..a8594c4ba169 100644
--- a/pkgs/applications/virtualization/virtualbox/default.nix
+++ b/pkgs/applications/virtualization/virtualbox/default.nix
@@ -10,7 +10,7 @@ with stdenv.lib;
 
 let
 
-  version = "4.1.22";
+  version = "4.2.2";
 
   forEachModule = action: ''
     for mod in \
@@ -34,7 +34,7 @@ in stdenv.mkDerivation {
 
   src = fetchurl {
     url = "http://download.virtualbox.org/virtualbox/${version}/VirtualBox-${version}.tar.bz2";
-    sha256 = "7abb506203dd0d69b4b408fd999b5b9a479a9adce5f80e9b5569641c053dd153";
+    sha256 = "943daa13694605d5d0a23ffef27c398b5e72ada669de89bad4b98f000f029700";
   };
 
   buildInputs =
@@ -44,7 +44,9 @@ in stdenv.mkDerivation {
     ++ optional javaBindings jdk
     ++ optional pythonBindings python;
 
-  patchPhase = ''
+  patches = [ ./remove_fa_ir.patch ];
+
+  postPatch = ''
     set -x
     MODULES_BUILD_DIR=`echo ${kernel}/lib/modules/*/build`
     sed -e 's@/lib/modules/`uname -r`/build@'$MODULES_BUILD_DIR@ \
@@ -110,6 +112,12 @@ in stdenv.mkDerivation {
     mkdir -p $out/share/applications
     sed -i -e "s|Icon=VBox|Icon=$libexec/VBox.png|" $libexec/virtualbox.desktop
     ln -sfv $libexec/virtualbox.desktop $out/share/applications
+    # Icons
+    mkdir -p $out/share/icons/hicolor
+    for size in `ls -1 $libexec/icons`; do
+      mkdir -p $out/share/icons/hicolor/$size/apps
+      ln -s $libexec/icons/$size/*.png $out/share/icons/hicolor/$size/apps
+    done
   '';
 
   meta = {
diff --git a/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix b/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix
index d903c44866c0..c4c7a9f27083 100644
--- a/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix
+++ b/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix
@@ -1,15 +1,18 @@
 { stdenv, fetchurl, lib, patchelf, cdrkit, kernel, which, makeWrapper
 , libX11, libXt, libXext, libXmu, libXcomposite, libXfixes, libXrandr, libXcursor}:
 
-let version = "4.1.22"; in
+let version = "4.2.2"; in
 
 stdenv.mkDerivation {
   name = "VirtualBox-GuestAdditions-${version}";
+
   src = fetchurl {
     url = "http://download.virtualbox.org/virtualbox/${version}/VBoxGuestAdditions_${version}.iso";
-    sha256 = "5c7d9a4a31c8a926ba6dbae2b9704a561638e94ea0fc4f805a9231dd4f932d46";
+    sha256 = "26f5390b36a3bb9855846d194dcd287b8e53613b599c6ffd7aff1b451cc7f1f1";
   };
+
   KERN_DIR = "${kernel}/lib/modules/*/build";
+
   buildInputs = [ patchelf cdrkit makeWrapper ];
 
   installPhase = ''
@@ -101,9 +104,7 @@ stdenv.mkDerivation {
 
     # Install Xorg drivers
     mkdir -p $out/lib/xorg/modules/{drivers,input}
-    install -m 644 lib/VBoxGuestAdditions/vboxvideo_drv_19.so $out/lib/xorg/modules/drivers/vboxvideo_drv.so
-    # There doesn't appear to be a vboxmouse driver for Xorg 1.9. Was there ever?
-    #install -m 644 lib/VBoxGuestAdditions/vboxmouse_drv_19.so $out/lib/xorg/modules/input/vboxmouse_drv.so
+    install -m 644 lib/VBoxGuestAdditions/vboxvideo_drv_112.so $out/lib/xorg/modules/drivers/vboxvideo_drv.so
 
     # Install kernel modules
     cd src
diff --git a/pkgs/applications/virtualization/virtualbox/remove_fa_ir.patch b/pkgs/applications/virtualization/virtualbox/remove_fa_ir.patch
new file mode 100644
index 000000000000..0d7a83421927
--- /dev/null
+++ b/pkgs/applications/virtualization/virtualbox/remove_fa_ir.patch
@@ -0,0 +1,30 @@
+This patch is for VirtualBox-4.2.2, to temporarily remove references to the
+fa_IR language file from the source tree, as it somehow got lost during tarball
+creation. For more information on this subject please have a look at:
+
+https://www.virtualbox.org/pipermail/vbox-dev/2012-October/005408.html
+
+diff --git a/src/VBox/Frontends/VirtualBox/VBoxUI.pro b/src/VBox/Frontends/VirtualBox/VBoxUI.pro
+index ffeb410..37ac56a 100644
+--- a/src/VBox/Frontends/VirtualBox/VBoxUI.pro
++++ b/src/VBox/Frontends/VirtualBox/VBoxUI.pro
+@@ -63,7 +63,6 @@ TRANSLATIONS = \
+ 	nls/VirtualBox_es.ts \
+ 	nls/VirtualBox_eu.ts \
+ 	nls/VirtualBox_fi.ts \
+-	nls/VirtualBox_fa_IR.ts \
+ 	nls/VirtualBox_fr.ts \
+ 	nls/VirtualBox_gl_ES.ts \
+ 	nls/VirtualBox_hu.ts \
+diff --git a/src/VBox/Frontends/VirtualBox/nls/ApprovedLanguages.kmk b/src/VBox/Frontends/VirtualBox/nls/ApprovedLanguages.kmk
+index 66f0ec3..2fc19b9 100644
+--- a/src/VBox/Frontends/VirtualBox/nls/ApprovedLanguages.kmk
++++ b/src/VBox/Frontends/VirtualBox/nls/ApprovedLanguages.kmk
+@@ -23,7 +23,6 @@ VBOX_APPROVED_GUI_LANGUAGES := \
+ 	de    \
+ 	en    \
+ 	es    \
+-	fa_IR \
+ 	hu    \
+ 	it    \
+ 	ja    \
diff --git a/pkgs/applications/window-managers/awesome/default.nix b/pkgs/applications/window-managers/awesome/default.nix
index 5e24a42d3a72..61f2145ff33c 100644
--- a/pkgs/applications/window-managers/awesome/default.nix
+++ b/pkgs/applications/window-managers/awesome/default.nix
@@ -48,3 +48,4 @@ stdenv.mkDerivation rec {
     platforms = with stdenv.lib.platforms; linux;
   };
 }
+
diff --git a/pkgs/applications/window-managers/i3/default.nix b/pkgs/applications/window-managers/i3/default.nix
index 14fd6ce41931..042e1a323a6d 100644
--- a/pkgs/applications/window-managers/i3/default.nix
+++ b/pkgs/applications/window-managers/i3/default.nix
@@ -3,17 +3,21 @@
   libXcursor, coreutils, perl }:
 
 stdenv.mkDerivation rec {
-  name = "i3-4.2";
+  name = "i3-${version}";
+  version = "4.3";
 
   src = fetchurl {
     url = "http://i3wm.org/downloads/${name}.tar.bz2";
-    sha256 = "e02c832820e8922a44e744e555294f8580c2f8e218c5c1029e52f1bde048732b";
+    sha256 = "895bf586092535efb2bc723ba599c71a027768115e56052f111fc8bb148db925";
   };
 
   buildInputs = [ which pkgconfig libxcb xcbutilkeysyms xcbutil bison xcbutilwm
     libstartup_notification libX11 pcre libev yajl flex libXcursor perl ];
 
-  patchPhase = "patchShebangs .";
+  patchPhase = ''
+    sed -i -e '/^# Pango/,/^$/d' common.mk
+    patchShebangs .
+  '';
 
   configurePhase = "makeFlags=PREFIX=$out";
 
diff --git a/pkgs/applications/window-managers/i3/status.nix b/pkgs/applications/window-managers/i3/status.nix
index 549cfc5d20dc..60db6188f70c 100644
--- a/pkgs/applications/window-managers/i3/status.nix
+++ b/pkgs/applications/window-managers/i3/status.nix
@@ -2,11 +2,11 @@
   }:
 
 stdenv.mkDerivation rec {
-  name = "i3status-2.5.1";
+  name = "i3status-2.6";
 
   src = fetchurl {
     url = "http://i3wm.org/i3status/${name}.tar.bz2";
-    sha256 = "7734efdf79a77617023f1e6d80080251eab3a05defb67313283568511d3e58f2";
+    sha256 = "e7e710cc271887bcd22757269e1b00a5618fb53abdb3455140116b3d38797bce";
   };
 
   buildInputs = [ confuse yajl alsaLib wirelesstools ];
diff --git a/pkgs/applications/window-managers/icewm/default.nix b/pkgs/applications/window-managers/icewm/default.nix
index 0b541d8104d3..3b1c3b4ad37a 100644
--- a/pkgs/applications/window-managers/icewm/default.nix
+++ b/pkgs/applications/window-managers/icewm/default.nix
@@ -16,6 +16,8 @@ stdenv.mkDerivation rec {
     sha256 = "0yw813d8amrl0n1fvdiyznxah92wcylj9kj1qhjc6h73d827h6na";
   };
 
+  patches = [ ./deprecated.patch ];
+
   NIX_LDFLAGS = "-lfontconfig";
 
   # The fuloong2f is not supported by 1.3.6 still
diff --git a/pkgs/applications/window-managers/icewm/deprecated.patch b/pkgs/applications/window-managers/icewm/deprecated.patch
new file mode 100644
index 000000000000..7d22dfe719bd
--- /dev/null
+++ b/pkgs/applications/window-managers/icewm/deprecated.patch
@@ -0,0 +1,23 @@
+http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/x11-wm/icewm/files/icewm-1.2.37-libX11-1.5.0-deprecated.patch?revision=1.1
+
+Description: Don't use "deprecated" as identifier, will FTBFS if another
+ library defines functions as deprecated.
+Author: Andreas Moog <amoog@ubuntu.com>
+Bug: https://sourceforge.net/tracker/?func=detail&aid=3494034&group_id=31&atid=100031
+Bug-Ubuntu: https://bugs.launchpad.net/bugs/935179
+Forwarded: Yes
+
+--- icewm-1.3.7.orig/src/base.h
++++ icewm-1.3.7/src/base.h
+@@ -2,9 +2,9 @@
+ #define __BASE_H
+ 
+ #if ( __GNUC__ == 3 && __GNUC_MINOR__ > 0 ) || __GNUC__ > 3
+-#define deprecated __attribute__((deprecated))
++#define ICEWM_deprecated __attribute__((deprecated))
+ #else
+-#define deprecated
++#define ICEWM_deprecated
+ #endif
+ 
+ /*** Atomar Data Types ********************************************************/
diff --git a/pkgs/applications/window-managers/xmonad/default.nix b/pkgs/applications/window-managers/xmonad/default.nix
index a490bc8018dd..fd215986fa30 100644
--- a/pkgs/applications/window-managers/xmonad/default.nix
+++ b/pkgs/applications/window-managers/xmonad/default.nix
@@ -14,7 +14,6 @@ cabal.mkDerivation (self: {
     platforms = self.ghc.meta.platforms;
     maintainers = [
       self.stdenv.lib.maintainers.andres
-      self.stdenv.lib.maintainers.simons
     ];
   };
 
diff --git a/pkgs/applications/window-managers/xmonad/xmonad-extras.nix b/pkgs/applications/window-managers/xmonad/xmonad-extras.nix
index 42ffeae6f9c2..334c7f59d571 100644
--- a/pkgs/applications/window-managers/xmonad/xmonad-extras.nix
+++ b/pkgs/applications/window-managers/xmonad/xmonad-extras.nix
@@ -4,13 +4,13 @@
 
 cabal.mkDerivation (self: {
   pname = "xmonad-extras";
-  version = "0.10.1.1";
-  sha256 = "1pkp9z58w2x8yhxhvm5nifxb1qcajv52ji53n77rjhpysvrgq5m7";
+  version = "0.10.1.2";
+  sha256 = "1v0yhi3sw7qks8d13amps0qs5p90j3prjh5abm02wblcd0bm1xay";
   buildDepends = [
     hint libmpd mtl network parsec random regexPosix split X11 xmonad
     xmonadContrib
   ];
-  configureFlags = "-f-with_hlist";
+  configureFlags = "-f-with_hlist -fwith_split -fwith_parsec";
   meta = {
     homepage = "http://projects.haskell.org/xmonad-extras";
     description = "Third party extensions for xmonad with wacky dependencies";