summary refs log tree commit diff
diff options
context:
space:
mode:
authorLluís Batlle i Rossell <viric@vicerveza.homeunix.net>2010-01-14 14:49:31 +0000
committerLluís Batlle i Rossell <viric@vicerveza.homeunix.net>2010-01-14 14:49:31 +0000
commit9183f21f7e005b9229b615e65fa463733267ce96 (patch)
tree9155247a14d60982c3f4be514e386a976f7240d3
parentc161cd1773e6411054047b1dd2a9544b0b05b0d1 (diff)
parentc63858a16919de0f929d8377ce616e93a99f2074 (diff)
downloadnixpkgs-9183f21f7e005b9229b615e65fa463733267ce96.tar
nixpkgs-9183f21f7e005b9229b615e65fa463733267ce96.tar.gz
nixpkgs-9183f21f7e005b9229b615e65fa463733267ce96.tar.bz2
nixpkgs-9183f21f7e005b9229b615e65fa463733267ce96.tar.lz
nixpkgs-9183f21f7e005b9229b615e65fa463733267ce96.tar.xz
nixpkgs-9183f21f7e005b9229b615e65fa463733267ce96.tar.zst
nixpkgs-9183f21f7e005b9229b615e65fa463733267ce96.zip
Merging from trunk.
I fixed conflicts regarding the renaming 'kernel' -> 'linux' in all-packages.
Also a small conflict in all-packages about making openssl overridable.
And I some linux 2.6.31-zen kernel files also marked in conflict.


svn path=/nixpkgs/branches/stdenv-updates/; revision=19438
-rw-r--r--doc/package-notes.xml6
-rw-r--r--pkgs/applications/graphics/gimp/default.nix4
-rw-r--r--pkgs/applications/misc/calibre/default.nix46
-rw-r--r--pkgs/applications/misc/gv/default.nix12
-rw-r--r--pkgs/applications/networking/browsers/chromium/default.nix11
-rw-r--r--pkgs/applications/networking/browsers/firefox/3.0.nix6
-rw-r--r--pkgs/applications/networking/browsers/firefox/3.5.nix6
-rw-r--r--pkgs/applications/networking/browsers/icecat-3/default.nix4
-rw-r--r--pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-10/default.nix46
-rw-r--r--pkgs/applications/networking/instant-messengers/bitlbee/default.nix4
-rw-r--r--pkgs/applications/networking/instant-messengers/pidgin/default.nix10
-rw-r--r--pkgs/applications/networking/mailreaders/thunderbird-3.x/default.nix105
-rw-r--r--pkgs/applications/networking/mailreaders/thunderbird/2.x.nix (renamed from pkgs/applications/networking/mailreaders/thunderbird-2.x/default.nix)0
-rw-r--r--pkgs/applications/networking/mailreaders/thunderbird/3.x.nix65
-rw-r--r--pkgs/applications/networking/mailreaders/thunderbird/builder.sh (renamed from pkgs/applications/networking/mailreaders/thunderbird-2.x/builder.sh)0
-rw-r--r--pkgs/applications/networking/mailreaders/thunderbird/xlibs.patch (renamed from pkgs/applications/networking/mailreaders/thunderbird-2.x/xlibs.patch)0
-rw-r--r--pkgs/applications/networking/p2p/gnunet/default.nix45
-rw-r--r--pkgs/applications/networking/p2p/gnunet/disable-http-tests.patch88
-rw-r--r--pkgs/applications/networking/p2p/gnunet/tmpdir.patch93
-rw-r--r--pkgs/applications/networking/sync/rsync/default.nix10
-rw-r--r--pkgs/applications/office/openoffice/OOo-3.1.1-HEADERFIX-1.patch74
-rw-r--r--pkgs/applications/office/openoffice/default.nix2
-rw-r--r--pkgs/applications/science/math/maxima/default.nix4
-rw-r--r--pkgs/applications/virtualization/qemu/0.12.1.nix (renamed from pkgs/applications/virtualization/qemu/0.10.3.nix)6
-rw-r--r--pkgs/applications/virtualization/qemu/0.9.1.nix20
-rw-r--r--pkgs/applications/virtualization/virtualbox/default.nix6
-rw-r--r--pkgs/applications/window-managers/icewm/default.nix15
-rw-r--r--pkgs/applications/window-managers/xcompmgr/default.nix22
-rw-r--r--pkgs/applications/window-managers/xmonad/default.nix4
-rw-r--r--pkgs/applications/window-managers/xmonad/xmonad-contrib.nix4
-rw-r--r--pkgs/build-support/release/nix-build.nix3
-rw-r--r--pkgs/build-support/trivial-builders.nix25
-rw-r--r--pkgs/desktops/gnome-2.28/desktop/libsoup/default.nix6
-rw-r--r--pkgs/development/compilers/adobe-flex-sdk/default.nix13
-rw-r--r--pkgs/development/compilers/fpc/binary.nix17
-rw-r--r--pkgs/development/compilers/fpc/default.nix4
-rw-r--r--pkgs/development/compilers/fpc/lazarus.nix4
-rw-r--r--pkgs/development/compilers/ghc/6.12.1.nix12
-rwxr-xr-xpkgs/development/compilers/ghc/ghc-get-packages.sh1
-rw-r--r--pkgs/development/compilers/mozart/default.nix14
-rw-r--r--pkgs/development/compilers/strategoxt/0.18.nix6
-rw-r--r--pkgs/development/interpreters/guile/1.9.nix4
-rw-r--r--pkgs/development/interpreters/guile/gcov-file-name.patch42
-rw-r--r--pkgs/development/interpreters/php-xdebug/default.nix34
-rw-r--r--pkgs/development/interpreters/php/ini-bulider.nix43
-rw-r--r--pkgs/development/interpreters/php_configurable/default.nix36
-rw-r--r--pkgs/development/libraries/adns/default.nix6
-rw-r--r--pkgs/development/libraries/enginepkcs11/default.nix18
-rw-r--r--pkgs/development/libraries/glib/2.22.x.nix4
-rw-r--r--pkgs/development/libraries/gtk+/2.18.x.nix4
-rw-r--r--pkgs/development/libraries/haskell/Agda/default.nix5
-rw-r--r--pkgs/development/libraries/haskell/QuickCheck/QuickCheck-2.nix (renamed from pkgs/development/libraries/haskell/QuickCheck/2.1.0.1.nix)7
-rw-r--r--pkgs/development/libraries/haskell/X11/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/cabal/cabal.nix42
-rw-r--r--pkgs/development/libraries/haskell/haskeline/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/regular/default.nix6
-rw-r--r--pkgs/development/libraries/haskell/utf8-string/default.nix4
-rw-r--r--pkgs/development/libraries/haskell/uu-parsinglib/default.nix4
-rw-r--r--pkgs/development/libraries/java/dbus-java/default.nix21
-rw-r--r--pkgs/development/libraries/java/libmatthew-java/default.nix13
-rw-r--r--pkgs/development/libraries/libdrm/default.nix4
-rw-r--r--pkgs/development/libraries/libextractor/0.5.18.nix21
-rw-r--r--pkgs/development/libraries/libextractor/default.nix64
-rw-r--r--pkgs/development/libraries/libidn/default.nix6
-rw-r--r--pkgs/development/libraries/libjpeg/62.nix29
-rwxr-xr-xpkgs/development/libraries/libjpeg/builder.sh25
-rw-r--r--pkgs/development/libraries/libmicrohttpd/default.nix14
-rw-r--r--pkgs/development/libraries/libmusclecard/default.nix22
-rw-r--r--pkgs/development/libraries/libp11/default.nix18
-rw-r--r--pkgs/development/libraries/mesa/default.nix8
-rw-r--r--pkgs/development/libraries/mesa/headers.nix10
-rw-r--r--pkgs/development/libraries/mpeg2dec/default.nix2
-rw-r--r--pkgs/development/libraries/nss/default.nix6
-rw-r--r--pkgs/development/libraries/openct/default.nix21
-rw-r--r--pkgs/development/libraries/opensc-dnie/default.nix49
-rw-r--r--pkgs/development/libraries/pango/1.26.x.nix4
-rw-r--r--pkgs/development/libraries/podofo/default.nix12
-rw-r--r--pkgs/development/libraries/poppler/default.nix6
-rw-r--r--pkgs/development/libraries/poppler/use_exceptions.patch60
-rw-r--r--pkgs/development/libraries/qt-4.6/default.nix4
-rw-r--r--pkgs/development/libraries/scmccid/default.nix38
-rw-r--r--pkgs/development/libraries/webkit/src-for-default.nix10
-rw-r--r--pkgs/development/python-modules/pyqt/default.nix2
-rw-r--r--pkgs/development/python-modules/python-sip/default.nix2
-rw-r--r--pkgs/development/python-modules/setuptools/default.nix6
-rw-r--r--pkgs/development/tools/build-managers/apache-ant/default.nix4
-rw-r--r--pkgs/development/tools/build-managers/buildbot/default.nix83
-rw-r--r--pkgs/development/tools/misc/coccinelle/default.nix10
-rw-r--r--pkgs/games/quake3/wrapper/builder.sh2
-rw-r--r--pkgs/lib/lists.nix5
-rw-r--r--pkgs/lib/maintainers.nix1
-rw-r--r--pkgs/lib/modules.nix11
-rw-r--r--pkgs/lib/strings.nix2
-rw-r--r--pkgs/misc/emulators/wine/default.nix2
-rw-r--r--pkgs/misc/emulators/wine/src-for-default.nix8
-rw-r--r--pkgs/os-specific/linux/cryptsetup/default.nix2
-rw-r--r--pkgs/os-specific/linux/device-mapper/default.nix17
-rw-r--r--pkgs/os-specific/linux/kernel/config-blocks.nix257
-rw-r--r--pkgs/os-specific/linux/kernel/generic.nix3
-rw-r--r--pkgs/os-specific/linux/kernel/linux-2.6.27.nix4
-rw-r--r--pkgs/os-specific/linux/kernel/linux-2.6.32.nix6
-rw-r--r--pkgs/os-specific/linux/kernel/patches.nix15
-rw-r--r--pkgs/os-specific/linux/lvm2/default.nix21
-rw-r--r--pkgs/os-specific/linux/pam_usb/default.nix48
-rw-r--r--pkgs/os-specific/linux/pmount/default.nix42
-rw-r--r--pkgs/os-specific/linux/qemu-kvm/default.nix4
-rw-r--r--pkgs/os-specific/linux/qemu-kvm/unix-domain.patch74
-rw-r--r--pkgs/os-specific/linux/zen-kernel/2.6.31-zen5.nix205
-rw-r--r--pkgs/os-specific/linux/zen-kernel/2.6.32-zen4.nix74
-rw-r--r--pkgs/os-specific/linux/zen-kernel/src-for-2.6.31-zen5.nix7
-rw-r--r--pkgs/os-specific/linux/zen-kernel/src-for-zen-stable.nix7
-rw-r--r--pkgs/os-specific/linux/zen-kernel/src-info-for-default.nix6
-rw-r--r--pkgs/os-specific/linux/zen-kernel/src-info-for-zen-stable.nix6
-rw-r--r--pkgs/os-specific/linux/zen-kernel/zen-stable.nix102
-rw-r--r--pkgs/servers/x11/xorg/default.nix70
-rw-r--r--pkgs/servers/x11/xorg/extra.list2
-rw-r--r--pkgs/servers/x11/xorg/old.list3
-rw-r--r--pkgs/servers/x11/xorg/tarballs-7.5.list17
-rw-r--r--pkgs/stdenv/adapters.nix7
-rw-r--r--pkgs/tools/archivers/unrar/default.nix23
-rw-r--r--pkgs/tools/compression/ncompress/builder.sh14
-rw-r--r--pkgs/tools/compression/ncompress/default.nix18
-rw-r--r--pkgs/tools/compression/ncompress/makefile.patch31
-rw-r--r--pkgs/tools/graphics/netpbm/default.nix19
-rw-r--r--pkgs/tools/misc/grub/1.9x.nix12
-rw-r--r--pkgs/tools/misc/grub/device-mapper-symlinks.patch28
-rw-r--r--pkgs/tools/misc/parted/default.nix9
-rw-r--r--pkgs/tools/misc/parted/t7000-scripting.patch15
-rw-r--r--pkgs/tools/networking/inetutils/default.nix2
-rw-r--r--pkgs/tools/networking/socat/default.nix4
-rw-r--r--pkgs/tools/networking/wicd/default.nix79
-rw-r--r--pkgs/tools/networking/wicd/mkdir-networks.patch11
-rw-r--r--pkgs/tools/networking/wicd/no-var-install.patch21
-rw-r--r--pkgs/tools/networking/wicd/pygtk.patch15
-rw-r--r--pkgs/tools/security/ccid/default.nix26
-rw-r--r--pkgs/tools/security/muscleframework/default.nix30
-rw-r--r--pkgs/tools/security/muscletool/default.nix19
-rw-r--r--pkgs/tools/security/opensc/0.11.7.nix26
-rw-r--r--pkgs/tools/security/pcsclite/default.nix25
-rw-r--r--pkgs/tools/system/fdisk/default.nix4
-rw-r--r--pkgs/tools/text/dos2unix/default.nix41
-rw-r--r--pkgs/tools/text/dos2unix/dos2unix-3.1-manpage-update-57507.patch238
-rw-r--r--pkgs/tools/text/dos2unix/dos2unix-3.1-preserve-file-modes.patch28
-rw-r--r--pkgs/tools/text/dos2unix/dos2unix-3.1-safeconv.patch88
-rw-r--r--pkgs/tools/text/dos2unix/dos2unix-3.1-segfault.patch93
-rw-r--r--pkgs/tools/text/dos2unix/dos2unix-3.1-tmppath.patch141
-rw-r--r--pkgs/tools/text/dos2unix/dos2unix-3.1.patch49
-rw-r--r--pkgs/tools/text/dos2unix/dos2unix-c-missing-arg.patch42
-rw-r--r--pkgs/tools/text/dos2unix/dos2unix-manpage.patch12
-rw-r--r--pkgs/tools/text/dos2unix/dos2unix-missing-proto.patch15
-rw-r--r--pkgs/tools/text/dos2unix/dos2unix-preserve-file-modes.patch28
-rw-r--r--pkgs/tools/text/unix2dos/default.nix37
-rw-r--r--pkgs/tools/text/unix2dos/unix2dos-2.2-manpage.patch42
-rw-r--r--pkgs/tools/text/unix2dos/unix2dos-2.2-mode.patch29
-rw-r--r--pkgs/tools/text/unix2dos/unix2dos-2.2-segfault.patch94
-rw-r--r--pkgs/tools/text/unix2dos/unix2dos-2.2-tmppath.patch146
-rw-r--r--pkgs/tools/text/unix2dos/unix2dos-mkstemp.patch20
-rw-r--r--pkgs/tools/text/unix2dos/unix2dos-preserve-file-modes.patch29
-rw-r--r--pkgs/tools/typesetting/lhs2tex/default.nix12
-rw-r--r--pkgs/tools/virtualization/amazon-ec2-ami-tools/default.nix34
-rw-r--r--pkgs/tools/virtualization/amazon-ec2-api-tools/builder.sh7
-rw-r--r--pkgs/tools/virtualization/amazon-ec2-api-tools/default.nix29
-rw-r--r--pkgs/top-level/all-packages.nix338
-rw-r--r--pkgs/top-level/haskell-packages.nix9
-rw-r--r--pkgs/top-level/perl-packages.nix15
-rw-r--r--pkgs/top-level/python-packages.nix49
-rw-r--r--pkgs/top-level/release.nix10
167 files changed, 3561 insertions, 1239 deletions
diff --git a/doc/package-notes.xml b/doc/package-notes.xml
index d69930350b1..39ad9d897e3 100644
--- a/doc/package-notes.xml
+++ b/doc/package-notes.xml
@@ -11,7 +11,7 @@ Linux kernel or X.org.</para>
 
 <!--============================================================-->
 
-<section>
+<section xml:id="sec-linux-kernel">
 
 <title>Linux kernel</title>
 
@@ -181,7 +181,7 @@ generator.</para>
 
 <screen>
 $ cd pkgs/servers/x11/xorg
-$ cat tarballs-7.4.list extra.list old.list \
+$ cat tarballs-7.5.list extra.list old.list \
   | perl ./generate-expr-from-tarballs.pl
 </screen>
 
@@ -195,7 +195,7 @@ tarballs between runs.  Pay close attention to the <literal>NOT FOUND:
 run, since they may indicate missing dependencies.  (Some might be
 optional dependencies, however.)</para>
 
-<para>A file like <filename>tarballs-7.4.list</filename> contains all
+<para>A file like <filename>tarballs-7.5.list</filename> contains all
 tarballs in a X.org release.  It can be generated like this:
 
 <screen>
diff --git a/pkgs/applications/graphics/gimp/default.nix b/pkgs/applications/graphics/gimp/default.nix
index 4d1985d4911..e26b2b3d9ef 100644
--- a/pkgs/applications/graphics/gimp/default.nix
+++ b/pkgs/applications/graphics/gimp/default.nix
@@ -4,11 +4,11 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "gimp-2.6.7";
+  name = "gimp-2.6.8";
   
   src = fetchurl {
     url = "ftp://ftp.gtk.org/pub/gimp/v2.6/${name}.tar.bz2";
-    sha256 = "05g1dwxf0ydaadc8nv85akr9n240frh3f2sdrc9j90cywpxwa0d4";
+    sha256 = "0cikkb4l6psankz9yhgal934b41nwk6d5a93r9zib413fj5j3m6m";
   };
   
   buildInputs = [
diff --git a/pkgs/applications/misc/calibre/default.nix b/pkgs/applications/misc/calibre/default.nix
new file mode 100644
index 00000000000..43395b76941
--- /dev/null
+++ b/pkgs/applications/misc/calibre/default.nix
@@ -0,0 +1,46 @@
+{stdenv, fetchurl, python, pyqt4, sip, popplerQt4, pkgconfig, libpng,
+imagemagick, libjpeg, fontconfig, podofo, qt4, mechanize, lxml, dateutil,
+pil, makeWrapper, unrar}:
+
+stdenv.mkDerivation rec {
+  name = "calibre-0.6.32";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/calibre/${name}.tar.gz";
+    sha256 = "0r646k5yig9y139jpajsr5scwsqjbgyq94klj7f2b8wjw79qpsmz";
+  };
+
+  inherit python;
+
+  buildInputs = [ python pyqt4 sip popplerQt4 pkgconfig libpng imagemagick
+    libjpeg fontconfig podofo qt4 mechanize lxml dateutil pil makeWrapper ];
+
+  installPhase = ''
+    export POPPLER_INC_DIR=${popplerQt4}/include/poppler
+    export POPPLER_LIB_DIR=${popplerQt4}/lib
+    export MAGICK_INC=${imagemagick}/include/ImageMagick
+    export MAGICK_LIB=${imagemagick}/lib
+    export FC_INC_DIR=${fontconfig}/include/fontconfig
+    export FC_LIB_DIR=${fontconfig}/lib
+    export PODOFO_INC_DIR=${podofo}/include/podofo
+    export PODOFO_LIB_DIR=${podofo}/lib
+    python setup.py install --prefix=$out
+
+    PYFILES="$out/bin/* $out/lib/calibre/calibre/web/feeds/*.py
+      $out/lib/calibre/calibre/ebooks/metadata/*.py
+      $out/lib/calibre/calibre/ebooks/rtf2xml/*.py"
+
+    sed -i "s/env python/python/" $PYFILES
+    for a in $out/bin/*; do
+      wrapProgram $a --prefix PYTHONPATH : $PYTHONPATH --prefix LD_LIBRARY_PATH : ${unrar}/lib
+    done
+  '';
+
+  meta = { 
+    description = "Comprehensive e-book software";
+    homepage = http://calibre-ebook.com;
+    license = "GPLv3";
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/applications/misc/gv/default.nix b/pkgs/applications/misc/gv/default.nix
index 88f84cdd122..c01f516599f 100644
--- a/pkgs/applications/misc/gv/default.nix
+++ b/pkgs/applications/misc/gv/default.nix
@@ -1,18 +1,18 @@
 { stdenv, fetchurl, Xaw3d, ghostscriptX }:
 
 stdenv.mkDerivation rec {
-  name = "gv-3.6.7";
+  name = "gv-3.6.8";
 
   src = fetchurl {
     url = "mirror://gnu/gv/${name}.tar.gz";
-    sha256 = "1cdkkxamsicpk0jdbrkjpxhcsrx0b82kqgrc4j407q2gc3qs8wgf";
+    sha256 = "1i86a4wfswp908gp4i0f6jbksn8bqqzkfy58r9ishspzkp2fb510";
   };
 
   buildInputs = [ Xaw3d ghostscriptX ];
-  
+
   patchPhase = ''
-    sed 's|\<gs\>|${ghostscriptX}/bin/gs|g' -i src/*.in
-    sed 's|"gs"|"${ghostscriptX}/bin/gs"|g' -i src/*.c
+    sed 's|\<gs\>|${ghostscriptX}/bin/gs|g' -i "src/"*.in
+    sed 's|"gs"|"${ghostscriptX}/bin/gs"|g' -i "src/"*.c
   '';
 
   doCheck = true;
@@ -28,5 +28,7 @@ stdenv.mkDerivation rec {
     '';
 
     license = "GPLv3+";
+    maintainers = [ stdenv.lib.maintainers.ludo ];
+    platforms = stdenv.lib.platforms.gnu;  # arbitrary choice
   };
 }
diff --git a/pkgs/applications/networking/browsers/chromium/default.nix b/pkgs/applications/networking/browsers/chromium/default.nix
index 9a57b8869ac..acdd07399b3 100644
--- a/pkgs/applications/networking/browsers/chromium/default.nix
+++ b/pkgs/applications/networking/browsers/chromium/default.nix
@@ -20,23 +20,26 @@
 , unzip
 , expat
 , zlib
+, libjpeg
+, bzip2
+, libpng
 }:
 
 assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux" ;
 
 stdenv.mkDerivation rec {
   name = "chrome-${version}";
-  version = "32599";
+  version = "35449";
   src = 
     if stdenv.system == "x86_64-linux" then 
       fetchurl {
         url = "http://build.chromium.org/buildbot/snapshots/chromium-rel-linux-64/${version}/chrome-linux.zip";
-        sha256 = "1wz24hrnnjggsjxsaa4spqg73p1f7bv4a8l2ys3kbkdp709fl6v8";
+        sha256 = "0fdm1hs67vcr68r290ami3zlyypcvd88rm059622qyadqz49yvcj";
       } 
     else if stdenv.system == "i686-linux" then 
       fetchurl {
         url = "http://build.chromium.org/buildbot/snapshots/chromium-rel-linux/${version}/chrome-linux.zip";
-        sha256 = "16w6d7kp34jr1c4ym6y2h6llkq3d65rybj5hs46w1b8qri60q6aa";
+        sha256 = "1indm0s87yz9zsg4archsywvp4yd0ff83azkjbwszj0snggk16pg";
       } 
     else null;
 
@@ -46,7 +49,7 @@ stdenv.mkDerivation rec {
 
   libPath = 
     stdenv.lib.makeLibraryPath
-       [ stdenv.glibc stdenv.gcc.gcc ffmpeg cairo pango glib libXrender gtk nspr nss fontconfig freetype alsaLib libX11 GConf libXext atk libXt expat zlib] ;
+       [ stdenv.glibc stdenv.gcc.gcc ffmpeg cairo pango glib libXrender gtk nspr nss fontconfig freetype alsaLib libX11 GConf libXext atk libXt expat zlib libjpeg bzip2 libpng] ;
 
   installPhase = ''
     ensureDir $out/bin
diff --git a/pkgs/applications/networking/browsers/firefox/3.0.nix b/pkgs/applications/networking/browsers/firefox/3.0.nix
index 4996698e7cd..e6da5e6f44d 100644
--- a/pkgs/applications/networking/browsers/firefox/3.0.nix
+++ b/pkgs/applications/networking/browsers/firefox/3.0.nix
@@ -11,14 +11,14 @@
 
 rec {
 
-  firefoxVersion = "3.0.15";
+  firefoxVersion = "3.0.17";
   
-  xulVersion = "1.9.0.15"; # this attribute is used by other packages
+  xulVersion = "1.9.0.17"; # 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";
-    sha1 = "06d488f0aee8f9e60dc6526c1d292f3708da301f";
+    sha1 = "e4bb7daae1699f3493936ca6739512d28c7f150f";
   };
 
 
diff --git a/pkgs/applications/networking/browsers/firefox/3.5.nix b/pkgs/applications/networking/browsers/firefox/3.5.nix
index b98840c8f48..71a083149c7 100644
--- a/pkgs/applications/networking/browsers/firefox/3.5.nix
+++ b/pkgs/applications/networking/browsers/firefox/3.5.nix
@@ -12,14 +12,14 @@
 
 rec {
 
-  firefoxVersion = "3.5.6";
+  firefoxVersion = "3.5.7";
   
-  xulVersion = "1.9.1.6"; # this attribute is used by other packages
+  xulVersion = "1.9.1.7"; # 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";
-    sha1 = "fc1de4ddb9c20c7ba9e297737f926e9d8e32eed4";
+    sha1 = "7605d89b3d3e458db74dea4d227dd86d0d12ba1b";
   };
 
 
diff --git a/pkgs/applications/networking/browsers/icecat-3/default.nix b/pkgs/applications/networking/browsers/icecat-3/default.nix
index b2a2150ba5b..908b1eff225 100644
--- a/pkgs/applications/networking/browsers/icecat-3/default.nix
+++ b/pkgs/applications/networking/browsers/icecat-3/default.nix
@@ -4,13 +4,13 @@
 , freetype, fontconfig
 , application ? "browser" }:
 
-let version = "3.5.6"; in
+let version = "3.5.7"; in
 stdenv.mkDerivation {
   name = "icecat-${version}";
 
   src = fetchurl {
     url = "mirror://gnu/gnuzilla/${version}/icecat-${version}.tar.bz2";
-    sha256 = "10lacri0imag90ib1lg4caxljzsfzryysygx22ja3akfwjlkrk8c";
+    sha256 = "0pz48rz9rpig3xdvs6jkjc4azhwxabn81bz7c0alkfkdzjmcl8ym";
   };
 
   buildInputs = [
diff --git a/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-10/default.nix b/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-10/default.nix
index a345cf44cc5..c4e4c394019 100644
--- a/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-10/default.nix
+++ b/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-10/default.nix
@@ -16,24 +16,47 @@
 , glib
 , pango
 , atk
+, 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
+*/
+
 }:
 
-stdenv.mkDerivation {
+stdenv.mkDerivation ({
   name = "flashplayer-10.0.32.18";
 
   builder = ./builder.sh;
   
   src =
     if stdenv.system == "x86_64-linux" then
-      fetchurl {
-        url = http://download.macromedia.com/pub/labs/flashplayer10/libflashplayer-10.0.32.18.linux-x86_64.so.tar.gz;
-        sha256 = "006k3jvahlq2v34q5mf2y7ghczhy6spsdd69fj120i9yz9zklhpw";
-      }
+      fetchurl (
+        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_64bit.html
+          url = http://download.macromedia.com/pub/labs/flashplayer10/libflashplayer-10.0.32.18.linux-x86_64.so.tar.gz;
+          sha256 = "006k3jvahlq2v34q5mf2y7ghczhy6spsdd69fj120i9yz9zklhpw";
+        }
+      )
     else
-      fetchurl {
+      fetchurl ( if debug then {
+        # The debug version also contains a player
+        url = http://download.macromedia.com/pub/flashplayer/updaters/10/flash_player_10_linux_dev.tar.gz;
+        sha256 = "0j3i4sbry9xdln23892hbkfbznqg2wzrakpfv4g5g6y7r2nchkfj";
+      } else {
         url = http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_10_linux.tar.gz;
-        sha256 = "1nnswpivn8ymbvqywdw39xf26mn2i65hyqw8lcl77qsv7kbsbbl8";
-      };
+        sha256 = "04ppx812dz4d93pkyx412z3jslkw8nsqw5gni467ipahqz6lifhi";
+      });
 
   inherit zlib alsaLib;
 
@@ -47,4 +70,9 @@ stdenv.mkDerivation {
     description = "Adobe Flash Player browser plugin";
     homepage = http://www.adobe.com/products/flashplayer/;
   };
-}
+} // (if debug then {
+    buildPhase = ''
+      pwd;ls -l .
+      tar xfz plugin/debugger/libflashplayer.so.tar.gz
+    '';
+  } else {} ) )
diff --git a/pkgs/applications/networking/instant-messengers/bitlbee/default.nix b/pkgs/applications/networking/instant-messengers/bitlbee/default.nix
index 23ae0684138..e136670a589 100644
--- a/pkgs/applications/networking/instant-messengers/bitlbee/default.nix
+++ b/pkgs/applications/networking/instant-messengers/bitlbee/default.nix
@@ -1,11 +1,11 @@
 { fetchurl, stdenv, gnutls, glib, pkgconfig }:
 
 stdenv.mkDerivation rec {
-  name = "bitlbee-1.2.3";
+  name = "bitlbee-1.2.4";
 
   src = fetchurl {
     url = "mirror://bitlbee/src/" + name + ".tar.gz";
-    sha256 = "1qj5cx0lqhg6dy2gdjb05ap963r84rv1b96iz23c97c2ihc31fqc";
+    sha256 = "1lwcjh1r81xqf6fxjwd2a2hv8dq9g0iyc8dnbr1pgas4vmjg9xf2";
   };
 
   buildInputs = [ gnutls glib pkgconfig ];
diff --git a/pkgs/applications/networking/instant-messengers/pidgin/default.nix b/pkgs/applications/networking/instant-messengers/pidgin/default.nix
index 99461a97762..380509a875e 100644
--- a/pkgs/applications/networking/instant-messengers/pidgin/default.nix
+++ b/pkgs/applications/networking/instant-messengers/pidgin/default.nix
@@ -14,17 +14,17 @@
   GStreamer, gstPluginsBase, startupnotification, gettext,
   perl, perlXMLParser, libxml2, nss, nspr, farsight2,
   libXScrnSaver, ncurses, avahi, dbus, dbus_glib, intltool, libidn
-  , lib
+  , lib, python
   , openssl ? null
   , gnutls ? null
   , voice ? null
 } :
 
 stdenv.mkDerivation {
-  name = "pidgin-2.6.4";
+  name = "pidgin-2.6.5";
   src = fetchurl {
-    url = mirror://sourceforge/pidgin/pidgin-2.6.4.tar.bz2;
-    sha256 = "04dyr2g45i3wr67zsn04pjl6vyvic8dchb73pajf823pa377m47s";
+    url = mirror://sourceforge/pidgin/pidgin-2.6.5.tar.bz2;
+    sha256 = "03ix5w1dr1hl98qh1jmp5dgv2i8f9bd39sim3rcpk9pwjd09wi9w";
   };
 
   inherit nss ncurses;
@@ -36,7 +36,7 @@ stdenv.mkDerivation {
   ++ (lib.optional (gnutls != null) gnutls)
   ++
   [nss nspr farsight2
-    libXScrnSaver ncurses
+    libXScrnSaver ncurses python
     avahi dbus dbus_glib intltool libidn
   ]
   ;
diff --git a/pkgs/applications/networking/mailreaders/thunderbird-3.x/default.nix b/pkgs/applications/networking/mailreaders/thunderbird-3.x/default.nix
deleted file mode 100644
index 5381c65f516..00000000000
--- a/pkgs/applications/networking/mailreaders/thunderbird-3.x/default.nix
+++ /dev/null
@@ -1,105 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, gtk, pango, perl, python, zip, libIDL
-, libjpeg, zlib, cairo, dbus, dbus_glib, bzip2
-, freetype, fontconfig, xulrunner
-, autoconf , libpng , alsaLib, sqlite, patchelf
-
-, # If you want the resulting program to call itself "Thunderbird"
-  # instead of "Mail", enable this option.  However, those
-  # binaries may not be distributed without permission from the
-  # Mozilla Foundation, see
-  # http://www.mozilla.org/foundation/trademarks/.
-  enableOfficialBranding ? false
-    
-}:
-
-stdenv.mkDerivation {
-  name = "thunderbird-3.0beta2";
-
-  src = fetchurl {
-    url = "ftp://ftp.mozilla.org/pub/thunderbird/releases/3.0b2/source/thunderbird-3.0b2-source.tar.bz2";
-    sha256 = "17mlp0x6sf1v9w8vraln7mr566gvk84rxvxiwzhbdj2p0475zjqr";
-  };
-
-  buildInputs = [
-    pkgconfig gtk perl zip libIDL libjpeg zlib cairo bzip2
-    python dbus dbus_glib pango freetype fontconfig autoconf
-    libpng alsaLib sqlite patchelf
-  ];
-
-  propagatedBuildInputs = [xulrunner];
-
-  preUnpack = "mkdir thunderbird; cd thunderbird;";
-  setSourceRoot = "export sourceRoot=.;";
-  preConfigure = ''
-    for i in $(find . -name configure.in); do echo $i; (cd $(dirname $i); autoconf || true; ); done;
-    XUL_SDK=$(echo ${xulrunner}/lib/xulrunner-devel-*/)
-    export NIX_CFLAGS_COMPILE="''${NIX_CFLAGS_COMPILE} -I$XUL_SDK/include";
-    export NIX_CFLAGS_COMPILE="''${NIX_CFLAGS_COMPILE} -I$(echo ${xulrunner}/include/xulrunner-*/stable)";
-    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE";
-    export NIX_LDFLAGS="''${NIX_LDFLAGS} -L$XUL_SDK/lib -L$XUL_SDK/sdk/lib";
-    export NIX_LDFLAGS="$NIX_LDFLAGS -L${xulrunner}/lib/xulrunner-${xulrunner.version}";
-    export NIX_LDFLAGS="$NIX_LDFLAGS -lxpcomglue -lxpcomglue_s -lxul -lnss -lmozjs -lsqlite3";
-    echo NIX_CFLAGS_COMPILE: $NIX_CFLAGS_COMPILE
-    echo NIX_LDFLAGS: $NIX_LDFLAGS
-    for i in $(find $(pwd) -wholename '*/public/*.idl' -exec dirname '{}' ';' | sort | uniq); do
-      export XPIDL_FLAGS="$XPIDL_FLAGS -I$i";
-    done;
-    echo $XPIDL_FLAGS
-
-    sed -e "s@\$(XPIDL_FLAGS)@\$(XPIDL_FLAGS) $XPIDL_FLAGS@" -i config/rules.mk
-  '';
-  postConfigure = ''
-    (cd mozilla/nsprpub; ./configure --prefix=$out/XUL_SDK; )
-  '';
-  preBuild = ''
-    for i in $(find . -name autoconf.mk); do echo $i; sed -e 's@-Wl,-rpath-link,$(PREFIX)/lib@@' -i $i; done
-    make -C mozilla/config nsinstall
-    mkdir -p $out/libexec/mozilla/nsinstall
-    mv mozilla/config/nsinstall $out/libexec/mozilla/nsinstall/nsinstall
-    cat > mozilla/config/nsinstall <<EOF
-    #! /bin/sh
-    export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:${sqlite}/lib:${xulrunner}/lib/xulrunner-${xulrunner.version}"
-    $out/libexec/mozilla/nsinstall/nsinstall "\$@"
-    EOF
-    chmod a+x mozilla/config/nsinstall
-  '';
-
-  configureFlags = [
-    "--enable-application=mail"
-    "--enable-optimize"
-    "--disable-debug"
-    "--with-system-jpeg"
-    "--with-system-zlib"
-    "--with-system-bz2"
-    #"--with-system-png" # <-- "--with-system-png won't work because the system's libpng doesn't have APNG support"
-    "--enable-system-cairo"
-    #"--enable-system-sqlite" # <-- this seems to be discouraged
-    "--disable-crashreporter"
-    "--with-libxul-sdk=${xulrunner}/lib/xulrunner-devel-${xulrunner.version}"
-    "--enable-extensions=default"
-  ]
-  ++ (if enableOfficialBranding then ["--enable-official-branding"] else []);
-
-  postInstall = ''
-    # Strip some more stuff.
-    strip -S $out/lib/*/* || true
-
-    libDir=$(cd $out/lib && ls -d thunderbird-[0-9]*)
-    test -n "$libDir"
-    
-    ln -s ${xulrunner}/lib/xulrunner-${xulrunner.version} $out/lib/$libDir/xulrunner
-
-    # Register extensions etc. !!! is this needed anymore?
-    echo "running thunderbird -register..."
-    $out/bin/thunderbird -register
-  ''; # */
-
-  meta = {
-    description = "Mozilla Thunderbird, a full-featured email client";
-    homepage = http://www.mozilla.com/en-US/thunderbird/;
-  };
-
-  passthru = {
-    inherit gtk;
-  };
-}
diff --git a/pkgs/applications/networking/mailreaders/thunderbird-2.x/default.nix b/pkgs/applications/networking/mailreaders/thunderbird/2.x.nix
index 3604470cb0d..3604470cb0d 100644
--- a/pkgs/applications/networking/mailreaders/thunderbird-2.x/default.nix
+++ b/pkgs/applications/networking/mailreaders/thunderbird/2.x.nix
diff --git a/pkgs/applications/networking/mailreaders/thunderbird/3.x.nix b/pkgs/applications/networking/mailreaders/thunderbird/3.x.nix
new file mode 100644
index 00000000000..101caa6825d
--- /dev/null
+++ b/pkgs/applications/networking/mailreaders/thunderbird/3.x.nix
@@ -0,0 +1,65 @@
+{ stdenv, fetchurl, pkgconfig, gtk, perl, python, zip, libIDL
+, dbus_glib, bzip2, alsaLib, nspr
+
+, # If you want the resulting program to call itself "Thunderbird"
+  # instead of "Shredder", enable this option.  However, those
+  # binaries may not be distributed without permission from the
+  # Mozilla Foundation, see
+  # http://www.mozilla.org/foundation/trademarks/.
+  enableOfficialBranding ? false
+    
+}:
+
+let version = "3.0"; 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 = "7a8a08f011901b4c0b737de2d7a226242935543d";
+  };
+
+  buildInputs =
+    [ pkgconfig perl python zip bzip2 gtk dbus_glib alsaLib libIDL nspr ];
+
+  configureFlags =
+    [ "--enable-application=mail"
+      "--enable-optimize"
+      "--disable-debug"
+      "--enable-strip"
+      "--with-system-jpeg"
+      "--with-system-zlib"
+      "--with-system-bz2"
+      "--with-system-nspr"
+      "--enable-system-cairo"
+      "--disable-crashreporter"
+      "--disable-tests"
+      "--enable-static" # required by `make install'
+    ]
+    ++ stdenv.lib.optional enableOfficialBranding "--enable-official-branding";
+
+  # The Thunderbird Makefiles refer to the variables LIBXUL_DIST,
+  # prefix, and PREFIX in some places where they are not set.  In
+  # particular, there are some linker flags like
+  # `-rpath-link=$(LIBXUL_DIST)/bin'.  Since this expands to
+  # `-rpath-link=/bin', the build fails due to the purity checks in
+  # the ld wrapper.  So disable the purity check for now.
+  preBuild = "NIX_ENFORCE_PURITY=0";
+
+  # This doesn't work:
+  #makeFlags = "LIBXUL_DIST=$(out) prefix=$(out) PREFIX=$(out)";
+    
+  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)"
+    '';
+
+  meta = {
+    description = "Mozilla Thunderbird, a full-featured email client";
+    homepage = http://www.mozilla.com/en-US/thunderbird/;
+  };
+}
diff --git a/pkgs/applications/networking/mailreaders/thunderbird-2.x/builder.sh b/pkgs/applications/networking/mailreaders/thunderbird/builder.sh
index c4b477fcec5..c4b477fcec5 100644
--- a/pkgs/applications/networking/mailreaders/thunderbird-2.x/builder.sh
+++ b/pkgs/applications/networking/mailreaders/thunderbird/builder.sh
diff --git a/pkgs/applications/networking/mailreaders/thunderbird-2.x/xlibs.patch b/pkgs/applications/networking/mailreaders/thunderbird/xlibs.patch
index a656fbf9beb..a656fbf9beb 100644
--- a/pkgs/applications/networking/mailreaders/thunderbird-2.x/xlibs.patch
+++ b/pkgs/applications/networking/mailreaders/thunderbird/xlibs.patch
diff --git a/pkgs/applications/networking/p2p/gnunet/default.nix b/pkgs/applications/networking/p2p/gnunet/default.nix
index 1abf982f9a3..70d1ed4afde 100644
--- a/pkgs/applications/networking/p2p/gnunet/default.nix
+++ b/pkgs/applications/networking/p2p/gnunet/default.nix
@@ -6,20 +6,16 @@
 
 assert gtkSupport -> (gtk != null) && (libglade != null);
 
-let version = "0.8.0b";
+let version = "0.8.1";
 in
   stdenv.mkDerivation {
     name = "gnunet-${version}";
 
     src = fetchurl {
-      url = "http://gnunet.org/download/GNUnet-${version}.tar.bz2";
-      sha256 = "1d1abnfqbd1f8pjzq9p0za7jyy2lay7k8l09xadk83k8d96abwcs";
+      url = "mirror://gnu/gnunet/GNUnet-${version}.tar.gz";
+      sha256 = "0makh52fsrsxg2qgfi1n68sh2hllqxj453g335m05wk05d7minl4";
     };
 
-    configureFlags = ''
-      --without-included-ltdl --disable-ltdl-install --with-ltdl-include=${libtool}/include --with-ltdl-lib=${libtool}/lib
-    '';
-
     buildInputs = [
       libextractor libmicrohttpd libgcrypt gmp curl libtool
       zlib guile adns sqlite libxml2 ncurses
@@ -27,14 +23,19 @@ in
       makeWrapper
     ] ++ (if gtkSupport then [ gtk libglade ] else []);
 
-    patches = [
-      ./tmpdir.patch
-      ./disable-http-tests.patch
-    ];
-
     preConfigure = ''
-      # Brute force: make sure the tests don't rely on `/tmp', for
-      # the sake of chroot builds.
+      # Brute force: since nix-worker chroots don't provide
+      # /etc/{resolv.conf,hosts}, replace all references to `localhost'
+      # by their IPv4 equivalent.
+      for i in $(find . \( -name \*.c -or -name \*.conf \) \
+                      -exec grep -l localhost {} \;)
+      do
+        echo "$i: substituting \`127.0.0.1' to \`localhost'..."
+        substituteInPlace "$i" --replace "localhost" "127.0.0.1"
+      done
+
+      # Make sure the tests don't rely on `/tmp', for the sake of chroot
+      # builds.
       for i in $(find . \( -iname \*test\*.c -or -name \*.conf \) \
                       -exec grep -l /tmp {} \;)
       do
@@ -43,16 +44,15 @@ in
       done
     '';
 
-    # Tests have to be run xonce it's installed.
-    # FIXME: Re-enable tests when they are less broken.
-    #postInstall = ''
-    #  GNUNET_PREFIX="$out" make check
-    #'';
-
     doCheck = false;
 
-    # Help programs find the numerous modules that sit under `$out/lib/GNUnet'.
+    # 1. Run tests have once GNUnet is installed.
+    # 2. Help programs find the numerous modules that sit under
+    #    `$out/lib/GNUnet'.
+
+    # FIXME: `src/transports/test_udp' hangs forever.
     postInstall = ''
+      #GNUNET_PREFIX="$out" make check
       wrapProgram "$out/bin/gnunetd" \
         --prefix LTDL_LIBRARY_PATH ":" "$out/lib/GNUnet"
     '';
@@ -78,5 +78,8 @@ in
       homepage = http://gnunet.org/;
 
       license = "GPLv2+";
+
+      maintainers = [ stdenv.lib.maintainers.ludo ];
+      platforms = stdenv.lib.platforms.gnu;
     };
   }
diff --git a/pkgs/applications/networking/p2p/gnunet/disable-http-tests.patch b/pkgs/applications/networking/p2p/gnunet/disable-http-tests.patch
deleted file mode 100644
index 919a1fca63c..00000000000
--- a/pkgs/applications/networking/p2p/gnunet/disable-http-tests.patch
+++ /dev/null
@@ -1,88 +0,0 @@
-Disable HTTP tests as they seem to deadlock when building in a chroot on NixOS.
-
-diff --git a/src/transports/Makefile.in b/src/transports/Makefile.in
-index b0b76a2..30a0bb5 100644
---- a/src/transports/Makefile.in
-+++ b/src/transports/Makefile.in
-@@ -38,8 +38,8 @@ PRE_UNINSTALL = :
- POST_UNINSTALL = :
- host_triplet = @host@
- check_PROGRAMS = test_udp$(EXEEXT) test_tcp$(EXEEXT) \
--	test_http$(EXEEXT) testrepeat_udp$(EXEEXT) \
--	testrepeat_tcp$(EXEEXT) testrepeat_http$(EXEEXT)
-+	testrepeat_udp$(EXEEXT) \
-+	testrepeat_tcp$(EXEEXT)
- subdir = src/transports
- DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
- ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-
-diff --git a/src/applications/session/Makefile.in b/src/applications/session/Makefile.in
-index b2717f9..a048d21 100644
---- a/src/applications/session/Makefile.in
-+++ b/src/applications/session/Makefile.in
-@@ -38,7 +38,7 @@ PRE_UNINSTALL = :
- POST_UNINSTALL = :
- host_triplet = @host@
- check_PROGRAMS = sessiontest_tcp$(EXEEXT) sessiontest_udp$(EXEEXT) \
--	sessiontest_nat$(EXEEXT) $(am__EXEEXT_1)
-+	sessiontest_nat$(EXEEXT)
- subdir = src/applications/session
- DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
- ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-
-diff --git a/src/applications/tbench/Makefile.in b/src/applications/tbench/Makefile.in
-index ea061bc..c6ee8f8 100644
---- a/src/applications/tbench/Makefile.in
-+++ b/src/applications/tbench/Makefile.in
-@@ -39,8 +39,7 @@ PRE_UNINSTALL = :
- POST_UNINSTALL = :
- host_triplet = @host@
- bin_PROGRAMS = gnunet-tbench$(EXEEXT)
--check_PROGRAMS = tbenchtest_tcp$(EXEEXT) tbenchtest_udp$(EXEEXT) \
--	$(am__EXEEXT_1)
-+check_PROGRAMS = tbenchtest_tcp$(EXEEXT) tbenchtest_udp$(EXEEXT)
- subdir = src/applications/tbench
- DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
- ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-
-diff --git a/src/applications/advertising/Makefile.in b/src/applications/advertising/Makefile.in
-index 454fa63..af7aefb 100644
---- a/src/applications/advertising/Makefile.in
-+++ b/src/applications/advertising/Makefile.in
-@@ -38,7 +38,7 @@ PRE_UNINSTALL = :
- POST_UNINSTALL = :
- host_triplet = @host@
- check_PROGRAMS = advertisingtest_tcp$(EXEEXT) \
--	advertisingtest_udp$(EXEEXT) $(am__EXEEXT_1)
-+	advertisingtest_udp$(EXEEXT)
- subdir = src/applications/advertising
- DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
- ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-
-diff --git a/src/applications/bootstrap_http/Makefile.in b/src/applications/bootstrap_http/Makefile.in
-index 29800af..ad5c6a1 100644
---- a/src/applications/bootstrap_http/Makefile.in
-+++ b/src/applications/bootstrap_http/Makefile.in
-@@ -37,7 +37,7 @@ NORMAL_UNINSTALL = :
- PRE_UNINSTALL = :
- POST_UNINSTALL = :
- host_triplet = @host@
--check_PROGRAMS = httptest$(EXEEXT)
-+check_PROGRAMS =
- subdir = src/applications/bootstrap_http
- DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
- ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
-
-diff --git a/src/applications/hostlist/Makefile.in b/src/applications/hostlist/Makefile.in
-index 126df5e..2317c60 100644
---- a/src/applications/hostlist/Makefile.in
-+++ b/src/applications/hostlist/Makefile.in
-@@ -37,7 +37,7 @@ NORMAL_UNINSTALL = :
- PRE_UNINSTALL = :
- POST_UNINSTALL = :
- host_triplet = @host@
--check_PROGRAMS = hostlisttest$(EXEEXT)
-+check_PROGRAMS =
- subdir = src/applications/hostlist
- DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
- ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
diff --git a/pkgs/applications/networking/p2p/gnunet/tmpdir.patch b/pkgs/applications/networking/p2p/gnunet/tmpdir.patch
deleted file mode 100644
index e47a253e0f0..00000000000
--- a/pkgs/applications/networking/p2p/gnunet/tmpdir.patch
+++ /dev/null
@@ -1,93 +0,0 @@
-Make sure the core libraries used by the tests honor $TMPDIR.
-
-diff --git a/src/applications/dstore_sqlite/dstore.c b/src/applications/dstore_sqlite/dstore.c
-index cdcae81..4bb45a3 100644
---- a/src/applications/dstore_sqlite/dstore.c
-+++ b/src/applications/dstore_sqlite/dstore.c
-@@ -129,6 +129,7 @@ db_reset ()
-   int fd;
-   sqlite3 *dbh;
-   char *tmpl;
-+  const char *tmpdir;
- 
-   if (fn != NULL)
-     {
-@@ -136,7 +137,15 @@ db_reset ()
-       GNUNET_free (fn);
-     }
-   payload = 0;
--  tmpl = "/tmp/dstoreXXXXXX";
-+
-+  tmpdir = getenv ("TMPDIR");
-+  tmpdir = tmpdir ? tmpdir : "/tmp";
-+
-+#define TEMPLATE "/gnunet-dstoreXXXXXX"
-+  tmpl = alloca (strlen (tmpdir) + sizeof (TEMPLATE) + 1);
-+  strcpy (tmpl, tmpdir);
-+  strcat (tmpl, TEMPLATE);
-+#undef TEMPLATE
- 
- #ifdef MINGW
-   fn = (char *) GNUNET_malloc (MAX_PATH + 1);
-diff --git a/src/applications/fs/collection/collection.c b/src/applications/fs/collection/collection.c
-index 5671cb3..da2b605 100644
---- a/src/applications/fs/collection/collection.c
-+++ b/src/applications/fs/collection/collection.c
-@@ -487,6 +487,7 @@ GNUNET_CO_collection_publish_now ()
-   char *dirData;
-   char this_revision_string[128];
-   char next_revision_string[128];
-+  const char *tmpdir;
- 
-   GNUNET_mutex_lock (lock);
-   if ((collectionData == NULL) ||
-@@ -495,7 +496,17 @@ GNUNET_CO_collection_publish_now ()
-       GNUNET_mutex_unlock (lock);
-       return;
-     }
--  tmpName = GNUNET_strdup ("/tmp/gnunet-collectionXXXXXX");
-+
-+  tmpdir = getenv ("TMPDIR");
-+  tmpdir = tmpdir ? tmpdir : "/tmp";
-+
-+#define TEMPLATE "/gnunet-collectionXXXXXX"
-+  tmpName = alloca (strlen (tmpdir) + sizeof (TEMPLATE) + 1);
-+  strcpy (tmpName, tmpdir);
-+  strcat (tmpName, TEMPLATE);
-+#undef TEMPLATE
-+
-+  tmpName = GNUNET_strdup (tmpName);
-   fd = mkstemp (tmpName);
-   if (fd == -1)
-     {
-diff --git a/src/applications/fs/fsui/upload.c b/src/applications/fs/fsui/upload.c
-index dc683a5..46a04af 100644
---- a/src/applications/fs/fsui/upload.c
-+++ b/src/applications/fs/fsui/upload.c
-@@ -159,6 +159,7 @@ createDirectoryHelper (struct GNUNET_GE_Context *ectx,
-   int handle;
-   struct GNUNET_GE_Memory *mem;
-   struct GNUNET_GE_Context *ee;
-+  const char *tmpdir;
- 
-   fis = NULL;
-   size = 0;
-@@ -208,7 +209,17 @@ createDirectoryHelper (struct GNUNET_GE_Context *ectx,
-       pos = pos->next;
-     }
-   GNUNET_GE_memory_reset (mem);
--  tempName = GNUNET_strdup ("/tmp/gnunet-upload-dir.XXXXXX");
-+
-+  tmpdir = getenv ("TMPDIR");
-+  tmpdir = tmpdir ? tmpdir : "/tmp";
-+
-+#define TEMPLATE "/gnunet-upload-dirXXXXXX"
-+  tempName = alloca (strlen (tmpdir) + sizeof (TEMPLATE) + 1);
-+  strcpy (tempName, tmpdir);
-+  strcat (tempName, TEMPLATE);
-+#undef TEMPLATE
-+
-+  tempName = GNUNET_strdup (tempName);
-   handle = mkstemp (tempName);
-   if (handle == -1)
-     {
diff --git a/pkgs/applications/networking/sync/rsync/default.nix b/pkgs/applications/networking/sync/rsync/default.nix
index 006effdef24..3c84ee56a68 100644
--- a/pkgs/applications/networking/sync/rsync/default.nix
+++ b/pkgs/applications/networking/sync/rsync/default.nix
@@ -1,18 +1,18 @@
-{ stdenv, fetchurl
+{ stdenv, fetchurl, perl
 , enableACLs ? true, acl ? null
 }:
 
 assert enableACLs -> acl != null;
 
 stdenv.mkDerivation {
-  name = "rsync-3.0.6";
+  name = "rsync-3.0.7";
   
   src = fetchurl {
-    url = http://rsync.samba.org/ftp/rsync/src/rsync-3.0.6.tar.gz;
-    sha256 = "1cz1adlshjwwi41yqhw7wph7vq58a73b4zgs8piv6rnbcj9rdk1k";
+    url = http://rsync.samba.org/ftp/rsync/src/rsync-3.0.7.tar.gz;
+    sha256 = "1j77vwz6q3dvgr8w6wvigd5v4m5952czaqdvihr8di13q0b0vq4y";
   };
 
-  buildInputs = stdenv.lib.optional enableACLs acl;
+  buildInputs = [perl] ++ stdenv.lib.optional enableACLs acl;
 
   meta = {
     homepage = http://samba.anu.edu.au/rsync/;
diff --git a/pkgs/applications/office/openoffice/OOo-3.1.1-HEADERFIX-1.patch b/pkgs/applications/office/openoffice/OOo-3.1.1-HEADERFIX-1.patch
new file mode 100644
index 00000000000..ce943890ff6
--- /dev/null
+++ b/pkgs/applications/office/openoffice/OOo-3.1.1-HEADERFIX-1.patch
@@ -0,0 +1,74 @@
+Submitted By:            zippo zippo@oppiz.net
+Date:                    2009-09-23
+Initial Package Version: 3.1.1
+Upstream Status:         Unknown
+Origin:                  zippo@oppiz.net
+Description: Fixes missing headers, GCC-4.3.2 and corrects errors for Glib 2.10
+diff -Naur OOO310_m19/soltools/mkdepend/def.h OOO310_m19.new/soltools/mkdepend/def.h
+--- OOO310_m19/soltools/mkdepend/def.h	2008-04-10 18:05:14.000000000 +0000
++++ OOO310_m19.new/soltools/mkdepend/def.h	2009-09-23 01:17:01.913883308 +0000
+@@ -154,7 +154,7 @@
+ 
+ char			*copy();
+ char			*base_name();
+-char			*getline();
++char			*get_line();
+ char			*isdefined();
+ struct filepointer	*getfile();
+ struct inclist		*newinclude();
+diff -Naur OOO310_m19/soltools/mkdepend/main.c OOO310_m19.new/soltools/mkdepend/main.c
+--- OOO310_m19/soltools/mkdepend/main.c	2008-07-22 17:24:34.000000000 +0000
++++ OOO310_m19.new/soltools/mkdepend/main.c	2009-09-23 01:18:09.160646833 +0000
+@@ -548,7 +548,7 @@
+  * Get the next line.  We only return lines beginning with '#' since that
+  * is all this program is ever interested in.
+  */
+-char *getline(filep)
++char *get_line(filep)
+ 	register struct filepointer	*filep;
+ {
+ 	register char	*p,	/* walking pointer */
+diff -Naur OOO310_m19/soltools/mkdepend/parse.c OOO310_m19.new/soltools/mkdepend/parse.c
+--- OOO310_m19/soltools/mkdepend/parse.c	2008-04-10 18:06:39.000000000 +0000
++++ OOO310_m19.new/soltools/mkdepend/parse.c	2009-09-23 01:18:54.183802453 +0000
+@@ -45,7 +45,7 @@
+ 	register int	type;
+ 	boolean recfailOK;
+ 
+-	while ((line = getline(filep))) {
++	while ((line = get_line(filep))) {
+ 		switch(type = deftype(line, filep, file_red, file, TRUE, symbols)) {
+ 		case IF:
+ 		doif:
+@@ -168,7 +168,7 @@
+ 	register char	*line;
+ 	register int	type;
+ 
+-	while ((line = getline(filep))) {
++	while ((line = get_line(filep))) {
+ 		switch(type = deftype(line, filep, file_red, file, FALSE, symbols)) {
+ 		case IF:
+ 		case IFFALSE:
+diff -Naur OOO310_m19/sw/source/core/doc/docbm.cxx OOO310_m19.new/sw/source/core/doc/docbm.cxx
+--- OOO310_m19/sw/source/core/doc/docbm.cxx	2008-09-04 10:19:07.000000000 +0000
++++ OOO310_m19.new/sw/source/core/doc/docbm.cxx	2009-09-23 12:32:08.011104664 +0000
+@@ -32,7 +32,7 @@
+ // MARKER(update_precomp.py): autogen include statement, do not remove
+ #include "precompiled_sw.hxx"
+ 
+-
++#include <stdio.h>
+ #include <tools/pstm.hxx>
+ #include <svx/linkmgr.hxx>
+ #include <fmtanchr.hxx>
+diff -Naur OOO310_m19/sw/source/filter/ww8/WW8TableInfo.cxx OOO310_m19.new/sw/source/filter/ww8/WW8TableInfo.cxx
+--- OOO310_m19/sw/source/filter/ww8/WW8TableInfo.cxx	2009-04-21 09:51:46.000000000 +0000
++++ OOO310_m19.new/sw/source/filter/ww8/WW8TableInfo.cxx	2009-09-23 12:51:12.882511596 +0000
+@@ -31,6 +31,7 @@
+ // MARKER(update_precomp.py): autogen include statement, do not remove
+ #include "precompiled_sw.hxx"
+ 
++#include <stdio.h>
+ #include <iostream> 
+ #include "WW8TableInfo.hxx"
+ #include "swtable.hxx"
diff --git a/pkgs/applications/office/openoffice/default.nix b/pkgs/applications/office/openoffice/default.nix
index 07a7392e6d1..73c046fef52 100644
--- a/pkgs/applications/office/openoffice/default.nix
+++ b/pkgs/applications/office/openoffice/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
       sha256 = "95440f09f8dce616178b86b26af8e543c869d01579207aa68e8474019b59caca";
     };
 
-  patches = [ ./oo.patch ];
+  patches = [ ./oo.patch ./OOo-3.1.1-HEADERFIX-1.patch ];
 
   src_system = fetchurl {
       url = "http://openoffice.bouncer.osuosl.org/?product=OpenOffice.org&os=src_bzip&lang=system&version=${version}";
diff --git a/pkgs/applications/science/math/maxima/default.nix b/pkgs/applications/science/math/maxima/default.nix
index ff45a8257c0..edee18ed2b3 100644
--- a/pkgs/applications/science/math/maxima/default.nix
+++ b/pkgs/applications/science/math/maxima/default.nix
@@ -2,14 +2,14 @@
 
 let
     name    = "maxima";
-    version = "5.19.2";
+    version = "5.20.1";
 in
 stdenv.mkDerivation {
   name = "${name}-${version}";
 
   src = fetchurl {
     url = "mirror://sourceforge/${name}/${name}-${version}.tar.gz";
-    sha256 = "4b9d592cb5c5b49acf10c894aa4e899bd47f079b315ee22542122a2e64589072";
+    sha256 = "cc2430ad6b895fb730ee2a7b8df4852c2b6d09a5a8bb715bdba783982c470bd9";
   };
 
   buildInputs = [clisp];
diff --git a/pkgs/applications/virtualization/qemu/0.10.3.nix b/pkgs/applications/virtualization/qemu/0.12.1.nix
index 18683a209fb..f44733f001c 100644
--- a/pkgs/applications/virtualization/qemu/0.10.3.nix
+++ b/pkgs/applications/virtualization/qemu/0.12.1.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl, SDL, zlib, which}:
 
 stdenv.mkDerivation {
-  name = "qemu-0.10.3";
+  name = "qemu-0.12.1";
 
   src = fetchurl {
-    url = http://download.savannah.gnu.org/releases/qemu/qemu-0.10.3.tar.gz;
-    sha256 = "0xxhyxa376vi4drjpqq21g0h6gqgb1fxamca7zinl2l8iix0sm49";
+    url = http://download.savannah.gnu.org/releases/qemu/qemu-0.12.1.tar.gz;
+    sha256 = "15frq26h2f847fiy1aivb3kj4psx8id8kw217781aimqlk9q45pf";
   };
 
   patchFlags = "-p2";
diff --git a/pkgs/applications/virtualization/qemu/0.9.1.nix b/pkgs/applications/virtualization/qemu/0.9.1.nix
deleted file mode 100644
index bb5ad173c0a..00000000000
--- a/pkgs/applications/virtualization/qemu/0.9.1.nix
+++ /dev/null
@@ -1,20 +0,0 @@
-{stdenv, fetchurl, SDL, zlib, which}:
-
-stdenv.mkDerivation {
-  name = "qemu-0.9.1";
-
-  src = fetchurl {
-    url = http://bellard.org/qemu/qemu-0.9.1.tar.gz;
-    sha256 = "199mb12w141yh2afzznh539jsip4h79kfsxwaj1xhzfwljsd0mj7";
-  };
-
-  patches = [../../../os-specific/linux/kvm/smbd-path.patch];
-
-  patchFlags = "-p2";
-  
-  buildInputs = [SDL zlib which];
-  
-  meta = {
-    description = "QEmu processor emulator";
-  };
-}
diff --git a/pkgs/applications/virtualization/virtualbox/default.nix b/pkgs/applications/virtualization/virtualbox/default.nix
index 2329ecc089a..3ea038376c5 100644
--- a/pkgs/applications/virtualization/virtualbox/default.nix
+++ b/pkgs/applications/virtualization/virtualbox/default.nix
@@ -4,11 +4,11 @@
 }:
 
 stdenv.mkDerivation {
-  name = "virtualbox-3.1.0-${kernel.version}";
+  name = "virtualbox-3.1.2-${kernel.version}";
 
   src = fetchurl {
-    url = http://download.virtualbox.org/virtualbox/3.1.0/VirtualBox-3.1.0-OSE.tar.bz2;
-    sha256 = "0f86w4awscgbg9az26h0rlg4i7xr9319hbddjs69ils28g2gz2ns";
+    url = http://download.virtualbox.org/virtualbox/3.1.2/VirtualBox-3.1.2-OSE.tar.bz2;
+    sha256 = "1cgj696lyrklddjjhmrgb5j1jvj43d46hr1wnpyrx8pd6wp5hgr9";
   };
 
   buildInputs = [iasl dev86 libxslt libxml2 xproto libX11 libXext libXcursor qt4 libIDL SDL hal libcap glib kernel python alsaLib curl];
diff --git a/pkgs/applications/window-managers/icewm/default.nix b/pkgs/applications/window-managers/icewm/default.nix
index 7a8d12dee50..5394b7f507b 100644
--- a/pkgs/applications/window-managers/icewm/default.nix
+++ b/pkgs/applications/window-managers/icewm/default.nix
@@ -1,13 +1,16 @@
-args: with args;
+{ stdenv, fetchurl, gettext, libjpeg, libtiff, libungif, libpng, imlib, xlibs }:
 
-stdenv.mkDerivation {
-  name = "icewm-1.2.32";
+stdenv.mkDerivation rec {
+  name = "icewm-1.2.37";
 
-  buildInputs = [ gettext libX11 libXft libXext libXinerama libXrandr libjpeg libtiff libungif libpng imlib ];
+  buildInputs =
+    [ gettext libjpeg libtiff libungif libpng imlib
+      xlibs.libX11 xlibs.libXft xlibs.libXext xlibs.libXinerama xlibs.libXrandr
+    ];
 
   src = fetchurl {
-    url = http://mesh.dl.sourceforge.net/sourceforge/icewm/icewm-1.2.32.tar.gz;
-    sha256 = "c2fe6ef0bdc0a9f841ae6fe214c06a15d666f90df027d105305f3e0dc109a667";
+    url = "mirror://sourceforge/icewm/${name}.tar.gz";
+    sha256 = "15852k96z2w19v3d02jynxyf6ld378hbkd6lpy64byysrmjh3dmz";
   };
 
   meta = {
diff --git a/pkgs/applications/window-managers/xcompmgr/default.nix b/pkgs/applications/window-managers/xcompmgr/default.nix
new file mode 100644
index 00000000000..9dd5892d9fc
--- /dev/null
+++ b/pkgs/applications/window-managers/xcompmgr/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchurl, pkgconfig, libXcomposite, libXfixes, libXdamage
+, libXrender }:
+stdenv.mkDerivation rec {
+  name = "xcompmgr-1.1.5";
+  src = fetchurl {
+    url = "http://www.x.org/releases/individual/app/${name}.tar.bz2";
+    sha256 = "bb20737a6f9e0cdf5cfbd5288b6a9a4b16ca18d2be19444549c1d6be2a90b571";
+  };
+  buildInputs = [ pkgconfig libXcomposite libXfixes libXdamage libXrender ];
+  meta = {
+    homepage = http://www.x.org/;
+    description = "A sample compositing manager for X servers";
+    longDescription = ''
+      A sample compositing manager for X servers supporting the XFIXES,
+      DAMAGE, RENDER, and COMPOSITE extensions.  It enables basic eye-candy
+      effects.
+    '';
+    license = "bsd";
+    maintainers = with stdenv.lib.maintainers; [ astsmtl ];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/applications/window-managers/xmonad/default.nix b/pkgs/applications/window-managers/xmonad/default.nix
index cda58ee0f25..ba142f4fb9e 100644
--- a/pkgs/applications/window-managers/xmonad/default.nix
+++ b/pkgs/applications/window-managers/xmonad/default.nix
@@ -3,8 +3,8 @@
 cabal.mkDerivation (self : {
   pname = "xmonad";
   name = "${self.fname}";
-  version = "0.9";
-  sha256 = "51670f83de211a8ea24ce2724c71ac5c3e4782f25422319d8b5e43f3ae7bf9e8";
+  version = "0.9.1";
+  sha256 = "014201200e8a521ee3a0d8c0727392916a7549207b91064fb456f8c660609927";
   propagatedBuildInputs = [X11 mtl];
   meta = {
     description = "xmonad is a tiling window manager for X";
diff --git a/pkgs/applications/window-managers/xmonad/xmonad-contrib.nix b/pkgs/applications/window-managers/xmonad/xmonad-contrib.nix
index 248f74fa61e..62c00faa4ac 100644
--- a/pkgs/applications/window-managers/xmonad/xmonad-contrib.nix
+++ b/pkgs/applications/window-managers/xmonad/xmonad-contrib.nix
@@ -3,8 +3,8 @@
 cabal.mkDerivation (self : {
   pname = "xmonad-contrib";
   name = "${self.fname}";
-  version = "0.9";
-  sha256 = "f67471785eba323ac416f912d3503976ef6ed43e93e53fabf5621b2c93351ae9";
+  version = "0.9.1";
+  sha256 = "b4ca1d71d12903be76187ce58898697086e7af3ef73468987cb7ef03b076ec47";
   propagatedBuildInputs = [X11 xmonad utf8String];
   meta = {
     description = "a huge extension library for xmonad";
diff --git a/pkgs/build-support/release/nix-build.nix b/pkgs/build-support/release/nix-build.nix
index 005719552f1..385abe53140 100644
--- a/pkgs/build-support/release/nix-build.nix
+++ b/pkgs/build-support/release/nix-build.nix
@@ -22,7 +22,8 @@ stdenv.mkDerivation (
 
     showBuildStats = true;
 
-    phases = "unpackPhase patchPhase configurePhase buildPhase installPhase checkPhase fixupPhase distPhase ${if doCoverageAnalysis then "coverageReportPhase" else ""} finalPhase";
+    postPhases =
+      (stdenv.lib.optional doCoverageAnalysis "coverageReportPhase") ++ ["finalPhase"];
 
     finalPhase =
       ''
diff --git a/pkgs/build-support/trivial-builders.nix b/pkgs/build-support/trivial-builders.nix
index cbbc5ae0628..25ae340629b 100644
--- a/pkgs/build-support/trivial-builders.nix
+++ b/pkgs/build-support/trivial-builders.nix
@@ -73,4 +73,29 @@ rec {
   linkFarm = name: entries: runCommand name {} ("mkdir -p $out; cd $out; \n" +
     (stdenv.lib.concatMapStrings (x: "ln -s '${x.path}' '${x.name}';\n") entries));
 
+  # Search in the environment if the same program exists with a set uid or
+  # set gid bit.  If it exists, run the first program found, otherwise run
+  # the default binary.
+  useSetUID = drv: path:
+    let
+      name = stdenv.lib.basename path;
+      bin = "${drv}${path}";
+    in assert name != "";
+      writeScript "setUID-${name}" ''
+        #!${stdenv.shell}
+        inode=$(stat -Lc %i ${bin})
+        for file in $(type -ap ${name}); do
+          case $(stat -Lc %a $file) in
+            ([2-7][0-7][0-7][0-7])
+              if test -r "$file".real; then
+                orig=$(cat "$file".real)
+                if test $inode = $(stat -Lc %i "$orig"); then
+                  exec "$file" "$@"
+                fi
+              fi;;
+          esac
+        done
+        exec ${bin} "$@"
+      '';
+
 }
diff --git a/pkgs/desktops/gnome-2.28/desktop/libsoup/default.nix b/pkgs/desktops/gnome-2.28/desktop/libsoup/default.nix
index feb1d988dcd..584b583a2fd 100644
--- a/pkgs/desktops/gnome-2.28/desktop/libsoup/default.nix
+++ b/pkgs/desktops/gnome-2.28/desktop/libsoup/default.nix
@@ -2,10 +2,10 @@
   glib, GConf, gnome_keyring}:
 
 stdenv.mkDerivation {
-  name = "libsoup-2.28.0";
+  name = "libsoup-2.28.2";
   src = fetchurl {
-    url = mirror://gnome/sources/libsoup/2.28/libsoup-2.28.0.tar.bz2;
-    sha256 = "1dkgih5im81lqc0y2qv3xcjd8hvmd4fjjvh5a5akfq6mjp9ifwk4";
+    url = mirror://gnome/sources/libsoup/2.28/libsoup-2.28.2.tar.bz2;
+    sha256 = "002kxjh6dwpps4iwly1bazxlzgqhkfszqqy26mp1gy2il3lzrlcx";
   };
   buildInputs = [ pkgconfig libxml2 gnutls libproxy sqlite curl 
     glib GConf gnome_keyring ];
diff --git a/pkgs/development/compilers/adobe-flex-sdk/default.nix b/pkgs/development/compilers/adobe-flex-sdk/default.nix
index 7beea35a78a..dc209bd6ddb 100644
--- a/pkgs/development/compilers/adobe-flex-sdk/default.nix
+++ b/pkgs/development/compilers/adobe-flex-sdk/default.nix
@@ -1,10 +1,11 @@
 args: with args;
 stdenv.mkDerivation rec {
-  name = "adobe-flex-sdk-3.3.0.4852_mpl";
+  name = "adobe_flex_sdk_3.4.1.10084_mpl";
 
   src = fetchurl {
-    url = http://flexorg.wip3.adobe.com/flexsdk/3.3.0.4852/flex_sdk_3.3.0.4852_mpl.zip;
-    sha256 = "1gsm774afc7zwv3hyib5n6fpdbnd0dh6z7r2amjf38fm96jw7a99";
+    # This is the open source distribution
+    url = http://fpdownload.adobe.com/pub/flex/sdk/builds/flex3/flex_sdk_3.4.1.10084_mpl.zip;
+    sha256 = "0bq0cnq25qyr3g64sqqc20y3mmnhgh07p3ylxd2iq0ha8cdis7z0";
   };
 
   phases="installPhase";
@@ -18,9 +19,9 @@ stdenv.mkDerivation rec {
     t=$out/opt/flex-sdk
     ensureDir $t $out/bin
     mv * $t
-    sed 's/
$//' -i $t/bin/mxmlc
-    rm $t/bin/*.exe
-    for i in $t/bin/mxmlc; do
+    rm $t/bin/*.exe $t/bin/*.bat
+    sed 's/
$//' -i $t/bin/*
+    for i in $t/bin/*; do
       b="$(basename "$i")";
     cat > "$out/bin/$b" << EOF
     #!/bin/sh
diff --git a/pkgs/development/compilers/fpc/binary.nix b/pkgs/development/compilers/fpc/binary.nix
index eb931b959cb..fadc73c051e 100644
--- a/pkgs/development/compilers/fpc/binary.nix
+++ b/pkgs/development/compilers/fpc/binary.nix
@@ -1,12 +1,19 @@
 args: with args;
 
 stdenv.mkDerivation {
-  name = "fpc-2.2.2-binary";
+  name = "fpc-2.4.0-binary";
 
-  src = fetchurl {
-    url = ftp://ftp.chg.ru/pub/lang/pascal/fpc/dist/i386-linux-2.2.2/fpc-2.2.2.i386-linux.tar;
-    sha256 = "8c18f63b36a76eee673f96ca254c49c5a42bcf3e36279abe8774f961792449a5";
-  };
+  src = if stdenv.system == "i686-linux" then
+  fetchurl {
+    url = "ftp://ftp.chg.ru/pub/lang/pascal/fpc/dist/2.4.0/i386-linux/fpc-2.4.0.i386-linux.tar";
+    sha256 = "1zas9kp0b36zxqvb9i4idh2l0nb6qpmgah038l77w6las7ghh0dv";
+  }
+  else if stdenv.system == "x86_64-linux" then
+  fetchurl {
+    url = "ftp://ftp.chg.ru/pub/lang/pascal/fpc/dist/2.4.0/x86_64-linux/fpc-2.4.0.x86_64-linux.tar";
+    sha256 = "111d11g5ra55hjywx64ldwwflpimsy8zryvap68v0309nyd23f0z";
+  }
+  else null;
 
   builder = ./binary-builder.sh;
 
diff --git a/pkgs/development/compilers/fpc/default.nix b/pkgs/development/compilers/fpc/default.nix
index bf849960cdf..2d6cadf07fd 100644
--- a/pkgs/development/compilers/fpc/default.nix
+++ b/pkgs/development/compilers/fpc/default.nix
@@ -5,12 +5,12 @@ if args ? startFPC && args.startFPC != null then
 with args;
 
 stdenv.mkDerivation rec {
-  version = "2.2.4";
+  version = "2.4.0";
   name = "fpc-${version}";
 
   src = fetchurl {
     url = "http://downloads.sourceforge.net/sourceforge/freepascal/fpcbuild-${version}.tar.gz";
-    sha256 = "1kxljnivww4riqff8vxann7s135cv634ly3i61rfs1wzwc4lz9bp";
+    sha256 = "1m2g2bafjixbwl5b9lna5h7r56y1rcayfnbp8kyjfd1c1ymbxaxk";
   };
 
   buildInputs = [startFPC gawk];
diff --git a/pkgs/development/compilers/fpc/lazarus.nix b/pkgs/development/compilers/fpc/lazarus.nix
index a091e1da298..96a05c7880f 100644
--- a/pkgs/development/compilers/fpc/lazarus.nix
+++ b/pkgs/development/compilers/fpc/lazarus.nix
@@ -2,8 +2,8 @@ args : with args;
 rec {
   version = "0.9.26.2-0";
   src = fetchurl {
-    url = "http://downloads.sourceforge.net/lazarus/lazarus-${version}.tgz";
-    sha256 = "5b582685c0447034580fe17c60b8fc84a8b097b6f31ff9b4583cf0eb741297cc";
+    url = "mirror://sourceforge/lazarus/Lazarus%20Zip%20_%20GZip/Lazarus%200.9.28.2/lazarus-0.9.28.2-src.tar.bz2";
+    sha256 = "1zad1sylgvhpb210zxypdyng72fpjz1zdf3cpqj9dl94cwn3f4ap";
   };
 
   buildInputs = [fpc gtk glib libXi inputproto 
diff --git a/pkgs/development/compilers/ghc/6.12.1.nix b/pkgs/development/compilers/ghc/6.12.1.nix
index 9b108fbad8a..3412cc771ac 100644
--- a/pkgs/development/compilers/ghc/6.12.1.nix
+++ b/pkgs/development/compilers/ghc/6.12.1.nix
@@ -1,15 +1,15 @@
 {stdenv, fetchurl, ghc, perl, gmp, ncurses}:
 
 stdenv.mkDerivation rec {
-  version = "6.12.0.20091010";
+  version = "6.12.1";
   
   name = "ghc-${version}";
   
   homepage = "http://haskell.org/ghc";
 
   src = fetchurl {
-    url = "http://darcs.haskell.org/~ghc/dist/6.12.1rc1/${name}-src.tar.bz2";
-    sha256 = "903552917778329fc79cc273ece81030324006f47157ddd4278cb08c1c637fd3";
+    url = http://haskell.org/ghc/dist/6.12.1/ghc-6.12.1-src.tar.bz2;
+    sha256 = "0ajm4sypk4zgjp0m6i03fadyv5dm9vlqfnvsx1g94yk7vnd9zyfd";
   };
 
   buildInputs = [ghc perl gmp ncurses];
@@ -34,12 +34,14 @@ stdenv.mkDerivation rec {
   meta = {
     inherit homepage;
     description = "The Glasgow Haskell Compiler";
+    maintainers = [stdenv.lib.maintainers.marcweber];
+    platforms = stdenv.platforms.linux;
   };
 
 
   passthru = {
     corePackages = [
-       [ "Cabal" "1.8.0" ]
+       [ "Cabal" "1.8.0.2" ]
        [ "array" "0.3.0.0" ]
        [ "base" "3.0.3.2" ]
        [ "base" "4.2.0.0" ]
@@ -56,7 +58,7 @@ stdenv.mkDerivation rec {
        [ "extensible-exceptions" "0.1.1.1" ]
        [ "ffi" "1.0" ]
        [ "filepath" "1.1.0.3" ]
-       [ "ghc" "6.12.0.20091010" ]
+       [ "ghc" "6.12.1" ]
        [ "ghc-binary" "0.5.0.2" ]
        [ "ghc-prim" "0.2.0.0" ]
        [ "haskell98" "1.0.1.1" ]
diff --git a/pkgs/development/compilers/ghc/ghc-get-packages.sh b/pkgs/development/compilers/ghc/ghc-get-packages.sh
index 381dd571111..9ed1455d232 100755
--- a/pkgs/development/compilers/ghc/ghc-get-packages.sh
+++ b/pkgs/development/compilers/ghc/ghc-get-packages.sh
@@ -18,3 +18,4 @@ for p in $PATH; do
     test -f $i && echo -n " $prefix$i"
   done
 done
+test -f "$2/../lib/ghc-$version/package.conf" && echo -n " $prefix$2/../lib/ghc-$version/package.conf"
diff --git a/pkgs/development/compilers/mozart/default.nix b/pkgs/development/compilers/mozart/default.nix
new file mode 100644
index 00000000000..d649ef46918
--- /dev/null
+++ b/pkgs/development/compilers/mozart/default.nix
@@ -0,0 +1,14 @@
+{stdenv, fetchurl, flex, bison, perl, gmp, zlib, tcl, tk, gdbm, m4, x11, emacs}:
+
+stdenv.mkDerivation {
+  name = "mozart-1.4.0";
+  src = fetchurl {
+    url = http://www.mozart-oz.org/download/mozart-ftp/store/1.4.0-2008-07-02-tar/mozart-1.4.0.20080704-src.tar.gz;
+    sha256 = "5da73d80b5aa7fa42edca64159a1a076323f090e5c548f3747f94d0afc60b223";
+  };
+
+  buildInputs = [flex bison perl gmp zlib tcl tk gdbm m4 x11 emacs];
+
+  # micq gives a compile error for me
+  configureFlags = "--with-tcl=${tcl}/lib --with-tk=${tk}/lib --disable-contrib-micq";
+}
diff --git a/pkgs/development/compilers/strategoxt/0.18.nix b/pkgs/development/compilers/strategoxt/0.18.nix
index bb4b9e9e45e..84346075cf5 100644
--- a/pkgs/development/compilers/strategoxt/0.18.nix
+++ b/pkgs/development/compilers/strategoxt/0.18.nix
@@ -41,11 +41,11 @@ rec {
 
   
   strategoxt = stdenv.mkDerivation rec {
-    name = "strategoxt-0.18pre20227";
+    name = "strategoxt-0.18pre20449";
 
     src = fetchurl {
-      url = "http://hydra.nixos.org/build/124117/download/1/strategoxt-0.18pre20227.tar.gz";
-      sha256 = "c2c7a68f76c6dfaf470ed9f7bad71cddebb620b709f20b01231c3a6fd93d8150";
+      url = "http://hydra.nixos.org/build/199475/download/1/strategoxt-0.18pre20449.tar.gz";
+      sha256 = "c492df19a810801377f160f6d117bfd3e689f23396bd89c3e98224f35db666f2";
     };
 
     buildInputs = [pkgconfig aterm sdf getopt];
diff --git a/pkgs/development/interpreters/guile/1.9.nix b/pkgs/development/interpreters/guile/1.9.nix
index 1dd3d495339..27e41248405 100644
--- a/pkgs/development/interpreters/guile/1.9.nix
+++ b/pkgs/development/interpreters/guile/1.9.nix
@@ -17,8 +17,8 @@ rec {
   propagatedBuildInputs = [ gmp boehmgc ];
 
   patches =
-    stdenv.lib.optional (coverageAnalysis != null)
-      ./disable-gc-sensitive-tests.patch;
+    stdenv.lib.optionals (coverageAnalysis != null)
+      [ ./gcov-file-name.patch ./disable-gc-sensitive-tests.patch ];
 
   postInstall = ''
     wrapProgram $out/bin/guile-snarf --prefix PATH : "${gawk}/bin"
diff --git a/pkgs/development/interpreters/guile/gcov-file-name.patch b/pkgs/development/interpreters/guile/gcov-file-name.patch
new file mode 100644
index 00000000000..f144296170e
--- /dev/null
+++ b/pkgs/development/interpreters/guile/gcov-file-name.patch
@@ -0,0 +1,42 @@
+This patch arranges so that we don't end up, with profiling builds, with a
+file named `<stdout>.gcov' since that confuses lcov:
+
+  <stdout>:cannot open source file
+  geninfo: ERROR: cannot read <stdout>.gcov!
+
+--- guile/libguile/c-tokenize.c	2009-09-13 13:05:15.000000000 +0200
++++ guile/libguile/c-tokenize.c	2009-10-28 16:24:15.000000000 +0100
+@@ -1,5 +1,5 @@
+ 
+-#line 3 "<stdout>"
++#line 3 "c-tokenize.c"
+ 
+ #define  YY_INT_ALIGNED short int
+ 
+@@ -616,7 +616,7 @@ int cookie_was_last = 0; 
+ #define IS_COOKIE cookie_was_last = 1
+ #define IS_NOT_COOKIE cookie_was_last = 0
+  
+-#line 620 "<stdout>"
++#line 620 "c-tokenize.c"
+ 
+ #define INITIAL 0
+ 
+@@ -799,7 +799,7 @@ YY_DECL
+ #line 65 "./c-tokenize.lex"
+ 
+ 
+-#line 803 "<stdout>"
++#line 803 "c-tokenize.c"
+ 
+ 	if ( !(yy_init) )
+ 		{
+@@ -1235,7 +1235,7 @@ YY_RULE_SETUP
+ #line 181 "./c-tokenize.lex"
+ ECHO;
+ 	YY_BREAK
+-#line 1239 "<stdout>"
++#line 1239 "c-tokenize.c"
+ case YY_STATE_EOF(INITIAL):
+ 	yyterminate();
+ 
diff --git a/pkgs/development/interpreters/php-xdebug/default.nix b/pkgs/development/interpreters/php-xdebug/default.nix
new file mode 100644
index 00000000000..6fdeac2d24c
--- /dev/null
+++ b/pkgs/development/interpreters/php-xdebug/default.nix
@@ -0,0 +1,34 @@
+args: with args;
+stdenv.mkDerivation {
+  name = "php-xdebug";
+
+  src = args.fetchurl {
+    url = "http://xdebug.org/files/xdebug-2.0.5.tgz";
+    sha256 = "1cmq7c36gj8n41mfq1wba5rij8j77yqhydpcsbcysk1zchg68f26";
+  };
+
+  buildInputs = [php autoconf automake];
+
+  configurePhase = ''
+    phpize
+    ./configure --prefix=$out
+  '';
+
+  buildPhase = ''
+    make && make test
+  '';
+
+  installPhase = ''
+    ensureDir $out/lib/xdebug
+    cp modules/xdebug.so $out/lib
+    cp LICENSE $out/lib/xdebug
+  '';
+
+  meta = {
+    description = "php debugger and profiler extension";
+    homepage = http://xdebug.org/;
+    license = "xdebug"; # based on PHP-3
+    maintainers = [stdenv.lib.maintainers.marcweber];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/development/interpreters/php/ini-bulider.nix b/pkgs/development/interpreters/php/ini-bulider.nix
new file mode 100644
index 00000000000..72179fd068b
--- /dev/null
+++ b/pkgs/development/interpreters/php/ini-bulider.nix
@@ -0,0 +1,43 @@
+{runCommand, php, appendLines ? "", prefixPhpRecommended ? true} :
+
+
+/*
+
+NixOS: see apache-httpd/default.nix's phpIni option
+
+to enable Xdebug append these lines:
+  ''
+      zend_extension="${pkgs.phpXdebug}/lib/xdebug.so"
+      zend_extension_ts="${pkgs.phpXdebug}/lib/xdebug.so"
+      zend_extension_debug="${pkgs.phpXdebug}/lib/xdebug.so"
+      xdebug.remote_enable=true
+      xdebug.remote_host=127.0.0.1
+      xdebug.remote_port=9000
+      xdebug.remote_handler=dbgp
+      xdebug.profiler_enable=0
+      xdebug.profiler_output_dir="/tmp/xdebug"
+      xdebug.remote_mode=req
+  ''
+
+to make php's mail() function work add
+  ''
+   ; Needed for PHP's mail() function.
+   sendmail_path = sendmail -t -i
+  ''
+*/
+
+
+runCommand "php.ini"
+  {
+    inherit php appendLines prefixPhpRecommended;
+  }
+  ''
+    [ -z "$prefixPhpRecommended" ] || {
+      {
+      echo "# PHP RECOMMENDED INI START"
+      cat $php/etc/php-recommended.ini
+      echo "# PHP RECOMMENDED INI END"
+      } >> $out
+    }
+    echo "$appendLines" >> $out
+  ''
diff --git a/pkgs/development/interpreters/php_configurable/default.nix b/pkgs/development/interpreters/php_configurable/default.nix
index 07ac6f90a1b..eb4a29dd720 100644
--- a/pkgs/development/interpreters/php_configurable/default.nix
+++ b/pkgs/development/interpreters/php_configurable/default.nix
@@ -106,13 +106,6 @@ composableDerivation {} ( fixed : {
                 license = "based on the PHP license - as is";
                 };
       */
-      xdebug = {
-        buildInputs = [ automake autoconf ];
-        xdebug_src = args.fetchurl {
-          url = "http://xdebug.org/files/xdebug-2.0.5.tgz";
-          sha256 = "1cmq7c36gj8n41mfq1wba5rij8j77yqhydpcsbcysk1zchg68f26";
-        };
-      };
     };
 
   cfg = {
@@ -130,14 +123,13 @@ composableDerivation {} ( fixed : {
     soapSupport = getConfig ["php" "soap"] true;
     zlibSupport = getConfig ["php" "zlib"] true;
     opensslSupport = getConfig ["php" "openssl"] true;
-    xdebugSupport = getConfig ["php" "xdebug"] false;
     mbstringSupport = getConfig ["php" "mbstring"] true;
     gdSupport = getConfig ["php" "gd"] true;
   };
 
   # only -O1
   configurePhase = ''
-    iniFile=$out/etc/$name.ini
+    iniFile=$out/etc/php-recommended.ini
     [[ -z "$libxml2" ]] || export PATH=$PATH:$libxml2/bin
     ./configure --with-config-file-scan-dir=/etc --with-config-file-path=$out/etc --prefix=$out  $configureFlags
     echo configurePhase end
@@ -147,32 +139,6 @@ composableDerivation {} ( fixed : {
   installPhase = ''
     unset installPhase; installPhase;
     cp php.ini-recommended $iniFile
-
-    # Now Let's build xdebug if flag has been given
-    # TODO I think there are better paths than the given below
-    if [ -n "$xdebug_src" ]; then
-      PATH=$PATH:$out/bin
-      tar xfz $xdebug_src;
-      cd xdebug*
-      phpize
-      ./configure --prefix=$out
-      make
-      ensureDir $out/lib; cp modules/xdebug.so $out/lib
-      cat >> $out/etc/php.ini << EOF
-        zend_extension="$out/lib/xdebug.so"
-        zend_extension_ts="$out/lib/xdebug.so"
-        zend_extension_debug="$out/lib/xdebug.so"
-        xdebug.remote_enable=true
-        xdebug.remote_host=127.0.0.1
-        xdebug.remote_port=9000
-        xdebug.remote_handler=dbgp
-        xdebug.profiler_enable=0
-        xdebug.profiler_output_dir="/tmp/xdebug"
-        xdebug.remote_mode=req
-        max_execution_time = 300
-        date.timezone = UTC
-  EOF
-    fi
   '';
 
   src = args.fetchurl {
diff --git a/pkgs/development/libraries/adns/default.nix b/pkgs/development/libraries/adns/default.nix
index f433b1611bb..d0eedef15f0 100644
--- a/pkgs/development/libraries/adns/default.nix
+++ b/pkgs/development/libraries/adns/default.nix
@@ -11,7 +11,11 @@ stdenv.mkDerivation
   };
   src = fetchurl
   {
-    url = "ftp://ftp.chiark.greenend.org.uk/users/ian/adns/adns-${version}.tar.gz";
+    urls =
+      [ "http://www.chiark.greenend.org.uk/~ian/adns/ftp/adns-${version}.tar.gz"
+        "ftp://ftp.chiark.greenend.org.uk/users/ian/adns/adns-${version}.tar.gz"
+        "mirror://gnu/adns/adns-${version}.tar.gz"
+      ];
     sha256 = "${versionHash}";
   };
   configureFlags = if static then "--disable-dynamic" else "--enable-dynamic";
diff --git a/pkgs/development/libraries/enginepkcs11/default.nix b/pkgs/development/libraries/enginepkcs11/default.nix
new file mode 100644
index 00000000000..edd646f94fa
--- /dev/null
+++ b/pkgs/development/libraries/enginepkcs11/default.nix
@@ -0,0 +1,18 @@
+{stdenv, fetchurl, libp11, pkgconfig, openssl}:
+
+stdenv.mkDerivation rec {
+  name = "engine_pkcs11-0.1.8";
+  
+  src = fetchurl {
+    url = "http://www.opensc-project.org/files/engine_pkcs11/${name}.tar.gz";
+    sha256 = "1rd20rxy12rfx3kwwvk5sqvc1ll87z60rqak1ksfwbf4wx0pwzfy";
+  };
+  
+  buildInputs = [ libp11 pkgconfig openssl ];
+
+  meta = {
+    homepage = http://www.opensc-project.org/engine_pkcs11/;
+    license = "BSD";
+    description = "Engine for OpenSSL to use smart cards in PKCS#11 format";
+  };
+}
diff --git a/pkgs/development/libraries/glib/2.22.x.nix b/pkgs/development/libraries/glib/2.22.x.nix
index b1965f1915f..eaf6a56dade 100644
--- a/pkgs/development/libraries/glib/2.22.x.nix
+++ b/pkgs/development/libraries/glib/2.22.x.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, pkgconfig, gettext, perl }:
 
 stdenv.mkDerivation rec {
-  name = "glib-2.22.2";
+  name = "glib-2.22.4";
 
   src = fetchurl {
     url = "mirror://gnome/sources/glib/2.22/${name}.tar.bz2";
-    sha256 = "18ycpaf69wlpp4wq385hkq7bcfhbis8ncd7wl7zmwgrdzh11v954";
+    sha256 = "055dv2hymbyzwpcd39r97x747vsvlkyywa826zr75dzambw6n7qd";
   };
 
   buildInputs = [pkgconfig gettext perl];
diff --git a/pkgs/development/libraries/gtk+/2.18.x.nix b/pkgs/development/libraries/gtk+/2.18.x.nix
index 22efef4255f..b0d17bf4581 100644
--- a/pkgs/development/libraries/gtk+/2.18.x.nix
+++ b/pkgs/development/libraries/gtk+/2.18.x.nix
@@ -8,11 +8,11 @@ assert xineramaSupport -> xlibs.libXinerama != null;
 assert cupsSupport -> cups != null;
 
 stdenv.mkDerivation rec {
-  name = "gtk+-2.18.3";
+  name = "gtk+-2.18.6";
   
   src = fetchurl {
     url = "mirror://gnome/sources/gtk+/2.18/${name}.tar.bz2";
-    sha256 = "1gv8lx7a00yp95ss0vzvmda4nv213m8adjdkx18hhmhaavz6a1hw";
+    sha256 = "0k9mz46q97537kdpmz8j5bhrzpn3zjp7k4mni4niafdp2x4r8aan";
   };
   
   buildInputs = [ pkgconfig perl jasper ];
diff --git a/pkgs/development/libraries/haskell/Agda/default.nix b/pkgs/development/libraries/haskell/Agda/default.nix
index e1f5b27c0ec..db49277d7fc 100644
--- a/pkgs/development/libraries/haskell/Agda/default.nix
+++ b/pkgs/development/libraries/haskell/Agda/default.nix
@@ -3,13 +3,14 @@
 
 cabal.mkDerivation (self : {
   pname = "Agda";
-  version = "2.2.2";
-  sha256 = "265dbb5bc6d67bfeefa4a2a4ac9e5018d6d8b5c1a75816e05da2661c43a39bba";
+  version = "2.2.6";
+  sha256 = "e9268a61db30fc0f22f7e1fbc78673cd3e0d1bf2dd40ee5cf809635ca40fca78";
   extraBuildInputs = [happy alex];
   propagatedBuildInputs =
     [QuickCheck binary haskeline haskellSrc mtl utf8String xhtml zlib];
   meta = {
     description = "A dependently typed functional language and proof assistant";
+    maintainers = [self.stdenv.lib.maintainers.andres];
   };
 })  
 
diff --git a/pkgs/development/libraries/haskell/QuickCheck/2.1.0.1.nix b/pkgs/development/libraries/haskell/QuickCheck/QuickCheck-2.nix
index e84a7780983..4e9bdefc537 100644
--- a/pkgs/development/libraries/haskell/QuickCheck/2.1.0.1.nix
+++ b/pkgs/development/libraries/haskell/QuickCheck/QuickCheck-2.nix
@@ -2,12 +2,13 @@
 
 cabal.mkDerivation (self : {
   pname = "QuickCheck";
-  version = "2.1.0.1";
-  sha256 = "f99edf1a45315e90c9ec672d5d959d5878dcc1de65678c6aed85829a896b75f1";
+  version = "2.1.0.2";
+  sha256 = "1adeea5aa52cba7b8bcd27f9cdd9fe944e9a4a22d22fdf0570b526f580981e58";
   propagatedBuildInputs = [mtl];
-  configureFlags = ''--constraint=base<4'';
   meta = {
     description = "Automatic testing of Haskell programs";
+    license = "BSD";
+    maintainers = [self.stdenv.lib.maintainers.andres];
   };
 })  
 
diff --git a/pkgs/development/libraries/haskell/X11/default.nix b/pkgs/development/libraries/haskell/X11/default.nix
index cf54b11977b..214cc3aecc7 100644
--- a/pkgs/development/libraries/haskell/X11/default.nix
+++ b/pkgs/development/libraries/haskell/X11/default.nix
@@ -4,8 +4,8 @@ assert xineramaSupport -> (libXinerama != null && libXext != null);
 
 cabal.mkDerivation (self : {
   pname = "X11";
-  version = "1.4.6.1";
-  sha256 = "3e1375d4e53a8366fa2ea12bd9c3033ffe2f7dd00443acd84f722cf0dfff0fa9";
+  version = "1.5.0.0";
+  sha256 = "653ff8aa4053574a36dbb1729459df6e5a1a87a223bc3eeced8e40c6e3a5406f";
   propagatedBuildInputs = [libX11] ++ (if xineramaSupport then [libXinerama libXext] else []);
   meta = {
     description = "A Haskell binding to the X11 graphics library";
diff --git a/pkgs/development/libraries/haskell/cabal/cabal.nix b/pkgs/development/libraries/haskell/cabal/cabal.nix
index c4ea86a4ac7..f6220cb0fb3 100644
--- a/pkgs/development/libraries/haskell/cabal/cabal.nix
+++ b/pkgs/development/libraries/haskell/cabal/cabal.nix
@@ -9,15 +9,15 @@ attrs :
 
             # pname should be defined by the client to be the package basename
             # version should be defined by the client to be the package version
- 
+
             # fname is the internal full name of the package
             fname = "${self.pname}-${self.version}";
 
-	    # name is the external full name of the package; usually we prefix
-	    # all packages with haskell- to avoid name clashes for libraries;
-	    # if that is not desired (for applications), name can be set to
-	    # fname.
-            name = "haskell-${self.pname}-ghc${attrs.ghc.ghc.version}-${self.version}"; 
+            # name is the external full name of the package; usually we prefix
+            # all packages with haskell- to avoid name clashes for libraries;
+            # if that is not desired (for applications), name can be set to
+            # fname.
+            name = "haskell-${self.pname}-ghc${attrs.ghc.ghc.version}-${self.version}";
 
             # the default download location for Cabal packages is Hackage,
             # you still have to specify the checksum
@@ -37,7 +37,7 @@ attrs :
             propagatedBuildInputs = [];
 
             # library directories that have to be added to the Cabal files
-            extraLibDirs = attrs.lib.lists.concatMap (x : [ (x + "/lib64") (x + "/lib") ]) self.propagatedBuildInputs;
+            extraLibDirs = [];
 
             # compiles Setup and configures
             configurePhase = ''
@@ -46,7 +46,16 @@ attrs :
               for i in Setup.hs Setup.lhs; do
                 test -f $i && ghc --make $i
               done
-              ./Setup configure --verbose --prefix="$out" ${toString (map (x : "--extra-lib-dir=" + x) self.extraLibDirs)} $configureFlags
+
+              for p in $propagatedBuildInputs; do
+                for d in lib{,64}; do
+                  if [ -e "$p/$d" ]; then
+                    extraLibDirs="$extraLibDirs --extra-lib-dir=$p/$d"
+                  fi
+                done
+              done
+
+              ./Setup configure --verbose --prefix="$out" $extraLibDirs $configureFlags
 
               eval "$postConfigure"
             '';
@@ -57,12 +66,15 @@ attrs :
 
               ./Setup build
 
+              export GHC_PACKAGE_PATH=$(ghc-packages)
+              ./Setup haddock
+
               eval "$postBuild"
             '';
 
-	    # installs via Cabal; creates a registration file for nix-support
-	    # so that the package can be used in other Haskell-builds; also
-	    # adds all propagated build inputs to the user environment packages
+            # installs via Cabal; creates a registration file for nix-support
+            # so that the package can be used in other Haskell-builds; also
+            # adds all propagated build inputs to the user environment packages
             installPhase = ''
               eval "$preInstall"
 
@@ -82,9 +94,13 @@ attrs :
 
               ensureDir $out/nix-support
               ln -s $out/nix-support/propagated-build-inputs $out/nix-support/propagated-user-env-packages
-              
+
               eval "$postInstall"
             '';
+
+            # We inherit stdenv and ghc so that they can be used
+            # in Cabal derivations.
+            inherit (attrs) stdenv ghc;
           };
     in  attrs.stdenv.mkDerivation ((rec { f = dtransform f // transform f; }).f);
-} 
+}
diff --git a/pkgs/development/libraries/haskell/haskeline/default.nix b/pkgs/development/libraries/haskell/haskeline/default.nix
index e46427bcc3c..646400acc5a 100644
--- a/pkgs/development/libraries/haskell/haskeline/default.nix
+++ b/pkgs/development/libraries/haskell/haskeline/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self : {
   pname = "haskeline";
-  version = "0.6.1.3";
-  sha256 = "af27d17bf6df7647e843bca91548b542748a5305f072ba7cfef97105a52578d4";
+  version = "0.6.2.2";
+  sha256 = "b6307563258802453d65c7e7bd1ef1c6635fefea17af3e01449192b52075b25b";
   propagatedBuildInputs = [extensibleExceptions mtl utf8String];
   meta = {
     description = "A command-line interface for user input, written in Haskell";
diff --git a/pkgs/development/libraries/haskell/regular/default.nix b/pkgs/development/libraries/haskell/regular/default.nix
index f9f19f46824..7a43c50a6a6 100644
--- a/pkgs/development/libraries/haskell/regular/default.nix
+++ b/pkgs/development/libraries/haskell/regular/default.nix
@@ -2,10 +2,12 @@
 
 cabal.mkDerivation (self : {
   pname = "regular";
-  version = "0.1";
-  sha256 = "2f2858a22dd26d93eaa4b5244141d6d146387eac98e0fb15f647123d50525820";
+  version = "0.2.1";
+  sha256 = "732de15c4687b34a2702d38975581c8ab32167a76cd3c40cd4886bca0fc8b762";
   meta = {
     description = "Generic programming library for regular datatypes";
+    license = "BSD";
+    maintainers = [self.stdenv.lib.maintainers.andres];
   };
 })  
 
diff --git a/pkgs/development/libraries/haskell/utf8-string/default.nix b/pkgs/development/libraries/haskell/utf8-string/default.nix
index 9b932edfb46..b9d9628350d 100644
--- a/pkgs/development/libraries/haskell/utf8-string/default.nix
+++ b/pkgs/development/libraries/haskell/utf8-string/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self : {
   pname = "utf8-string";
-  version = "0.3.5";
-  sha256 = "41f99b3e9f61ab5309c93f98d45f1ba2e475a8504c5202a350720c27fb82d07a";
+  version = "0.3.6";
+  sha256 = "c8c74555174edfb96145585c9b80780d0fc55ba249282b8a4c5968cca7c09d69";
   meta = {
     description = "A UTF8 layer for IO and Strings";
   };
diff --git a/pkgs/development/libraries/haskell/uu-parsinglib/default.nix b/pkgs/development/libraries/haskell/uu-parsinglib/default.nix
index 3936c5dc495..784fe915814 100644
--- a/pkgs/development/libraries/haskell/uu-parsinglib/default.nix
+++ b/pkgs/development/libraries/haskell/uu-parsinglib/default.nix
@@ -2,8 +2,8 @@
 
 cabal.mkDerivation (self : {
   pname = "uu-parsinglib";
-  version = "2.2.1";
-  sha256 = "f05088d621715e5ebc7037f1a8cb5f34fd13ed055a26bf2dc331bdbeef7552dc";
+  version = "2.3.0";
+  sha256 = "0ddf5ff41e59d8a777942f821170f1e6c7373712b029261a7efbc16fa663b671";
   meta = {
     description = "New version of the Utrecht University parser combinator library";
   };
diff --git a/pkgs/development/libraries/java/dbus-java/default.nix b/pkgs/development/libraries/java/dbus-java/default.nix
new file mode 100644
index 00000000000..7b55f8b15a2
--- /dev/null
+++ b/pkgs/development/libraries/java/dbus-java/default.nix
@@ -0,0 +1,21 @@
+{stdenv, fetchurl, gettext, jdk, libmatthew_java}:
+
+stdenv.mkDerivation {
+  name = "dbus-java-2.7";
+  src = fetchurl {
+    url = http://dbus.freedesktop.org/releases/dbus-java/dbus-java-2.7.tar.gz;
+    sha256 = "0cyaxd8x6sxmi6pklkkx45j311a6w51fxl4jc5j3inc4cailwh5y";
+  };
+  JAVA_HOME=jdk;
+  JAVA="${jdk}/bin/java";
+  PREFIX=''''${out}'';
+  JAVAUNIXLIBDIR="${libmatthew_java}/lib/jni";
+  JAVAUNIXJARDIR="${libmatthew_java}/share/java";
+  buildInputs = [ gettext jdk ];
+  # I'm too lazy to build the documentation
+  preBuild = ''
+    sed -i -e "s|all: bin doc man|all: bin|" \
+           -e "s|install: install-bin install-man install-doc|install: install-bin|" Makefile
+  '';
+  maintainers = [ stdenv.lib.maintainers.sander ];
+}
diff --git a/pkgs/development/libraries/java/libmatthew-java/default.nix b/pkgs/development/libraries/java/libmatthew-java/default.nix
new file mode 100644
index 00000000000..785ba9ab9ea
--- /dev/null
+++ b/pkgs/development/libraries/java/libmatthew-java/default.nix
@@ -0,0 +1,13 @@
+{stdenv, fetchurl, jdk}:
+
+stdenv.mkDerivation {
+  name = "libmatthew-java-0.7.2";
+  src = fetchurl {
+    url = http://www.matthew.ath.cx/projects/java/libmatthew-java-0.7.2.tar.gz;
+    sha256 = "00zd6vplbvha64pf65bpw44abg2y8irblik30pbk35wcm86a0j4z";
+  };
+  JAVA_HOME=jdk;
+  PREFIX=''''${out}'';
+  buildInputs = [ jdk ];
+  maintainers = [ stdenv.lib.maintainers.sander ];
+}
diff --git a/pkgs/development/libraries/libdrm/default.nix b/pkgs/development/libraries/libdrm/default.nix
index ea10c3ee8d2..98dce86a2f8 100644
--- a/pkgs/development/libraries/libdrm/default.nix
+++ b/pkgs/development/libraries/libdrm/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl, pkgconfig, libpthreadstubs}:
 
 stdenv.mkDerivation rec {
-  name = "libdrm-2.4.15";
+  name = "libdrm-2.4.17";
   
   src = fetchurl {
     url = "http://dri.freedesktop.org/libdrm/${name}.tar.bz2";
-    sha256 = "1pm7iddv3yjwvqmlbdmj9m55bmkfcfzq0wvqpgx4gkmdjfd8kzxw";
+    sha256 = "0sii8bhplb99i4x67626sd4pm1c2i3i0c73rdma71sdh233fg95q";
   };
 
   buildInputs = [ pkgconfig libpthreadstubs ];
diff --git a/pkgs/development/libraries/libextractor/0.5.18.nix b/pkgs/development/libraries/libextractor/0.5.18.nix
deleted file mode 100644
index 557369bd76c..00000000000
--- a/pkgs/development/libraries/libextractor/0.5.18.nix
+++ /dev/null
@@ -1,21 +0,0 @@
-args : with args;
-	let localDefs = builderDefs.passthru.function {
-		src = /* put a fetchurl here */
-		fetchurl {
-			url = http://gnunet.org/libextractor/download/libextractor-0.5.18.tar.gz;
-			sha256 = "09y869zmnr6n2953ra4y7z9m9nj23prlqa4nr4rwcb50dzdmil1k";
-		};
-
-		buildInputs = [ zlib];
-		configureFlags = [];
-	};
-	in with localDefs;
-stdenv.mkDerivation rec {
-	name = "libextractor-0.5.18";
-	builder = writeScript (name + "-builder")
-		(textClosure localDefs [doConfigure doMakeInstall doForceShare doPropagate]);
-	meta = {
-		description = "A tool to extract metadata from files";
-		inherit src;
-	};
-}
diff --git a/pkgs/development/libraries/libextractor/default.nix b/pkgs/development/libraries/libextractor/default.nix
new file mode 100644
index 00000000000..a134fbacf0b
--- /dev/null
+++ b/pkgs/development/libraries/libextractor/default.nix
@@ -0,0 +1,64 @@
+{ fetchurl, stdenv, libtool, gettext, zlib, bzip2, flac, libvorbis, libmpeg2
+, ffmpeg, exiv2, libgsf, rpm, pkgconfig, glib, gtk }:
+
+stdenv.mkDerivation rec {
+  name = "libextractor-0.5.23";
+
+  src = fetchurl {
+    url = "mirror://gnu/libextractor/${name}.tar.gz";
+    sha256 = "1zyfshayjrp7kd87pm7blyq0dvbv5bbh3f368pp4jws4qxs8aj9f";
+  };
+
+  preConfigure =
+    '' echo "patching installation directory in \`extractor.c'..."
+       sed -i "src/main/extractor.c" \
+           -e "s|pexe[[:blank:]]*=.*$|pexe = strdup(\"$out/lib/\");|g"
+    '';
+
+  buildInputs =
+   [ libtool gettext zlib bzip2 flac libvorbis libmpeg2 exiv2 ffmpeg
+     libgsf rpm
+     pkgconfig glib gtk
+   ];
+
+  configureFlags = "--disable-ltdl-install "
+    + "--with-ltdl-include=${libtool}/include "
+    + "--with-ltdl-lib=${libtool}/lib "
+    + "--enable-xpdf";
+
+  # Checks need to be run after "make install", otherwise plug-ins are not in
+  # the search path, etc.
+  # FIXME: Tests currently fail and the test framework appears to be deeply
+  # broken anyway.
+  doCheck = false;
+  #postInstall = "make check";
+
+  meta = {
+    description = "GNU libextractor, a simple library for keyword extraction";
+
+    longDescription =
+      '' GNU libextractor is a library used to extract meta-data from files
+         of arbitrary type.  It is designed to use helper-libraries to perform
+         the actual extraction, and to be trivially extendable by linking
+         against external extractors for additional file types.
+
+         The goal is to provide developers of file-sharing networks or
+         WWW-indexing bots with a universal library to obtain simple keywords
+         to match against queries.  libextractor contains a shell-command
+         extract that, similar to the well-known file command, can extract
+         meta-data from a file an print the results to stdout.
+
+         Currently, libextractor supports the following formats: HTML, PDF,
+         PS, OLE2 (DOC, XLS, PPT), OpenOffice (sxw), StarOffice (sdw), DVI,
+         MAN, FLAC, MP3 (ID3v1 and ID3v2), NSF(E) (NES music), SID (C64
+         music), OGG, WAV, EXIV2, JPEG, GIF, PNG, TIFF, DEB, RPM, TAR(.GZ),
+         ZIP, ELF, S3M (Scream Tracker 3), XM (eXtended Module), IT (Impulse
+         Tracker), FLV, REAL, RIFF (AVI), MPEG, QT and ASF.  Also, various
+         additional MIME types are detected.
+      '';
+
+    license = "GPLv2+";
+
+    maintainers = [ stdenv.lib.maintainers.ludo ];
+  };
+}
diff --git a/pkgs/development/libraries/libidn/default.nix b/pkgs/development/libraries/libidn/default.nix
index 10bb8966222..3f17f7e5a99 100644
--- a/pkgs/development/libraries/libidn/default.nix
+++ b/pkgs/development/libraries/libidn/default.nix
@@ -1,11 +1,11 @@
 { fetchurl, stdenv }:
 
 stdenv.mkDerivation rec {
-  name = "libidn-1.13";
+  name = "libidn-1.16";
 
   src = fetchurl {
     url = "mirror://gnu/libidn/${name}.tar.gz";
-    sha256 = "07p7cnmfnq7ds8a56iqmxps46bzznn92xxpdlnnp3n6pwcnidmn7";
+    sha256 = "1zywwhqg7i44qg0sj2wpwprxif7723sp3if7vhvgy8mdzfn0zn7p";
   };
 
   doCheck = true;
@@ -31,5 +31,7 @@ stdenv.mkDerivation rec {
     '';
 
     license = "LGPLv2+";
+    platforms = stdenv.lib.platforms.all;
+    maintainers = [ stdenv.lib.maintainers.ludo ];
   };
 }
diff --git a/pkgs/development/libraries/libjpeg/62.nix b/pkgs/development/libraries/libjpeg/62.nix
new file mode 100644
index 00000000000..fb92fe995b6
--- /dev/null
+++ b/pkgs/development/libraries/libjpeg/62.nix
@@ -0,0 +1,29 @@
+{stdenv, fetchurl, libtool, static ? false, ...}: 
+
+stdenv.mkDerivation {
+  name = "libjpeg-6b";
+  
+  builder = ./builder.sh;
+  
+  src = fetchurl {
+    url = http://www.ijg.org/files/jpegsrc.v6b.tar.gz;
+    md5 = "dbd5f3b47ed13132f04c685d608a7547";
+  };
+  
+  inherit libtool;
+
+  configureFlags = "--enable-shared ${if static then " --enable-static" else ""}";
+    
+  # Required for building of dynamic libraries on Darwin.
+  patches = [
+    (fetchurl {
+      url = http://svn.macports.org/repository/macports/trunk/dports/graphics/jpeg/files/patch-ltconfig;
+      md5 = "e6725fa4a09aa1de4ca75343fd0f61d5";
+    })
+    (fetchurl {
+      url = http://svn.macports.org/repository/macports/trunk/dports/graphics/jpeg/files/patch-ltmain.sh;
+      #md5 = "489986ad8e7a93aef036766b25f321d5";
+      md5 = "092a12aeb0c386dd7dae059109d950ba";
+    })
+  ];
+}
diff --git a/pkgs/development/libraries/libjpeg/builder.sh b/pkgs/development/libraries/libjpeg/builder.sh
new file mode 100755
index 00000000000..58ca9a790ba
--- /dev/null
+++ b/pkgs/development/libraries/libjpeg/builder.sh
@@ -0,0 +1,25 @@
+source $stdenv/setup
+
+preConfigure() {
+    # Workarounds for the ancient libtool shipped by libjpeg.
+    ln -s $libtool/bin/libtool .
+    cp $libtool/share/libtool/config.guess .
+    cp $libtool/share/libtool/config.sub .
+}
+
+preInstall() {
+    mkdir $out
+    mkdir $out/bin
+    mkdir $out/lib
+    mkdir $out/include
+    mkdir $out/man
+    mkdir $out/man/man1
+}
+
+patchPhase() {
+    for i in $patches; do
+	patch < $i
+    done
+}
+
+genericBuild
diff --git a/pkgs/development/libraries/libmicrohttpd/default.nix b/pkgs/development/libraries/libmicrohttpd/default.nix
index 3ddf4905b10..ed213c75959 100644
--- a/pkgs/development/libraries/libmicrohttpd/default.nix
+++ b/pkgs/development/libraries/libmicrohttpd/default.nix
@@ -1,15 +1,23 @@
 {stdenv, fetchurl, curl}:
 
 stdenv.mkDerivation rec {
-  name = "libmicrohttpd-0.3.1";
+  name = "libmicrohttpd-0.4.4";
 
   src = fetchurl {
     url = "mirror://gnu/libmicrohttpd/${name}.tar.gz";
-    sha256 = "1zv8a7lwypwbwzam5jvr35wvxb13chyh0ir18k82nzm9q5s3v3n3";
+    sha256 = "1w486b4hpwnzpc4zdywm3f1q5zs7j4yh7xibbsig6b8cv1npn0rz";
   };
 
   buildInputs = [ curl ];
 
+  preCheck =
+    # Since `localhost' can't be resolved in a chroot, work around it.
+    '' for i in "src/test"*"/"*.[ch]
+       do
+         sed -i "$i" -es/localhost/127.0.0.1/g
+       done
+    '';
+
   doCheck = true;
 
   meta = {
@@ -23,5 +31,7 @@ stdenv.mkDerivation rec {
     license = "LGPLv2+";
 
     homepage = http://www.gnu.org/software/libmicrohttpd/;
+
+    maintainers = [ stdenv.lib.maintainers.ludo ];
   };
 }
diff --git a/pkgs/development/libraries/libmusclecard/default.nix b/pkgs/development/libraries/libmusclecard/default.nix
new file mode 100644
index 00000000000..5968c6d9a55
--- /dev/null
+++ b/pkgs/development/libraries/libmusclecard/default.nix
@@ -0,0 +1,22 @@
+{stdenv, fetchurl, pkgconfig, pcsclite}:
+stdenv.mkDerivation {
+  name = "libmusclecard-1.3.6";
+
+  src = fetchurl {
+    url = https://alioth.debian.org/frs/download.php/3024/libmusclecard-1.3.6.tar.bz2;
+    sha256 = "1sswy7vcy0w9p6818al7prv9d3whj7w3w98k55zw9nhspbj6lppb";
+  };
+
+  # The OS should care on preparing the services into this location
+  configureFlags = [ "--enable-muscledropdir=/var/lib/pcsc/services" ];
+
+  buildInputs = [ pkgconfig pcsclite ];
+
+  meta = {
+    description = "Library for MUSCLE smartcard applications";
+    homepage = http://pcsclite.alioth.debian.org/;
+    license = "BSD";
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/development/libraries/libp11/default.nix b/pkgs/development/libraries/libp11/default.nix
new file mode 100644
index 00000000000..acfca9bf888
--- /dev/null
+++ b/pkgs/development/libraries/libp11/default.nix
@@ -0,0 +1,18 @@
+{stdenv, fetchurl, libtool, openssl, pkgconfig}:
+
+stdenv.mkDerivation rec {
+  name = "libp11-0.2.7";
+  
+  src = fetchurl {
+    url = "http://www.opensc-project.org/files/libp11/${name}.tar.gz";
+    sha256 = "0kaz5qafaxm0ycywmajl166c29fh9cz89b8i043jqsbxlpzf4hdp";
+  };
+  
+  buildInputs = [ libtool openssl pkgconfig ];
+
+  meta = {
+    homepage = http://www.opensc-project.org/libp11/;
+    license = "LGPL";
+    description = "Small layer on top of PKCS#11 API to make PKCS#11 implementations easier";
+  };
+}
diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix
index ad7ea7ecc5d..558291f5327 100644
--- a/pkgs/development/libraries/mesa/default.nix
+++ b/pkgs/development/libraries/mesa/default.nix
@@ -5,12 +5,14 @@ if stdenv.system != "i686-linux" && stdenv.system != "x86_64-linux" && stdenv.sy
 else
 
 stdenv.mkDerivation {
-  name = "mesa-7.5.2";
+  name = "mesa-7.6.1";
   
   src = fetchurl {
-    url = ftp://ftp.freedesktop.org/pub/mesa/7.5.2/MesaLib-7.5.2.tar.bz2;
-    md5 = "94e47a499f1226803869c2e37a6a8e3a";
+    url = ftp://ftp.freedesktop.org/pub/mesa/7.6.1/MesaLib-7.6.1.tar.bz2;
+    md5 = "7db4617e9e10ad3aca1b64339fd71b7d";
   };
+
+  configureFlags = "--disable-gallium";
   
   buildInputs =
     [ pkgconfig expat x11 libdrm xlibs.glproto
diff --git a/pkgs/development/libraries/mesa/headers.nix b/pkgs/development/libraries/mesa/headers.nix
deleted file mode 100644
index d90f9be6fd0..00000000000
--- a/pkgs/development/libraries/mesa/headers.nix
+++ /dev/null
@@ -1,10 +0,0 @@
-{stdenv, mesaSrc}:
-
-stdenv.mkDerivation {
-  name = "mesa-headers-6.5.2"; # !!! keep up-to-date
-  buildCommand = "
-    unpackFile ${mesaSrc}
-    ensureDir $out/include
-    cp -prvd Mesa-*/include/GL $out/include/
-  ";
-}
\ No newline at end of file
diff --git a/pkgs/development/libraries/mpeg2dec/default.nix b/pkgs/development/libraries/mpeg2dec/default.nix
index 684301b939d..8b29deba56f 100644
--- a/pkgs/development/libraries/mpeg2dec/default.nix
+++ b/pkgs/development/libraries/mpeg2dec/default.nix
@@ -8,6 +8,8 @@ stdenv.mkDerivation {
     sha256 = "1vny7rg0p2rmic71hli2l2612i5yaw8vy0wsnm5nvhwfiw37cjn7";
   };
 
+  configureFlags = "--enable-shared --disable-static";
+
   meta = {
     homepage = http://libmpeg2.sourceforge.net/;
     description = "A free library for decoding mpeg-2 and mpeg-1 video streams";
diff --git a/pkgs/development/libraries/nss/default.nix b/pkgs/development/libraries/nss/default.nix
index ecdcc57a106..473405c5951 100644
--- a/pkgs/development/libraries/nss/default.nix
+++ b/pkgs/development/libraries/nss/default.nix
@@ -10,11 +10,11 @@ let
 in
 
 stdenv.mkDerivation {
-  name = "nss-3.12.4";
+  name = "nss-3.12.5";
   
   src = fetchurl {
-    url = http://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_12_4_RTM/src/nss-3.12.4.tar.gz;
-    sha1 = "a152bf980f3a3dcf575c2d149fb279058ef2e757";
+    url = http://ftp.mozilla.org/pub/mozilla.org/security/nss/releases/NSS_3_12_5_RTM/src/nss-3.12.5.tar.gz;
+    sha1 = "ec12c6eddba5fb4609a174b079095b374935d37c";
   };
 
   buildInputs = [nspr perl zlib];
diff --git a/pkgs/development/libraries/openct/default.nix b/pkgs/development/libraries/openct/default.nix
new file mode 100644
index 00000000000..a0f7f88e8dc
--- /dev/null
+++ b/pkgs/development/libraries/openct/default.nix
@@ -0,0 +1,21 @@
+{stdenv, fetchurl, libtool, pcsclite, libusb, pkgconfig}:
+
+stdenv.mkDerivation rec {
+  name = "openct-0.6.19";
+  
+  src = fetchurl {
+    url = "http://www.opensc-project.org/files/openct/${name}.tar.gz";
+    sha256 = "1y4jlr877g3lziq7i3p6pdkscqpkn1lld874q6r2hsvc39n7c88z";
+  };
+  
+  configureFlags = [ "--enable-usb" "--enable-pcsc" "--localstatedir=/var" ];
+  buildInputs = [ libtool pcsclite libusb pkgconfig ];
+
+  meta = {
+    homepage = http://www.opensc-project.org/openct/;
+    license = "LGPL";
+    description = "Drivers for several smart card readers";
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/development/libraries/opensc-dnie/default.nix b/pkgs/development/libraries/opensc-dnie/default.nix
new file mode 100644
index 00000000000..d36a3b157cc
--- /dev/null
+++ b/pkgs/development/libraries/opensc-dnie/default.nix
@@ -0,0 +1,49 @@
+{stdenv, fetchurl, writeScript, patchelf, glib, opensc, openssl, openct, libtool, pcsclite,
+zlib}:
+
+# Version 1.4.6-2 works only with opensc 0.11.7
+assert opensc.name == "opensc-0.11.7";
+
+stdenv.mkDerivation rec {
+  name = "opensc-dnie-1.4.6-2";
+  
+  src = if (stdenv.system == "i686-linux") then (fetchurl {
+      url = http://www.dnielectronico.es/descargas/PKCS11_para_Sistemas_Unix/1.4.6.Ubuntu_Jaunty_32/Ubuntu_Jaunty_opensc-dnie_1.4.6-2_i386.deb.tar;
+      sha256 = "1i6r9ahjr0rkcxjfzkg2rrib1rjsjd5raxswvvfiya98q8rlv39i";
+    })
+    else if (stdenv.system == "x86_64-linux") then (fetchurl { url = http://www.dnielectronico.es/descargas/PKCS11_para_Sistemas_Unix/1.4.6.Ubuntu_Jaunty_64/Ubuntu_Jaunty_opensc-dnie_1.4.6-2_amd64.deb.tar;
+      sha256 = "1py2bxavdcj0crhk1lwqzjgya5lvyhdfdbr4g04iysj56amxb7f9";
+    })
+    else throw "Architecture not supported";
+
+  buildInputs = [ patchelf glib ];
+
+  builder = writeScript (name + "-builder.sh") ''
+    source $stdenv/setup
+    tar xf $src
+    ar x opensc-dnie*
+    tar xf data.tar.gz
+
+    RPATH=${glib}/lib:${opensc}/lib:${openssl}/lib:${openct}/lib:${libtool}/lib:${pcsclite}/lib:${stdenv.gcc.libc}/lib:${zlib}/lib
+
+    for a in usr/lib/*.so*; do
+        if ! test -L $a; then
+            patchelf --set-rpath $RPATH $a
+        fi
+    done
+
+    sed -i s,/usr,$out, usr/lib/pkgconfig/*
+   
+    ensureDir $out
+    cp -R usr/lib $out
+    cp -R usr/share $out
+  '';
+
+  meta = {
+    homepage = http://www.dnielectronico.es/descargas/;
+    description = "Opensc plugin to access the Spanish national ID smartcard";
+    license = "nonfree";
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/development/libraries/pango/1.26.x.nix b/pkgs/development/libraries/pango/1.26.x.nix
index 7efca117cba..423f4c8c702 100644
--- a/pkgs/development/libraries/pango/1.26.x.nix
+++ b/pkgs/development/libraries/pango/1.26.x.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, pkgconfig, gettext, x11, glib, cairo, libpng }:
 
 stdenv.mkDerivation rec {
-  name = "pango-1.26.0";
+  name = "pango-1.26.2";
 
   src = fetchurl {
     url = "mirror://gnome/sources/pango/1.26/${name}.tar.bz2";
-    sha256 = "1hx6v6w3xk9wfcrb26gg7rrfl6m6ykxk2bqm67aqdzql4vysxgz1";
+    sha256 = "021ygk3l9bk00gsvxk02flxsk68w0wl99dx221fmb547bng8g19v";
   };
 
   buildInputs = [pkgconfig] ++ stdenv.lib.optional (stdenv.system == "i686-darwin") gettext;
diff --git a/pkgs/development/libraries/podofo/default.nix b/pkgs/development/libraries/podofo/default.nix
new file mode 100644
index 00000000000..270d4da23de
--- /dev/null
+++ b/pkgs/development/libraries/podofo/default.nix
@@ -0,0 +1,12 @@
+{stdenv, fetchurl, cmake, zlib, freetype, libjpeg, libtiff, fontconfig,
+openssl}:
+
+stdenv.mkDerivation rec {
+  name = "podofo-0.7.0";
+  src = fetchurl {
+    url = "mirror://sourceforge/podofo/${name}.tar.gz";
+    sha256 = "1hpd5ldjv013041rmcfrkbk8v6wdpxcg60i3aklik583q2rf0mqy";
+  };
+  buildInputs = [ cmake zlib freetype libjpeg libtiff fontconfig openssl ];
+  cmakeFlags = "-DPODOFO_BUILD_SHARED=ON -DPODOFO_BUILD_STATIC=OFF";
+}
diff --git a/pkgs/development/libraries/poppler/default.nix b/pkgs/development/libraries/poppler/default.nix
index ec761b3c44f..7c9223a91fd 100644
--- a/pkgs/development/libraries/poppler/default.nix
+++ b/pkgs/development/libraries/poppler/default.nix
@@ -5,11 +5,11 @@
 assert qt4Support -> (qt4 != null);
 
 stdenv.mkDerivation rec {
-  name = "poppler-0.10.6";
+  name = "poppler-0.12.3";
 
   src = fetchurl {
     url = "http://poppler.freedesktop.org/${name}.tar.gz";
-    sha256 = "bcd78d674c4166af069afdb27af810c012e13cfd2b7b21f9dce63dd3f62bded1";
+    sha256 = "1k7vilpz0ipnmw9dfpb3rqkhlm4rqcnkn3bhhp14di2h55nzwkvs";
   };
 
   buildInputs = [pkgconfig zlib glib cairo freetype fontconfig libjpeg gtk]
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
     ''
     + (if qt4Support then "--enable-qt-poppler" else "--disable-qt-poppler");
 
-  patches = [ ./GDir-const.patch ./use_exceptions.patch ];
+  patches = [ ./GDir-const.patch ];
 
   preConfigure = "sed -e '/jpeg_incdirs/s@/usr@${libjpeg}@' -i configure";
 
diff --git a/pkgs/development/libraries/poppler/use_exceptions.patch b/pkgs/development/libraries/poppler/use_exceptions.patch
deleted file mode 100644
index 4880da8e2e4..00000000000
--- a/pkgs/development/libraries/poppler/use_exceptions.patch
+++ /dev/null
@@ -1,60 +0,0 @@
-diff -ur poppler-0.6.1/goo/gmem.cc poppler-0.6.1-patched/goo/gmem.cc
---- poppler-0.6.1/goo/gmem.cc	2007-10-12 13:34:49.000000000 +0200
-+++ poppler-0.6.1-patched/goo/gmem.cc	2007-11-06 16:17:41.290632269 +0100
-@@ -60,7 +60,7 @@
-   }
-   size1 = gMemDataSize(size);
-   if (!(mem = (char *)malloc(size1 + gMemHdrSize + gMemTrlSize))) {
--#if USE_EXCEPTIONS
-+#ifdef USE_EXCEPTIONS
-     throw GMemException();
- #else
-     fprintf(stderr, "Out of memory\n");
-@@ -95,7 +95,7 @@
-     return NULL;
-   }
-   if (!(p = malloc(size))) {
--#if USE_EXCEPTIONS
-+#ifdef USE_EXCEPTIONS
-     throw GMemException();
- #else
-     fprintf(stderr, "Out of memory\n");
-@@ -143,7 +143,7 @@
-     q = malloc(size);
-   }
-   if (!q) {
--#if USE_EXCEPTIONS
-+#ifdef USE_EXCEPTIONS
-     throw GMemException();
- #else
-     fprintf(stderr, "Out of memory\n");
-@@ -162,7 +162,7 @@
-   }
-   n = nObjs * objSize;
-   if (objSize <= 0 || nObjs < 0 || nObjs >= INT_MAX / objSize) {
--#if USE_EXCEPTIONS
-+#ifdef USE_EXCEPTIONS
-     throw GMemException();
- #else
-     fprintf(stderr, "Bogus memory allocation size\n");
-@@ -183,7 +183,7 @@
-   }
-   n = nObjs * objSize;
-   if (objSize <= 0 || nObjs < 0 || nObjs >= INT_MAX / objSize) {
--#if USE_EXCEPTIONS
-+#ifdef USE_EXCEPTIONS
-     throw GMemException();
- #else
-     fprintf(stderr, "Bogus memory allocation size\n");
-diff -ur poppler-0.6.1/goo/gmem.h poppler-0.6.1-patched/goo/gmem.h
---- poppler-0.6.1/goo/gmem.h	2007-09-17 20:37:39.000000000 +0200
-+++ poppler-0.6.1-patched/goo/gmem.h	2007-11-06 16:17:46.606925527 +0100
-@@ -12,7 +12,7 @@
- #include <stdio.h>
- #include <poppler/poppler-config.h>
- 
--#if USE_EXCEPTIONS
-+#ifdef USE_EXCEPTIONS
- 
- class GMemException {
- public:
diff --git a/pkgs/development/libraries/qt-4.6/default.nix b/pkgs/development/libraries/qt-4.6/default.nix
index d4fb0882049..284760537b4 100644
--- a/pkgs/development/libraries/qt-4.6/default.nix
+++ b/pkgs/development/libraries/qt-4.6/default.nix
@@ -13,6 +13,10 @@ stdenv.mkDerivation {
   };
   
   setupHook = ./setup-hook.sh;
+
+  preConfigure = '' 
+    export LD_LIBRARY_PATH="`pwd`/lib:$LD_LIBRARY_PATH"
+  '';
   
   propagatedBuildInputs = [
     libXft 
diff --git a/pkgs/development/libraries/scmccid/default.nix b/pkgs/development/libraries/scmccid/default.nix
new file mode 100644
index 00000000000..32c4fe3de89
--- /dev/null
+++ b/pkgs/development/libraries/scmccid/default.nix
@@ -0,0 +1,38 @@
+{stdenv, fetchurl, patchelf, libusb}:
+
+stdenv.mkDerivation rec {
+  name = "scmccid-5.0.11";
+  
+  src = if (stdenv.system == "i686-linux") then (fetchurl {
+      url = "http://www.scmmicro.com/support/download/scmccid_5.0.11_linux.tar.gz";
+      sha256 = "1r5wkarhzl09ncgj55baizf573czw0nplh1pgddzx9xck66kh5bm";
+    })
+    else if (stdenv.system == "x86_64-linux") then (fetchurl {
+        url = "http://www.scmmicro.com/support/download/scmccid_5.0.11_linux_x64.tar.gz";
+        sha256 = "0k9lzlk01sl4ycfqgrqqy3bildz0mcr1r0kkicgjz96l4s0jgz0i";
+    })
+    else throw "Architecture not supported";
+
+  buildInputs = [ patchelf ];
+
+  installPhase = ''
+    RPATH=${libusb}/lib:${stdenv.gcc.libc}/lib
+
+    for a in proprietary/*/Contents/Linux/*.so*; do
+        if ! test -L $a; then
+            patchelf --set-rpath $RPATH $a
+        fi
+    done
+
+    ensureDir $out/pcsc/drivers
+    cp -R proprietary/* $out/pcsc/drivers
+  '';
+
+  meta = {
+    homepage = http://www.scmmicro.com/support/pc-security-support/downloads.html;
+    description = "PCSC drivers for linux, for the SCM SCR3310 v2.0 card and others";
+    license = "nonfree";
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/development/libraries/webkit/src-for-default.nix b/pkgs/development/libraries/webkit/src-for-default.nix
index 632c6fbbee2..6dd81f7d852 100644
--- a/pkgs/development/libraries/webkit/src-for-default.nix
+++ b/pkgs/development/libraries/webkit/src-for-default.nix
@@ -1,9 +1,9 @@
 rec {
-   version="r51303";
-   name="webkit-r51303";
-   hash="0khlc38gzb65xr0fsap60cz65rd6d7f7v31hhj4x1bxjrm3pj48w";
-   url="http://builds.nightly.webkit.org/files/trunk/src/WebKit-r51303.tar.bz2";
-   advertisedUrl="http://builds.nightly.webkit.org/files/trunk/src/WebKit-r51303.tar.bz2";
+   version="r53178";
+   name="webkit-r53178";
+   hash="0452kfqd73igmkgp0v4w13lk3ycypqz4zl9hnspg7ns5vlyknqcn";
+   url="http://builds.nightly.webkit.org/files/trunk/src/WebKit-r53178.tar.bz2";
+   advertisedUrl="http://builds.nightly.webkit.org/files/trunk/src/WebKit-r53178.tar.bz2";
   
   
 }
diff --git a/pkgs/development/python-modules/pyqt/default.nix b/pkgs/development/python-modules/pyqt/default.nix
index 207e727b437..f2c72f0ff27 100644
--- a/pkgs/development/python-modules/pyqt/default.nix
+++ b/pkgs/development/python-modules/pyqt/default.nix
@@ -6,7 +6,7 @@ stdenv.mkDerivation {
     url = http://pyqwt.sourceforge.net/support/PyQt-x11-gpl-4.5.4.tar.gz; # Not downloading from riverbank, since they remove older releases
     sha256 = "1a55zng6yhnbk5swc02bkbyccdgf0f0v94yxk9v5a43hv9xnrl5k";
   };
-  configurePhase = "python ./configure.py --confirm-license -b $out/bin -d $out/lib/python2.5/site-packages -v $out/share/sip -p $out/plugins";
+  configurePhase = "python ./configure.py --confirm-license -b $out/bin -d $out/lib/${python.libPrefix}/site-packages -v $out/share/sip -p $out/plugins";
   buildInputs = [ python sip qt4 ];
   meta = {
     description = "Python bindings for Qt";
diff --git a/pkgs/development/python-modules/python-sip/default.nix b/pkgs/development/python-modules/python-sip/default.nix
index 47398e2a284..bd08b7e6a24 100644
--- a/pkgs/development/python-modules/python-sip/default.nix
+++ b/pkgs/development/python-modules/python-sip/default.nix
@@ -6,7 +6,7 @@ stdenv.mkDerivation {
     url = http://pyqwt.sourceforge.net/support/sip-4.8.2.tar.gz; # Not downloading from riverbank, since they remove older releases
     sha256 = "1afr2qaibzgf8fq4fmc31jz9hvbwxbg5jvl68ygvkkdvnbg2kfrf";
   };
-  configurePhase = "python ./configure.py -d $out/lib/python2.5/site-packages -b $out/bin -e $out/include";
+  configurePhase = "python ./configure.py -d $out/lib/${python.libPrefix}/site-packages -b $out/bin -e $out/include";
   buildInputs = [ python ];
   meta = {
     description = "Creates C++ bindings for Python modules";
diff --git a/pkgs/development/python-modules/setuptools/default.nix b/pkgs/development/python-modules/setuptools/default.nix
index df6d466b138..1cdbb2e2624 100644
--- a/pkgs/development/python-modules/setuptools/default.nix
+++ b/pkgs/development/python-modules/setuptools/default.nix
@@ -29,16 +29,16 @@ rec {
   '') ["addInputs" "doUnpack"];
 
   doInstall = a.fullDepEntry(''
-    ensureDir "$out/lib/python2.5/site-packages"
+    ensureDir "$out/lib/${a.python.libPrefix}/site-packages"
 
-    PYTHONPATH="$out/lib/python2.5/site-packages:$PYTHONPATH" \
+    PYTHONPATH="$out/lib/${a.python.libPrefix}/site-packages:$PYTHONPATH" \
     python setup.py install --prefix="$out"
 
     for i in "$out/bin/"*
     do
       wrapProgram "$i"                          \
         --prefix PYTHONPATH ":"			\
-          "$out/lib/python2.5/site-packages"
+          "$out/lib/${a.python.libPrefix}/site-packages"
     done
   '') ["doBuild"];
 
diff --git a/pkgs/development/tools/build-managers/apache-ant/default.nix b/pkgs/development/tools/build-managers/apache-ant/default.nix
index 50f73a42af5..47a916f48e2 100644
--- a/pkgs/development/tools/build-managers/apache-ant/default.nix
+++ b/pkgs/development/tools/build-managers/apache-ant/default.nix
@@ -11,8 +11,8 @@ let {
       inherit antContrib jdk;
 
       src = fetchurl {
-        url = http://apache.mirror.transip.nl/ant/binaries/apache-ant-1.7.1-bin.tar.bz2 ;
-        sha256 = "15rgkini0g100jygp7z9hgc3yfb9m62q4nk989rin7dqj2flrr94";
+        url = http://apache.mirror.transip.nl/ant/binaries/apache-ant-1.8.0RC1-bin.tar.bz2 ;
+        sha256 = "0xvmrsghibq7p3wvfkmvmkkg0zzfmw32lrfjl5f6cfzchjjnw9wx";
       };
     };
 
diff --git a/pkgs/development/tools/build-managers/buildbot/default.nix b/pkgs/development/tools/build-managers/buildbot/default.nix
index a8c78b51540..92b63869f33 100644
--- a/pkgs/development/tools/build-managers/buildbot/default.nix
+++ b/pkgs/development/tools/build-managers/buildbot/default.nix
@@ -1,21 +1,68 @@
-{stdenv, fetchurl, python, twisted, makeWrapper}:
+{ fetchurl, stdenv, buildPythonPackage, twisted, texinfo }:
+
+buildPythonPackage (rec {
+  name = "buildbot-0.7.11p3";
+  namePrefix = "";
 
-stdenv.mkDerivation rec {
-  name = "buildbot-${version}";
-  version = "0.7.8";
-  meta = {
-    homepage = "http://buildbot.net/";
-    description = "A system to automate the compile/test cycle to validate code changes.";
-  };
   src = fetchurl {
-    url = "mirror://sourceforge/buildbot/buildbot-${version}.tar.gz";
-    sha256 = "0f3qkbs1y4a1djxbfkvsr1639qkc7bzzsz2wpas2mk1zg8zrci2v";
+    url = "mirror://sourceforge/buildbot/${name}.tar.gz";
+    sha256 = "0h77ijf5iqvc8bnfxpsh3hvpr7wj23pkcywd3hcyphv1wwlhmhjv";
+  };
+
+  patchPhase =
+    # The code insists on /usr/bin/tail, /usr/bin/make, etc.
+    '' echo "patching erroneous absolute path references..."
+       for i in $(find -name \*.py)
+       do
+         sed -i "$i" \
+             -e "s|/usr/bin/python|$(type -P python)|g ; s|/usr/bin/||g"
+       done
+    '';
+
+  buildInputs = [ texinfo ];
+  propagatedBuildInputs = [ twisted ];
+
+  # FIXME: Some tests fail.
+  doCheck = false;
+
+  postInstall =
+    '' ensureDir "$out/share/info"
+       make -C docs buildbot.info
+       cp -v "docs/buildbot.info"* "$out/share/info"
+    '';
+
+  meta = {
+    homepage = http://buildbot.net/;
+
+    license = "GPLv2+";
+
+    # Of course, we don't really need that on NixOS.  :-)
+    description = "BuildBot, a system to automate the software compile/test cycle";
+
+    longDescription =
+      '' The BuildBot is a system to automate the compile/test cycle
+         required by most software projects to validate code changes.  By
+         automatically rebuilding and testing the tree each time something
+         has changed, build problems are pinpointed quickly, before other
+         developers are inconvenienced by the failure.  The guilty
+         developer can be identified and harassed without human
+         intervention.  By running the builds on a variety of platforms,
+         developers who do not have the facilities to test their changes
+         everywhere before checkin will at least know shortly afterwards
+         whether they have broken the build or not.  Warning counts, lint
+         checks, image size, compile time, and other build parameters can
+         be tracked over time, are more visible, and are therefore easier
+         to improve.
+
+         The overall goal is to reduce tree breakage and provide a platform
+         to run tests or code-quality checks that are too annoying or
+         pedantic for any human to waste their time with.  Developers get
+         immediate (and potentially public) feedback about their changes,
+         encouraging them to be more careful about testing before checking
+         in code.
+      '';
+
+    maintainers = [ stdenv.lib.maintainers.ludo ];
+    platforms = stdenv.lib.platforms.all;
   };
-  propagatedBuildInputs = [python twisted makeWrapper];
-  buildPhase = "true";
-  installPhase =
-  ''
-     python setup.py install --prefix=$out --install-lib=$(toPythonPath $out) -O1
-     for n in $out/bin/*; do wrapProgram $n --set PYTHONPATH "$(toPythonPath $out):$PYTHONPATH"; done
-  '';
-}
+})
diff --git a/pkgs/development/tools/misc/coccinelle/default.nix b/pkgs/development/tools/misc/coccinelle/default.nix
index 811a289baed..02de182ff76 100644
--- a/pkgs/development/tools/misc/coccinelle/default.nix
+++ b/pkgs/development/tools/misc/coccinelle/default.nix
@@ -1,11 +1,11 @@
 { fetchurl, stdenv, ocaml, perl, python, ncurses, makeWrapper }:
 
 stdenv.mkDerivation rec {
-  name = "coccinelle-0.1.11rc1";
+  name = "coccinelle-0.2.0";
 
   src = fetchurl {
     url = "http://coccinelle.lip6.fr/distrib/${name}.tgz";
-    sha256 = "1rdsv3qcl6zcx3d3zd4cl9d79hdgaw19llxbflkfxipvkg3vk59x";
+    sha256 = "1mg6r92h8j3kqgy9iv6kk0g96m84wcj71iavgvv9qdbk3qwim8i4";
   };
 
   buildInputs = [ ocaml perl python ncurses makeWrapper ];
@@ -18,14 +18,16 @@ stdenv.mkDerivation rec {
 
   buildPhase = "make depend && make all";
 
-  # Most of the test suite seems to fail (?!).
+  # Note: The tests want $out/share/coccinelle/standard.h so they must be run
+  # after "make install".
   doCheck = false;
-  checkPhase = "make test";
 
   postInstall =
     '' wrapProgram "$out/bin/spatch"                                    \
          --prefix "LD_LIBRARY_PATH" ":" "$out/lib"                      \
          --prefix "PYTHONPATH" ":" "$out/share/coccinelle/python"
+
+       make test
     '';
 
   meta = {
diff --git a/pkgs/games/quake3/wrapper/builder.sh b/pkgs/games/quake3/wrapper/builder.sh
index e4c91a39b8f..f070973681e 100644
--- a/pkgs/games/quake3/wrapper/builder.sh
+++ b/pkgs/games/quake3/wrapper/builder.sh
@@ -10,6 +10,6 @@ done
 # We add Mesa to the end of $LD_LIBRARY_PATH to provide fallback
 # software rendering.  GCC is needed so that libgcc_s.so can be found
 # when Mesa is used.
-makeWrapper $game/ioquake3.i386 $out/bin/quake3 \
+makeWrapper $game/ioquake3.* $out/bin/quake3 \
     --suffix-each LD_LIBRARY_PATH ':' "$mesa/lib $gcc/lib" \
     --add-flags "+set fs_basepath $out +set r_allowSoftwareGL 1"
diff --git a/pkgs/lib/lists.nix b/pkgs/lib/lists.nix
index 4359662da27..6141ad413d3 100644
--- a/pkgs/lib/lists.nix
+++ b/pkgs/lib/lists.nix
@@ -167,4 +167,9 @@ rec {
     if list == [] || count == 0 then []
     else [ (head list) ] ++ take (builtins.sub count 1) (tail list);
 
+  last = list:
+    assert list != [];
+    let loop = l: if tail l == [] then head l else loop (tail l); in
+    loop list;
+
 }
diff --git a/pkgs/lib/maintainers.nix b/pkgs/lib/maintainers.nix
index 9127c8c7308..4b53ad0bb61 100644
--- a/pkgs/lib/maintainers.nix
+++ b/pkgs/lib/maintainers.nix
@@ -5,6 +5,7 @@
      alphabetically sorted.  */
 
   andres = "Andres Loeh <andres@cs.uu.nl>";
+  astsmtl = "Alexander Tsamutali <astsmtl@yandex.ru>";
   eelco = "Eelco Dolstra <e.dolstra@tudelft.nl>";
   ludo = "Ludovic Courtès <ludo@gnu.org>";
   marcweber = "Marc Weber <marco-oweber@gmx.de>";
diff --git a/pkgs/lib/modules.nix b/pkgs/lib/modules.nix
index 4500d588a02..3808893c14f 100644
--- a/pkgs/lib/modules.nix
+++ b/pkgs/lib/modules.nix
@@ -51,7 +51,7 @@ rec {
       getImportedSets = m: filter (x: !isPath x) (getImports m);
 
       getConfig = m:
-        removeAttrs (delayProperties m) ["require"];
+        removeAttrs (delayProperties m) ["require" "key"];
     in
       if isModule m then
         { key = "<unknown location>"; } // m
@@ -81,18 +81,19 @@ rec {
   moduleClosure = initModules: args:
     let
       moduleImport = m:
-        (unifyModuleSyntax (applyIfFunction (importIfPath m) args)) // {
+        let m' = applyIfFunction (importIfPath m) args;
+        in (unifyModuleSyntax m') // {
           # used by generic closure to avoid duplicated imports.
-          key = if isPath m then m else "<unknown location>";
+          key = if isPath m then m else if m' ? key then m'.key else "<unknown location>";
         };
 
       getImports = m: attrByPath ["imports"] [] m;
 
     in
       (lazyGenericClosure {
-        startSet = map moduleImport (filter isPath initModules);
+        startSet = map moduleImport initModules;
         operator = m: map moduleImport (getImports m);
-      }) ++ (map moduleImport (filter (m: ! isPath m) initModules));
+      });
 
   selectDeclsAndDefs = modules:
     lib.concatMap (m:
diff --git a/pkgs/lib/strings.nix b/pkgs/lib/strings.nix
index e82fa0ebae0..83899079327 100644
--- a/pkgs/lib/strings.nix
+++ b/pkgs/lib/strings.nix
@@ -141,4 +141,6 @@ rec {
       else
         s;
 
+  basename = s: lib.last (splitString "/" s);
+
 }
diff --git a/pkgs/misc/emulators/wine/default.nix b/pkgs/misc/emulators/wine/default.nix
index f754951b4d4..3e773b35634 100644
--- a/pkgs/misc/emulators/wine/default.nix
+++ b/pkgs/misc/emulators/wine/default.nix
@@ -45,5 +45,7 @@ stdenv.mkDerivation rec {
     homepage = "http://www.winehq.org/";
     license = "LGPL";
     description = "An Open Source implementation of the Windows API on top of X, OpenGL, and Unix";
+    maintainers = [ stdenv.lib.maintainers.raskin ];
+    platforms = [ "i686-linux" ];
   };
 }
diff --git a/pkgs/misc/emulators/wine/src-for-default.nix b/pkgs/misc/emulators/wine/src-for-default.nix
index b24dc35166f..48ecc4f27e3 100644
--- a/pkgs/misc/emulators/wine/src-for-default.nix
+++ b/pkgs/misc/emulators/wine/src-for-default.nix
@@ -1,9 +1,9 @@
 rec {
-   version="1.1.34";
-   name="wine-1.1.34";
-   hash="1llsm6h0s765n0s5nvr852iyml2ckdd7vq96dhqjlck5vr4nxsns";
+   version="1.1.36";
+   name="wine-1.1.36";
+   hash="0b22w68w7z4in21xy286yddix6sf4jna919z2lw2p9hxsgzvhlwk";
    url="http://prdownloads.sourceforge.net/wine/wine-${version}.tar.bz2";
-   advertisedUrl="http://prdownloads.sourceforge.net/wine/wine-1.1.34.tar.bz2";
+   advertisedUrl="http://prdownloads.sourceforge.net/wine/wine-1.1.36.tar.bz2";
   
   
 }
diff --git a/pkgs/os-specific/linux/cryptsetup/default.nix b/pkgs/os-specific/linux/cryptsetup/default.nix
index df42a7ee40a..765a49c6446 100644
--- a/pkgs/os-specific/linux/cryptsetup/default.nix
+++ b/pkgs/os-specific/linux/cryptsetup/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation {
   configureFlags = [ "--enable-libdevmapper" ];
 
   patchPhase = ''
-    sed -i -e 's@/sbin/udevsettle@${udev}/sbin/udevsettle@' lib/libdevmapper.c
+    sed -i -e 's@/sbin/udevsettle@${udev}/sbin/udevadm settle@' lib/libdevmapper.c
   '';
 
   buildInputs = [ libuuid popt devicemapper ];
diff --git a/pkgs/os-specific/linux/device-mapper/default.nix b/pkgs/os-specific/linux/device-mapper/default.nix
deleted file mode 100644
index d17cebe3fd5..00000000000
--- a/pkgs/os-specific/linux/device-mapper/default.nix
+++ /dev/null
@@ -1,17 +0,0 @@
-{stdenv, fetchurl, enableStatic ? true}:
-
-stdenv.mkDerivation {
-  name = "device-mapper-1.02.27";
-  
-  src = fetchurl {
-    url = ftp://sources.redhat.com/pub/dm/device-mapper.1.02.27.tgz;
-    sha256 = "1z4dldjjxfinwvg39x4m2cm5rcsbxs833g3phm34f5a2lwh7i6v6";
-  };
-
-  inherit enableStatic;
-  
-  configureFlags = if enableStatic then "--enable-static_link" else "";
-
-  # To prevent make install from failing.
-  installFlags = "OWNER= GROUP=";
-}
diff --git a/pkgs/os-specific/linux/kernel/config-blocks.nix b/pkgs/os-specific/linux/kernel/config-blocks.nix
new file mode 100644
index 00000000000..ff018929364
--- /dev/null
+++ b/pkgs/os-specific/linux/kernel/config-blocks.nix
@@ -0,0 +1,257 @@
+rec {
+      generalOptions = ''
+        # Don't include any debug features.
+        DEBUG_KERNEL n
+
+        # Support drivers that need external firmware.
+        STANDALONE n
+
+        # Make /proc/config.gz available.
+        IKCONFIG_PROC y
+
+        # Optimize with -O2, not -Os.
+        CC_OPTIMIZE_FOR_SIZE n
+
+        # Enable the kernel's built-in memory tester.
+        MEMTEST y
+
+        KALLSYMS_EXTRA_PASS n
+      '';
+      
+      virtualisation = ''
+        # Virtualisation (KVM, Xen...).
+        PARAVIRT_GUEST y
+        KVM_CLOCK y
+        KVM_GUEST y
+        XEN y
+        KSM y
+
+        # We need 64 GB (PAE) support for Xen guest support.
+        HIGHMEM64G? y
+      '';
+
+      noPAE = ''
+        HIGHMEM64G? n
+        PAE n
+      '';
+
+      usefulSubsystems = ''
+        # Enable various subsystems.
+        ACCESSIBILITY y # Accessibility support
+        AUXDISPLAY y # Auxiliary Display support
+        DONGLE y # Serial dongle support
+        HIPPI y
+        MTD_COMPLEX_MAPPINGS y # needed for many devices
+        NET_POCKET y # enable pocket and portable adapters
+        SCSI_LOWLEVEL y # enable lots of SCSI devices
+        SCSI_LOWLEVEL_PCMCIA y
+        SPI y # needed for many devices
+        SPI_MASTER y
+        WAN y
+      '';
+
+      cfq = ''
+        # Include the CFQ I/O scheduler in the kernel, rather than as a
+        # module, so that the initrd gets a good I/O scheduler.
+        IOSCHED_CFQ y
+      '';
+
+      noDebug = ''
+        # Disable some expensive (?) features.
+        FTRACE n
+        KPROBES n
+        PM_TRACE_RTC n
+
+        AIC79XX_DEBUG_ENABLE n
+        AIC7XXX_DEBUG_ENABLE n
+        AIC94XX_DEBUG n
+        USB_DEBUG n
+        CPU_FREQ_DEBUG n
+      '';
+
+      noNUMA = ''
+        NUMA? n
+      '';
+
+      networking = ''
+        # Networking options.
+        IP_PNP n
+        IPV6_PRIVACY y
+        NETFILTER_ADVANCED y
+        IP_VS_PROTO_TCP y
+        IP_VS_PROTO_UDP y
+        IP_VS_PROTO_ESP y
+        IP_VS_PROTO_AH y
+        IP_DCCP_CCID3 n # experimental
+        CLS_U32_PERF y
+        CLS_U32_MARK y
+      '';
+
+      wireless = ''
+        # Wireless networking.
+        IPW2100_MONITOR y # support promiscuous mode
+        IPW2200_MONITOR y # support promiscuous mode
+        IWLWIFI_LEDS? y
+        IWLWIFI_SPECTRUM_MEASUREMENT y
+        IWL3945_SPECTRUM_MEASUREMENT y
+        IWL4965 y # Intel Wireless WiFi 4965AGN
+        IWL5000 y # Intel Wireless WiFi 5000AGN
+        HOSTAP_FIRMWARE y # Support downloading firmware images with Host AP driver
+        HOSTAP_FIRMWARE_NVRAM y
+      '';
+
+      fb = ''
+        # Enable various FB devices.
+        FB y
+        FB_EFI y
+        FB_NVIDIA_I2C y # Enable DDC Support
+        FB_RIVA_I2C y
+        FB_ATY_CT y # Mach64 CT/VT/GT/LT (incl. 3D RAGE) support
+        FB_ATY_GX y # Mach64 GX support
+        FB_SAVAGE_I2C y
+        FB_SAVAGE_ACCEL y
+        FB_SIS_300 y
+        FB_SIS_315 y
+        FB_3DFX_ACCEL y
+        FB_GEODE y
+      '';
+
+      fbNoTileBlit = ''
+        # Disable tileblitting
+        FB_TILEBLITTING n
+        FB_S3 n
+        FB_VT8623 n
+        FB_ARK n
+      '';
+
+      fbConDecor = ''
+        ${fb}
+        ${fbNoTileBlit}
+        FRAMEBUFFER_CONSOLE y
+        FB_VESA y
+        FB_CON_DECOR y
+      '';
+
+      sound = ''
+        # Sound.
+        SND_AC97_POWER_SAVE y # AC97 Power-Saving Mode
+        SND_HDA_INPUT_BEEP y # Support digital beep via input layer
+        SND_USB_CAIAQ_INPUT y
+        PSS_MIXER y # Enable PSS mixer (Beethoven ADSP-16 and other compatible)
+      '';
+
+      usbserial = ''
+        # USB serial devices.
+        USB_SERIAL_GENERIC y # USB Generic Serial Driver
+        USB_SERIAL_KEYSPAN_MPR y # include firmware for various USB serial devices
+        USB_SERIAL_KEYSPAN_USA28 y
+        USB_SERIAL_KEYSPAN_USA28X y
+        USB_SERIAL_KEYSPAN_USA28XA y
+        USB_SERIAL_KEYSPAN_USA28XB y
+        USB_SERIAL_KEYSPAN_USA19 y
+        USB_SERIAL_KEYSPAN_USA18X y
+        USB_SERIAL_KEYSPAN_USA19W y
+        USB_SERIAL_KEYSPAN_USA19QW y
+        USB_SERIAL_KEYSPAN_USA19QI y
+        USB_SERIAL_KEYSPAN_USA49W y
+        USB_SERIAL_KEYSPAN_USA49WLC y
+      '';
+
+      fsXattr = ''
+        # Filesystem options - in particular, enable extended attributes and
+        # ACLs for all filesystems that support them.
+        EXT2_FS_XATTR y # Ext2 extended attributes
+        EXT2_FS_POSIX_ACL y # Ext2 POSIX Access Control Lists
+        EXT2_FS_SECURITY y # Ext2 Security Labels
+        EXT2_FS_XIP y # Ext2 execute in place support
+        EXT4_FS_POSIX_ACL y
+        EXT4_FS_SECURITY y
+        REISERFS_FS_XATTR y
+        REISERFS_FS_POSIX_ACL y
+        REISERFS_FS_SECURITY y
+        JFS_POSIX_ACL y
+        JFS_SECURITY y
+        XFS_QUOTA y
+        XFS_POSIX_ACL y
+        XFS_RT y # XFS Realtime subvolume support
+        OCFS2_DEBUG_MASKLOG n
+        OCFS2_FS_POSIX_ACL y
+        BTRFS_FS_POSIX_ACL y
+        UBIFS_FS_XATTR y
+        UBIFS_FS_ADVANCED_COMPR y
+        NFSD_V2_ACL y
+        NFSD_V3 y
+        NFSD_V3_ACL y
+        NFSD_V4 y
+        CIFS_XATTR y
+        CIFS_POSIX y
+      '';
+
+      security = ''
+        # Security related features.
+        STRICT_DEVMEM y # Filter access to /dev/mem
+        SECURITY_SELINUX_BOOTPARAM_VALUE 0 # disable SELinux by default
+      '';
+
+      blockDevices = ''
+        BLK_DEV_BSG n
+        BLK_DEV_CMD640_ENHANCED y # CMD640 enhanced support
+        BLK_DEV_IDEACPI y # IDE ACPI support
+        BLK_DEV_INTEGRITY y
+      '';
+
+      bluetooth = ''
+        BT_HCIUART_BCSP y
+        BT_HCIUART_H4 y # UART (H4) protocol support
+        BT_HCIUART_LL y
+        BT_RFCOMM_TTY y # RFCOMM TTY support
+      '';
+
+      misc = ''
+        # Misc. options.
+        8139TOO_8129 y
+        8139TOO_PIO n # PIO is slower
+        B43_PCMCIA y
+        BSD_PROCESS_ACCT_V3 y
+        CRASH_DUMP n
+        DMAR? n # experimental
+        DVB_DYNAMIC_MINORS y # we use udev
+        FUSION y # Fusion MPT device support
+        IDE_GD_ATAPI y # ATAPI floppy support
+        IRDA_ULTRA y # Ultra (connectionless) protocol
+        JOYSTICK_IFORCE_232 y # I-Force Serial joysticks and wheels
+        JOYSTICK_IFORCE_USB y # I-Force USB joysticks and wheels
+        JOYSTICK_XPAD_FF y # X-Box gamepad rumble support
+        JOYSTICK_XPAD_LEDS y # LED Support for Xbox360 controller 'BigX' LED
+        LDM_PARTITION y # Windows Logical Disk Manager (Dynamic Disk) support
+        LEDS_TRIGGER_IDE_DISK y # LED IDE Disk Trigger
+        LOGIRUMBLEPAD2_FF y # Logitech Rumblepad 2 force feedback
+        LOGO n # not needed
+        MEDIA_ATTACH y
+        MEGARAID_NEWGEN y
+        MICROCODE_AMD y
+        MODVERSIONS y
+        MOUSE_PS2_ELANTECH y # Elantech PS/2 protocol extension
+        MTRR_SANITIZER y
+        NET_FC y # Fibre Channel driver support
+        PCI_LEGACY y
+        PPP_MULTILINK y # PPP multilink support
+        REGULATOR y # Voltage and Current Regulator Support
+        SCSI_LOGGING y # SCSI logging facility
+        SERIAL_8250 y # 8250/16550 and compatible serial support
+        SLIP_COMPRESSED y # CSLIP compressed headers
+        SLIP_SMART y
+        THERMAL_HWMON y # Hardware monitoring support
+        USB_EHCI_ROOT_HUB_TT y # Root Hub Transaction Translators
+        X86_CHECK_BIOS_CORRUPTION y
+        X86_MCE y
+      '';
+
+      bfsched = ''
+        SCHED_BFS y
+        NO_HZ n
+        HZ_1000 n
+        HZ_300 y
+        HZ 300
+      '';
+}
diff --git a/pkgs/os-specific/linux/kernel/generic.nix b/pkgs/os-specific/linux/kernel/generic.nix
index be5fda41aac..f1981d261c6 100644
--- a/pkgs/os-specific/linux/kernel/generic.nix
+++ b/pkgs/os-specific/linux/kernel/generic.nix
@@ -100,5 +100,8 @@ stdenv.mkDerivation {
         " (with patches: "
         + lib.concatStrings (lib.intersperse ", " (map (x: x.name) kernelPatches))
         + ")");
+    license = "GPLv2";
+    homepage = http://www.kernel.org/;
+    maintainers = [ lib.maintainers.eelco ];
   } // extraMeta;
 }
diff --git a/pkgs/os-specific/linux/kernel/linux-2.6.27.nix b/pkgs/os-specific/linux/kernel/linux-2.6.27.nix
index 6f290aa2b00..cc058770938 100644
--- a/pkgs/os-specific/linux/kernel/linux-2.6.27.nix
+++ b/pkgs/os-specific/linux/kernel/linux-2.6.27.nix
@@ -3,11 +3,11 @@ args @ { stdenv, fetchurl, userModeLinux ? false, extraConfig ? "", ... }:
 import ./generic.nix (
 
   rec {
-    version = "2.6.27.42";
+    version = "2.6.27.43";
   
     src = fetchurl {
       url = "mirror://kernel/linux/kernel/v2.6/linux-${version}.tar.bz2";
-      sha256 = "0nsjhikswqrag44wablsr02kl03p8jwd0j50brg6gpjwb3485zaz";
+      sha256 = "0y2fpc6maazzg75ixrzc7h0v0k48jaflbjjcsh6c69f0mq3l8zay";
     };
 
     features.iwlwifi = true;
diff --git a/pkgs/os-specific/linux/kernel/linux-2.6.32.nix b/pkgs/os-specific/linux/kernel/linux-2.6.32.nix
index 92526af371d..d4f3ea88f9d 100644
--- a/pkgs/os-specific/linux/kernel/linux-2.6.32.nix
+++ b/pkgs/os-specific/linux/kernel/linux-2.6.32.nix
@@ -4,11 +4,11 @@ args @ { stdenv, fetchurl, platform, userModeLinux ? false, extraConfig ? ""
 import ./generic.nix (
 
   rec {
-    version = "2.6.32.2";
+    version = "2.6.32.3";
   
     src = fetchurl {
       url = "mirror://kernel/linux/kernel/v2.6/linux-${version}.tar.bz2";
-      sha256 = "16fyfcj6cgd5b1n0qnf2lgx5v806xycr3w1nhyys1qc0ffy2iccj";
+      sha256 = "09zg9xk67vjpfrrb3m4rzql4nd7bz64i9sng5sbdpfgs7d4pi1cp";
     };
 
     features.iwlwifi = true;
@@ -203,5 +203,5 @@ import ./generic.nix (
       '';
   }
 
-  // args
+  // removeAttrs args ["extraConfig"]
 )
diff --git a/pkgs/os-specific/linux/kernel/patches.nix b/pkgs/os-specific/linux/kernel/patches.nix
index f76169af833..b0c4c210070 100644
--- a/pkgs/os-specific/linux/kernel/patches.nix
+++ b/pkgs/os-specific/linux/kernel/patches.nix
@@ -89,4 +89,19 @@ in
       };
     };
 
+  gcov_2_6_28 = 
+    { name = "gcov";
+      patch = fetchurl {
+        url = http://buildfarm.st.ewi.tudelft.nl/~eelco/dist/linux-2.6.28-gcov.patch;
+        sha256 = "0ck9misa3pgh3vzyb7714ibf7ix7piyg5dvfa9r42v15scjqiyny";
+      };
+      extraConfig =
+        ''
+          GCOV_PROFILE y
+          GCOV_ALL y
+          GCOV_PROC m
+          GCOV_HAMMER n
+        '';
+    };
+
 }
diff --git a/pkgs/os-specific/linux/lvm2/default.nix b/pkgs/os-specific/linux/lvm2/default.nix
index d33de1bd50e..26c2e3c392a 100644
--- a/pkgs/os-specific/linux/lvm2/default.nix
+++ b/pkgs/os-specific/linux/lvm2/default.nix
@@ -1,21 +1,20 @@
-{stdenv, fetchurl, devicemapper, enableStatic ? true}:
-
-assert enableStatic -> devicemapper.enableStatic;
+{ stdenv, fetchurl }:
 
 stdenv.mkDerivation {
-  name = "lvm2-2.02.39";
+  name = "lvm2-2.02.56";
   
   src = fetchurl {
-    url = ftp://sources.redhat.com/pub/lvm2/LVM2.2.02.39.tgz;
-    sha256 = "18nfy7lj9fjjqjjd9dmb4v8away7cpi51ss1k8gd0yrh77dbsyyh";
+    url = ftp://sources.redhat.com/pub/lvm2/LVM2.2.02.56.tgz;
+    sha256 = "0hrgca93jnc3k05cgc3rc5klvc03anxmqydgljv6qq59nhnfz5lw";
   };
   
-  buildInputs = [devicemapper];
-
-  inherit enableStatic;
-  
-  configureFlags = "--disable-readline ${if enableStatic then "--enable-static_link" else ""}";
+  configureFlags = "--disable-readline --enable-udev_rules --enable-udev_sync";
   
   # To prevent make install from failing.
   preInstall = "installFlags=\"OWNER= GROUP= confdir=$out/etc\"";
+
+  meta = {
+    homepage = http://sourceware.org/lvm2/;
+    descriptions = "Tools to support Logical Volume Management (LVM) on Linux";
+  };
 }
diff --git a/pkgs/os-specific/linux/pam_usb/default.nix b/pkgs/os-specific/linux/pam_usb/default.nix
new file mode 100644
index 00000000000..ce038419731
--- /dev/null
+++ b/pkgs/os-specific/linux/pam_usb/default.nix
@@ -0,0 +1,48 @@
+{stdenv, fetchurl, makeWrapper, useSetUID, dbus, libxml2, pam, hal, pkgconfig, pmount, python, pythonDBus}:
+
+let
+  pmountBin = useSetUID pmount "/bin/pmount";
+  pumountBin = useSetUID pmount "/bin/pumount";
+in
+
+stdenv.mkDerivation {
+  name = "pam_usb-0.4.2";
+
+  src = fetchurl {
+    url = mirror://sourceforge/pamusb/files/pam_usb/pam_usb-0.4.2/pam_usb-0.4.2.tar.gz;
+    sha256 = "736afced7482c7c5d47127285f7defe0a304a6136a0090588fa8698d385ba202";
+  };
+
+  buildInputs = [
+    makeWrapper
+    # pam_usb dependencies
+    dbus libxml2 pam hal pmount pkgconfig
+    # pam_usb's tools dependencies
+    python
+    # cElementTree is included with python 2.5 and later.
+  ];
+
+  preBuild = ''
+    makeFlagsArray=(DESTDIR=$out)
+    substituteInPlace ./src/volume.c \
+      --replace 'pmount' '${pmountBin}' \
+      --replace 'pumount' '${pumountBin}'
+  '';
+
+  # pmount is append to the PATH because pmounts binaries should have a set uid bit.
+  postInstall = ''
+    mv $out/usr/* $out/. # fix color */
+    rm -rf $out/usr
+    for prog in $out/bin/pamusb-conf $out/bin/pamusb-agent; do
+      substituteInPlace $prog --replace '/usr/bin/env python' '/bin/python'
+      wrapProgram $prog \
+        --prefix PYTHONPATH : "$(toPythonPath ${pythonDBus})"
+    done
+  '';
+
+  meta = {
+    homepage = http://pamusb.org/;
+    description = "Authentication using USB Flash Drives";
+    license = "GPLv2";
+  };
+}
diff --git a/pkgs/os-specific/linux/pmount/default.nix b/pkgs/os-specific/linux/pmount/default.nix
new file mode 100644
index 00000000000..feea32b33bb
--- /dev/null
+++ b/pkgs/os-specific/linux/pmount/default.nix
@@ -0,0 +1,42 @@
+{stdenv, fetchurl, cryptsetup, dbus, dbus_glib, hal, intltool, ntfs3g, utillinuxng
+, mediaDir ? "/media/"
+, lockDir ? "/var/lock/pmount"
+, whiteList ? "/etc/pmount.allow"
+}:
+
+# constraint mention in the configure.ac
+assert stdenv.lib.hasSuffix "/" mediaDir;
+
+stdenv.mkDerivation {
+  name = "pmount-0.9.20";
+
+  src = fetchurl {
+    url = https://alioth.debian.org/frs/download.php/3127/pmount-0.9.20.tar.gz;
+    sha256 = "0574d2e805610c179904f5c676b2b93e088906b91bcb76980daa4a8da1d23e8c";
+  };
+
+  buildInputs = [ hal intltool utillinuxng ];
+
+  configureFlags = ""
+  + " --with-media-dir=${mediaDir}"
+  + " --with-lock-dir=${lockDir}"
+  + " --with-whitelist=${whiteList}"
+  + " --with-mount-prog=${utillinuxng}/bin/mount"
+  + " --with-umount-prog=${utillinuxng}/bin/umount"
+  + " --with-cryptsetup=${cryptsetup}/sbin/cryptsetup"
+  + " --with-mount-ntfs3g=${ntfs3g}/sbin/mount.ntfs-3g"
+  + " --enable-hal";
+
+  postConfigure = ''
+    # etc/Mafile.am is hardcoded and it does not respect the --prefix option.
+    substituteInPlace ./etc/Makefile --replace DESTDIR prefix
+    # Do not change ownership & Do not add the set user ID bit
+    substituteInPlace ./src/Makefile --replace '-o root -g root -m 4755 ' '-m 755 '
+  '';
+
+  meta = {
+    homepage = http://pmount.alioth.debian.org/;
+    description = "Mount removable devices as normal user";
+    license = "GPLv2";
+  };
+}
diff --git a/pkgs/os-specific/linux/qemu-kvm/default.nix b/pkgs/os-specific/linux/qemu-kvm/default.nix
index 7fb01238994..bca1d4b3026 100644
--- a/pkgs/os-specific/linux/qemu-kvm/default.nix
+++ b/pkgs/os-specific/linux/qemu-kvm/default.nix
@@ -3,11 +3,11 @@
 assert stdenv.isLinux;
    
 stdenv.mkDerivation rec {
-  name = "qemu-kvm-0.11.1";
+  name = "qemu-kvm-0.12.1.2";
    
   src = fetchurl {
     url = "mirror://sourceforge/kvm/${name}.tar.gz";
-    sha256 = "12s5v35krd7m7s4blf75ml4lwmw19kiygg3al0shy7xvza4vbxbx";
+    sha256 = "1k5xx9rn0n311bgvl6g9c8h1bxj2nhjpjpzbngy0sf9hdjidnba7";
   };
 
   patches = [ ./unix-domain.patch ];
diff --git a/pkgs/os-specific/linux/qemu-kvm/unix-domain.patch b/pkgs/os-specific/linux/qemu-kvm/unix-domain.patch
index 270b8a0a47f..86815a06cd2 100644
--- a/pkgs/os-specific/linux/qemu-kvm/unix-domain.patch
+++ b/pkgs/os-specific/linux/qemu-kvm/unix-domain.patch
@@ -1,9 +1,9 @@
-diff -rc --exclude '*~' qemu-kvm-0.11.0-rc1-orig/slirp/socket.c qemu-kvm-0.11.0-rc1/slirp/socket.c
-*** qemu-kvm-0.11.0-rc1-orig/slirp/socket.c	2009-08-02 15:38:42.000000000 +0200
---- qemu-kvm-0.11.0-rc1/slirp/socket.c	2009-08-21 17:11:21.000000000 +0200
+diff -rc --exclude '*~' qemu-kvm-0.12.1.2-orig/slirp/socket.c qemu-kvm-0.12.1.2/slirp/socket.c
+*** qemu-kvm-0.12.1.2-orig/slirp/socket.c	2009-12-29 21:46:34.000000000 +0100
+--- qemu-kvm-0.12.1.2/slirp/socket.c	2010-01-03 20:24:11.000000000 +0100
 ***************
-*** 587,592 ****
---- 587,593 ----
+*** 588,593 ****
+--- 588,594 ----
              u_int lport, int flags)
   {
   	struct sockaddr_in addr;
@@ -12,7 +12,7 @@ diff -rc --exclude '*~' qemu-kvm-0.11.0-rc1-orig/slirp/socket.c qemu-kvm-0.11.0-
   	int s, opt = 1;
   	socklen_t addrlen = sizeof(addr);
 ***************
-*** 621,633 ****
+*** 622,634 ****
   	so->so_lport = lport; /* Kept in network format */
   	so->so_laddr.s_addr = laddr; /* Ditto */
   
@@ -20,37 +20,37 @@ diff -rc --exclude '*~' qemu-kvm-0.11.0-rc1-orig/slirp/socket.c qemu-kvm-0.11.0-
 ! 	addr.sin_addr.s_addr = haddr;
 ! 	addr.sin_port = hport;
   
-! 	if (((s = socket(AF_INET,SOCK_STREAM,0)) < 0) ||
+! 	if (((s = qemu_socket(AF_INET,SOCK_STREAM,0)) < 0) ||
   	    (setsockopt(s,SOL_SOCKET,SO_REUSEADDR,(char *)&opt,sizeof(int)) < 0) ||
 ! 	    (bind(s,(struct sockaddr *)&addr, sizeof(addr)) < 0) ||
   	    (listen(s,1) < 0)) {
   		int tmperrno = errno; /* Don't clobber the real reason we failed */
   
---- 622,643 ----
+--- 623,644 ----
   	so->so_lport = lport; /* Kept in network format */
   	so->so_laddr.s_addr = laddr; /* Ditto */
   
-!         so->so_uds = ntohs(hport) >= 0xff00;
-  
-!         if (so->so_uds) {
-!             addr_un.sun_family = AF_UNIX;
-!             sprintf(addr_un.sun_path, "./%d.socket", ntohs(hport));
-!             unlink(addr_un.sun_path);
-!         } else {
-!             addr.sin_family = AF_INET;
-!             addr.sin_addr.s_addr = haddr;
-!             addr.sin_port = hport;
-!         }
-! 
-! 	if (((s = socket(so->so_uds ? PF_UNIX : AF_INET, SOCK_STREAM, 0)) < 0) ||
+! 	so->so_uds = ntohs(hport) >= 0xff00;
+! 	
+! 	if (so->so_uds) {
+! 	    addr_un.sun_family = AF_UNIX;
+! 	    sprintf(addr_un.sun_path, "./%d.socket", ntohs(hport));
+! 	    unlink(addr_un.sun_path);
+! 	} else {
+! 	    addr.sin_family = AF_INET;
+! 	    addr.sin_addr.s_addr = haddr;
+! 	    addr.sin_port = hport;
+! 	}
+  
+!  	if (((s = qemu_socket(so->so_uds ? PF_UNIX : AF_INET, SOCK_STREAM, 0)) < 0) ||
   	    (setsockopt(s,SOL_SOCKET,SO_REUSEADDR,(char *)&opt,sizeof(int)) < 0) ||
-!             (bind(s, so->so_uds ? (struct sockaddr *) &addr_un : (struct sockaddr *) &addr,
-!                 so->so_uds ? sizeof(addr_un) : sizeof(addr)) < 0) ||
+! 	    (bind(s, so->so_uds ? (struct sockaddr *) &addr_un : (struct sockaddr *) &addr,
+! 		so->so_uds ? sizeof(addr_un) : sizeof(addr)) < 0) ||
   	    (listen(s,1) < 0)) {
   		int tmperrno = errno; /* Don't clobber the real reason we failed */
   
 ***************
-*** 643,654 ****
+*** 644,655 ****
   	}
   	setsockopt(s,SOL_SOCKET,SO_OOBINLINE,(char *)&opt,sizeof(int));
   
@@ -63,7 +63,7 @@ diff -rc --exclude '*~' qemu-kvm-0.11.0-rc1-orig/slirp/socket.c qemu-kvm-0.11.0-
   
   	so->s = s;
   	return so;
---- 653,669 ----
+--- 654,670 ----
   	}
   	setsockopt(s,SOL_SOCKET,SO_OOBINLINE,(char *)&opt,sizeof(int));
   
@@ -81,9 +81,9 @@ diff -rc --exclude '*~' qemu-kvm-0.11.0-rc1-orig/slirp/socket.c qemu-kvm-0.11.0-
   
   	so->s = s;
   	return so;
-diff -rc --exclude '*~' qemu-kvm-0.11.0-rc1-orig/slirp/socket.h qemu-kvm-0.11.0-rc1/slirp/socket.h
-*** qemu-kvm-0.11.0-rc1-orig/slirp/socket.h	2009-08-02 15:38:42.000000000 +0200
---- qemu-kvm-0.11.0-rc1/slirp/socket.h	2009-08-21 17:02:36.000000000 +0200
+diff -rc --exclude '*~' qemu-kvm-0.12.1.2-orig/slirp/socket.h qemu-kvm-0.12.1.2/slirp/socket.h
+*** qemu-kvm-0.12.1.2-orig/slirp/socket.h	2009-12-29 21:46:34.000000000 +0100
+--- qemu-kvm-0.12.1.2/slirp/socket.h	2010-01-03 20:20:50.000000000 +0100
 ***************
 *** 33,39 ****
     struct in_addr so_laddr;	   /* local host table entry */
@@ -102,11 +102,11 @@ diff -rc --exclude '*~' qemu-kvm-0.11.0-rc1-orig/slirp/socket.h qemu-kvm-0.11.0-
     u_int8_t	so_iptos;	/* Type of service */
     u_int8_t	so_emu;		/* Is the socket emulated? */
   
-diff -rc --exclude '*~' qemu-kvm-0.11.0-rc1-orig/slirp/tcp_subr.c qemu-kvm-0.11.0-rc1/slirp/tcp_subr.c
-*** qemu-kvm-0.11.0-rc1-orig/slirp/tcp_subr.c	2009-08-02 15:38:42.000000000 +0200
---- qemu-kvm-0.11.0-rc1/slirp/tcp_subr.c	2009-08-21 17:21:37.000000000 +0200
+diff -rc --exclude '*~' qemu-kvm-0.12.1.2-orig/slirp/tcp_subr.c qemu-kvm-0.12.1.2/slirp/tcp_subr.c
+*** qemu-kvm-0.12.1.2-orig/slirp/tcp_subr.c	2009-12-29 21:46:34.000000000 +0100
+--- qemu-kvm-0.12.1.2/slirp/tcp_subr.c	2010-01-03 20:20:50.000000000 +0100
 ***************
-*** 382,388 ****
+*** 383,389 ****
   	Slirp *slirp = inso->slirp;
   	struct socket *so;
   	struct sockaddr_in addr;
@@ -114,7 +114,7 @@ diff -rc --exclude '*~' qemu-kvm-0.11.0-rc1-orig/slirp/tcp_subr.c qemu-kvm-0.11.
   	struct tcpcb *tp;
   	int s, opt;
   
---- 382,389 ----
+--- 383,390 ----
   	Slirp *slirp = inso->slirp;
   	struct socket *so;
   	struct sockaddr_in addr;
@@ -124,7 +124,7 @@ diff -rc --exclude '*~' qemu-kvm-0.11.0-rc1-orig/slirp/tcp_subr.c qemu-kvm-0.11.
   	int s, opt;
   
 ***************
-*** 412,418 ****
+*** 413,419 ****
   
   	(void) tcp_mss(sototcpcb(so), 0);
   
@@ -132,7 +132,7 @@ diff -rc --exclude '*~' qemu-kvm-0.11.0-rc1-orig/slirp/tcp_subr.c qemu-kvm-0.11.
   		tcp_close(sototcpcb(so)); /* This will sofree() as well */
   		return;
   	}
---- 413,422 ----
+--- 414,423 ----
   
   	(void) tcp_mss(sototcpcb(so), 0);
   
@@ -144,7 +144,7 @@ diff -rc --exclude '*~' qemu-kvm-0.11.0-rc1-orig/slirp/tcp_subr.c qemu-kvm-0.11.
   		return;
   	}
 ***************
-*** 424,434 ****
+*** 425,435 ****
   	opt = 1;
   	setsockopt(s,IPPROTO_TCP,TCP_NODELAY,(char *)&opt,sizeof(int));
   
@@ -156,7 +156,7 @@ diff -rc --exclude '*~' qemu-kvm-0.11.0-rc1-orig/slirp/tcp_subr.c qemu-kvm-0.11.
   
   	/* Close the accept() socket, set right state */
   	if (inso->so_state & SS_FACCEPTONCE) {
---- 428,443 ----
+--- 429,444 ----
   	opt = 1;
   	setsockopt(s,IPPROTO_TCP,TCP_NODELAY,(char *)&opt,sizeof(int));
   
diff --git a/pkgs/os-specific/linux/zen-kernel/2.6.31-zen5.nix b/pkgs/os-specific/linux/zen-kernel/2.6.31-zen5.nix
deleted file mode 100644
index 6b311c8689f..00000000000
--- a/pkgs/os-specific/linux/zen-kernel/2.6.31-zen5.nix
+++ /dev/null
@@ -1,205 +0,0 @@
-a :  
-let 
-  s = import ./src-for-2.6.31-zen5.nix;
-  in 
-(import ../kernel/generic.nix) (rec {
-  inherit (a) stdenv fetchurl perl mktemp module_init_tools platform;
-
-  uboot = if (platform.name == "sheevaplug") then
-    platform.uboot else null;
-
-  src = a.builderDefs.fetchGitFromSrcInfo s;
-  version = "2.6.31-zen5";
-  config = "./kernel-config";
-  features = {
-    iwlwifi = true;
-    zen = true;
-    fbConDecor = if (platform.name == "pc") then true else false;
-    aufs = true;
-  };
-
-  extraMeta = {
-    maintainers = [
-      a.lib.maintainers.raskin
-    ];
-    platforms = with a.lib.platforms; 
-      linux;
-  };
-
-  configFunctions = '' 
-    killOption () {
-      sed -re 's/^('"$1"')=.*/# \1 is not set/' -i .config
-    }
-    setOptionVal () {
-      sed -re 's/^('"$1"')=.*/\1='"$2"'/' -i .config
-      sed -re 's/^# ('"$1"') is not set/\1='"$2"'/' -i .config
-      sed -re "1i$1=$2" -i .config
-    }
-    setOptionMod () {
-      setOptionVal "$1" m
-    }
-    setOptionYes () {
-      setOptionVal "$1" y
-    }
-  '';
-
-
-  configurePC = ''
-    make allmodconfig
-
-    killOption CONFIG_CMDLINE_OVERRIDE
-
-    killOption 'CONFIG_.*_DEBUG.*'
-    killOption 'CONFIG_DEBUG.*'
-    killOption CONFIG_AUDIT_ARCH
-    killOption CONFIG_PERF_COUNTERS
-    killOption 'CONFIG_GCOV.*'
-    killOption 'CONFIG_KGDB.*'
-    killOption 'CONFIG_.*_TEST'
-    killOption CONFIG_TASKSTATS
-
-    killOption CONFIG_SLQB
-    killOption CONFIG_SLQB_ALLOCATOR
-    setOptionYes CONFIG_SLUB_ALLOCATOR
-    setOptionYes CONFIG_SLUB
-    killOption CONFIG_ACPI_CUSTOM_DSDT_INITRD
-    killOption CONFIG_DEVTMPFS
-    killOption CONFIG_DEVTMPFS_MOUNT
-
-    killOption CONFIG_IMA
-  '' +
-  ''
-    killOption CONFIG_USB_OTG_BLACKLIST_HUB
-  ''+
-  ''
-    killOption CONFIG_KERNEL_BZIP2
-    killOption CONFIG_KERNEL_LZMA
-    setOptionYes CONFIG_KERNEL_GZIP
-  ''+
-  ''
-    killOption CONFIG_FB_TILEBLITTING
-    killOption CONFIG_FB_S3
-    killOption CONFIG_FB_VT8623
-    killOption CONFIG_FB_ARK
-    setOptionYes CONFIG_FRAMEBUFFER_CONSOLE
-    setOptionYes CONFIG_FB
-    make oldconfig
-    setOptionYes CONFIG_FB_CON_DECOR
-    setOptionYes CONFIG_FB_VESA
-  ''+
-  ''
-    killOption CONFIG_PREEMPT_NONE
-    setOptionYes CONFIG_PREEMPT_VOLUNTARY
-  ''+
-  ''
-    killOption CONFIG_PRAMFS
-  ''+
-  (if a.lib.attrByPath ["ckSched"] false a then ''
-    killOption CONFIG_CPU_CFS
-    setOptionYes CONFIG_CPU_BFS
-    killOption CONFIG_NO_HZ
-    killOption CONFIG_HZ_1000
-    setOptionYes CONFIG_HZ_250
-    setOptionVal CONFIG_HZ 250
-  ''else "") +
-  ''
-    cp .config ${config}
-  '';
-
-  configureBaseSheevaplug = '' 
-    ARCH=arm make kirkwood_defconfig
-  '';
-
-  configureBaseVersatileARM = '' 
-    ARCH=arm make versatile_defconfig
-
-    setOptionYes CONFIG_IP_PNP_DHCP
-    setOptionYes CONFIG_TUN
-    # This versatile arm is for the sheevaplug compatibility, so, EABI
-    setOptionYes CONFIG_AEABI
-    setOptionYes CONFIG_TMPFS
-    # For the qemu block device 'hda' to work
-    setOptionYes CONFIG_PCI
-    setOptionYes CONFIG_SCSI
-    setOptionYes CONFIG_BLK_DEV_SD
-    setOptionYes CONFIG_SCSI_SYM53C8XX_2
-  '';
-
-  configureARM = '' 
-    killOption CONFIG_CMDLINE_OVERRIDE
-
-    killOption 'CONFIG_.*_DEBUG.*'
-    killOption 'CONFIG_DEBUG.*'
-    killOption CONFIG_AUDIT_ARCH
-    killOption CONFIG_PERF_COUNTERS
-    killOption 'CONFIG_GCOV.*'
-    killOption 'CONFIG_KGDB.*'
-    killOption 'CONFIG_.*_TEST'
-    killOption CONFIG_TASKSTATS
-
-    killOption CONFIG_SLQB
-    killOption CONFIG_SLQB_ALLOCATOR
-    setOptionYes CONFIG_SLUB_ALLOCATOR
-    setOptionYes CONFIG_SLUB
-    killOption CONFIG_ACPI_CUSTOM_DSDT_INITRD
-    killOption CONFIG_DEVTMPFS
-    killOption CONFIG_DEVTMPFS_MOUNT
-
-    killOption CONFIG_IMA
-  '' +
-  ''
-    killOption CONFIG_USB_OTG_BLACKLIST_HUB
-  ''+
-  ''
-    killOption CONFIG_KERNEL_BZIP2
-    killOption CONFIG_KERNEL_LZMA
-    setOptionYes CONFIG_KERNEL_GZIP
-  ''+
-  ''
-    killOption CONFIG_FB_TILEBLITTING
-    killOption CONFIG_FB_S3
-    killOption CONFIG_FB_VT8623
-    killOption CONFIG_FB_ARK
-    killOption CONFIG_FRAMEBUFFER_CONSOLE
-    killOption CONFIG_FB
-    make oldconfig
-    killOption CONFIG_FB_CON_DECOR
-    killOption CONFIG_FB_VESA
-  ''+
-  ''
-    killOption CONFIG_PREEMPT_NONE
-    setOptionYes CONFIG_PREEMPT_VOLUNTARY
-  ''+
-  ''
-    killOption CONFIG_PRAMFS
-  ''+
-  ''
-    setOptionYes CONFIG_MTD_UBI
-    setOptionYes CONFIG_REISERFS_FS
-    setOptionYes CONFIG_FUSE_FS
-    setOptionYes CONFIG_ISO9660_FS
-    setOptionMod CONFIG_IPV6
-  ''+
-  (if a.lib.attrByPath ["ckSched"] false a then ''
-    killOption CONFIG_CPU_CFS
-    setOptionYes CONFIG_CPU_BFS
-    killOption CONFIG_NO_HZ
-    killOption CONFIG_HZ_1000
-    setOptionYes CONFIG_HZ_250
-    setOptionVal CONFIG_HZ 250
-  ''else "") +
-  ''
-    cp .config ${config}
-  '';
-
-
-  preConfigure = configFunctions +
-    (if (platform.name == "pc") then
-       (configureBaseSheevaplug + configureARM)
-    else if (platform.name == "sheevaplug") then
-       (configureBaseSheevaplug + configureARM)
-    else if (platform.name == "versatileARM") then
-       (configureBaseVersatileARM + configureARM)
-    else throw "platform not supported"
-    );
-})
diff --git a/pkgs/os-specific/linux/zen-kernel/2.6.32-zen4.nix b/pkgs/os-specific/linux/zen-kernel/2.6.32-zen4.nix
new file mode 100644
index 00000000000..676f29a6956
--- /dev/null
+++ b/pkgs/os-specific/linux/zen-kernel/2.6.32-zen4.nix
@@ -0,0 +1,74 @@
+args @ {stdenv, fetchurl, xz, runCommand, userModeLinux ? false, extraConfig ? "", 
+  kernelPatches ? [], extraMeta ? {}, 
+  features ? {}, preConfigure ? "",
+  ...}:
+
+let 
+  conf = import ../kernel/config-blocks.nix; 
+
+in
+
+import ../kernel/generic.nix (
+  rec {
+    version = "2.6.32-zen4";
+
+    src = fetchurl {
+      url = "mirror://kernel/linux/kernel/v2.6/linux-2.6.32.tar.bz2";
+      sha256 = "0kjhnkf2ldivagczs16q49zm2lr3khh01pqrlsc7sh5qh1npi6ah";
+    };
+
+    kernelPatches = [
+      {
+         patch = runCommand "2.6.32-zen4.patch" {} "${xz}/bin/lzma -d < ${ fetchurl {
+	   name = "2.6.32-zen4";
+           url = "http://downloads.zen-kernel.org/2.6.32/2.6.32-zen4.patch.lzma";
+           sha256 = "1dyp9sfigqjfqw1c94010c521bhcy1xnzp91kkhg3dwgzfpsp2k2";
+         } } > $out";
+      }
+    ]
+    ++
+    stdenv.lib.attrByPath ["kernelPatches"] [] args;
+
+    features = {
+      iwlwifi = true;
+      zen = true;
+      fbConDecor = true;
+      aufs = true;
+    } // (stdenv.lib.attrByPath ["features"] {} args);
+
+    config = with conf;
+    ''
+      ${generalOptions}
+      ${noDebug}
+      ${virtualisation}
+      ${if stdenv.lib.attrByPath ["features" "oldI686"] false args then noPAE else ""}
+      ${usefulSubsystems}
+      ${cfq}
+      ${noNUMA}
+      ${networking}
+      ${wireless}
+      ${fb}
+      ${fbConDecor}
+      ${sound}
+      ${usbserial}
+      ${fsXattr}
+      ${security}
+      ${blockDevices}
+      ${bluetooth}
+      ${misc}
+      ${if stdenv.lib.attrByPath ["features" "ckSched"] false args then bfsched else ""}
+    '';
+
+    preConfigure = ''
+      mv README.zen README-zen
+    '' + stdenv.lib.attrByPath ["preConfigure"] "" args;
+
+    extraMeta = {
+      maintainers = [stdenv.lib.maintainers.raskin];
+      platforms = with stdenv.lib.platforms;
+        linux;
+    } // stdenv.lib.attrByPath ["extraMeta"] {} args;
+  } 
+  // removeAttrs args ["extraConfig" "extraMeta" "features" "kernelPatches" 
+                        "xz" "runCommand" "preConfigure"]
+)
diff --git a/pkgs/os-specific/linux/zen-kernel/src-for-2.6.31-zen5.nix b/pkgs/os-specific/linux/zen-kernel/src-for-2.6.31-zen5.nix
deleted file mode 100644
index fed3b4555ad..00000000000
--- a/pkgs/os-specific/linux/zen-kernel/src-for-2.6.31-zen5.nix
+++ /dev/null
@@ -1,7 +0,0 @@
-rec {
-   version="cd9caea74b8f90e8dded45a93a173f0f5c5aef25";
-   name="zen-linux-cd9caea74b8f90e8dded45a93a173f0f5c5aef25";
-   hash="86e254d1aab17a66d7f5a83d93430b11dbeb95be1ee06f1d6a4c36219e4dfaf4";
-   rev="cd9caea74b8f90e8dded45a93a173f0f5c5aef25";
-   url="git://zen-kernel.org/kernel/zen-stable.git";
-}
diff --git a/pkgs/os-specific/linux/zen-kernel/src-for-zen-stable.nix b/pkgs/os-specific/linux/zen-kernel/src-for-zen-stable.nix
deleted file mode 100644
index a3d78137553..00000000000
--- a/pkgs/os-specific/linux/zen-kernel/src-for-zen-stable.nix
+++ /dev/null
@@ -1,7 +0,0 @@
-rec {
-   version="66a44aa93959818bdb8153fea27b0992197ebc54";
-   name="zen-linux-66a44aa93959818bdb8153fea27b0992197ebc54";
-   hash="f5c86214424c8a7202c2dd9bbbd800561940af00800edb8afab080a73c185bca";
-   rev="66a44aa93959818bdb8153fea27b0992197ebc54";
-   url="git://zen-kernel.org/kernel/zen-stable.git";
-}
diff --git a/pkgs/os-specific/linux/zen-kernel/src-info-for-default.nix b/pkgs/os-specific/linux/zen-kernel/src-info-for-default.nix
deleted file mode 100644
index c06385aac35..00000000000
--- a/pkgs/os-specific/linux/zen-kernel/src-info-for-default.nix
+++ /dev/null
@@ -1,6 +0,0 @@
-{
-  repoUrl = "http://git.zen-sources.org/zen.git";
-  rev = "origin/master";
-  baseName = "zen-linux";
-  method = "fetchgit";
-}
diff --git a/pkgs/os-specific/linux/zen-kernel/src-info-for-zen-stable.nix b/pkgs/os-specific/linux/zen-kernel/src-info-for-zen-stable.nix
deleted file mode 100644
index e71297b146d..00000000000
--- a/pkgs/os-specific/linux/zen-kernel/src-info-for-zen-stable.nix
+++ /dev/null
@@ -1,6 +0,0 @@
-{
-  repoUrl = "git://zen-kernel.org/kernel/zen-stable.git";
-  rev = "origin/master";
-  baseName = "zen-linux";
-  method = "fetchgit";
-}
diff --git a/pkgs/os-specific/linux/zen-kernel/zen-stable.nix b/pkgs/os-specific/linux/zen-kernel/zen-stable.nix
deleted file mode 100644
index dfc8828068e..00000000000
--- a/pkgs/os-specific/linux/zen-kernel/zen-stable.nix
+++ /dev/null
@@ -1,102 +0,0 @@
-a :  
-let 
-  s = import ./src-for-zen-stable.nix;
-in 
-(import ../kernel/generic.nix) (rec {
-  inherit (a) stdenv fetchurl perl mktemp module_init_tools;
-
-  src = a.builderDefs.fetchGitFromSrcInfo s;
-  version = "2.6.31-zen7";
-  config = "./kernel-config";
-  features = {
-    iwlwifi = true;
-    zen = true;
-    fbConDecor = true;
-    aufs = true;
-  };
-
-  extraMeta = {
-    maintainers = [
-      a.lib.maintainers.raskin
-    ];
-    platforms = with a.lib.platforms; 
-      linux;
-  };
-
-  preConfigure = '' 
-    killOption () {
-      sed -re 's/^('"$1"')=.*/# \1 is not set/' -i .config
-    }
-    setOptionVal () {
-      sed -re 's/^('"$1"')=.*/\1='"$2"'/' -i .config
-      sed -re 's/^# ('"$1"') is not set/\1='"$2"'/' -i .config
-      sed -re "1i$1=$2" -i .config
-    }
-    setOptionMod () {
-      setOptionVal "$1" m
-    }
-    setOptionYes () {
-      setOptionVal "$1" y
-    }
-
-    make allmodconfig
-
-    killOption CONFIG_CMDLINE_OVERRIDE
-
-    killOption 'CONFIG_.*_DEBUG.*'
-    killOption 'CONFIG_DEBUG.*'
-    killOption CONFIG_AUDIT_ARCH
-    killOption CONFIG_PERF_COUNTERS
-    killOption 'CONFIG_GCOV.*'
-    killOption 'CONFIG_KGDB.*'
-    killOption 'CONFIG_.*_TEST'
-    killOption CONFIG_TASKSTATS
-
-    killOption CONFIG_SLQB
-    killOption CONFIG_SLQB_ALLOCATOR
-    setOptionYes CONFIG_SLUB_ALLOCATOR
-    setOptionYes CONFIG_SLUB
-    killOption CONFIG_ACPI_CUSTOM_DSDT_INITRD
-    killOption CONFIG_DEVTMPFS
-    killOption CONFIG_DEVTMPFS_MOUNT
-
-    killOption CONFIG_IMA
-  '' +
-  ''
-    killOption CONFIG_USB_OTG_BLACKLIST_HUB
-  ''+
-  ''
-    killOption CONFIG_KERNEL_BZIP2
-    killOption CONFIG_KERNEL_LZMA
-    setOptionYes CONFIG_KERNEL_GZIP
-  ''+
-  ''
-    killOption CONFIG_FB_TILEBLITTING
-    killOption CONFIG_FB_S3
-    killOption CONFIG_FB_VT8623
-    killOption CONFIG_FB_ARK
-    setOptionYes CONFIG_FRAMEBUFFER_CONSOLE
-    setOptionYes CONFIG_FB
-    make oldconfig
-    setOptionYes CONFIG_FB_CON_DECOR
-    setOptionYes CONFIG_FB_VESA
-  ''+
-  ''
-    killOption CONFIG_PREEMPT_NONE
-    setOptionYes CONFIG_PREEMPT_VOLUNTARY
-  ''+
-  ''
-    killOption CONFIG_PRAMFS
-  ''+
-  (if a.lib.attrByPath ["ckSched"] false a then ''
-    killOption CONFIG_CPU_CFS
-    setOptionYes CONFIG_CPU_BFS
-    killOption CONFIG_NO_HZ
-    killOption CONFIG_HZ_1000
-    setOptionYes CONFIG_HZ_250
-    setOptionVal CONFIG_HZ 250
-  ''else "") +
-  ''
-    cp .config ${config}
-  '';
-})
diff --git a/pkgs/servers/x11/xorg/default.nix b/pkgs/servers/x11/xorg/default.nix
index 55d9243e4e5..94f527ab801 100644
--- a/pkgs/servers/x11/xorg/default.nix
+++ b/pkgs/servers/x11/xorg/default.nix
@@ -68,11 +68,11 @@ let
   })) // {inherit ;};
     
   dri2proto = (stdenv.mkDerivation ((if overrides ? dri2proto then overrides.dri2proto else x: x) {
-    name = "dri2proto-2.1";
+    name = "dri2proto-2.2";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.5/src/everything/dri2proto-2.1.tar.bz2;
-      sha256 = "0b8jjlw2dk5nx4jgvwvwsysswar625vp3wmaqc2g1f4gcp3zfcrb";
+      url = mirror://xorg/individual/proto/dri2proto-2.2.tar.bz2;
+      sha256 = "18djh2vy6z67hl1v63wc1kw7q35s92ixj5p2lffpshz4zq7ralpk";
     };
     buildInputs = [pkgconfig ];
   })) // {inherit ;};
@@ -478,11 +478,11 @@ let
   })) // {inherit ;};
     
   glproto = (stdenv.mkDerivation ((if overrides ? glproto then overrides.glproto else x: x) {
-    name = "glproto-1.4.10";
+    name = "glproto-1.4.11";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.5/src/everything/glproto-1.4.10.tar.bz2;
-      sha256 = "1kvgf662xdapcbxlnmxjmzhswks1zvq4ig48r9pgbm14mql3mf3z";
+      url = mirror://xorg/individual/proto/glproto-1.4.11.tar.bz2;
+      sha256 = "0lclh6fnz6k5xqbqarsvzx6sg7gjkprg27k7797xn0agsy4isj7y";
     };
     buildInputs = [pkgconfig ];
   })) // {inherit ;};
@@ -868,11 +868,11 @@ let
   })) // {inherit xproto zlib ;};
     
   libpciaccess = (stdenv.mkDerivation ((if overrides ? libpciaccess then overrides.libpciaccess else x: x) {
-    name = "libpciaccess-0.10.9";
+    name = "libpciaccess-0.11.0";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.5/src/everything/libpciaccess-0.10.9.tar.bz2;
-      sha256 = "1bgy2f17k0iflx5fb9fysgh1i46f3ip01gxlxbyfsxmyp21rdjsw";
+      url = mirror://xorg/individual/lib/libpciaccess-0.11.0.tar.bz2;
+      sha256 = "1avx3kn44lk3xs49q8bqh8hqi08x0inab2zxlrk3rj2nnq9bwf3f";
     };
     buildInputs = [pkgconfig zlib ];
   })) // {inherit zlib ;};
@@ -958,11 +958,11 @@ let
   })) // {inherit libfontenc freetype xproto zlib ;};
     
   pixman = (stdenv.mkDerivation ((if overrides ? pixman then overrides.pixman else x: x) {
-    name = "pixman-0.16.2";
+    name = "pixman-0.16.4";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/individual/lib/pixman-0.16.2.tar.bz2;
-      sha256 = "0q3754f9fjxmzjh2fv47dfhdvwy0gj19zyail9z2az79j8rzmcl0";
+      url = mirror://xorg/individual/lib/pixman-0.16.4.tar.bz2;
+      sha256 = "07ndvwxmkrc4zyxpi8ndjmyj509cm411ajrc6qj6clr5y5c96vi9";
     };
     buildInputs = [pkgconfig perl ];
   })) // {inherit perl ;};
@@ -1248,11 +1248,11 @@ let
   })) // {inherit ;};
     
   xeyes = (stdenv.mkDerivation ((if overrides ? xeyes then overrides.xeyes else x: x) {
-    name = "xeyes-1.0.991";
+    name = "xeyes-1.1.0";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/individual/app/xeyes-1.0.991.tar.bz2;
-      sha256 = "05giiqnd90kxb3bmz5xpc2m8agf6lpgq99d908hm02mj9c8j8hsr";
+      url = mirror://xorg/individual/app/xeyes-1.1.0.tar.bz2;
+      sha256 = "01ymjkdhz0jrra47l1cqc4vkklaw3frmzgwwvq6jyvm0zr0rcswr";
     };
     buildInputs = [pkgconfig libX11 libXext libXmu libXrender libXt ];
   })) // {inherit libX11 libXext libXmu libXrender libXt ;};
@@ -1308,11 +1308,11 @@ let
   })) // {inherit inputproto randrproto xorgserver xproto ;};
     
   xf86inputevdev = (stdenv.mkDerivation ((if overrides ? xf86inputevdev then overrides.xf86inputevdev else x: x) {
-    name = "xf86-input-evdev-2.3.1";
+    name = "xf86-input-evdev-2.3.2";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/individual/driver/xf86-input-evdev-2.3.1.tar.bz2;
-      sha256 = "13qxa5ah10d3m4501n7wpj2vzp04rlva4r57kzh8g6iqzpi2lbs6";
+      url = mirror://xorg/individual/driver/xf86-input-evdev-2.3.2.tar.bz2;
+      sha256 = "0a2y26fq3h1j5c16r8lhparvkr2rbah9f4jc70zcqfq1pmlz96q2";
     };
     buildInputs = [pkgconfig xorgserver xproto ];
   })) // {inherit xorgserver xproto ;};
@@ -1518,11 +1518,11 @@ let
   })) // {inherit fontsproto libpciaccess randrproto renderproto videoproto xextproto xorgserver xproto ;};
     
   xf86videointel = (stdenv.mkDerivation ((if overrides ? xf86videointel then overrides.xf86videointel else x: x) {
-    name = "xf86-video-intel-2.9.1";
+    name = "xf86-video-intel-2.10.0";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.5/src/everything/xf86-video-intel-2.9.1.tar.bz2;
-      sha256 = "0xlxipmpfa49hpqj01d2h6qpzlmqs6nxzg5kgb042aschn47qd4m";
+      url = mirror://xorg/individual/driver/xf86-video-intel-2.10.0.tar.bz2;
+      sha256 = "1as8zk6b74q9d3ynq0i89z9vzx79lzz88azjypb7rnwkvj8xcvg4";
     };
     buildInputs = [pkgconfig dri2proto fontsproto glproto libdrm libpciaccess randrproto renderproto libX11 libXext xextproto xf86driproto libXfixes xineramaproto xorgserver xproto libXvMC ];
   })) // {inherit dri2proto fontsproto glproto libdrm libpciaccess randrproto renderproto libX11 libXext xextproto xf86driproto libXfixes xineramaproto xorgserver xproto libXvMC ;};
@@ -1778,21 +1778,21 @@ let
   })) // {inherit randrproto videoproto xorgserver xproto ;};
     
   xf86videovesa = (stdenv.mkDerivation ((if overrides ? xf86videovesa then overrides.xf86videovesa else x: x) {
-    name = "xf86-video-vesa-2.2.1";
+    name = "xf86-video-vesa-2.3.0";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.5/src/everything/xf86-video-vesa-2.2.1.tar.bz2;
-      sha256 = "100hljpkml6dfk4rw2gpb78z8gkdv3nqlyjiwyrpv71f4dqpjrd3";
+      url = mirror://xorg/individual/driver/xf86-video-vesa-2.3.0.tar.bz2;
+      sha256 = "0yhdj39d8rfv2n4i52dg7cg1rsrclagn7rjs3pc3jdajjh75mn4f";
     };
     buildInputs = [pkgconfig fontsproto libpciaccess randrproto renderproto xextproto xorgserver xproto ];
   })) // {inherit fontsproto libpciaccess randrproto renderproto xextproto xorgserver xproto ;};
     
   xf86videovmware = (stdenv.mkDerivation ((if overrides ? xf86videovmware then overrides.xf86videovmware else x: x) {
-    name = "xf86-video-vmware-10.16.8";
+    name = "xf86-video-vmware-10.16.9";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/X11R7.5/src/everything/xf86-video-vmware-10.16.8.tar.bz2;
-      sha256 = "01yslyg4d16baw11zdnq453bm7ydya7wpn2n02dlbxwlina46r4m";
+      url = mirror://xorg/individual/driver/xf86-video-vmware-10.16.9.tar.bz2;
+      sha256 = "1hcbgqb7lfcfwrvdscg9jzh1g5vhvc4vsj1sjsywnds8nm2mwnl3";
     };
     buildInputs = [pkgconfig fontsproto libpciaccess randrproto renderproto videoproto xextproto xineramaproto xorgserver xproto ];
   })) // {inherit fontsproto libpciaccess randrproto renderproto videoproto xextproto xineramaproto xorgserver xproto ;};
@@ -1887,6 +1887,16 @@ let
     buildInputs = [pkgconfig ];
   })) // {inherit ;};
     
+  xinit = (stdenv.mkDerivation ((if overrides ? xinit then overrides.xinit else x: x) {
+    name = "xinit-1.2.0";
+    builder = ./builder.sh;
+    src = fetchurl {
+      url = mirror://xorg/individual/app/xinit-1.2.0.tar.bz2;
+      sha256 = "0zq8cpxm1ws81xj39d0wfv29f1nj7s3pmjdashr32x918hx6cqdb";
+    };
+    buildInputs = [pkgconfig libX11 ];
+  })) // {inherit libX11 ;};
+    
   xinput = (stdenv.mkDerivation ((if overrides ? xinput then overrides.xinput else x: x) {
     name = "xinput-1.5.0";
     builder = ./builder.sh;
@@ -1998,11 +2008,11 @@ let
   })) // {inherit ;};
     
   xorgserver = (stdenv.mkDerivation ((if overrides ? xorgserver then overrides.xorgserver else x: x) {
-    name = "xorg-server-1.7.3";
+    name = "xorg-server-1.7.4";
     builder = ./builder.sh;
     src = fetchurl {
-      url = mirror://xorg/individual/xserver/xorg-server-1.7.3.tar.bz2;
-      sha256 = "1d1dkidb8bpnws8akihy8wfxqqz055jpng602mvcf3q3rl9l2r2b";
+      url = mirror://xorg/individual/xserver/xorg-server-1.7.4.tar.bz2;
+      sha256 = "1y1k7qjyl1bjjkfmhgci7vd7zqm65dkh966dx0hlry66yari3v5q";
     };
     buildInputs = [pkgconfig bigreqsproto damageproto dbus fixesproto fontsproto hal inputproto kbproto libdrm openssl libpciaccess perl pixman randrproto renderproto libX11 libXau libXaw xcmiscproto libXdmcp xextproto libXfixes libXfont libxkbfile libXmu libXpm xproto libXrender libXres libXt xtrans libXv ];
   })) // {inherit bigreqsproto damageproto dbus fixesproto fontsproto hal inputproto kbproto libdrm openssl libpciaccess perl pixman randrproto renderproto libX11 libXau libXaw xcmiscproto libXdmcp xextproto libXfixes libXfont libxkbfile libXmu libXpm xproto libXrender libXres libXt xtrans libXv ;};
diff --git a/pkgs/servers/x11/xorg/extra.list b/pkgs/servers/x11/xorg/extra.list
index 64267ec39f9..83118fe0fc4 100644
--- a/pkgs/servers/x11/xorg/extra.list
+++ b/pkgs/servers/x11/xorg/extra.list
@@ -2,4 +2,4 @@ http://xcb.freedesktop.org/dist/xcb-proto-1.5.tar.bz2
 http://xcb.freedesktop.org/dist/xcb-util-0.3.6.tar.bz2
 http://xcb.freedesktop.org/dist/libxcb-1.4.tar.bz2
 http://xcb.freedesktop.org/dist/libpthread-stubs-0.3.tar.bz2
-mirror://xorg/individual/lib/pixman-0.16.2.tar.bz2
+mirror://xorg/individual/lib/pixman-0.16.4.tar.bz2
diff --git a/pkgs/servers/x11/xorg/old.list b/pkgs/servers/x11/xorg/old.list
index 9e6b988ea59..6599c79af53 100644
--- a/pkgs/servers/x11/xorg/old.list
+++ b/pkgs/servers/x11/xorg/old.list
@@ -1,7 +1,8 @@
 mirror://xorg/individual/app/twm-1.0.4.tar.bz2
 mirror://xorg/individual/app/xclock-1.0.4.tar.bz2
-mirror://xorg/individual/app/xeyes-1.0.991.tar.bz2
+mirror://xorg/individual/app/xeyes-1.1.0.tar.bz2
 mirror://xorg/individual/app/xfs-1.1.0.tar.bz2
+mirror://xorg/individual/app/xinit-1.2.0.tar.bz2
 mirror://xorg/individual/app/xmessage-1.0.2.tar.bz2
 mirror://xorg/individual/lib/libXp-1.0.0.tar.bz2
 mirror://xorg/individual/lib/libXxf86misc-1.0.2.tar.bz2
diff --git a/pkgs/servers/x11/xorg/tarballs-7.5.list b/pkgs/servers/x11/xorg/tarballs-7.5.list
index ba4f90d7fe6..4a0f4df1112 100644
--- a/pkgs/servers/x11/xorg/tarballs-7.5.list
+++ b/pkgs/servers/x11/xorg/tarballs-7.5.list
@@ -4,7 +4,7 @@ mirror://xorg/X11R7.5/src/everything/bigreqsproto-1.1.0.tar.bz2
 mirror://xorg/X11R7.5/src/everything/compositeproto-0.4.1.tar.bz2
 mirror://xorg/X11R7.5/src/everything/damageproto-1.2.0.tar.bz2
 mirror://xorg/X11R7.5/src/everything/dmxproto-2.3.tar.bz2
-mirror://xorg/X11R7.5/src/everything/dri2proto-2.1.tar.bz2
+mirror://xorg/individual/proto/dri2proto-2.2.tar.bz2
 mirror://xorg/X11R7.5/src/everything/encodings-1.0.3.tar.bz2
 mirror://xorg/X11R7.5/src/everything/fixesproto-4.1.1.tar.bz2
 mirror://xorg/X11R7.5/src/everything/font-adobe-100dpi-1.0.1.tar.bz2
@@ -44,7 +44,7 @@ mirror://xorg/X11R7.5/src/everything/font-sun-misc-1.0.1.tar.bz2
 mirror://xorg/X11R7.5/src/everything/font-util-1.1.1.tar.bz2
 mirror://xorg/X11R7.5/src/everything/font-winitzki-cyrillic-1.0.1.tar.bz2
 mirror://xorg/X11R7.5/src/everything/font-xfree86-type1-1.0.2.tar.bz2
-mirror://xorg/X11R7.5/src/everything/glproto-1.4.10.tar.bz2
+mirror://xorg/individual/proto/glproto-1.4.11.tar.bz2
 mirror://xorg/X11R7.5/src/everything/iceauth-1.0.3.tar.bz2
 mirror://xorg/X11R7.5/src/everything/inputproto-2.0.tar.bz2
 mirror://xorg/X11R7.5/src/everything/kbproto-1.0.4.tar.bz2
@@ -53,7 +53,7 @@ mirror://xorg/X11R7.5/src/everything/libdmx-1.1.0.tar.bz2
 mirror://xorg/X11R7.5/src/everything/libfontenc-1.0.5.tar.bz2
 mirror://xorg/X11R7.5/src/everything/libFS-1.0.2.tar.bz2
 mirror://xorg/X11R7.5/src/everything/libICE-1.0.6.tar.bz2
-mirror://xorg/X11R7.5/src/everything/libpciaccess-0.10.9.tar.bz2
+mirror://xorg/individual/lib/libpciaccess-0.11.0.tar.bz2
 mirror://xorg/X11R7.5/src/everything/libSM-1.1.1.tar.bz2
 mirror://xorg/X11R7.5/src/everything/libWindowsWM-1.0.1.tar.bz2
 mirror://xorg/X11R7.5/src/everything/libX11-1.3.2.tar.bz2
@@ -114,8 +114,7 @@ mirror://xorg/X11R7.5/src/everything/xf86dgaproto-2.1.tar.bz2
 mirror://xorg/X11R7.5/src/everything/xf86driproto-2.1.0.tar.bz2
 mirror://xorg/X11R7.5/src/everything/xf86-input-acecad-1.4.0.tar.bz2
 mirror://xorg/X11R7.5/src/everything/xf86-input-aiptek-1.3.0.tar.bz2
-mirror://xorg/individual/driver/xf86-input-evdev-2.3.1.tar.bz2
-mirror://xorg/X11R7.5/src/everything/xf86-input-evdev-2.3.0.tar.bz2
+mirror://xorg/individual/driver/xf86-input-evdev-2.3.2.tar.bz2
 mirror://xorg/X11R7.5/src/everything/xf86-input-joystick-1.4.99.2.tar.bz2
 mirror://xorg/X11R7.5/src/everything/xf86-input-keyboard-1.4.0.tar.bz2
 mirror://xorg/X11R7.5/src/everything/xf86-input-mouse-1.5.0.tar.bz2
@@ -135,7 +134,7 @@ mirror://xorg/X11R7.5/src/everything/xf86-video-glide-1.0.3.tar.bz2
 mirror://xorg/X11R7.5/src/everything/xf86-video-glint-1.2.4.tar.bz2
 mirror://xorg/X11R7.5/src/everything/xf86-video-i128-1.3.3.tar.bz2
 mirror://xorg/X11R7.5/src/everything/xf86-video-i740-1.3.2.tar.bz2
-mirror://xorg/X11R7.5/src/everything/xf86-video-intel-2.9.1.tar.bz2
+mirror://xorg/individual/driver/xf86-video-intel-2.10.0.tar.bz2
 mirror://xorg/X11R7.5/src/everything/xf86-video-mach64-6.8.2.tar.bz2
 mirror://xorg/X11R7.5/src/everything/xf86-video-mga-1.4.11.tar.bz2
 mirror://xorg/X11R7.5/src/everything/xf86-video-neomagic-1.2.4.tar.bz2
@@ -161,8 +160,8 @@ mirror://xorg/X11R7.5/src/everything/xf86-video-tga-1.2.1.tar.bz2
 mirror://xorg/X11R7.5/src/everything/xf86-video-trident-1.3.3.tar.bz2
 mirror://xorg/X11R7.5/src/everything/xf86-video-tseng-1.2.3.tar.bz2
 mirror://xorg/X11R7.5/src/everything/xf86-video-v4l-0.2.0.tar.bz2
-mirror://xorg/X11R7.5/src/everything/xf86-video-vesa-2.2.1.tar.bz2
-mirror://xorg/X11R7.5/src/everything/xf86-video-vmware-10.16.8.tar.bz2
+mirror://xorg/individual/driver/xf86-video-vesa-2.3.0.tar.bz2
+mirror://xorg/individual/driver/xf86-video-vmware-10.16.9.tar.bz2
 mirror://xorg/X11R7.5/src/everything/xf86-video-voodoo-1.2.3.tar.bz2
 mirror://xorg/X11R7.5/src/everything/xf86-video-wsfb-0.3.0.tar.bz2
 mirror://xorg/X11R7.5/src/everything/xf86-video-xgi-1.5.1.tar.bz2
@@ -180,7 +179,7 @@ mirror://xorg/X11R7.5/src/everything/xlsatoms-1.0.2.tar.bz2
 mirror://xorg/X11R7.5/src/everything/xlsclients-1.0.2.tar.bz2
 mirror://xorg/X11R7.5/src/everything/xmodmap-1.0.4.tar.bz2
 mirror://xorg/X11R7.5/src/everything/xorg-docs-1.5.tar.bz2
-mirror://xorg/individual/xserver/xorg-server-1.7.3.tar.bz2
+mirror://xorg/individual/xserver/xorg-server-1.7.4.tar.bz2
 mirror://xorg/X11R7.5/src/everything/xorg-sgml-doctools-1.3.tar.bz2
 mirror://xorg/X11R7.5/src/everything/xpr-1.0.3.tar.bz2
 mirror://xorg/X11R7.5/src/everything/xprop-1.1.0.tar.bz2
diff --git a/pkgs/stdenv/adapters.nix b/pkgs/stdenv/adapters.nix
index 5718d06c45d..5b37f9908c2 100644
--- a/pkgs/stdenv/adapters.nix
+++ b/pkgs/stdenv/adapters.nix
@@ -200,12 +200,17 @@ rec {
         # Get rid of everything that isn't a gcno file or a C source
         # file.  This also includes the gcda files; we're not
         # interested in coverage resulting from the package's own test
-        # suite.
+        # suite.  Also strip the `.tmp_' prefix from gcno files.  (The
+        # Linux kernel creates these.)
         cleanupBuildDir =
           ''
             find $out/.build/ -type f -a ! \
               \( -name "*.c" -o -name "*.h" -o -name "*.gcno" \) \
               | xargs rm -f --
+
+            for i in $(find $out/.build/ -name ".tmp_*.gcno"); do 
+                mv "$i" "$(echo $i | sed s/.tmp_//)"
+            done
           '';
       } stdenv;          
       
diff --git a/pkgs/tools/archivers/unrar/default.nix b/pkgs/tools/archivers/unrar/default.nix
index 6e545726b14..1667156adab 100644
--- a/pkgs/tools/archivers/unrar/default.nix
+++ b/pkgs/tools/archivers/unrar/default.nix
@@ -1,15 +1,28 @@
 {stdenv, fetchurl}:
 stdenv.mkDerivation {
-  name = "unrar-3.7.6";
+  name = "unrar-3.9.7";
 
   src = fetchurl {
-    url = http://www.rarlab.com/rar/unrarsrc-3.7.6.tar.gz;
-    sha256 = "0inzy0jlwqm18i6lq17aq4n2baqqlbjyr6incw4s9cxrvmjq51ls";
+    url = http://www.rarlab.com/rar/unrarsrc-3.9.7.tar.gz;
+    sha256 = "101w7fgfr5biyic8gj0km5aqi4xj8dikh4aa0rx0qvg8bjp19wb4";
   };
 
-  makeFlags = "-f makefile.unix";
+  # Add a missing objects to the library
+  #patchPhase = ''
+  #  sed -i 's/^\(LIB_OBJ=.*\)/\1 recvol.o rs.o/' makefile.unix
+  #'';
 
-  installPhase = "mkdir -p \${out}/bin/ ; cp unrar \${out}/bin/;";
+  buildPhase = ''
+    make -f makefile.unix unrar
+    rm *.o
+    make -f makefile.unix lib CXXFLAGS="-fPIC -O2 -DSILENT";
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin $out/lib
+    cp unrar $out/bin
+    cp libunrar.so $out/lib
+  '';
 
   buildInputs = [];
 }
diff --git a/pkgs/tools/compression/ncompress/builder.sh b/pkgs/tools/compression/ncompress/builder.sh
new file mode 100644
index 00000000000..fb0824d8a28
--- /dev/null
+++ b/pkgs/tools/compression/ncompress/builder.sh
@@ -0,0 +1,14 @@
+source $stdenv/setup
+installFlags="PREFIX=$out"
+
+preBuild() {
+    cp Makefile.def Makefile
+}
+
+postInstall() {
+    rm $out/bin/uncompress* $out/bin/zcat*
+    ln -s compress $out/bin/uncompress
+    ln -s compress $out/bin/zcat
+}
+
+genericBuild
diff --git a/pkgs/tools/compression/ncompress/default.nix b/pkgs/tools/compression/ncompress/default.nix
new file mode 100644
index 00000000000..33edf9bb84e
--- /dev/null
+++ b/pkgs/tools/compression/ncompress/default.nix
@@ -0,0 +1,18 @@
+{stdenv, fetchurl}:
+
+stdenv.mkDerivation {
+  name = "ncompress-4.2.4";
+  
+  builder = ./builder.sh;
+
+  patches = [ ./makefile.patch ];
+    
+  src = fetchurl {
+    url = mirror://sourceforge/project/ncompress/ncompress%20%28bugfixes%29/ncompress-4.2.4.2/ncompress-4.2.4.2.tar.gz;
+    sha256 = "38158c792b769fe23c74f8d3ea0e27569a9b1d21b53a4faf8acbb1ac03743221";
+  };
+
+  meta = {
+    homepage = http://sourceforge.net/projects/ncompress/files/ncompress%20%28bugfixes%29/ncompress-4.2.4.2/ncompress-4.2.4.2.tar.gz/download;
+  };
+}
diff --git a/pkgs/tools/compression/ncompress/makefile.patch b/pkgs/tools/compression/ncompress/makefile.patch
new file mode 100644
index 00000000000..49aa4e65c76
--- /dev/null
+++ b/pkgs/tools/compression/ncompress/makefile.patch
@@ -0,0 +1,31 @@
+diff -Naur ncompress-4.2.4.2.orig/Makefile.def ncompress-4.2.4.2/Makefile.def
+--- ncompress-4.2.4.2.orig/Makefile.def	2007-09-06 22:28:42.000000000 -0500
++++ ncompress-4.2.4.2/Makefile.def	2009-08-18 12:30:53.000000000 -0500
+@@ -3,14 +3,16 @@
+ # C complier
+ #CC=cc
+ 
++PREFIX=/usr/local
++
+ # Install prefix
+ DESTDIR=
+ 
+ # Install directory for binarys
+-BINDIR=/usr/local/bin
++BINDIR=$(PREFIX)/bin
+ 
+ # Install directory for manual
+-MANDIR=/usr/local/man/man1
++MANDIR=$(PREFIX)/man/man1
+ 
+ # compiler options:
+ # options is a collection of:
+@@ -31,7 +33,7 @@
+ #	-DDEF_ERRNO=1				Define error (not defined in errno.h).
+ #	-DMAXSEG_64K=1 -BITS=16		Support segment processsor like 80286.
+ #
+-options= $(CFLAGS) $(CPPFLAGS) -DDIRENT=1 -DUSERMEM=800000 -DREGISTERS=3
++options= $(CFLAGS) $(CPPFLAGS) -DDIRENT=1 -DUSERMEM=800000 -DREGISTERS=3 -DNOFUNCDEF=1
+ 
+ # libary options
+ LBOPT= $(LDFLAGS)
diff --git a/pkgs/tools/graphics/netpbm/default.nix b/pkgs/tools/graphics/netpbm/default.nix
index c2e85564e66..568762e3ded 100644
--- a/pkgs/tools/graphics/netpbm/default.nix
+++ b/pkgs/tools/graphics/netpbm/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchsvn, libjpeg, libpng, flex, zlib, perl, libxml2 }:
+{stdenv, fetchsvn, libjpeg, libpng, flex, zlib, perl, libxml2, makeWrapper }:
 
 stdenv.mkDerivation {
   name = "netpbm-advanced-844";
@@ -9,12 +9,22 @@ stdenv.mkDerivation {
     sha256 = "8729e63bb5cc9fd500a68d5aed91fa4b973ebc068e3014b47390ba7b4d85968e";
   };
 
+  patches = [ ./rgbpaths.patch ];
+
   NIX_CFLAGS_COMPILE = if stdenv.system == "x86_64-linux" then "-fPIC" else "";
 
-  buildInputs = [ flex zlib perl libpng libjpeg libxml2 ];
+  buildInputs = [ flex zlib perl libpng libjpeg libxml2 makeWrapper ];
 
   configurePhase = "cp config.mk.in config.mk";
 
+  preBuild = ''
+    export LDFLAGS=-lz
+    substituteInPlace "pm_config.in.h" \
+        --subst-var-by "rgbPath1" "$out/lib/rgb.txt" \
+        --subst-var-by "rgbPath2" "/var/empty/rgb.txt" \
+        --subst-var-by "rgbPath3" "/var/empty/rgb.txt"
+  '';
+
   installPhase = ''
     make package pkgdir=$PWD/netpbmpkg
     # Pass answers to the script questions
@@ -31,6 +41,11 @@ stdenv.mkDerivation {
     $out/man
     N
     EOF
+
+    # wrap any scripts that expect other programs in the package to be in their PATH
+    for prog in ppmquant; do
+        wrapProgram "$out/bin/$prog" --prefix PATH : "$out/bin"
+    done
   '';
 
   meta = {
diff --git a/pkgs/tools/misc/grub/1.9x.nix b/pkgs/tools/misc/grub/1.9x.nix
index 5f24aae7b05..87235a60eea 100644
--- a/pkgs/tools/misc/grub/1.9x.nix
+++ b/pkgs/tools/misc/grub/1.9x.nix
@@ -16,7 +16,17 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ bison ncurses libusb freetype ];
 
-  patchPhase =
+  patches =
+    [ # The udev rules for LVM create symlinks in /dev/mapper rathe
+      # than device nodes, causing GRUB to fail to recognize LVM
+      # volumes. See
+      # http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=550704
+      # This ugly workaround makes `find_root_device' use stat() on
+      # files in /dev/mapper instead of lstat().
+      ./device-mapper-symlinks.patch
+    ];
+
+  postPatch =
     '' gunzip < "${unifont_bdf}" > "unifont.bdf"
        sed -i "configure" \
            -e "s|/usr/src/unifont.bdf|$PWD/unifont.bdf|g"
diff --git a/pkgs/tools/misc/grub/device-mapper-symlinks.patch b/pkgs/tools/misc/grub/device-mapper-symlinks.patch
new file mode 100644
index 00000000000..0a21a51de79
--- /dev/null
+++ b/pkgs/tools/misc/grub/device-mapper-symlinks.patch
@@ -0,0 +1,28 @@
+Only in grub-1.97.1-orig/: grub-1.97.1
+diff -rc -x '*~' grub-1.97.1-orig/util/getroot.c grub-1.97.1/util/getroot.c
+*** grub-1.97.1-orig/util/getroot.c	2009-11-09 16:48:16.000000000 +0100
+--- grub-1.97.1/util/getroot.c	2010-01-08 00:26:12.000000000 +0100
+***************
+*** 217,224 ****
+  	continue;
+  
+        if (S_ISLNK (st.st_mode))
+! 	/* Don't follow symbolic links.  */
+! 	continue;
+  
+        if (S_ISDIR (st.st_mode))
+  	{
+--- 217,229 ----
+  	continue;
+  
+        if (S_ISLNK (st.st_mode))
+!         {
+!           if (strcmp(dir, "mapper") != 0)
+!             /* Don't follow symbolic links.  */
+!             continue;
+!           if (stat (ent->d_name, &st) < 0)
+!             continue;
+!         }
+  
+        if (S_ISDIR (st.st_mode))
+  	{
diff --git a/pkgs/tools/misc/parted/default.nix b/pkgs/tools/misc/parted/default.nix
index f66e44b3a31..55469357122 100644
--- a/pkgs/tools/misc/parted/default.nix
+++ b/pkgs/tools/misc/parted/default.nix
@@ -1,11 +1,11 @@
-{ stdenv, fetchurl, devicemapper, libuuid, gettext, readline }:
+{ stdenv, fetchurl, devicemapper, libuuid, gettext, readline, utillinuxng }:
 
 stdenv.mkDerivation rec {
-  name = "parted-1.9.0";
+  name = "parted-2.1";
 
   src = fetchurl {
     url = "mirror://gnu/parted/${name}.tar.gz";
-    sha256 = "02amqpzl8lgk247cjsbaz1nsiz9i1pbj0adx0z109h94p90i48sk";
+    sha256 = "1jc49lv0mglqdvrrh06vfqqmpa0cxczzmd2by6mlpxpblpgrb22a";
   };
 
   buildInputs = [ libuuid gettext readline libuuid devicemapper ];
@@ -21,7 +21,8 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  patches = [ ./t7000-scripting.patch ];
+  # The `t0400-loop-clobber-infloop.sh' test wants `mkswap'.
+  preCheck = "export PATH=\"${utillinuxng}/sbin:$PATH\"";
 
   meta = {
     description = "GNU Parted, a tool to create, destroy, resize, check, and copy partitions";
diff --git a/pkgs/tools/misc/parted/t7000-scripting.patch b/pkgs/tools/misc/parted/t7000-scripting.patch
deleted file mode 100644
index 9290e5cd16f..00000000000
--- a/pkgs/tools/misc/parted/t7000-scripting.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-This patch fixes the `t7000-scripting' test.  See
-http://lists.alioth.debian.org/pipermail/parted-devel/2009-June/thread.html#2887
-for details.
-
---- parted-1.9.0/tests/t7000-scripting.sh	2009-07-23 19:52:08.000000000 +0200
-+++ parted-1.9.0/tests/t7000-scripting.sh	2009-07-26 14:20:28.000000000 +0200
-@@ -28,7 +28,7 @@ EOF
- 
- { emit_superuser_warning
-   sed s/Error/Warning/ errS
--  printf 'Is this still acceptable to you?\nYes/No?'; } >> errI || fail=1
-+  printf 'Is this still acceptable to you?\nYes/No? n\n'; } >> errI || fail=1
- 
- for mkpart in mkpart mkpartfs; do
- 
diff --git a/pkgs/tools/networking/inetutils/default.nix b/pkgs/tools/networking/inetutils/default.nix
index 37c5f8db71d..2b164dcc223 100644
--- a/pkgs/tools/networking/inetutils/default.nix
+++ b/pkgs/tools/networking/inetutils/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
   postInstall = ''
     # XXX: These programs are normally installed setuid but since it
     # fails, they end up being non-executable, hence this hack.
-    chmod +x $out/bin/{ping,ping6,rcp,rlogin,rsh}
+    chmod +x $out/bin/{ping,ping6,rcp,rlogin,rsh,traceroute}
   '';
 
   meta = {
diff --git a/pkgs/tools/networking/socat/default.nix b/pkgs/tools/networking/socat/default.nix
index 7669a9b2d32..163db7c84e4 100644
--- a/pkgs/tools/networking/socat/default.nix
+++ b/pkgs/tools/networking/socat/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, openssl }:
 
 stdenv.mkDerivation rec {
-  name = "socat-1.6.0.1";
+  name = "socat-1.7.1.1";
   
   src = fetchurl {
     url = "http://www.dest-unreach.org/socat/download/${name}.tar.bz2";
-    sha256 = "1cl7kf0rnbvjxz8vdkmdh1crd069qmz1jjw40r8bydgpn0nsh6qd";
+    sha256 = "055a57lv2rgr6jvb76444ywhfbg9bzc9hainyk5d4cbpb4ws3pxv";
   };
 
   buildInputs = [openssl];
diff --git a/pkgs/tools/networking/wicd/default.nix b/pkgs/tools/networking/wicd/default.nix
new file mode 100644
index 00000000000..52bbf7d7a1f
--- /dev/null
+++ b/pkgs/tools/networking/wicd/default.nix
@@ -0,0 +1,79 @@
+{stdenv, fetchurl, python, pygobject, pycairo, pyGtkGlade, pythonDBus, 
+ wpa_supplicant, dhcp, wirelesstools, nettools, iproute,
+ locale ? "C" }:
+
+# Wicd has a ncurses interface that we do not build because it depends
+# on urwid which has not been packaged at this time (2009-12-27).
+
+stdenv.mkDerivation rec {
+  name = "wicd-1.6.2.2";
+  
+  src = fetchurl {
+    url = "mirror://sourceforge/wicd/files/wicd-stable/${name}/${name}.tar.bz2";
+    sha256 = "1gpjrlanz7rrzkchnpm1dgik333rz1fsg4c4046c5pwdfpp1crxr";
+  };
+
+  buildInputs = [ python ];
+
+  patches = [ ./no-var-install.patch ./pygtk.patch ./mkdir-networks.patch ];
+
+  # Should I be using pygtk's propogated build inputs?
+  postPatch = ''
+    sed -i "2iexport PATH=\$PATH\$\{PATH:+:\}${python}/bin:${wpa_supplicant}/sbin:${dhcp}/sbin:${wirelesstools}/sbin:${nettools}/sbin:${iproute}/sbin" in/scripts=wicd.in
+    sed -i "3iexport PYTHONPATH=\$PYTHONPATH\$\{PYTHONPATH:+:\}$(toPythonPath $out):$(toPythonPath ${pygobject})/gtk-2.0:$(toPythonPath ${pythonDBus})" in/scripts=wicd.in
+    sed -i "4iexport LC_ALL=\\\"${locale}\\\"" in/scripts=wicd.in
+    sed -i "2iexport PATH=\$PATH\$\{PATH:+:\}${python}/bin" in/scripts=wicd-client.in
+    sed -i "3iexport PYTHONPATH=\$PYTHONPATH\$\{PYTHONPATH:+:\}$(toPythonPath $out):$(toPythonPath ${pyGtkGlade})/gtk-2.0:$(toPythonPath ${pygobject})/gtk-2.0:$(toPythonPath ${pycairo}):$(toPythonPath ${pythonDBus})" in/scripts=wicd-client.in
+  '';
+
+  configurePhase = ''
+    python setup.py configure \
+    --lib=$out/lib/ \
+    --etc=/var/lib/wicd/ \
+    --share=$out/share/ \
+    --scripts=$out/etc/scripts/ \
+    --images=$out/share/pixmaps/ \
+    --encryption=$out/etc/encryption/templates/ \
+    --bin=$out/bin/ \
+    --sbin=$out/sbin/ \
+    --backends=$out/lib/backends/ \
+    --networks=/var/lib/wicd/configurations/ \
+    --resume=$out/etc/acpi/resume.d/ \
+    --suspend=$out/etc/acpi/suspend.d/ \
+    --pmutils=$out/lib/pm-utils/sleep.d/ \
+    --dbus=$out/etc/dbus-1/system.d/ \
+    --desktop=$out/share/applications/ \
+    --icons=$out/share/icons/hicolour/ \
+    --translations=$out/share/locale/ \
+    --autostart=$out/etc/xdg/autostart/ \
+    --varlib=$out/share/ \
+    --docdir=$out/share/doc/ \
+    --mandir=$out/share/man/ \
+    --kdedir=$out/share/autostart/ \
+    --python=${python}/bin/python \
+    --distro=nix \
+    --wicdgroup=users \
+    --no-install-init \
+    --no-install-kde \
+    --no-install-acpi \
+    --no-install-pmutils \
+    --no-install-ncurses \
+  '';
+
+  installPhase = ''python setup.py install --prefix=$out'';
+
+  meta = {
+    homepage = http://wicd.net/;
+    description = "A wiredless and wired network manager";
+    longDescription=''
+      A complete network connection manager
+      Wicd supports wired and wireless networks, and capable of
+      creating and tracking profiles for both.  It has a
+      template-based wireless encryption system, which allows the user
+      to easily add encryption methods used.  It ships with some common
+      encryption types, such as WPA and WEP. Wicd will automatically
+      connect at startup to any preferred network within range.
+    '';
+    license="GPLv2";
+  };
+}
diff --git a/pkgs/tools/networking/wicd/mkdir-networks.patch b/pkgs/tools/networking/wicd/mkdir-networks.patch
new file mode 100644
index 00000000000..df3f0487d1d
--- /dev/null
+++ b/pkgs/tools/networking/wicd/mkdir-networks.patch
@@ -0,0 +1,11 @@
+wicd normally makes the NETWORKS directory at install time, but we cannot do that,
+so we make it at runtime instead.
+
+--- wicd-1.6.2.2/in/scripts=wicd.in	2009-09-01 11:05:31.000000000 -0400
++++ wicd-1.6.2.2/in/scripts=wicd.in	2010-01-04 18:01:57.000000000 -0500
+@@ -1,3 +1,5 @@
+ #!/bin/bash
+ 
++mkdir -p %NETWORKS%
++
+ exec python -O %LIB%wicd-daemon.py $@
diff --git a/pkgs/tools/networking/wicd/no-var-install.patch b/pkgs/tools/networking/wicd/no-var-install.patch
new file mode 100644
index 00000000000..9ab5a0520d9
--- /dev/null
+++ b/pkgs/tools/networking/wicd/no-var-install.patch
@@ -0,0 +1,21 @@
+The install tries to create files in /var.  This patch removes those steps.

+

+--- wicd-1.6.2.2/setup.py	2009-09-01 11:05:31.000000000 -0400

++++ wicd-1.6.2.2/setup.py	2009-12-27 21:27:57.000000000 -0500

+@@ -464,8 +464,6 @@

+     data = [

+     (wpath.dbus, ['other/wicd.conf']),

+     (wpath.desktop, ['other/wicd.desktop']),

+-    (wpath.log, []), 

+-    (wpath.etc, []),

+     (wpath.icons + 'scalable/apps/', ['icons/scalable/wicd-client.svg']),

+     (wpath.icons + '192x192/apps/', ['icons/192px/wicd-client.png']),

+     (wpath.icons + '128x128/apps/', ['icons/128px/wicd-client.png']),

+@@ -481,7 +479,6 @@

+     (wpath.images, [('images/' + b) for b in os.listdir('images') if not b.startswith('.')]),

+     (wpath.encryption, [('encryption/templates/' + b) for b in 

+                         os.listdir('encryption/templates') if not b.startswith('.')]),

+-    (wpath.networks, []),

+     (wpath.bin, ['scripts/wicd-client', ]), 

+     (wpath.sbin,  ['scripts/wicd', ]),  

+     (wpath.share, ['data/wicd.glade', ]),

diff --git a/pkgs/tools/networking/wicd/pygtk.patch b/pkgs/tools/networking/wicd/pygtk.patch
new file mode 100644
index 00000000000..e72228f75a5
--- /dev/null
+++ b/pkgs/tools/networking/wicd/pygtk.patch
@@ -0,0 +1,15 @@
+For some reason nix's pygtk doesn't have a pygtk module so we remove the version check.
+If this ever changes we could remove this patch.
+
+--- wicd-1.6.2.2/wicd/wicd-client.py	2009-09-01 11:05:31.000000000 -0400
++++ wicd-1.6.2.2/wicd/wicd-client.py	2009-12-28 00:22:57.000000000 -0500
+@@ -43,9 +43,6 @@
+ import atexit
+ from dbus import DBusException
+ 
+-import pygtk
+-pygtk.require('2.0')
+-
+ HAS_NOTIFY = True
+ try:
+     import pynotify
diff --git a/pkgs/tools/security/ccid/default.nix b/pkgs/tools/security/ccid/default.nix
new file mode 100644
index 00000000000..896e034ee76
--- /dev/null
+++ b/pkgs/tools/security/ccid/default.nix
@@ -0,0 +1,26 @@
+{stdenv, fetchurl, pcsclite, pkgconfig, libusb, perl}:
+stdenv.mkDerivation {
+  name = "ccid-1.3.11";
+
+  src = fetchurl {
+    url = https://alioth.debian.org/frs/download.php/3080/ccid-1.3.11.tar.bz2;
+    sha256 = "01l9956wids087d38bprr8jqcl05j48cdp25k9q7vzran215mgzp";
+  };
+
+  patchPhase = ''
+    sed -i 's,/usr/bin/env perl,${perl}/bin/perl,' src/*.pl
+  '';
+  preConfigure = ''
+    configureFlags="$configureFlags --enable-usbdropdir=$out/pcsc/drivers"
+  '';
+
+  buildInputs = [ pcsclite pkgconfig libusb ];
+
+  meta = {
+    description = "ccid drivers for pcsclite";
+    homepage = http://pcsclite.alioth.debian.org/;
+    license = "GPLv2+";
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/tools/security/muscleframework/default.nix b/pkgs/tools/security/muscleframework/default.nix
new file mode 100644
index 00000000000..e2a87119dd9
--- /dev/null
+++ b/pkgs/tools/security/muscleframework/default.nix
@@ -0,0 +1,30 @@
+# The tarball has different plugins in it, and as I don't need all of them,
+# I only build one of those in this derivation
+# This is an arbitrary decision, and this simplicity fit my needs.
+# Anyone can extend the extension to build all the plugins, or to make
+# different derivations for each plugin.
+
+{stdenv, fetchurl, libmusclecard, pkgconfig, pcsclite}:
+stdenv.mkDerivation {
+  name = "muscleframework-mcardplugin-1.1.7";
+
+  src = fetchurl {
+    url = https://alioth.debian.org/frs/download.php/3056/muscleframework-1.1.7.tar.gz;
+    sha256 = "081sq25fa3k1gz0asq2995krx7pzxbfq5vx1ahsd5sbmwnplv94v";
+  };
+
+  preConfigure = ''
+    cd MCardPlugin
+    configureFlags="$configureFlags --enable-muscledropdir=$out/pcsc/services"
+  '';
+
+  buildInputs = [ libmusclecard pkgconfig pcsclite];
+
+  meta = {
+    description = "MUSCLE smart card framework - mcard plugin";
+    homepage = http://muscleplugins.alioth.debian.org/;
+    license = "BSD";
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/tools/security/muscletool/default.nix b/pkgs/tools/security/muscletool/default.nix
new file mode 100644
index 00000000000..c9648fbe404
--- /dev/null
+++ b/pkgs/tools/security/muscletool/default.nix
@@ -0,0 +1,19 @@
+{stdenv, fetchurl, libmusclecard, pcsclite, pkgconfig }:
+stdenv.mkDerivation {
+  name = "muscletool-2.1.1";
+
+  src = fetchurl {
+    url = https://alioth.debian.org/frs/download.php/3180/muscletool-2.1.1.tar.bz2;
+    sha256 = "11d812ijvhsaxwkr05hzxfl0n6ji9hwl5j1kv56f9gv8kyy3b9kw";
+  };
+
+  buildInputs = [ libmusclecard pcsclite pkgconfig ];
+
+  meta = {
+    description = "Smart card applications for use with MUSCLE plugins";
+    homepage = http://muscleapps.alioth.debian.org/;
+    license = "BSD";
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/tools/security/opensc/0.11.7.nix b/pkgs/tools/security/opensc/0.11.7.nix
new file mode 100644
index 00000000000..52a4d2af19a
--- /dev/null
+++ b/pkgs/tools/security/opensc/0.11.7.nix
@@ -0,0 +1,26 @@
+{stdenv, fetchurl, libtool, readline, zlib, openssl, libiconv, pcsclite, libassuan, pkgconfig,
+libXt}:
+
+stdenv.mkDerivation rec {
+  name = "opensc-0.11.7";
+
+  src = fetchurl {
+    url = "http://www.opensc-project.org/files/opensc/${name}.tar.gz";
+    sha256 = "0781qi0bsm01wdhkb1vd3ra9wkwgyjcm2w87jb2r53msply2gavd";
+  };
+
+  configureFlags = [ "--enable-pcsc" "--enable-nsplugin"
+    "--with-pcsc-provider=${pcsclite}/lib/libpcsclite.so.1" ];
+
+  buildInputs = [ libtool readline zlib openssl pcsclite libassuan pkgconfig
+    libXt ] ++
+    stdenv.lib.optional (! stdenv.isLinux) libiconv;
+
+  meta = {
+    description = "Set of libraries and utilities to access smart cards";
+    homepage = http://www.opensc-project.org/opensc/;
+    license = "LGPL";
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/tools/security/pcsclite/default.nix b/pkgs/tools/security/pcsclite/default.nix
new file mode 100644
index 00000000000..03924858e06
--- /dev/null
+++ b/pkgs/tools/security/pcsclite/default.nix
@@ -0,0 +1,25 @@
+{stdenv, fetchurl, hal, pkgconfig, dbus}:
+stdenv.mkDerivation {
+  name = "pcsclite-1.5.5";
+
+  src = fetchurl {
+    url = https://alioth.debian.org/frs/download.php/3082/pcsc-lite-1.5.5.tar.bz2;
+    sha256 = "09pdf4dbzjh235zp6x7aiby266i7kmmmz6bjdyf9mzyyq7ryc785";
+  };
+
+  # The OS should care on preparing the drivers into this location
+  configureFlags = [ "--enable-usbdropdir=/var/lib/pcsc/drivers" ];
+
+  preConfigure = ''
+    configureFlags="$configureFlags --enable-confdir=$out/etc"
+  '';
+  buildInputs = [ hal pkgconfig dbus ];
+
+  meta = {
+    description = "Middleware to access a smart card using SCard API (PC/SC)";
+    homepage = http://pcsclite.alioth.debian.org/;
+    license = "BSD";
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/tools/system/fdisk/default.nix b/pkgs/tools/system/fdisk/default.nix
index 1b9e62f5d03..ddb162b4599 100644
--- a/pkgs/tools/system/fdisk/default.nix
+++ b/pkgs/tools/system/fdisk/default.nix
@@ -1,11 +1,11 @@
 { fetchurl, stdenv, parted, libuuid, gettext }:
 
 stdenv.mkDerivation rec {
-  name = "fdisk-1.2.3";
+  name = "fdisk-1.2.4";
 
   src = fetchurl {
     url = "mirror://gnu/fdisk/${name}.tar.bz2";
-    sha256 = "04nsa0xf1m5zy45wqv88ksk3xxc86r9n8f4mj3r6gm7rz0sfiqil";
+    sha256 = "17xl8xa1cwaxcdw49m1kqwralhac2y2z8nbx7mwlf28dpplvd9p0";
   };
 
   buildInputs = [ parted libuuid gettext ];
diff --git a/pkgs/tools/text/dos2unix/default.nix b/pkgs/tools/text/dos2unix/default.nix
new file mode 100644
index 00000000000..59fb08aad5f
--- /dev/null
+++ b/pkgs/tools/text/dos2unix/default.nix
@@ -0,0 +1,41 @@
+{stdenv, fetchurl}:
+
+stdenv.mkDerivation {
+  name = "dos2unix-2.2";
+  
+  src = fetchurl {
+    url = http://cvs.fedoraproject.org/repo/pkgs/dos2unix/dos2unix-3.1.tar.bz2/f90026a397cf787083ec2e4892c6dcdd/dos2unix-3.1.tar.bz2;
+    md5 = "f90026a397cf787083ec2e4892c6dcdd";
+  };
+  
+  patches = [
+    ./dos2unix-3.1.patch
+    ./dos2unix-3.1-segfault.patch
+    ./dos2unix-3.1-safeconv.patch
+    ./dos2unix-3.1-manpage-update-57507.patch
+    ./dos2unix-3.1-preserve-file-modes.patch
+    ./dos2unix-3.1-tmppath.patch
+    ./dos2unix-c-missing-arg.patch
+    ./dos2unix-missing-proto.patch
+    ./dos2unix-manpage.patch
+    ./dos2unix-preserve-file-modes.patch
+  ];
+
+  installPhase = ''
+    ensureDir $out/bin
+    ensureDir $out/share/man/man1
+    install -p -m755 dos2unix $out/bin
+    install  -p -m644 dos2unix.1 $out/share/man/man1
+    ln -s dos2unix $out/bin/mac2unix
+  '';
+
+  buildPhase = ''
+    rm -f dos2unix
+    make dos2unix
+  '';
+
+  meta = {
+    homepage = http://unknown/;
+    description = "dos2unix tool";
+  };
+}
diff --git a/pkgs/tools/text/dos2unix/dos2unix-3.1-manpage-update-57507.patch b/pkgs/tools/text/dos2unix/dos2unix-3.1-manpage-update-57507.patch
new file mode 100644
index 00000000000..e27096666f2
--- /dev/null
+++ b/pkgs/tools/text/dos2unix/dos2unix-3.1-manpage-update-57507.patch
@@ -0,0 +1,238 @@
+Patch by Bill Anderson, to fix bug:
+	https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=57507
+
+
+
+Description of Problem:
+
+The dos2unix man page examples are confusing.
+For instance, one piece of text mentions "c.txt", but that file
+isn't used in the following example.
+
+
+
+--- dos2unix-3.1/dos2unix.1	2004-09-28 03:17:29.000000000 -0600
++++ dos2unix-3.1/dos2unix.1-new	2004-09-28 03:16:32.000000000 -0600
+@@ -1,123 +1,126 @@
+ .\" $$Id: dos2unix.1 2.2 1995/03/31 01:50:45 blin Exp blin $$
+-.TH dos2unix 1 "dos2unix v3.0" "1995.03.31"
+-
+-.SH NAME
+-
++.\" 
++.TH "dos2unix" "1" "dos2unix v3.0" "1995.03.31" ""
++.SH "NAME"
+ dos2unix \- DOS/MAC to UNIX text file format converter
+ 
+-.SH SYNOPSYS
+-
+-dos2unix [options] [-c convmode] [-o file ...] [-n infile outfile ...]
+-.PP
++.SH "SYNOPSYS"
++dos2unix [options] [\-c convmode] [\-o file ...] [\-n infile outfile ...]
++.PP 
+ Options:
+-.PP
+-[-hkqV] [--help] [--keepdate] [--quiet] [--version]
+-
+-.SH DESCRIPTION
++.PP 
++[\-hkqV] [\-\-help] [\-\-keepdate] [\-\-quiet] [\-\-version]
+ 
+-.PP
++.SH "DESCRIPTION"
++.PP 
+ This manual page documents dos2unix, the program that converts plain text
+ files in DOS/MAC format to UNIX format.
+ 
+-.SH OPTIONS
+-
++.SH "OPTIONS"
+ The following options are available:
+-.TP
+-.B \-h --help
++.TP 
++.B \-h \-\-help
+ Print online help.
+ 
+-.TP
+-.B \-k --keepdate
++.TP 
++.B \-k \-\-keepdate
+ Keep the date stamp of output file same as input file.
+ 
+-.TP
+-.B \-q --quiet
++.TP 
++.B \-q \-\-quiet
+ Quiet mode. Suppress all warning and messages.
+ 
+-.TP
+-.B \-V --version
++.TP 
++.B \-V \-\-version
+ Prints version information.
+ 
+-.TP
+-.B \-c --convmode convmode
+-Sets conversion mode. Simulates dos2unix under SunOS.
++.TP 
++.B \-c \-\-convmode convmode
++Sets conversion mode. Where convmode is one of:
++.B ASCII, 7bit, ISO, Mac
++with ASCII being the default.
++Simulates dos2unix under SunOS.
++
++
+ 
+-.TP
+-.B \-o --oldfile file ...
++.TP 
++.B \-o \-\-oldfile file ...
+ Old file mode. Convert the file and write output to it. The program 
+ default to run in this mode. Wildcard names may be used.
+ 
+-.TP
+-.B \-n --newfile infile outfile ...
++.TP 
++.B \-n \-\-newfile infile outfile ...
+ New file mode. Convert the infile and write output to outfile. File names
+ must be given in pairs and wildcard names should NOT be used or you WILL 
+ lost your files. 
+ 
+-.SH EXAMPLES
+-
+-.LP
++.SH "EXAMPLES"
++.LP 
+ Get input from stdin and write output to stdout.
+-.IP
++.IP 
+ .B dos2unix
+ 
+-.LP
++.LP 
+ Convert and replace a.txt. Convert and replace b.txt.
+-.IP
++.IP 
+ .B dos2unix a.txt b.txt
+-.IP
+-.B dos2unix -o a.txt b.txt
++.IP 
++.B dos2unix \-o a.txt b.txt
+ 
+-.LP
++.LP 
+ Convert and replace a.txt in ASCII conversion mode. 
++.IP 
++.B dos2unix a.txt \-c iso b.txt
++
++.LP 
+ Convert and replace b.txt in ISO conversion mode.
++.IP 
++.B dos2unix \-c ascii a.txt \-c iso b.txt
++
++.LP 
+ Convert c.txt from Mac to Unix ascii format.
+-.IP
+-.B dos2unix a.txt -c iso b.txt
+-.IP
+-.B dos2unix -c ascii a.txt -c iso b.txt
+-.IP
+-.B dos2unix -c mac a.txt  b.txt
+ 
+-.LP
++.IP 
++.B dos2unix \-c mac c.txt  b.txt
++
++.LP 
+ Convert and replace a.txt while keeping original date stamp.
+-.IP
+-.B dos2unix -k a.txt
+-.IP
+-.B dos2unix -k -o a.txt
++.IP 
++.B dos2unix \-k a.txt
++.IP 
++.B dos2unix \-k \-o a.txt
+ 
+-.LP
++.LP 
+ Convert a.txt and write to e.txt.
+-.IP
+-.B dos2unix -n a.txt e.txt
++.IP 
++.B dos2unix \-n a.txt e.txt
+ 
+-.LP
++.LP 
+ Convert a.txt and write to e.txt, keep date stamp of e.txt same as a.txt.
+-.IP
+-.B dos2unix -k -n a.txt e.txt 
++.IP 
++.B dos2unix \-k \-n a.txt e.txt 
+ 
+-.LP
++.LP 
+ Convert and replace a.txt. Convert b.txt and write to e.txt.
+-.IP
+-.B dos2unix a.txt -n b.txt e.txt
+-.IP
+-.B dos2unix -o a.txt -n b.txt e.txt
++.IP 
++.B dos2unix a.txt \-n b.txt e.txt
++.IP 
++.B dos2unix \-o a.txt \-n b.txt e.txt
+ 
+-.LP
++.LP 
+ Convert c.txt and write to e.txt. Convert and replace a.txt.
+ Convert and replace b.txt. Convert d.txt and write to f.txt.
+-.IP
+-.B dos2unix -n c.txt e.txt -o a.txt b.txt -n d.txt f.txt
++.IP 
++.B dos2unix \-n c.txt e.txt \-o a.txt b.txt \-n d.txt f.txt
+ 
+-.SH DIAGNOSTICS
+-
+-.SH BUGS
++.SH "DIAGNOSTICS"
+ 
++.SH "BUGS"
+ The program does not work properly under MSDOS in stdio processing mode. 
+ If you know why is that so, please tell me.
+ 
+-.SH AUTHORS
+-
+-Benjamin Lin -
++.SH "AUTHORS"
++Benjamin Lin \-
+ .B <blin@socs.uts.edu.au>
+ 
+ 
+@@ -125,18 +128,17 @@
+ .B <wuebben@kde.org>
+ 
+ 
+-.SH MISCELLANY
+-
++.SH "MISCELLANY"
+ Tested environment:
+-.IP
++.IP 
+ Linux 1.2.0 with GNU C 2.5.8
+-.IP
++.IP 
+ SunOS 4.1.3 with GNU C 2.6.3
+-.IP
+-MS-DOS 6.20 with Borland C++ 4.02
+-.PP
++.IP 
++MS\-DOS 6.20 with Borland C++ 4.02
++.PP 
+ Suggestions and bug reports are welcome.
+ 
+-.SH SEE ALSO
++.SH "SEE ALSO"
+ unix2dos(1) mac2unix(1)
+ 
diff --git a/pkgs/tools/text/dos2unix/dos2unix-3.1-preserve-file-modes.patch b/pkgs/tools/text/dos2unix/dos2unix-3.1-preserve-file-modes.patch
new file mode 100644
index 00000000000..7e8f3bdd55d
--- /dev/null
+++ b/pkgs/tools/text/dos2unix/dos2unix-3.1-preserve-file-modes.patch
@@ -0,0 +1,28 @@
+--- dos2unix-3.1/dos2unix.c.mode	2003-05-21 08:09:08.000000000 -0700
++++ dos2unix-3.1/dos2unix.c	2003-05-21 08:09:56.000000000 -0700
+@@ -345,11 +345,14 @@ int ConvertDosToUnixOldFile(char* ipInFN
+   char TempPath[16];
+   struct stat StatBuf;
+   struct utimbuf UTimeBuf;
++  mode_t mode = S_IRUSR | S_IWUSR;
+   int fd;
+ 
+   /* retrieve ipInFN file date stamp */
+-  if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf))
++  if (stat(ipInFN, &StatBuf))
+     RetVal = -1;
++  else
++    mode = StatBuf.st_mode;
+ 
+   strcpy (TempPath, "./u2dtmpXXXXXX");
+   if((fd=mkstemp (TempPath))<0) {
+@@ -357,6 +360,9 @@ int ConvertDosToUnixOldFile(char* ipInFN
+ 	  RetVal = -1;
+   }
+ 
++  if (!RetVal && fchmod (fd, mode) && fchmod (fd, S_IRUSR | S_IWUSR))
++    RetVal = -1;
++
+ #ifdef DEBUG
+   fprintf(stderr, "dos2unix: using %s as temp file\n", TempPath);
+ #endif DEBUG
diff --git a/pkgs/tools/text/dos2unix/dos2unix-3.1-safeconv.patch b/pkgs/tools/text/dos2unix/dos2unix-3.1-safeconv.patch
new file mode 100644
index 00000000000..11998be1fdd
--- /dev/null
+++ b/pkgs/tools/text/dos2unix/dos2unix-3.1-safeconv.patch
@@ -0,0 +1,88 @@
+* Fix http://bugzilla.redhat.com/57508 (make dos2unix not modify Mac
+  files unless in mac2unix mode)
+* Make mac2unix mode not create duplicate Unix line delimiters when
+  run on a DOS file. (mschwendt@users.sf.net)
+
+diff -Nur dos2unix-3.1-orig/dos2unix.c dos2unix-3.1/dos2unix.c
+--- dos2unix-3.1-orig/dos2unix.c	1998-11-19 13:19:25.000000000 +0100
++++ dos2unix-3.1/dos2unix.c	2004-09-26 20:57:41.606587616 +0200
+@@ -153,6 +153,24 @@
+ }
+ 
+ 
++void StripDelimiter(FILE* ipInF, FILE* ipOutF, CFlag *ipFlag, int CurChar)
++{
++  int TempNextChar;
++  /* Don't modify Mac files when in dos2unix mode. */
++  if ( (TempNextChar = getc(ipInF)) != EOF) {
++    ungetc( TempNextChar, ipInF );  /* put back peek char */
++    if ( TempNextChar != '\x0a' ) {
++      putc( CurChar, ipOutF );  /* Mac line, put back CR */
++    }
++  }
++  else if ( CurChar == '\x0d' ) {  /* EOF: last Mac line delimiter (CR)? */
++    putc( CurChar, ipOutF );
++  }
++  if (ipFlag->NewLine) {  /* add additional LF? */
++    putc('\n', ipOutF);
++  }
++}
++
+ /* converts stream ipInF to UNIX format text and write to stream ipOutF
+  * RetVal: 0  if success
+  *         -1  otherwise
+@@ -161,6 +179,7 @@
+ {
+     int RetVal = 0;
+     int TempChar;
++    int TempNextChar;
+     
+     if ( macmode )
+       ipFlag->ConvMode = 3;
+@@ -177,9 +196,7 @@
+ 		break;
+ 	      } 
+ 	    } else {
+-	      if (ipFlag->NewLine) {
+-		putc('\n', ipOutF);
+-	      }
++	      StripDelimiter( ipInF, ipOutF, ipFlag, TempChar );
+ 	    }
+ 	  }
+ 	  break;
+@@ -193,9 +210,7 @@
+ 		break;
+ 	      }
+ 	    } else {
+-	      if (ipFlag->NewLine) {
+-		putc('\n', ipOutF);
+-	      }
++	      StripDelimiter( ipInF, ipOutF, ipFlag, TempChar );
+ 	    }
+ 	  }
+ 	  break;
+@@ -209,9 +224,7 @@
+ 		break;
+ 	      }
+ 	    } else {
+-	      if (ipFlag->NewLine) {
+-		putc('\n', ipOutF);
+-	      }
++	      StripDelimiter( ipInF, ipOutF, ipFlag, TempChar );
+ 	    }
+ 	  }
+ 	  break;
+@@ -227,6 +240,13 @@
+ 		}
+ 	      }
+ 	    else{
++	      if ( (TempNextChar = getc(ipInF)) != EOF) {
++		ungetc( TempNextChar, ipInF );  /* put back peek char */
++		/* Don't touch this delimiter if it's a CR,LF pair. */
++		if ( TempNextChar == '\x0a' ) {
++		  continue;
++		}
++	      }
+ 	      if (putc('\x0a', ipOutF) == EOF)
+ 		{
+ 		  RetVal = -1;
diff --git a/pkgs/tools/text/dos2unix/dos2unix-3.1-segfault.patch b/pkgs/tools/text/dos2unix/dos2unix-3.1-segfault.patch
new file mode 100644
index 00000000000..7c8391bd2bd
--- /dev/null
+++ b/pkgs/tools/text/dos2unix/dos2unix-3.1-segfault.patch
@@ -0,0 +1,93 @@
+--- dos2unix-3.1/dos2unix.c.segf	Thu Jan 17 17:27:42 2002
++++ dos2unix-3.1/dos2unix.c	Thu Jan 17 17:28:07 2002
+@@ -147,9 +147,9 @@
+  * RetVal: NULL if failure
+  *         file stream otherwise
+  */
+-FILE* OpenOutFile(char *ipFN)
++FILE* OpenOutFile(int fd)
+ {
+-  return (fopen(ipFN, W_CNTRL));
++  return (fdopen(fd, W_CNTRL));
+ }
+ 
+ 
+@@ -260,14 +260,17 @@
+   char TempPath[16];
+   struct stat StatBuf;
+   struct utimbuf UTimeBuf;
++  int fd;
+ 
+   /* retrieve ipInFN file date stamp */
+   if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf))
+     RetVal = -1;
+ 
+-  strcpy (TempPath, "./d2utmp");
+-  strcat (TempPath, "XXXXXX");
+-  mkstemp (TempPath);
++  strcpy (TempPath, "./d2utmpXXXXXX");
++  if((fd=mkstemp (TempPath))<0) {
++	  perror("Failed to open output temp file");
++	  RetVal = -1;
++  }
+ 
+ #ifdef DEBUG
+   fprintf(stderr, "dos2unix: using %s as temp file\n", TempPath);
+@@ -278,7 +281,7 @@
+     RetVal = -1;
+ 
+   /* can open out file? */
+-  if ((!RetVal) && (InF) && ((TempF=OpenOutFile(TempPath)) == NULL))
++  if ((!RetVal) && (InF) && ((TempF=OpenOutFile(fd)) == NULL))
+   {
+     fclose (InF);
+     RetVal = -1;
+@@ -295,6 +298,8 @@
+   /* can close out file? */
+   if ((TempF) && (fclose(TempF) == EOF))
+     RetVal = -1;
++  if(fd>=0)
++	  close(fd);
+ 
+   if ((!RetVal) && (ipFlag->KeepDate))
+   {
+@@ -340,14 +345,17 @@
+   char TempPath[16];
+   struct stat StatBuf;
+   struct utimbuf UTimeBuf;
++  int fd;
+ 
+   /* retrieve ipInFN file date stamp */
+   if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf))
+     RetVal = -1;
+ 
+-  strcpy (TempPath, "./u2dtmp");
+-  strcat (TempPath, "XXXXXX");
+-  mkstemp (TempPath);
++  strcpy (TempPath, "./u2dtmpXXXXXX");
++  if((fd=mkstemp (TempPath))<0) {
++	  perror("Failed to open output temp file");
++	  RetVal = -1;
++  }
+ 
+ #ifdef DEBUG
+   fprintf(stderr, "dos2unix: using %s as temp file\n", TempPath);
+@@ -358,7 +366,7 @@
+     RetVal = -1;
+ 
+   /* can open out file? */
+-  if ((!RetVal) && (InF) && ((TempF=OpenOutFile(TempPath)) == NULL))
++  if ((!RetVal) && (InF) && ((TempF=OpenOutFile(fd)) == NULL))
+   {
+     fclose (InF);
+     RetVal = -1;
+@@ -376,6 +384,9 @@
+   if ((TempF) && (fclose(TempF) == EOF))
+     RetVal = -1;
+ 
++  if(fd>=0)
++	  close(fd);
++
+   if ((!RetVal) && (ipFlag->KeepDate))
+   {
+     UTimeBuf.actime = StatBuf.st_atime;
diff --git a/pkgs/tools/text/dos2unix/dos2unix-3.1-tmppath.patch b/pkgs/tools/text/dos2unix/dos2unix-3.1-tmppath.patch
new file mode 100644
index 00000000000..6db6c84e04a
--- /dev/null
+++ b/pkgs/tools/text/dos2unix/dos2unix-3.1-tmppath.patch
@@ -0,0 +1,141 @@
+--- dos2unix-3.1/dos2unix.c.tmppath	2004-10-20 16:00:00.342561008 +0200
++++ dos2unix-3.1/dos2unix.c	2004-10-20 16:01:42.210074792 +0200
+@@ -69,6 +69,7 @@
+ #ifdef __MSDOS__
+ #  include <dir.h>
+ #endif __MSDOS__
++#include <libgen.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+@@ -267,6 +268,39 @@
+     return RetVal;
+ }
+ 
++static int MakeTempFileFrom(const char *OutFN, char **fname_ret)
++{
++  char *cpy = strdup(OutFN);
++  char *dir = NULL;
++  size_t fname_len = 0;
++  char  *fname_str = NULL;
++  int fd = -1;
++  
++  *fname_ret = NULL;
++  
++  if (!cpy)
++    goto make_failed;
++  
++  dir = dirname(cpy);
++  
++  fname_len = strlen(dir) + strlen("/d2utmpXXXXXX") + sizeof (char);
++  if (!(fname_str = malloc(fname_len)))
++    goto make_failed;
++  sprintf(fname_str, "%s%s", dir, "/d2utmpXXXXXX");
++  *fname_ret = fname_str;
++  
++  free(cpy);
++  
++  if ((fd = mkstemp(fname_str)) == -1)
++    goto make_failed;
++  
++  return (fd);
++  
++ make_failed:
++  free(*fname_ret);
++  *fname_ret = NULL;
++  return (-1);
++}
+ 
+ /* convert file ipInFN to UNIX format text and write to file ipOutFN
+  * RetVal: 0 if success
+@@ -277,7 +311,7 @@
+   int RetVal = 0;
+   FILE *InF = NULL;
+   FILE *TempF = NULL;
+-  char TempPath[16];
++  char *TempPath;
+   struct stat StatBuf;
+   struct utimbuf UTimeBuf;
+   int fd;
+@@ -286,8 +320,7 @@
+   if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf))
+     RetVal = -1;
+ 
+-  strcpy (TempPath, "./d2utmpXXXXXX");
+-  if((fd=mkstemp (TempPath))<0) {
++  if((fd = MakeTempFileFrom(ipOutFN, &TempPath))<0) {
+ 	  perror("Failed to open output temp file");
+ 	  RetVal = -1;
+   }
+@@ -304,6 +337,7 @@
+   if ((!RetVal) && (InF) && ((TempF=OpenOutFile(fd)) == NULL))
+   {
+     fclose (InF);
++    InF = NULL;
+     RetVal = -1;
+   }
+ 
+@@ -337,9 +371,6 @@
+   /* can rename temp file to out file? */
+   if (!RetVal)
+   {
+-    if (stat(ipOutFN, &StatBuf) == 0)
+-      unlink(ipOutFN);
+-
+     if ((rename(TempPath, ipOutFN) == -1) && (!ipFlag->Quiet))
+     {
+       fprintf(stderr, "dos2unix: problems renaming '%s' to '%s'\n", TempPath, ipOutFN);
+@@ -347,6 +378,7 @@
+       RetVal = -1;
+     }
+   }
++  free(TempPath);
+   return RetVal;
+ }
+ 
+@@ -362,7 +394,7 @@
+   int RetVal = 0;
+   FILE *InF = NULL;
+   FILE *TempF = NULL;
+-  char TempPath[16];
++  char *TempPath;
+   struct stat StatBuf;
+   struct utimbuf UTimeBuf;
+   mode_t mode = S_IRUSR | S_IWUSR;
+@@ -374,8 +406,7 @@
+   else
+     mode = StatBuf.st_mode;
+ 
+-  strcpy (TempPath, "./u2dtmpXXXXXX");
+-  if((fd=mkstemp (TempPath))<0) {
++  if((fd = MakeTempFileFrom(ipInFN, &TempPath))<0) {
+ 	  perror("Failed to open output temp file");
+ 	  RetVal = -1;
+   }
+@@ -395,6 +426,7 @@
+   if ((!RetVal) && (InF) && ((TempF=OpenOutFile(fd)) == NULL))
+   {
+     fclose (InF);
++    InF = NULL;
+     RetVal = -1;
+   }
+ 
+@@ -422,10 +454,6 @@
+       RetVal = -1;
+   }
+ 
+-  /* can delete in file? */
+-  if ((!RetVal) && (unlink(ipInFN) == -1))
+-    RetVal = -1;
+-
+   /* any error? */
+   if ((RetVal) && (unlink(TempPath)))
+     RetVal = -1;
+@@ -440,6 +468,7 @@
+     }
+     RetVal = -1;
+   }
++  free(TempPath);
+   return RetVal;
+ }
+ 
diff --git a/pkgs/tools/text/dos2unix/dos2unix-3.1.patch b/pkgs/tools/text/dos2unix/dos2unix-3.1.patch
new file mode 100644
index 00000000000..5f823b2e7a9
--- /dev/null
+++ b/pkgs/tools/text/dos2unix/dos2unix-3.1.patch
@@ -0,0 +1,49 @@
+--- dos2unix-3.1/Makefile.orig	Thu Nov 19 07:09:38 1998
++++ dos2unix-3.1/Makefile	Fri Nov 17 13:25:35 2000
+@@ -1,10 +1,12 @@
++CFLAGS=
++
+ default: dos2unix
+ 
+ all:	dos2unix link install
+ 
+ 
+ dos2unix:
+-	gcc -O dos2unix.c -o dos2unix
++	gcc $(CFLAGS) dos2unix.c -o dos2unix
+ 
+ 
+ link:	
+@@ -12,11 +14,10 @@
+ 	ln -s dos2unix.1 mac2unix.1		
+ 
+ clean:
+-	rm dos2unix
++	rm -f dos2unix mac2unix mac2unix.1 *~ *.orig core
+ 
+ install:
+ 	install -m 755 dos2unix /usr/local/bin
+ 	install -m 644 dos2unix.1 /usr/local/man/man1
+ 	install -m 755 mac2unix /usr/local/bin
+ 	install -m 644 mac2unix.1 /usr/local/man/man1
+-
+--- dos2unix-3.1/dos2unix.c.orig	Thu Nov 19 07:19:25 1998
++++ dos2unix-3.1/dos2unix.c	Fri Nov 17 13:25:25 2000
+@@ -267,7 +267,7 @@
+ 
+   strcpy (TempPath, "./d2utmp");
+   strcat (TempPath, "XXXXXX");
+-  mktemp (TempPath);
++  mkstemp (TempPath);
+ 
+ #ifdef DEBUG
+   fprintf(stderr, "dos2unix: using %s as temp file\n", TempPath);
+@@ -347,7 +347,7 @@
+ 
+   strcpy (TempPath, "./u2dtmp");
+   strcat (TempPath, "XXXXXX");
+-  mktemp (TempPath);
++  mkstemp (TempPath);
+ 
+ #ifdef DEBUG
+   fprintf(stderr, "dos2unix: using %s as temp file\n", TempPath);
diff --git a/pkgs/tools/text/dos2unix/dos2unix-c-missing-arg.patch b/pkgs/tools/text/dos2unix/dos2unix-c-missing-arg.patch
new file mode 100644
index 00000000000..ff63e67134f
--- /dev/null
+++ b/pkgs/tools/text/dos2unix/dos2unix-c-missing-arg.patch
@@ -0,0 +1,42 @@
+diff -up dos2unix-3.1/dos2unix.c.c-missing-arg dos2unix-3.1/dos2unix.c
+--- dos2unix-3.1/dos2unix.c.c-missing-arg	2008-01-18 09:24:21.000000000 +0000
++++ dos2unix-3.1/dos2unix.c	2008-01-18 09:25:43.000000000 +0000
+@@ -533,19 +533,28 @@ int main (int argc, char *argv[])
+       
+       if ((strcmp(argv[ArgIdx],"-c") == 0) || (strcmp(argv[ArgIdx],"--convmode") == 0))
+       {
+-        ArgIdx++;
+-        if (strcmpi(argv[ArgIdx],"ASCII") == 0)
+-          pFlag->ConvMode = 0;
+-        else if (strcmpi(argv[ArgIdx], "7Bit") == 0)
+-          pFlag->ConvMode = 1;
+-        else if (strcmpi(argv[ArgIdx], "ISO") == 0)
+-          pFlag->ConvMode = 2;
+-        else if (strcmpi(argv[ArgIdx], "Mac") == 0)
+-          pFlag->ConvMode = 3;
++        if (++ArgIdx < argc)
++        {
++          if (strcmpi(argv[ArgIdx],"ASCII") == 0)
++            pFlag->ConvMode = 0;
++          else if (strcmpi(argv[ArgIdx], "7Bit") == 0)
++            pFlag->ConvMode = 1;
++          else if (strcmpi(argv[ArgIdx], "ISO") == 0)
++            pFlag->ConvMode = 2;
++          else if (strcmpi(argv[ArgIdx], "Mac") == 0)
++            pFlag->ConvMode = 3;
++          else
++          {
++            if (!pFlag->Quiet)
++              fprintf(stderr, "dos2unix: invalid %s conversion mode specified\n",argv[ArgIdx]);
++            ShouldExit = 1;
++          }
++        }
+         else
+         {
++          ArgIdx--;
+           if (!pFlag->Quiet)
+-            fprintf(stderr, "dos2unix: invalid %s conversion mode specified\n",argv[ArgIdx]);
++            fprintf(stderr,"dos2unix: option `%s' requires an argument\n",argv[ArgIdx]);
+           ShouldExit = 1;
+         }
+       }
diff --git a/pkgs/tools/text/dos2unix/dos2unix-manpage.patch b/pkgs/tools/text/dos2unix/dos2unix-manpage.patch
new file mode 100644
index 00000000000..f9e1e6701bc
--- /dev/null
+++ b/pkgs/tools/text/dos2unix/dos2unix-manpage.patch
@@ -0,0 +1,12 @@
+diff -up dos2unix-3.1/dos2unix.1.manpage dos2unix-3.1/dos2unix.1
+--- dos2unix-3.1/dos2unix.1.manpage	2008-09-08 09:58:46.000000000 +0100
++++ dos2unix-3.1/dos2unix.1	2008-09-08 09:58:56.000000000 +0100
+@@ -52,7 +52,7 @@ default to run in this mode. Wildcard na
+ .B \-n \-\-newfile infile outfile ...
+ New file mode. Convert the infile and write output to outfile. File names
+ must be given in pairs and wildcard names should NOT be used or you WILL 
+-lost your files. 
++lose your files. 
+ 
+ .SH "EXAMPLES"
+ .LP 
diff --git a/pkgs/tools/text/dos2unix/dos2unix-missing-proto.patch b/pkgs/tools/text/dos2unix/dos2unix-missing-proto.patch
new file mode 100644
index 00000000000..72cd2c0b6a4
--- /dev/null
+++ b/pkgs/tools/text/dos2unix/dos2unix-missing-proto.patch
@@ -0,0 +1,15 @@
+diff -up dos2unix-3.1/dos2unix.c.missing-proto dos2unix-3.1/dos2unix.c
+--- dos2unix-3.1/dos2unix.c.missing-proto	2008-04-14 17:11:58.000000000 +0100
++++ dos2unix-3.1/dos2unix.c	2008-04-14 17:12:42.000000000 +0100
+@@ -75,6 +75,11 @@ static int macmode = 0;
+ #include <string.h>
+ #include <utime.h>
+ #include <sys/stat.h>
++#if defined(__MSDOS__) || defined(__WIN32__) || defined(_WIN32)
++#  include <io.h>
++#else
++#  include <unistd.h>
++#endif
+ #include "dos2unix.h"
+ 
+ 
diff --git a/pkgs/tools/text/dos2unix/dos2unix-preserve-file-modes.patch b/pkgs/tools/text/dos2unix/dos2unix-preserve-file-modes.patch
new file mode 100644
index 00000000000..1d4ab5d8e71
--- /dev/null
+++ b/pkgs/tools/text/dos2unix/dos2unix-preserve-file-modes.patch
@@ -0,0 +1,28 @@
+diff -up dos2unix-3.1/dos2unix.c.preserve-file-modes dos2unix-3.1/dos2unix.c
+--- dos2unix-3.1/dos2unix.c.preserve-file-modes	2008-09-08 09:58:05.000000000 +0100
++++ dos2unix-3.1/dos2unix.c	2008-09-08 10:16:04.000000000 +0100
+@@ -320,9 +320,10 @@ int ConvertDosToUnixNewFile(char *ipInFN
+   struct stat StatBuf;
+   struct utimbuf UTimeBuf;
+   int fd;
++  mode_t mask;
+ 
+   /* retrieve ipInFN file date stamp */
+-  if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf))
++  if (stat(ipInFN, &StatBuf))
+     RetVal = -1;
+ 
+   if((fd = MakeTempFileFrom(ipOutFN, &TempPath))<0) {
+@@ -346,6 +347,12 @@ int ConvertDosToUnixNewFile(char *ipInFN
+     RetVal = -1;
+   }
+ 
++  /* preserve original mode as modified by umask */
++  mask = umask(0);
++  umask(mask);
++  if (!RetVal && fchmod(fd, StatBuf.st_mode & ~mask))
++    RetVal = -1;
++
+   /* conversion sucessful? */
+   if ((!RetVal) && (ConvertDosToUnix(InF, TempF, ipFlag)))
+     RetVal = -1;
diff --git a/pkgs/tools/text/unix2dos/default.nix b/pkgs/tools/text/unix2dos/default.nix
new file mode 100644
index 00000000000..326149feb21
--- /dev/null
+++ b/pkgs/tools/text/unix2dos/default.nix
@@ -0,0 +1,37 @@
+{stdenv, fetchurl}:
+
+stdenv.mkDerivation {
+  name = "unix2dos-2.2";
+  
+  src = fetchurl {
+    url = http://cvs.fedoraproject.org/repo/pkgs/unix2dos/unix2dos-2.2.src.tar.gz/e4488c241fa9067a48a7534a21d4babb/unix2dos-2.2.src.tar.gz;
+    md5 = "e4488c241fa9067a48a7534a21d4babb";
+  };
+
+  patches = [
+    ./unix2dos-mkstemp.patch
+    ./unix2dos-2.2-segfault.patch
+    ./unix2dos-2.2-manpage.patch
+    ./unix2dos-2.2-mode.patch
+    ./unix2dos-2.2-tmppath.patch
+    ./unix2dos-preserve-file-modes.patch
+  ];
+
+  sourceRoot = ".";
+
+  buildPhase = ''
+    cc -o unix2dos unix2dos.c
+  '';
+
+  installPhase = ''
+    ensureDir $out/bin
+    ensureDir $out/share/man
+    install -p -m755 unix2dos $out/bin
+    install -p -m444 unix2dos.1 $out/share/man
+  '';
+
+  meta = {
+    homepage = http://unknown/;
+    description = "unix2dos tool";
+  };
+}
diff --git a/pkgs/tools/text/unix2dos/unix2dos-2.2-manpage.patch b/pkgs/tools/text/unix2dos/unix2dos-2.2-manpage.patch
new file mode 100644
index 00000000000..1172e2f82ea
--- /dev/null
+++ b/pkgs/tools/text/unix2dos/unix2dos-2.2-manpage.patch
@@ -0,0 +1,42 @@
+diff -up unix2dos-2.2/unix2dos.1.man unix2dos-2.2/unix2dos.1
+--- unix2dos-2.2/unix2dos.1.man	1995-03-30 17:03:22.000000000 +0100
++++ unix2dos-2.2/unix2dos.1	2008-09-08 09:49:19.000000000 +0100
+@@ -16,7 +16,7 @@ Options:
+ .SH DESCRIPTION
+ 
+ .PP
+-This manual page documents dos2unix, the program that converts text 
++This manual page documents unix2dos, the program that converts text 
+ files in UNIX format to DOS format.
+ 
+ .SH OPTIONS
+@@ -40,7 +40,7 @@ Prints version information.
+ 
+ .TP
+ .B \-c --convmode convmode
+-Sets conversion mode. Simulates dos2unix under SunOS.
++Sets conversion mode. Simulates unix2dos under SunOS.
+ 
+ .TP
+ .B \-o --oldfile file ...
+@@ -51,7 +51,7 @@ default to run in this mode. Wildcard na
+ .B \-n --newfile infile outfile ...
+ New file mode. Convert the infile and write output to outfile. File names
+ must be given in pairs and wildcard names should NOT be used or you WILL 
+-lost your files. 
++lose your files. 
+ 
+ .SH EXAMPLES
+ 
+@@ -71,9 +71,9 @@ Convert and replace a.txt. Convert and r
+ Convert and replace a.txt in ASCII conversion mode.
+ Convert and replace b.txt in ISO conversion mode.
+ .IP
+-.B dos2unix a.txt -c iso b.txt
++.B unix2dos a.txt -c iso b.txt
+ .IP
+-.B dos2unix -c ascii a.txt -c iso b.txt
++.B unix2dos -c ascii a.txt -c iso b.txt
+ 
+ .LP
+ Convert and replace a.txt while keeping original date stamp.
diff --git a/pkgs/tools/text/unix2dos/unix2dos-2.2-mode.patch b/pkgs/tools/text/unix2dos/unix2dos-2.2-mode.patch
new file mode 100644
index 00000000000..f5ff62aab82
--- /dev/null
+++ b/pkgs/tools/text/unix2dos/unix2dos-2.2-mode.patch
@@ -0,0 +1,29 @@
+diff -up unix2dos-2.2/unix2dos.c.mode unix2dos-2.2/unix2dos.c
+--- unix2dos-2.2/unix2dos.c.mode	2008-09-08 10:13:39.000000000 +0100
++++ unix2dos-2.2/unix2dos.c	2008-09-08 10:13:39.000000000 +0100
+@@ -292,11 +292,14 @@ int ConvertUnixToDosOldFile(char* ipInFN
+   char TempPath[16];
+   struct stat StatBuf;
+   struct utimbuf UTimeBuf;
++  mode_t mode = S_IRUSR | S_IWUSR;
+   int fd;
+ 
+   /* retrieve ipInFN file date stamp */
+-  if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf))
++  if (stat(ipInFN, &StatBuf))
+     RetVal = -1;
++  else
++    mode = StatBuf.st_mode;
+ 
+   strcpy (TempPath, "./u2dtmpXXXXXX");
+   if((fd=mkstemp (TempPath)) < 0) {
+@@ -304,6 +307,9 @@ int ConvertUnixToDosOldFile(char* ipInFN
+       RetVal = -1;
+   }
+ 
++  if (!RetVal && fchmod (fd, mode) && fchmod (fd, S_IRUSR | S_IWUSR))
++    RetVal = -1;
++
+ #ifdef DEBUG
+   fprintf(stderr, "unix2dos: using %s as temp file\n", TempPath);
+ #endif DEBUG    
diff --git a/pkgs/tools/text/unix2dos/unix2dos-2.2-segfault.patch b/pkgs/tools/text/unix2dos/unix2dos-2.2-segfault.patch
new file mode 100644
index 00000000000..a92f57cfe70
--- /dev/null
+++ b/pkgs/tools/text/unix2dos/unix2dos-2.2-segfault.patch
@@ -0,0 +1,94 @@
+--- unix2dos-2.2/unix2dos.c.segf	Thu Jan 17 17:09:49 2002
++++ unix2dos-2.2/unix2dos.c	Thu Jan 17 17:12:47 2002
+@@ -131,9 +131,9 @@
+  * RetVal: NULL if failure
+  *         file stream otherwise
+  */
+-FILE* OpenOutFile(char *ipFN)
++FILE* OpenOutFile(int fd)
+ {
+-  return (fopen(ipFN, W_CNTRL));
++  return (fdopen(fd, W_CNTRL));
+ }
+ 
+ 
+@@ -207,14 +207,17 @@
+   char TempPath[16];
+   struct stat StatBuf;
+   struct utimbuf UTimeBuf;
++  int fd;
+ 
+   /* retrieve ipInFN file date stamp */
+   if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf))
+     RetVal = -1;
+ 
+-  strcpy (TempPath, "./u2dtmp");
+-  strcat (TempPath, "XXXXXX");
+-  mkstemp (TempPath);
++  strcpy (TempPath, "./u2dtmpXXXXXX");
++  if((fd=mkstemp (TempPath)) < 0) {
++	  perror("Can't open output temp file");
++	  RetVal = -1;
++  }
+ 
+ #ifdef DEBUG
+   fprintf(stderr, "unix2dos: using %s as temp file\n", TempPath);
+@@ -225,7 +228,7 @@
+     RetVal = -1;
+ 
+   /* can open out file? */
+-  if ((!RetVal) && (InF) && ((TempF=OpenOutFile(TempPath)) == NULL))
++  if ((!RetVal) && (InF) && ((TempF=OpenOutFile(fd)) == NULL))
+   {
+     fclose (InF);
+     RetVal = -1;
+@@ -243,6 +246,9 @@
+   if ((TempF) && (fclose(TempF) == EOF))
+     RetVal = -1;
+ 
++  if(fd>=0)
++	  close(fd);
++
+   if ((!RetVal) && (ipFlag->KeepDate))
+   {
+     UTimeBuf.actime = StatBuf.st_atime;
+@@ -286,14 +292,17 @@
+   char TempPath[16];
+   struct stat StatBuf;
+   struct utimbuf UTimeBuf;
++  int fd;
+ 
+   /* retrieve ipInFN file date stamp */
+   if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf))
+     RetVal = -1;
+ 
+-  strcpy (TempPath, "./u2dtmp");
+-  strcat (TempPath, "XXXXXX");
+-  mkstemp (TempPath);
++  strcpy (TempPath, "./u2dtmpXXXXXX");
++  if((fd=mkstemp (TempPath)) < 0) {
++      perror("Can't open output temp file");
++      RetVal = -1;
++  }
+ 
+ #ifdef DEBUG
+   fprintf(stderr, "unix2dos: using %s as temp file\n", TempPath);
+@@ -304,7 +313,7 @@
+     RetVal = -1;
+ 
+   /* can open out file? */
+-  if ((!RetVal) && (InF) && ((TempF=OpenOutFile(TempPath)) == NULL))
++  if ((!RetVal) && (InF) && ((TempF=OpenOutFile(fd)) == NULL))
+   {
+     fclose (InF);
+     RetVal = -1;
+@@ -322,6 +331,9 @@
+   if ((TempF) && (fclose(TempF) == EOF))
+     RetVal = -1;
+ 
++  if(fd>=0)
++	  close(fd);
++
+   if ((!RetVal) && (ipFlag->KeepDate))
+   {
+     UTimeBuf.actime = StatBuf.st_atime;
diff --git a/pkgs/tools/text/unix2dos/unix2dos-2.2-tmppath.patch b/pkgs/tools/text/unix2dos/unix2dos-2.2-tmppath.patch
new file mode 100644
index 00000000000..f8ad138f4da
--- /dev/null
+++ b/pkgs/tools/text/unix2dos/unix2dos-2.2-tmppath.patch
@@ -0,0 +1,146 @@
+diff -up unix2dos-2.2/unix2dos.c.tmppath unix2dos-2.2/unix2dos.c
+--- unix2dos-2.2/unix2dos.c.tmppath	2008-09-08 10:14:30.000000000 +0100
++++ unix2dos-2.2/unix2dos.c	2008-09-08 10:14:30.000000000 +0100
+@@ -57,7 +57,10 @@
+ 
+ #ifdef __MSDOS__
+ #  include <dir.h>
++#else
++#  include <unistd.h>
+ #endif __MSDOS
++#include <libgen.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+ #include <string.h>
+@@ -195,6 +198,40 @@ int ConvertUnixToDos(FILE* ipInF, FILE* 
+ }
+ 
+ 
++static int MakeTempFileFrom(const char *OutFN, char **fname_ret)
++{
++  char *cpy = strdup(OutFN);
++  char *dir = NULL;
++  size_t fname_len = 0;
++  char  *fname_str = NULL;
++  int fd = -1;
++  
++  *fname_ret = NULL;
++ 
++  if (!cpy)
++    goto make_failed;
++  
++  dir = dirname(cpy);
++  
++  fname_len = strlen(dir) + strlen("/u2dtmpXXXXXX") + sizeof (char);
++  if (!(fname_str = malloc(fname_len)))
++    goto make_failed;
++  sprintf(fname_str, "%s%s", dir, "/u2dtmpXXXXXX");
++  *fname_ret = fname_str;
++
++  free(cpy);
++
++  if ((fd = mkstemp(fname_str)) == -1)
++    goto make_failed;
++  
++  return (fd);
++  
++ make_failed:
++  free(*fname_ret);
++  *fname_ret = NULL;
++  return (-1);
++}
++
+ /* convert file ipInFN to DOS format text and write to file ipOutFN
+  * RetVal: 0 if success
+  *         -1 otherwise
+@@ -204,7 +241,7 @@ int ConvertUnixToDosNewFile(char *ipInFN
+   int RetVal = 0;
+   FILE *InF = NULL;
+   FILE *TempF = NULL;
+-  char TempPath[16];
++  char *TempPath;
+   struct stat StatBuf;
+   struct utimbuf UTimeBuf;
+   int fd;
+@@ -213,8 +250,7 @@ int ConvertUnixToDosNewFile(char *ipInFN
+   if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf))
+     RetVal = -1;
+ 
+-  strcpy (TempPath, "./u2dtmpXXXXXX");
+-  if((fd=mkstemp (TempPath)) < 0) {
++  if((fd = MakeTempFileFrom (ipOutFN, &TempPath)) < 0) {
+ 	  perror("Can't open output temp file");
+ 	  RetVal = -1;
+   }
+@@ -231,6 +267,7 @@ int ConvertUnixToDosNewFile(char *ipInFN
+   if ((!RetVal) && (InF) && ((TempF=OpenOutFile(fd)) == NULL))
+   {
+     fclose (InF);
++    InF = NULL;
+     RetVal = -1;
+   }
+ 
+@@ -265,9 +302,6 @@ int ConvertUnixToDosNewFile(char *ipInFN
+   /* can rename temp file to out file? */
+   if (!RetVal)
+   {
+-    if (stat(ipOutFN, &StatBuf) == 0)
+-      unlink(ipOutFN);
+-
+     if ((rename(TempPath, ipOutFN) == -1) && (!ipFlag->Quiet))
+     {
+       fprintf(stderr, "unix2dos: problems renaming '%s' to '%s'\n", TempPath, ipOutFN);
+@@ -275,6 +309,7 @@ int ConvertUnixToDosNewFile(char *ipInFN
+       RetVal = -1;
+     }
+   }
++  free(TempPath);
+ 
+   return RetVal;
+ }
+@@ -289,7 +324,7 @@ int ConvertUnixToDosOldFile(char* ipInFN
+   int RetVal = 0;
+   FILE *InF = NULL;
+   FILE *TempF = NULL;
+-  char TempPath[16];
++  char *TempPath;
+   struct stat StatBuf;
+   struct utimbuf UTimeBuf;
+   mode_t mode = S_IRUSR | S_IWUSR;
+@@ -301,8 +336,7 @@ int ConvertUnixToDosOldFile(char* ipInFN
+   else
+     mode = StatBuf.st_mode;
+ 
+-  strcpy (TempPath, "./u2dtmpXXXXXX");
+-  if((fd=mkstemp (TempPath)) < 0) {
++  if((fd = MakeTempFileFrom(ipInFN, &TempPath)) < 0) {
+       perror("Can't open output temp file");
+       RetVal = -1;
+   }
+@@ -322,6 +356,7 @@ int ConvertUnixToDosOldFile(char* ipInFN
+   if ((!RetVal) && (InF) && ((TempF=OpenOutFile(fd)) == NULL))
+   {
+     fclose (InF);
++    InF = NULL;
+     RetVal = -1;
+   }
+ 
+@@ -349,10 +384,6 @@ int ConvertUnixToDosOldFile(char* ipInFN
+       RetVal = -1;
+   }
+ 
+-  /* can delete in file? */
+-  if ((!RetVal) && (unlink(ipInFN) == -1))
+-    RetVal = -1;
+-
+   /* any error? */
+   if ((RetVal) && (unlink(TempPath)))
+     RetVal = -1;
+@@ -367,6 +398,7 @@ int ConvertUnixToDosOldFile(char* ipInFN
+     }
+     RetVal = -1;
+   }
++  free(TempPath);
+   return RetVal;
+ }
+ 
diff --git a/pkgs/tools/text/unix2dos/unix2dos-mkstemp.patch b/pkgs/tools/text/unix2dos/unix2dos-mkstemp.patch
new file mode 100644
index 00000000000..034e0a00b68
--- /dev/null
+++ b/pkgs/tools/text/unix2dos/unix2dos-mkstemp.patch
@@ -0,0 +1,20 @@
+--- unix2dos-2.2/unix2dos.c.orig	Fri Nov 17 13:29:24 2000
++++ unix2dos-2.2/unix2dos.c	Fri Nov 17 13:30:16 2000
+@@ -214,7 +214,7 @@
+ 
+   strcpy (TempPath, "./u2dtmp");
+   strcat (TempPath, "XXXXXX");
+-  mktemp (TempPath);
++  mkstemp (TempPath);
+ 
+ #ifdef DEBUG
+   fprintf(stderr, "unix2dos: using %s as temp file\n", TempPath);
+@@ -293,7 +293,7 @@
+ 
+   strcpy (TempPath, "./u2dtmp");
+   strcat (TempPath, "XXXXXX");
+-  mktemp (TempPath);
++  mkstemp (TempPath);
+ 
+ #ifdef DEBUG
+   fprintf(stderr, "unix2dos: using %s as temp file\n", TempPath);
diff --git a/pkgs/tools/text/unix2dos/unix2dos-preserve-file-modes.patch b/pkgs/tools/text/unix2dos/unix2dos-preserve-file-modes.patch
new file mode 100644
index 00000000000..e824044b50c
--- /dev/null
+++ b/pkgs/tools/text/unix2dos/unix2dos-preserve-file-modes.patch
@@ -0,0 +1,29 @@
+diff -up unix2dos-2.2/unix2dos.c~ unix2dos-2.2/unix2dos.c
+--- unix2dos-2.2/unix2dos.c~	2008-03-03 13:16:34.000000000 +0000
++++ unix2dos-2.2/unix2dos.c	2008-03-03 13:22:10.000000000 +0000
+@@ -244,10 +244,11 @@ int ConvertUnixToDosNewFile(char *ipInFN
+   char *TempPath;
+   struct stat StatBuf;
+   struct utimbuf UTimeBuf;
++  mode_t mask;
+   int fd;
+ 
+   /* retrieve ipInFN file date stamp */
+-  if ((ipFlag->KeepDate) && stat(ipInFN, &StatBuf))
++  if (stat(ipInFN, &StatBuf))
+     RetVal = -1;
+ 
+   if((fd = MakeTempFileFrom (ipOutFN, &TempPath)) < 0) {
+@@ -271,6 +272,12 @@ int ConvertUnixToDosNewFile(char *ipInFN
+     RetVal = -1;
+   }
+ 
++  /* preserve original mode as modified by umask */
++  mask = umask(0);
++  umask(mask);
++  if (!RetVal && fchmod(fd, StatBuf.st_mode & ~mask))
++      RetVal = -1;
++
+   /* conversion sucessful? */
+   if ((!RetVal) && (ConvertUnixToDos(InF, TempF, ipFlag)))
+     RetVal = -1;
diff --git a/pkgs/tools/typesetting/lhs2tex/default.nix b/pkgs/tools/typesetting/lhs2tex/default.nix
index 0881591436f..ce74a0812d3 100644
--- a/pkgs/tools/typesetting/lhs2tex/default.nix
+++ b/pkgs/tools/typesetting/lhs2tex/default.nix
@@ -4,18 +4,22 @@
 
 cabal.mkDerivation (self : {
   pname = "lhs2tex";
-  version = "1.14";
+  version = "1.15";
   name = self.fname;
-  sha256 = "1667acce394a0d4852f8ad07fa85397e43873fd98a219db794e4773883288687";
+  sha256 = "77f25c1f22823587ceca6eead133a403540319a0ae3bf03a369b3e8c86baf124";
   extraBuildInputs = [tetex regexCompat utf8String];
   propagatedBuildInputs = [polytable]; # automatically in user-env now with cabal
 
-  configureFlags = ''--constraint=base<4'';
-
   postInstall = ''
     ensureDir "$out/share/doc/$name"
     cp doc/Guide2.pdf $out/share/doc/$name
     ensureDir "$out/nix-support"
   '';
+
+  meta = {
+    description = "Preprocessor for typesetting Haskell sources with LaTeX";
+    license = "GPLv2";
+    maintainers = [self.stdenv.lib.maintainers.andres];
+  };
 })
 
diff --git a/pkgs/tools/virtualization/amazon-ec2-ami-tools/default.nix b/pkgs/tools/virtualization/amazon-ec2-ami-tools/default.nix
new file mode 100644
index 00000000000..58a833a33ea
--- /dev/null
+++ b/pkgs/tools/virtualization/amazon-ec2-ami-tools/default.nix
@@ -0,0 +1,34 @@
+{ stdenv, fetchurl, unzip, ruby, openssl, makeWrapper }:
+
+stdenv.mkDerivation {
+  name = "ec2-ami-tools";
+  
+  buildInputs = [unzip makeWrapper];
+  
+  src = fetchurl {
+    url = http://s3.amazonaws.com/ec2-downloads/ec2-ami-tools.zip;
+    sha256 = "2a7c848abea286234adcbb08938cfad50b844ecdfc7770e781289d9d396a1972";
+  };
+
+  installPhase =
+    ''
+      ensureDir $out
+      mv * $out
+      rm $out/*.txt
+
+      for i in $out/bin/*; do
+          wrapProgram $i \
+            --set EC2_HOME $out \
+            --prefix PATH : ${ruby}/bin:${openssl}/bin
+      done
+      
+      sed -i 's|/bin/bash|${stdenv.shell}|' $out/lib/ec2/platform/base/pipeline.rb
+    ''; 
+
+  meta = {
+    homepage = http://developer.amazonwebservices.com/connect/entry.jspa?externalID=368&categoryID=88;
+    description = "Command-line tools to create and manage Amazon EC2 virtual machine images";
+    license = "unfree-redistributable";
+  };
+
+}
diff --git a/pkgs/tools/virtualization/amazon-ec2-api-tools/builder.sh b/pkgs/tools/virtualization/amazon-ec2-api-tools/builder.sh
deleted file mode 100644
index 1bea40a0456..00000000000
--- a/pkgs/tools/virtualization/amazon-ec2-api-tools/builder.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-source $stdenv/setup
-ensureDir $out
-
-unzip $src
-mv ec2-api-tools-*/* $out
-
-fixupPhase
diff --git a/pkgs/tools/virtualization/amazon-ec2-api-tools/default.nix b/pkgs/tools/virtualization/amazon-ec2-api-tools/default.nix
index 29a693a116a..6c568a95c2f 100644
--- a/pkgs/tools/virtualization/amazon-ec2-api-tools/default.nix
+++ b/pkgs/tools/virtualization/amazon-ec2-api-tools/default.nix
@@ -1,12 +1,31 @@
-{stdenv, fetchurl, unzip}:
+{ stdenv, fetchurl, unzip, makeWrapper, jre }:
 
 stdenv.mkDerivation {
-  name = "ec2-api-tools";
-  buildInputs = [unzip];
+  name = "ec2-api-tools-1.3-46266";
+  
   src = fetchurl {
     url = http://s3.amazonaws.com/ec2-downloads/ec2-api-tools.zip;
-    sha256 = "1d5j3hsa9vswrhan5yf2v6sq3plpfl4lgdvk3wlaw14rdv50cdiv";
+    sha256 = "06d5hpzc18bj30hjc477xx62hsspgfkn3fdccrg1avadgwsykgq6";
   };
 
-  builder = ./builder.sh ;
+  buildInputs = [ unzip makeWrapper ];
+
+  installPhase =
+    ''
+      ensureDir $out
+      mv * $out
+      rm $out/bin/*.cmd # Windows stuff
+
+      for i in $out/bin/*; do
+          wrapProgram $i \
+            --set EC2_HOME $out \
+            --set JAVA_HOME ${jre}
+      done
+    ''; # */
+  
+  meta = {
+    homepage = http://developer.amazonwebservices.com/connect/entry.jspa?externalID=351;
+    description = "Command-line tools to create and manage Amazon EC2 virtual machines";
+    license = "unfree-redistributable";
+  };
 }
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index d089bbc296b..bb0efb49915 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -78,9 +78,12 @@ let
 
   # Helper functions that are exported through `pkgs'.
   helperFunctions =
-    (import ../stdenv/adapters.nix { inherit (pkgs) dietlibc fetchurl runCommand; }) //
+    stdenvAdapters //
     (import ../build-support/trivial-builders.nix { inherit (pkgs) stdenv; inherit (pkgs.xorg) lndir; });
 
+  stdenvAdapters =
+    import ../stdenv/adapters.nix { inherit (pkgs) dietlibc fetchurl runCommand; };
+
 
   # Allow packages to be overriden globally via the `packageOverrides'
   # configuration option, which must be a function that takes `pkgs'
@@ -101,6 +104,14 @@ let
   # The package compositions.  Yes, this isn't properly indented.
   pkgsFun = __overrides: with helperFunctions; rec {
 
+  # override system. This is useful to build i686 packages on x86_64-linux
+  forceSystem = system: (import ./all-packages.nix) {
+    inherit system;
+    inherit bootStdenv noSysDirs gccWithCC gccWithProfiling config;
+  };
+
+  # used by wine, firefox with debugging version of Flash, ..
+  pkgsi686Linux = forceSystem "i686-linux";
 
   inherit __overrides;
 
@@ -124,7 +135,7 @@ let
   ### Helper functions.
 
 
-  inherit lib config getConfig;
+  inherit lib config getConfig stdenvAdapters;
 
   inherit (lib) lowPrio appendToName makeOverridable;
 
@@ -331,7 +342,11 @@ let
   };
 
   ec2apitools = import ../tools/virtualization/amazon-ec2-api-tools {
-    inherit stdenv fetchurl unzip ;
+    inherit stdenv fetchurl unzip makeWrapper jre;
+  };
+
+  ec2amitools = import ../tools/virtualization/amazon-ec2-ami-tools {
+    inherit stdenv fetchurl unzip makeWrapper ruby openssl;
   };
 
   amule = import ../tools/networking/p2p/amule {
@@ -439,6 +454,10 @@ let
     inherit fetchurl stdenv;
   };
 
+  ncompress = import ../tools/compression/ncompress {
+    inherit fetchurl stdenv;
+  };
+
   bzip2 = useFromStdenv "bzip2"
     (import ../tools/compression/bzip2 {
       inherit fetchurl stdenv;
@@ -448,6 +467,10 @@ let
     inherit fetchurl stdenv;
   };
 
+  ccid = import ../tools/security/ccid {
+    inherit fetchurl stdenv pcsclite libusb pkgconfig perl;
+  };
+
   ccrypt = import ../tools/security/ccrypt {
     inherit fetchurl stdenv;
   };
@@ -687,6 +710,14 @@ let
     inherit (xlibs) libX11 xproto libXt;
   };
 
+  dos2unix = import ../tools/text/dos2unix {
+      inherit fetchurl stdenv;
+  };
+
+  unix2dos = import ../tools/text/unix2dos {
+      inherit fetchurl stdenv;
+  };
+
   gawk = useFromStdenv "gawk"
     (import ../tools/text/gawk {
       inherit fetchurl stdenv;
@@ -1061,6 +1092,14 @@ let
       };
     });
 
+  muscleframework = import ../tools/security/muscleframework {
+    inherit fetchurl stdenv libmusclecard pkgconfig pcsclite;
+  };
+
+  muscletool = import ../tools/security/muscletool {
+    inherit fetchurl stdenv pkgconfig libmusclecard pcsclite;
+  };
+
   mysql2pgsql = import ../tools/misc/mysql2pgsql {
     inherit fetchurl stdenv perl shebangfix;
   };
@@ -1094,7 +1133,7 @@ let
   };
 
   netpbm = import ../tools/graphics/netpbm {
-    inherit stdenv fetchsvn libjpeg libpng zlib flex perl libxml2;
+    inherit stdenv fetchsvn libjpeg libpng zlib flex perl libxml2 makeWrapper;
   };
 
   netselect = import ../tools/networking/netselect {
@@ -1150,6 +1189,14 @@ let
     inherit fetchurl stdenv pkgconfig bluez libusb;
   };
 
+  opensc_0_11_7 = import ../tools/security/opensc/0.11.7.nix {
+    inherit fetchurl stdenv libtool readline zlib openssl libiconv pcsclite
+      libassuan pkgconfig;
+    inherit (xlibs) libXt;
+  };
+
+  opensc = opensc_0_11_7;
+
   openssh = import ../tools/networking/openssh {
     inherit fetchurl stdenv zlib openssl pam perl;
     pamSupport = getPkgConfig "openssh" "pam" true;
@@ -1183,7 +1230,8 @@ let
   };
 
   parted = import ../tools/misc/parted {
-    inherit fetchurl stdenv devicemapper libuuid gettext readline;
+    inherit fetchurl stdenv devicemapper libuuid gettext readline
+      utillinuxng;
   };
 
   patch = gnupatch;
@@ -1196,6 +1244,10 @@ let
     inherit fetchurl stdenv zlib;
   };
 
+  pcsclite = import ../tools/security/pcsclite {
+    inherit fetchurl stdenv hal pkgconfig dbus;
+  };
+
   pdf2djvu = import ../tools/typesetting/pdf2djvu {
     inherit fetchurl stdenv pkgconfig djvulibre poppler fontconfig libjpeg;
   };
@@ -1632,6 +1684,11 @@ let
     inherit fetchurl stdenv readline;
   };
 
+  wicd = import ../tools/networking/wicd {
+    inherit stdenv fetchurl python pygobject pycairo pyGtkGlade pythonDBus 
+            wpa_supplicant dhcp wirelesstools nettools iproute;
+  };
+
   wv = import ../tools/misc/wv {
     inherit fetchurl stdenv libpng zlib imagemagick
       pkgconfig libgsf libxml2 bzip2 glib;
@@ -2061,13 +2118,14 @@ let
     };
   });
 
-  haskellPackages_ghc6121 = import ./haskell-packages.nix {
+  # make this ghc default when it's supported by the Haskell Platform
+  haskellPackages_ghc6121 = lowPrio (import ./haskell-packages.nix {
     inherit pkgs;
     ghc = import ../development/compilers/ghc/6.12.1.nix {
       inherit fetchurl stdenv perl ncurses gmp;
       ghc = ghc6101Binary;
     };
-  };
+  });
 
   haskellPackages_ghcHEAD = import ./haskell-packages.nix {
     inherit pkgs;
@@ -2171,21 +2229,8 @@ let
     inherit stdenv perl;
   };
 
-  monotone = import ../applications/version-management/monotone {
-    inherit stdenv fetchurl boost zlib botan libidn pcre
-      sqlite lib perl;
-    lua = lua5;
-  };
-
-  monotoneViz = builderDefsPackage (import ../applications/version-management/monotone-viz/mtn-head.nix) {
-    inherit ocaml lablgtk graphviz pkgconfig autoconf automake libtool;
-    inherit (gnome) gtk libgnomecanvas glib;
-  };
-
-  viewMtn = builderDefsPackage (import ../applications/version-management/viewmtn/0.10.nix)
-  {
-    inherit monotone flup cheetahTemplate highlight ctags
-      makeWrapper graphviz which python;
+  mozart = import ../development/compilers/mozart {
+    inherit fetchurl stdenv flex bison perl gmp zlib tcl tk gdbm m4 x11 emacs;
   };
 
   neko = import ../development/compilers/neko {
@@ -2439,13 +2484,21 @@ let
       if stdenv.isDarwin then null else unixODBC;
   };
 
-  php = import ../development/interpreters/php_configurable {
+  php = makeOverridable (import ../development/interpreters/php_configurable) {
     inherit
       stdenv fetchurl lib composableDerivation autoconf automake
       flex bison apacheHttpd mysql libxml2 # gettext
       zlib curl gd postgresql openssl pkgconfig sqlite getConfig;
   };
 
+  phpXdebug = import ../development/interpreters/php-xdebug {
+    inherit stdenv fetchurl php autoconf automake;
+  };
+
+  phpIniBuilder = makeOverridable (import ../development/interpreters/php/ini-bulider.nix) {
+    inherit php runCommand;
+  };
+
   pltScheme = builderDefsPackage (import ../development/interpreters/plt-scheme) {
     inherit cairo fontconfig freetype libjpeg libpng openssl
       perl mesa zlib which;
@@ -2460,6 +2513,7 @@ let
 
   python = if getConfig ["python" "full"] false then pythonFull else pythonBase;
   python25 = if getConfig ["python" "full"] false then python25Full else python25Base;
+  python26 = if getConfig ["python" "full"] false then python26Full else python26Base;
   pythonBase = python25Base;
   pythonFull = python25Full;
 
@@ -2727,7 +2781,8 @@ let
   };
 
   buildbot = import ../development/tools/build-managers/buildbot {
-    inherit fetchurl stdenv python twisted makeWrapper;
+    inherit fetchurl stdenv buildPythonPackage texinfo;
+    inherit (pythonPackages) twisted;
   };
 
   byacc = import ../development/tools/parsing/byacc {
@@ -3228,6 +3283,10 @@ let
     inherit fetchurl stdenv pkgconfig cairo x11 fontconfig freetype libsigcxx;
   };
 
+  scmccid = import ../development/libraries/scmccid {
+    inherit fetchurl stdenv libusb patchelf;
+  };
+
   ccrtp = import ../development/libraries/ccrtp {
     inherit fetchurl stdenv lib pkgconfig openssl libgcrypt commoncpp2;
   };
@@ -3327,6 +3386,10 @@ let
     inherit fetchurl stdenv pkgconfig gettext dbus expat glib;
   };
 
+  dbus_java = import ../development/libraries/java/dbus-java {
+    inherit stdenv fetchurl gettext jdk libmatthew_java;
+  };
+
   dclib = import ../development/libraries/dclib {
     inherit fetchurl stdenv libxml2 openssl bzip2;
   };
@@ -3343,6 +3406,10 @@ let
     inherit (gnome) glib;
   };
 
+  enginepkcs11 = import ../development/libraries/enginepkcs11 {
+    inherit fetchurl stdenv libp11 pkgconfig openssl;
+  };
+
   exiv2 = import ../development/libraries/exiv2 {
     inherit fetchurl stdenv zlib;
   };
@@ -3402,14 +3469,14 @@ let
 
   fltk11 = (import ../development/libraries/fltk/fltk11.nix) {
     inherit composableDerivation x11 lib pkgconfig freeglut;
-    inherit fetchurl stdenv mesa mesaHeaders libpng libjpeg zlib ;
+    inherit fetchurl stdenv mesa libpng libjpeg zlib ;
     inherit (xlibs) inputproto libXi libXinerama libXft;
     flags = [ "useNixLibs" "threads" "shared" "gl" ];
   };
 
   fltk20 = (import ../development/libraries/fltk) {
     inherit composableDerivation x11 lib pkgconfig freeglut;
-    inherit fetchurl stdenv mesa mesaHeaders libpng libjpeg zlib ;
+    inherit fetchurl stdenv mesa libpng libjpeg zlib ;
     inherit (xlibs) inputproto libXi libXinerama libXft;
     flags = [ "useNixLibs" "threads" "shared" "gl" ];
   };
@@ -4014,8 +4081,11 @@ let
     inherit fetchurl stdenv gettext;
   };
 
-  libextractor = composedArgsAndFun (import ../development/libraries/libextractor/0.5.18.nix) {
-    inherit fetchurl stdenv builderDefs zlib;
+  libextractor = import ../development/libraries/libextractor {
+    inherit fetchurl stdenv libtool gettext zlib bzip2 flac libvorbis
+     exiv2 ffmpeg libgsf glib rpm pkgconfig;
+    inherit (gnome) gtk;
+    libmpeg2 = mpeg2dec;
   };
 
   libffcall = builderDefsPackage (import ../development/libraries/libffcall) {
@@ -4104,6 +4174,11 @@ let
     libtool = libtool_1_5;
   };
 
+  libjpeg62 = makeOverridable (import ../development/libraries/libjpeg/62.nix) {
+    inherit fetchurl stdenv;
+    libtool = libtool_1_5;
+  };
+
   libjpegStatic = lowPrio (appendToName "static" (libjpeg.override {
     static = true;
   }));
@@ -4116,6 +4191,10 @@ let
     inherit fetchurl stdenv;
   };
 
+  libmatthew_java = import ../development/libraries/java/libmatthew-java {
+    inherit stdenv fetchurl jdk;
+  };
+
   libmcs = import ../development/libraries/libmcs {
     inherit fetchurl stdenv pkgconfig libmowgli;
   };
@@ -4144,6 +4223,10 @@ let
     inherit fetchurl stdenv;
   };
 
+  libmusclecard = import ../development/libraries/libmusclecard {
+    inherit fetchurl stdenv pkgconfig pcsclite;
+  };
+
   libnova = import ../development/libraries/libnova {
     inherit fetchurl stdenv;
   };
@@ -4164,6 +4247,10 @@ let
     inherit fetchurl stdenv libgcrypt;
   };
 
+  libp11 = import ../development/libraries/libp11 {
+    inherit fetchurl stdenv libtool openssl pkgconfig;
+  };
+
   libpcap = import ../development/libraries/libpcap {
     inherit fetchurl stdenv flex bison;
   };
@@ -4349,11 +4436,6 @@ let
     inherit fetchurl stdenv pkgconfig expat x11 xlibs libdrm;
   };
 
-  mesaHeaders = import ../development/libraries/mesa/headers.nix {
-    inherit stdenv;
-    mesaSrc = mesa.src;
-  };
-
   ming = import ../development/libraries/ming {
     inherit fetchurl stdenv flex bison freetype zlib libpng perl;
   };
@@ -4431,6 +4513,10 @@ let
     inherit fetchurl stdenv mesa qt4 tcl tk;
   };
 
+  openct = import ../development/libraries/openct {
+    inherit fetchurl stdenv libtool pcsclite libusb pkgconfig;
+  };
+
   # this ctl version is needed by openexr_viewers
   openexr_ctl = import ../development/libraries/openexr_ctl {
     inherit fetchurl stdenv ilmbase ctl;
@@ -4460,6 +4546,13 @@ let
       pkgconfig;
   };
 
+  opensc_dnie = import ../development/libraries/opensc-dnie {
+    inherit fetchurl stdenv patchelf writeScript openssl openct
+      libtool pcsclite zlib;
+    inherit (gtkLibs) glib;
+    opensc = opensc_0_11_7;
+  };
+
   openssl = makeOverridable (import ../development/libraries/openssl) {
     fetchurl = fetchurlBoot;
     inherit stdenv perl;
@@ -4489,6 +4582,11 @@ let
     inherit (xlibs) libXi libSM libXmu libXext libX11;
   };
 
+  podofo = import ../development/libraries/podofo {
+    inherit fetchurl stdenv cmake zlib freetype libjpeg libtiff
+      fontconfig openssl;
+  };
+
   polkit = import ../development/libraries/polkit {
     inherit stdenv fetchurl pkgconfig eggdbus expat pam intltool gettext glib;
   };
@@ -4967,8 +5065,21 @@ let
       inherit python setuptools makeWrapper lib;
     };
 
+  buildPython26Package =
+    import ../development/python-modules/generic {
+      inherit makeWrapper lib;
+      python = python26;
+      setuptools = setuptools_python26;
+    };
+
   pythonPackages = recurseIntoAttrs (import ./python-packages.nix {
+    inherit pkgs python buildPythonPackage;
+  });
+
+  python26Packages = recurseIntoAttrs (import ./python-packages.nix {
     inherit pkgs;
+    python = python26;
+    buildPythonPackage = buildPython26Package;
   });
 
   foursuite = import ../development/python-modules/4suite {
@@ -4993,6 +5104,11 @@ let
     inherit fetchurl stdenv python zlib libjpeg freetype;
   };
 
+  pil_python26 = import ../development/python-modules/pil {
+    inherit fetchurl stdenv zlib libjpeg freetype;
+    python = python26;
+  };
+
   psyco = import ../development/python-modules/psyco {
       inherit fetchurl stdenv python;
     };
@@ -5049,6 +5165,11 @@ let
     inherit stdenv fetchurl lib python;
   };
 
+  sip_python26 = import ../development/python-modules/python-sip {
+    inherit stdenv fetchurl lib;
+    python = python26;
+  };
+
   pyqt = builderDefsPackage (import ../development/python-modules/pyqt/4.3.3.nix) {
     inherit pkgconfig python pythonSip glib;
     inherit (xlibs) libX11 libXext;
@@ -5060,6 +5181,13 @@ let
     qt4 = qt45;
   };
 
+  pyqt4_python26 = import ../development/python-modules/pyqt {
+    inherit stdenv fetchurl lib;
+    qt4 = qt45;
+    python = python26;
+    sip = sip_python26;
+  };
+
   pyx = import ../development/python-modules/pyx {
     inherit fetchurl stdenv python makeWrapper;
   };
@@ -5072,6 +5200,11 @@ let
     inherit python makeWrapper;
   };
 
+  setuptools_python26 = builderDefsPackage (import ../development/python-modules/setuptools) {
+    inherit makeWrapper;
+    python = python26;
+  };
+
   wxPython = wxPython26;
 
   wxPython26 = import ../development/python-modules/wxPython/2.6.nix {
@@ -5304,7 +5437,7 @@ let
 
   xorg = recurseIntoAttrs (import ../servers/x11/xorg/default.nix {
     inherit fetchurl fetchsvn stdenv pkgconfig freetype fontconfig
-      libxslt expat libdrm libpng zlib perl mesa mesaHeaders
+      libxslt expat libdrm libpng zlib perl mesa
       xkeyboard_config dbus hal libuuid openssl gperf m4
       automake autoconf libtool;
 
@@ -5417,9 +5550,7 @@ let
     inherit stdenv;
   };
 
-  devicemapper = import ../os-specific/linux/device-mapper {
-    inherit fetchurl stdenv;
-  };
+  devicemapper = lvm2;
 
   dmidecode = import ../os-specific/linux/dmidecode {
     inherit fetchurl stdenv;
@@ -5620,34 +5751,29 @@ let
     kernelPatches = [];
   };
 
-  linux_2_6_31_zen5 = makeOverridable (import ../os-specific/linux/zen-kernel/2.6.31-zen5.nix) {
-    inherit fetchurl stdenv perl mktemp module_init_tools
-      lib builderDefs;
+  linux_2_6_32 = makeOverridable (import ../os-specific/linux/kernel/linux-2.6.32.nix) {
+    inherit fetchurl stdenv perl mktemp module_init_tools;
+    kernelPatches =
+      [ kernelPatches.fbcondecor_2_6_31
+        kernelPatches.sec_perm_2_6_24
+      ];
     inherit platform;
   };
 
-  linux_2_6_31_zen5_bfs = linux_2_6_31_zen5.override {
-    ckSched = true;
-  };
-
-  linux_2_6_31_zen7 = makeOverridable (import ../os-specific/linux/zen-kernel/zen-stable.nix) {
-    inherit fetchurl stdenv perl mktemp module_init_tools
-      lib builderDefs;
+  linux_2_6_32_zen4 = makeOverridable (import ../os-specific/linux/zen-kernel/2.6.32-zen4.nix) {
+    inherit fetchurl stdenv perl mktemp module_init_tools runCommand xz;
   };
 
-  linux_2_6_31_zen7_bfs = linux_2_6_31_zen7.override {
-    ckSched = true;
+  linux_2_6_32_zen4_oldi686 = linux_2_6_32_zen4.override {
+    features = {
+      oldI686 = true;
+    };
   };
 
-  linux_2_6_31_zen = linux_2_6_31_zen7;
-  linux_2_6_31_zen_bfs = linux_2_6_31_zen7_bfs;
-
-  linux_2_6_32 = makeOverridable (import ../os-specific/linux/kernel/linux-2.6.32.nix) {
-    inherit fetchurl stdenv perl mktemp module_init_tools platform;
-    kernelPatches =
-      [ kernelPatches.fbcondecor_2_6_31
-        kernelPatches.sec_perm_2_6_24
-      ];
+  linux_2_6_32_zen4_bfs = linux_2_6_32_zen4.override {
+    features = {
+      ckSched = true;
+    };
   };
 
   /* Linux kernel modules are inherently tied to a specific kernel.  So
@@ -5776,14 +5902,12 @@ let
   linuxPackages_2_6_27 = recurseIntoAttrs (linuxPackagesFor linux_2_6_27);
   linuxPackages_2_6_28 = recurseIntoAttrs (linuxPackagesFor linux_2_6_28);
   linuxPackages_2_6_29 = recurseIntoAttrs (linuxPackagesFor linux_2_6_29);
-  linuxPackages_2_6_31_zen5 = recurseIntoAttrs (linuxPackagesFor linux_2_6_31_zen5);
-  linuxPackages_2_6_31_zen = recurseIntoAttrs (linuxPackagesFor linux_2_6_31_zen);
-  linuxPackages_2_6_31_zen_bfs = recurseIntoAttrs (linuxPackagesFor linux_2_6_31_zen_bfs);
   linuxPackages_2_6_31 = recurseIntoAttrs (linuxPackagesFor linux_2_6_31);
   linuxPackages_2_6_32 = recurseIntoAttrs (linuxPackagesFor linux_2_6_32);
 
-  # The current default Linux kernel & modules.
-  linuxPackages = linuxPackages_2_6_28;
+  # The current default kernel / kernel modules.
+  linux = linux_2_6_32;
+  linuxPackages = linuxPackagesFor linux;
 
   customKernel = composedArgsAndFun (lib.sumTwoArgs (import ../os-specific/linux/kernel/generic.nix) {
     inherit fetchurl stdenv perl mktemp module_init_tools;
@@ -5867,7 +5991,7 @@ let
   };
 
   lvm2 = import ../os-specific/linux/lvm2 {
-    inherit fetchurl stdenv devicemapper;
+    inherit fetchurl stdenv;
   };
 
   mdadm = import ../os-specific/linux/mdadm {
@@ -5921,6 +6045,8 @@ let
     inherit stdenv fetchurl cracklib flex;
   };
 
+  # pam_bioapi ( see http://www.thinkwiki.org/wiki/How_to_enable_the_fingerprint_reader )
+
   pam_console = import ../os-specific/linux/pam_console {
     inherit stdenv fetchurl pam autoconf automake pkgconfig bison glib;
     libtool = libtool_1_5;
@@ -5943,6 +6069,10 @@ let
     inherit stdenv fetchurl pam;
   };
 
+  pam_usb = import ../os-specific/linux/pam_usb {
+    inherit stdenv fetchurl makeWrapper useSetUID dbus libxml2 pam hal pkgconfig pmount python pythonDBus;
+  };
+
   pcmciaUtils = composedArgsAndFun (import ../os-specific/linux/pcmciautils) {
     inherit stdenv fetchurl udev yacc flex;
     inherit sysfsutils module_init_tools;
@@ -5952,6 +6082,10 @@ let
     inherit lib;
   };
 
+  pmount = import ../os-specific/linux/pmount {
+    inherit fetchurl stdenv cryptsetup dbus dbus_glib hal intltool ntfs3g utillinuxng;
+  };
+
   pmutils = import ../os-specific/linux/pm-utils {
     inherit fetchurl stdenv;
   };
@@ -6469,6 +6603,17 @@ let
     inherit fetchurl stdenv ncurses;
   };
 
+  calibre = import ../applications/misc/calibre {
+    inherit stdenv fetchurl libpng imagemagick pkgconfig libjpeg fontconfig podofo
+      qt4 makeWrapper unrar;
+    python = python26Full;
+    pyqt4 = pyqt4_python26;
+    sip = sip_python26;
+    pil = pil_python26;
+    popplerQt4 = popplerQt45;
+    inherit (python26Packages) mechanize lxml dateutil;
+  };
+
   carrier = builderDefsPackage (import ../applications/networking/instant-messengers/carrier/2.5.0.nix) {
     inherit fetchurl stdenv pkgconfig perl perlXMLParser libxml2 openssl nss
       gtkspell aspell gettext ncurses avahi dbus dbus_glib python
@@ -6503,10 +6648,11 @@ let
     };
 
   chrome = import ../applications/networking/browsers/chromium {
-    inherit stdenv fetchurl ffmpeg cairo nspr nss fontconfig freetype alsaLib makeWrapper unzip expat zlib;
+    inherit stdenv fetchurl ffmpeg cairo nspr nss fontconfig freetype alsaLib makeWrapper unzip expat zlib bzip2 libpng;
     inherit (xlibs) libX11 libXext libXrender libXt ;
     inherit (gtkLibs) gtk glib pango atk;
     inherit (gnome) GConf;
+    libjpeg = libjpeg62;
   };
 
   chromeWrapper = wrapFirefox chrome "chrome" "";
@@ -6617,7 +6763,7 @@ let
     inherit (gtkLibs) gtk glib;
   };
 
-  darcs = haskellPackages.darcs;
+  darcs = haskellPackages_ghc6104.darcs;
 
   dia = import ../applications/graphics/dia {
     inherit stdenv fetchurl pkgconfig perl perlXMLParser
@@ -6910,6 +7056,7 @@ let
       inherit fetchurl stdenv zlib alsaLib curl nss nspr fontconfig freetype expat;
       inherit (xlibs) libX11 libXext libXrender libXt ;
       inherit (gtkLibs) gtk glib pango atk;
+      debug = getConfig ["flashplayer" "debug"] false;
     });
 
   flite = import ../applications/misc/flite {
@@ -7117,8 +7264,7 @@ let
   icecatWrapper = wrapFirefox icecat3Xul "icecat" "";
 
   icewm = import ../applications/window-managers/icewm {
-    inherit fetchurl stdenv gettext libjpeg libtiff libungif libpng imlib;
-    inherit (xlibs) libX11 libXft libXext libXinerama libXrandr;
+    inherit fetchurl stdenv gettext libjpeg libtiff libungif libpng imlib xlibs;
   };
 
   ikiwiki = makeOverridable (import ../applications/misc/ikiwiki) {
@@ -7324,6 +7470,17 @@ let
     gtksharp = gtksharp1;
   };
 
+  monotone = import ../applications/version-management/monotone {
+    inherit stdenv fetchurl boost zlib botan libidn pcre
+      sqlite lib perl;
+    lua = lua5;
+  };
+
+  monotoneViz = builderDefsPackage (import ../applications/version-management/monotone-viz/mtn-head.nix) {
+    inherit ocaml lablgtk graphviz pkgconfig autoconf automake libtool;
+    inherit (gnome) gtk libgnomecanvas glib;
+  };
+
   mozilla = import ../applications/networking/browsers/mozilla {
     inherit fetchurl pkgconfig stdenv perl zip;
     inherit (gtkLibs) gtk;
@@ -7461,7 +7618,7 @@ let
   };
 
   pidgin = import ../applications/networking/instant-messengers/pidgin {
-    inherit fetchurl stdenv pkgconfig perl perlXMLParser libxml2 nss nspr farsight2
+    inherit fetchurl stdenv pkgconfig perl perlXMLParser libxml2 nss nspr farsight2 python
       gtkspell aspell gettext ncurses avahi dbus dbus_glib lib intltool libidn;
     openssl = if (getConfig ["pidgin" "openssl"] true) then openssl else null;
     gnutls = if (getConfig ["pidgin" "gnutls"] false) then gnutls else null;
@@ -7512,7 +7669,7 @@ let
     inherit fetchurl stdenv pkgconfig imagemagick boost python;
   };
 
-  qemu = import ../applications/virtualization/qemu/0.11.0.nix {
+  qemu = import ../applications/virtualization/qemu/0.12.1.nix {
     inherit stdenv fetchurl SDL zlib which;
   };
 
@@ -7553,7 +7710,7 @@ let
     });
 
   rsync = import ../applications/networking/sync/rsync {
-    inherit fetchurl stdenv acl;
+    inherit fetchurl stdenv acl perl;
     enableACLs = !stdenv.isDarwin;
   };
 
@@ -7696,27 +7853,20 @@ let
     inherit fetchurl stdenv;
   };
 
-  thunderbird = import ../applications/networking/mailreaders/thunderbird-2.x {
+  thunderbird = thunderbird2;
+
+  thunderbird2 = import ../applications/networking/mailreaders/thunderbird/2.x.nix {
     inherit fetchurl stdenv pkgconfig perl zip libjpeg libpng zlib cairo;
     inherit (gtkLibs) gtk;
     inherit (gnome) libIDL;
     inherit (xlibs) libXi;
-    #enableOfficialBranding = true;
   };
 
-  /*
-  Despaired. Looks like ThunderBird-on-Firefox's-Xulrunner is non-trivial
-
-  thunderbird3 = lowPrio (import ../applications/networking/mailreaders/thunderbird-3.x {
-    inherit fetchurl stdenv pkgconfig perl zip libjpeg zlib cairo
-      python dbus dbus_glib freetype fontconfig bzip2 libpng alsaLib sqlite
-      patchelf nspr;
-    inherit (gtkLibs) gtk pango;
+  thunderbird3 = lowPrio (import ../applications/networking/mailreaders/thunderbird/3.x.nix {
+    inherit fetchurl stdenv pkgconfig perl python dbus_glib zip bzip2 alsaLib nspr;
+    inherit (gtkLibs) gtk;
     inherit (gnome) libIDL;
-    #enableOfficialBranding = true;
-    xulrunner = xulrunner35;
-    autoconf = autoconf213;
-  });*/
+  });
 
   timidity = import ../tools/misc/timidity {
     inherit fetchurl stdenv lib alsaLib composableDerivation jackaudio ncurses;
@@ -7765,6 +7915,12 @@ let
     qt = qt3;
   };
 
+  viewMtn = builderDefsPackage (import ../applications/version-management/viewmtn/0.10.nix)
+  {
+    inherit monotone flup cheetahTemplate highlight ctags
+      makeWrapper graphviz which python;
+  };
+
   vim = import ../applications/editors/vim {
     inherit fetchurl stdenv ncurses lib;
   };
@@ -7894,6 +8050,11 @@ let
     inherit fetchurl stdenv chmlib wxGTK;
   };
 
+  xcompmgr = import ../applications/window-managers/xcompmgr {
+    inherit stdenv fetchurl pkgconfig;
+    inherit (xlibs) libXcomposite libXfixes libXdamage libXrender;
+  };
+
   /* Doesn't work yet
 
   xen = builderDefsPackage (import ../applications/virtualization/xen) {
@@ -8259,7 +8420,7 @@ let
 
   kde4 = kde43;
 
-  kde43 = import ../desktops/kde-4.3 (pkgs // {
+  kde43 = makeOverridable (import ../desktops/kde-4.3) (pkgs // {
     openexr = openexr_1_6_1;
     qt4 = qt45;
     popplerQt4 = popplerQt45;
@@ -8717,14 +8878,15 @@ let
   wine =
     if system == "x86_64-linux" then
       # Can't build this in 64-bit; use a 32-bit build instead.
-      (import ./all-packages.nix {system = "i686-linux";}).wine
+      pkgsi686Linux.wine
       # some hackery to make nix-env show this package on x86_64...
       // {system = "x86_64-linux";}
     else
       import ../misc/emulators/wine {
-        inherit fetchurl stdenv flex bison mesa ncurses
+        inherit fetchurl stdenv bison mesa ncurses
           libpng libjpeg alsaLib lcms xlibs freetype
           fontconfig fontforge libxml2 libxslt openssl;
+	flex = flex2535;
       };
 
   xosd = import ../misc/xosd {
diff --git a/pkgs/top-level/haskell-packages.nix b/pkgs/top-level/haskell-packages.nix
index 9948236812f..ed5e5706291 100644
--- a/pkgs/top-level/haskell-packages.nix
+++ b/pkgs/top-level/haskell-packages.nix
@@ -27,11 +27,10 @@ rec {
 
   # Haskell libraries.
 
-  # Agda depends on a specific version of QuickCheck
   Agda = import ../development/libraries/haskell/Agda {
     inherit cabal binary haskeline haskellSrc mtl utf8String xhtml zlib
       happy alex;
-    QuickCheck = QuickCheck2101;
+    QuickCheck = QuickCheck2;
   };
 
   ansiTerminal = import ../development/libraries/haskell/ansi-terminal {
@@ -403,14 +402,12 @@ rec {
   };
 
   QuickCheck  = QuickCheck1;
-  QuickCheck1 = QuickCheck1200;
-  QuickCheck2 = QuickCheck2101;
 
-  QuickCheck1200 = import ../development/libraries/haskell/QuickCheck {
+  QuickCheck1 = import ../development/libraries/haskell/QuickCheck {
     inherit cabal;
   };
 
-  QuickCheck2101 = import ../development/libraries/haskell/QuickCheck/2.1.0.1.nix {
+  QuickCheck2 = import ../development/libraries/haskell/QuickCheck/QuickCheck-2.nix {
     inherit cabal mtl;
   };
 
diff --git a/pkgs/top-level/perl-packages.nix b/pkgs/top-level/perl-packages.nix
index 80127e1c1b4..ecc056d9017 100644
--- a/pkgs/top-level/perl-packages.nix
+++ b/pkgs/top-level/perl-packages.nix
@@ -2438,10 +2438,10 @@ rec {
   };
 
   VariableMagic = buildPerlPackage rec {
-    name = "Variable-Magic-0.35";
+    name = "Variable-Magic-0.36";
     src = fetchurl {
       url = "mirror://cpan/authors/id/V/VP/VPIT/${name}.tar.gz";
-      sha256 = "0p6f593bh8zyg4qlxpa3hmdp56saghcgx7r0p46gxscxyf3k0bdc";
+      sha256 = "15305b54e948f74a0cf77c1c6bd8aa399caac12d6b1dee8cc4a69ff7d1421db6";
     };
   };
 
@@ -2471,6 +2471,17 @@ rec {
     doCheck = false;
   };
 
+  X11GUITest = buildPerlPackage rec {
+    name = "X11-GUITest-0.21";
+    src = fetchurl {
+      url = "mirror://cpan/authors/id/C/CT/CTRONDLP/${name}.tar.gz";
+      sha256 = "0akjk2x2d3j1f95wn93mh6nvq8p6c9jcqmvkh1mli5jxr1rmhjx8";
+    };
+    buildInputs = [pkgs.x11 pkgs.xorg.libXtst pkgs.xorg.libXi];
+    NIX_CFLAGS_LINK = "-lX11 -lXext -lXtst";
+    doCheck = false; # requires an X server
+  };
+
   XMLDOM = buildPerlPackage {
     name = "XML-DOM-1.44";
     src = fetchurl {
diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix
index deb5e630fac..1965adc173d 100644
--- a/pkgs/top-level/python-packages.nix
+++ b/pkgs/top-level/python-packages.nix
@@ -1,7 +1,7 @@
-{ pkgs }:
+{ pkgs, python, buildPythonPackage }:
 
 rec {
-  inherit (pkgs) buildPythonPackage fetchurl fetchsvn stdenv python;
+  inherit (pkgs) fetchurl fetchsvn stdenv;
 
   argparse = buildPythonPackage (rec {
     name = "argparse-0.9.1";
@@ -53,6 +53,23 @@ rec {
     };
   });
 
+  dateutil = buildPythonPackage (rec {
+    name = "dateutil-1.4.1";
+
+    src = fetchurl {
+      url = "http://pypi.python.org/packages/source/p/python-dateutil/${name}.tar.gz";
+      sha256 = "0mrkh932k8s74h4rpgksvpmwbrrkq8zn78gbgwc22i2vlp31bdkl";
+    };
+
+    meta = {
+      description = "Powerful extensions to the standard datetime module";
+
+      homepage = http://pypi.python.org/pypi/python-dateutil;
+
+      license = "BSD-style";
+    };
+  });
+
   foolscap = buildPythonPackage (rec {
     name = "foolscap-0.4.2";
 
@@ -143,6 +160,23 @@ rec {
     };
   });
 
+  mechanize = buildPythonPackage (rec {
+    name = "mechanize-0.1.11";
+
+    src = fetchurl {
+      url = "http://wwwsearch.sourceforge.net/mechanize/src/${name}.tar.gz";
+      sha256 = "1h62mwy4iz09jqz17nrb9j8y0djd500zdfqwrz9xmdwqzqwixkj2";
+    };
+
+    meta = {
+      description = "Stateful programmatic web browsing in Python";
+
+      homepage = http://wwwsearch.sourceforge.net/;
+
+      license = "BSD-style";
+    };
+  });
+
   namebench = buildPythonPackage (rec {
     name = "namebench-1.0.5";
 
@@ -248,21 +282,20 @@ rec {
     };
   });
 
-  psycopg2 = buildPythonPackage {
-    name = "psycopg2-r407";
+  psycopg2 = buildPythonPackage rec {
+    name = "psycopg2-2.0.13";
 
     doCheck = false;
     
     src = fetchurl {
-      url = http://initd.org/pub/software/psycopg/psycopg2-r407.tar.gz;
-      sha256 = "b80bf2f106fc6dbd3d3c512e61baca0b44fa80b975e554982cc9e793c085cc86";
+      url = "http://initd.org/pub/software/psycopg/PSYCOPG-2-0/${name}.tar.gz";
+      sha256 = "0arkaa1nbbd3pyn4l1bc75wi7nff3vxxh4s8sj5al5hv20p64pm1";
     };
     
     propagatedBuildInputs = [ pkgs.postgresql ];
     
     meta = {
-      description = "PostgreSQL database adapter for the Python programming language.";
-      
+      description = "PostgreSQL database adapter for the Python programming language";
       license = "GPLv2/ZPL";
     };
   };
diff --git a/pkgs/top-level/release.nix b/pkgs/top-level/release.nix
index 091022eed19..0bfb086e8c7 100644
--- a/pkgs/top-level/release.nix
+++ b/pkgs/top-level/release.nix
@@ -225,6 +225,7 @@ in {
   inkscape = linux;
   iputils = linux;
   iproute = linux;
+  iptables = linux;
   irssi = linux;
   jfsutils = linux;
   jfsrec = linux;
@@ -240,6 +241,7 @@ in {
   ktorrent = linux;
   kvm = linux;
   qemu = linux;
+  qemu_kvm = linux;
   less = all;
   lftp = all;
   libarchive = linux;
@@ -375,7 +377,8 @@ in {
   texLiveBeamer = linux;
   texLiveExtra = linux;
   texinfo = all;
-  thunderbird = linux;
+  thunderbird2 = linux;
+  thunderbird3 = linux;
   tightvnc = linux;
   time = linux;
   tinycc = ["i686-linux"];
@@ -402,6 +405,7 @@ in {
   webkit = linux;
   wget = all;
   which = all;
+  wicd = linux;
   wine = ["i686-linux"];
   wireshark = linux;
   wirelesstools = linux;
@@ -484,6 +488,10 @@ in {
     xmonad = linux;
   };
 
+  haskellPackages_ghc6121 = {
+    ghc = ghcSupported;
+  };
+
   kde3 = {
     kdebase = linux;
     kdelibs = linux;