summary refs log tree commit diff
path: root/pkgs/applications
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/applications')
-rw-r--r--pkgs/applications/audio/amarok/default.nix4
-rw-r--r--pkgs/applications/audio/amarok/live.nix37
-rw-r--r--pkgs/applications/audio/ardour/ardour3.nix48
-rw-r--r--pkgs/applications/audio/audacious/default.nix14
-rw-r--r--pkgs/applications/audio/audacity/default.nix21
-rw-r--r--pkgs/applications/audio/bmp-plugins/musepack/builder.sh6
-rw-r--r--pkgs/applications/audio/bmp-plugins/musepack/default.nix11
-rw-r--r--pkgs/applications/audio/bmp-plugins/wma/default.nix19
-rw-r--r--pkgs/applications/audio/bmp/default.nix21
-rw-r--r--pkgs/applications/audio/cdparanoia/default.nix14
-rw-r--r--pkgs/applications/audio/cdparanoia/fix.patch46
-rw-r--r--pkgs/applications/audio/gmu/default.nix35
-rw-r--r--pkgs/applications/audio/hydrogen/default.nix35
-rw-r--r--pkgs/applications/audio/hydrogen/scons-env.patch20
-rw-r--r--pkgs/applications/audio/lash/default.nix36
-rw-r--r--pkgs/applications/audio/lash/socket.patch16
-rw-r--r--pkgs/applications/audio/lingot/default.nix22
-rw-r--r--pkgs/applications/audio/lmms/default.nix23
-rw-r--r--pkgs/applications/audio/mpg321/default.nix13
-rw-r--r--pkgs/applications/audio/puredata/default.nix28
-rw-r--r--pkgs/applications/audio/qjackctl/default.nix15
-rw-r--r--pkgs/applications/audio/qtractor/default.nix25
-rw-r--r--pkgs/applications/audio/rakarrack/default.nix23
-rw-r--r--pkgs/applications/audio/seq24/default.nix21
-rw-r--r--pkgs/applications/audio/sonic-visualiser/default.nix53
-rw-r--r--pkgs/applications/audio/sonic-visualizer/default.nix45
-rw-r--r--pkgs/applications/audio/specimen/default.nix28
-rw-r--r--pkgs/applications/audio/spotify/default.nix63
-rw-r--r--pkgs/applications/audio/spotify/preload.c66
-rw-r--r--pkgs/applications/audio/vkeybd/default.nix32
-rw-r--r--pkgs/applications/audio/vorbis-tools/default.nix10
-rw-r--r--pkgs/applications/audio/vorbis-tools/ogg123-curlopt-mute.patch13
-rw-r--r--pkgs/applications/audio/xsynth-dssi/default.nix37
-rw-r--r--pkgs/applications/audio/yoshimi/default.nix36
-rw-r--r--pkgs/applications/audio/zynaddsubfx/default.nix25
-rw-r--r--pkgs/applications/display-managers/slim/default.nix6
-rw-r--r--pkgs/applications/display-managers/slim/slim-1.3.1-gcc4.4.patch17
-rw-r--r--pkgs/applications/editors/eclipse/default.nix258
-rw-r--r--pkgs/applications/editors/emacs-23/default.nix20
-rw-r--r--pkgs/applications/editors/emacs-modes/bbdb/builder.sh12
-rw-r--r--pkgs/applications/editors/emacs-modes/bbdb/default.nix15
-rw-r--r--pkgs/applications/editors/emacs-modes/magit/default.nix15
-rw-r--r--pkgs/applications/editors/emacs-modes/org/default.nix18
-rw-r--r--pkgs/applications/editors/emacs-modes/proofgeneral/default.nix25
-rw-r--r--pkgs/applications/editors/emacs-modes/proofgeneral/emacs-23.3.patch45
-rw-r--r--pkgs/applications/editors/kdevelop/default.nix13
-rw-r--r--pkgs/applications/editors/leksah/default.nix45
-rw-r--r--pkgs/applications/editors/texmacs/default.nix8
-rw-r--r--pkgs/applications/editors/zile/default.nix4
-rw-r--r--pkgs/applications/graphics/ImageMagick/default.nix18
-rw-r--r--pkgs/applications/graphics/darktable/default.nix47
-rw-r--r--pkgs/applications/graphics/djview/default.nix4
-rw-r--r--pkgs/applications/graphics/fbida/default.nix49
-rw-r--r--pkgs/applications/graphics/feh/default.nix10
-rw-r--r--pkgs/applications/graphics/freecad/cmakeinstall.patch55
-rw-r--r--pkgs/applications/graphics/freecad/default.nix47
-rw-r--r--pkgs/applications/graphics/freecad/pythonpath.patch19
-rw-r--r--pkgs/applications/graphics/geeqie/default.nix10
-rw-r--r--pkgs/applications/graphics/giv/build.patch44
-rw-r--r--pkgs/applications/graphics/giv/default.nix35
-rw-r--r--pkgs/applications/graphics/giv/union.patch38
-rw-r--r--pkgs/applications/graphics/hugin/default.nix6
-rw-r--r--pkgs/applications/graphics/inkscape/default.nix4
-rw-r--r--pkgs/applications/graphics/jbrout/default.nix38
-rw-r--r--pkgs/applications/graphics/kipi-plugins/default.nix19
-rw-r--r--pkgs/applications/graphics/kipi-plugins/find-gdk.patch16
-rw-r--r--pkgs/applications/graphics/minidjvu/default.nix26
-rw-r--r--pkgs/applications/graphics/ocrad/default.nix34
-rw-r--r--pkgs/applications/graphics/paraview/default.nix33
-rw-r--r--pkgs/applications/graphics/tesseract/default.nix39
-rw-r--r--pkgs/applications/graphics/xscreensaver/default.nix17
-rw-r--r--pkgs/applications/misc/adobe-reader/default.nix16
-rw-r--r--pkgs/applications/misc/bitcoin/default.nix44
-rw-r--r--pkgs/applications/misc/blender/default.nix23
-rw-r--r--pkgs/applications/misc/blender/python-chmod.patch14
-rw-r--r--pkgs/applications/misc/calibre/default.nix9
-rw-r--r--pkgs/applications/misc/djvulibre/default.nix8
-rw-r--r--pkgs/applications/misc/dmenu/default.nix4
-rw-r--r--pkgs/applications/misc/epdfview/default.nix4
-rw-r--r--pkgs/applications/misc/evince/default.nix15
-rw-r--r--pkgs/applications/misc/fetchmail/default.nix29
-rw-r--r--pkgs/applications/misc/flite/default.nix29
-rw-r--r--pkgs/applications/misc/googleearth/default.nix11
-rw-r--r--pkgs/applications/misc/grip/default.nix6
-rw-r--r--pkgs/applications/misc/gv/default.nix4
-rw-r--r--pkgs/applications/misc/hello/ex-2/default.nix6
-rw-r--r--pkgs/applications/misc/ikiwiki/default.nix19
-rw-r--r--pkgs/applications/misc/jbidwatcher/default.nix50
-rw-r--r--pkgs/applications/misc/k3b/default.nix16
-rw-r--r--pkgs/applications/misc/kde-wacomtablet/default.nix20
-rw-r--r--pkgs/applications/misc/keepassx/default.nix24
-rw-r--r--pkgs/applications/misc/krename/default.nix4
-rw-r--r--pkgs/applications/misc/krusader/default.nix4
-rw-r--r--pkgs/applications/misc/lyx/default.nix10
-rw-r--r--pkgs/applications/misc/makeself/default.nix23
-rw-r--r--pkgs/applications/misc/merkaartor/default.nix16
-rw-r--r--pkgs/applications/misc/mysql-workbench/default.nix13
-rw-r--r--pkgs/applications/misc/nut/default.nix30
-rw-r--r--pkgs/applications/misc/qgis/default.nix43
-rw-r--r--pkgs/applications/misc/qgis/r14988.diff38
-rw-r--r--pkgs/applications/misc/qgis/trunk.nix23
-rw-r--r--pkgs/applications/misc/redshift/default.nix28
-rw-r--r--pkgs/applications/misc/rxvt_unicode/default.nix14
-rw-r--r--pkgs/applications/misc/sakura/default.nix4
-rw-r--r--pkgs/applications/misc/semnotes/default.nix4
-rw-r--r--pkgs/applications/misc/surf/default.nix29
-rw-r--r--pkgs/applications/misc/taskjuggler/default.nix20
-rw-r--r--pkgs/applications/misc/taskjuggler/timezone-glibc.patch48
-rw-r--r--pkgs/applications/misc/vifm/default.nix48
-rw-r--r--pkgs/applications/misc/xchm/default.nix6
-rw-r--r--pkgs/applications/misc/xmobar/default.nix22
-rw-r--r--pkgs/applications/misc/xneur/default.nix7
-rw-r--r--pkgs/applications/misc/xneur/src-for-default.nix8
-rw-r--r--pkgs/applications/misc/xpdf/default.nix6
-rw-r--r--pkgs/applications/misc/xterm/default.nix7
-rw-r--r--pkgs/applications/misc/zathura/default.nix22
-rw-r--r--pkgs/applications/networking/browsers/chromium/default.nix63
-rw-r--r--pkgs/applications/networking/browsers/conkeror/default.nix8
-rw-r--r--pkgs/applications/networking/browsers/elinks/default.nix4
-rw-r--r--pkgs/applications/networking/browsers/elinks/gc-init.patch17
-rw-r--r--pkgs/applications/networking/browsers/firefox/3.6.nix12
-rw-r--r--pkgs/applications/networking/browsers/firefox/5.0.nix (renamed from pkgs/applications/networking/browsers/firefox/4.0.nix)89
-rw-r--r--pkgs/applications/networking/browsers/firefox/6.0.nix (renamed from pkgs/applications/networking/browsers/firefox/3.5.nix)75
-rw-r--r--pkgs/applications/networking/browsers/firefox/7.0.nix184
-rw-r--r--pkgs/applications/networking/browsers/firefox/binary.nix55
-rw-r--r--pkgs/applications/networking/browsers/firefox/writable-copies.patch23
-rw-r--r--pkgs/applications/networking/browsers/firefox/xlibs.patch10
-rw-r--r--pkgs/applications/networking/browsers/icecat-3/default.nix4
-rw-r--r--pkgs/applications/networking/browsers/icecat-4/default.nix118
-rw-r--r--pkgs/applications/networking/browsers/icecat-4/rpath-link.patch14
-rw-r--r--pkgs/applications/networking/browsers/icecat-4/skip-gre-registration.patch12
-rw-r--r--pkgs/applications/networking/browsers/konq-plugins/default.nix4
-rw-r--r--pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-10/builder.sh3
-rw-r--r--pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-10/default.nix15
-rw-r--r--pkgs/applications/networking/browsers/mozilla-plugins/gecko-mediaplayer/default.nix4
-rw-r--r--pkgs/applications/networking/browsers/mozilla-plugins/google-talk-plugin/default.nix92
-rw-r--r--pkgs/applications/networking/browsers/rekonq/default.nix4
-rw-r--r--pkgs/applications/networking/browsers/uzbl/default.nix3
-rw-r--r--pkgs/applications/networking/browsers/w3m/default.nix8
-rw-r--r--pkgs/applications/networking/ekiga/default.nix2
-rw-r--r--pkgs/applications/networking/esniper/default.nix28
-rw-r--r--pkgs/applications/networking/instant-messengers/bitlbee-otr/default.nix38
-rw-r--r--pkgs/applications/networking/instant-messengers/bitlbee/default.nix11
-rw-r--r--pkgs/applications/networking/instant-messengers/freetalk/01_callbacks_const_fix.diff25
-rw-r--r--pkgs/applications/networking/instant-messengers/freetalk/default.nix51
-rw-r--r--pkgs/applications/networking/instant-messengers/kadu/config.patch15
-rw-r--r--pkgs/applications/networking/instant-messengers/kadu/default.nix26
-rw-r--r--pkgs/applications/networking/instant-messengers/kadu/more-icons.patch12
-rw-r--r--pkgs/applications/networking/instant-messengers/oneteam/default.nix90
-rw-r--r--pkgs/applications/networking/instant-messengers/pidgin/default.nix11
-rw-r--r--pkgs/applications/networking/instant-messengers/vacuum/default.nix10
-rw-r--r--pkgs/applications/networking/irc/chatzilla/default.nix6
-rw-r--r--pkgs/applications/networking/irc/quassel/default.nix4
-rw-r--r--pkgs/applications/networking/linphone/default.nix20
-rw-r--r--pkgs/applications/networking/mailreaders/mutt/default.nix16
-rw-r--r--pkgs/applications/networking/mailreaders/mutt/openssl.patch15
-rw-r--r--pkgs/applications/networking/mailreaders/notmuch/default.nix84
-rw-r--r--pkgs/applications/networking/mailreaders/thunderbird/3.x.nix6
-rw-r--r--pkgs/applications/networking/mailreaders/thunderbird/5.x.nix83
-rw-r--r--pkgs/applications/networking/mailreaders/thunderbird/thunderbird-build-deps.patch21
-rw-r--r--pkgs/applications/networking/mumble/default.nix45
-rw-r--r--pkgs/applications/networking/mumble/mumble-jack-support.patch457
-rw-r--r--pkgs/applications/networking/newsreaders/pan/default.nix22
-rw-r--r--pkgs/applications/networking/offrss/default.nix29
-rw-r--r--pkgs/applications/networking/p2p/ktorrent/default.nix (renamed from pkgs/applications/networking/ktorrent/default.nix)16
-rw-r--r--pkgs/applications/networking/p2p/ktorrent/find-workspace.diff (renamed from pkgs/applications/networking/ktorrent/find-workspace.diff)0
-rw-r--r--pkgs/applications/networking/p2p/mldonkey/default.nix4
-rw-r--r--pkgs/applications/networking/p2p/retroshare/default.nix28
-rw-r--r--pkgs/applications/networking/p2p/transmission/default.nix15
-rw-r--r--pkgs/applications/networking/p2p/tribler/default.nix43
-rw-r--r--pkgs/applications/networking/pjsip/default.nix30
-rw-r--r--pkgs/applications/networking/remote/rdesktop/default.nix4
-rw-r--r--pkgs/applications/networking/siproxd/default.nix19
-rw-r--r--pkgs/applications/networking/skype/default.nix12
-rw-r--r--pkgs/applications/networking/sync/akunambol/default.nix16
-rw-r--r--pkgs/applications/networking/sync/akunambol/non-latin.diff17
-rw-r--r--pkgs/applications/networking/sync/unison/default.nix30
-rw-r--r--pkgs/applications/office/abiword/default.nix4
-rw-r--r--pkgs/applications/office/gnucash/default.nix56
-rw-r--r--pkgs/applications/office/hledger-interest/default.nix20
-rw-r--r--pkgs/applications/office/homebank/default.nix4
-rw-r--r--pkgs/applications/office/keepnote/default.nix5
-rw-r--r--pkgs/applications/office/koffice/default.nix1
-rw-r--r--pkgs/applications/office/koffice/krita-exiv-0.21.diff81
-rw-r--r--pkgs/applications/office/ledger/3.0.nix45
-rw-r--r--pkgs/applications/office/ledger/default.nix61
-rw-r--r--pkgs/applications/office/openoffice/default.nix3
-rw-r--r--pkgs/applications/office/openoffice/go-oo.nix5
-rw-r--r--pkgs/applications/office/openoffice/xlib.patch22
-rw-r--r--pkgs/applications/science/astronomy/gravit/default.nix41
-rw-r--r--pkgs/applications/science/astronomy/stellarium/default.nix31
-rw-r--r--pkgs/applications/science/astronomy/xplanet/default.nix (renamed from pkgs/applications/science/xplanet/default.nix)0
-rw-r--r--pkgs/applications/science/chemistry/avogadro/default.nix19
-rw-r--r--pkgs/applications/science/electronics/gtkwave/default.nix4
-rw-r--r--pkgs/applications/science/logic/coq/default.nix11
-rw-r--r--pkgs/applications/science/logic/hol_light/default.nix61
-rw-r--r--pkgs/applications/science/logic/hol_light/dmtcp_checkpoint.nix99
-rw-r--r--pkgs/applications/science/logic/hol_light/dmtcp_selfdestruct.ml19
-rw-r--r--pkgs/applications/science/logic/hol_light/parser_setup.patch34
-rw-r--r--pkgs/applications/science/logic/hol_light/sources.nix28
-rw-r--r--pkgs/applications/science/logic/isabelle/default.nix4
-rw-r--r--pkgs/applications/science/logic/isabelle/settings.patch20
-rw-r--r--pkgs/applications/science/logic/leo2/default.nix4
-rw-r--r--pkgs/applications/science/logic/matita/Makefile.patch11
-rw-r--r--pkgs/applications/science/logic/matita/configure.patch36
-rw-r--r--pkgs/applications/science/logic/matita/default.nix54
-rw-r--r--pkgs/applications/science/logic/ssreflect/default.nix22
-rw-r--r--pkgs/applications/science/logic/tptp/default.nix87
-rw-r--r--pkgs/applications/science/math/ecm/default.nix27
-rw-r--r--pkgs/applications/science/math/eukleides/default.nix37
-rw-r--r--pkgs/applications/science/math/jags/default.nix17
-rw-r--r--pkgs/applications/science/math/maxima/default.nix32
-rw-r--r--pkgs/applications/science/math/msieve/default.nix28
-rw-r--r--pkgs/applications/science/math/pari/default.nix4
-rw-r--r--pkgs/applications/science/math/wxmaxima/default.nix25
-rw-r--r--pkgs/applications/science/misc/tulip/configure-opengl.patch75
-rw-r--r--pkgs/applications/science/misc/tulip/default.nix26
-rw-r--r--pkgs/applications/taxes/aangifte-2010/default.nix37
-rw-r--r--pkgs/applications/version-management/bazaar/default.nix21
-rw-r--r--pkgs/applications/version-management/bazaar/tools.nix4
-rw-r--r--pkgs/applications/version-management/darcs/darcs-2.nix20
-rw-r--r--pkgs/applications/version-management/darcs/default.nix27
-rw-r--r--pkgs/applications/version-management/fossil/default.nix9
-rw-r--r--pkgs/applications/version-management/git-and-tools/default.nix71
-rw-r--r--pkgs/applications/version-management/git-and-tools/git-annex/default.nix52
-rw-r--r--pkgs/applications/version-management/git-and-tools/git/default.nix49
-rw-r--r--pkgs/applications/version-management/git-and-tools/git2cl/default.nix23
-rw-r--r--pkgs/applications/version-management/git-and-tools/svn2git/default.nix25
-rw-r--r--pkgs/applications/version-management/git-and-tools/topgit/default.nix33
-rw-r--r--pkgs/applications/version-management/kdesvn/default.nix2
-rw-r--r--pkgs/applications/version-management/meld/default.nix13
-rw-r--r--pkgs/applications/version-management/mercurial/default.nix20
-rw-r--r--pkgs/applications/version-management/monotone-viz/mtn-head.nix2
-rw-r--r--pkgs/applications/version-management/monotone/default.nix26
-rw-r--r--pkgs/applications/version-management/subversion/default.nix4
-rw-r--r--pkgs/applications/version-management/veracity/default.nix32
-rw-r--r--pkgs/applications/version-management/veracity/src-for-default.nix10
-rw-r--r--pkgs/applications/version-management/veracity/src-info-for-default.nix4
-rw-r--r--pkgs/applications/video/MPlayer/default.nix61
-rw-r--r--pkgs/applications/video/bangarang/default.nix4
-rw-r--r--pkgs/applications/video/cinelerra/default.nix34
-rw-r--r--pkgs/applications/video/gnash/default.nix29
-rw-r--r--pkgs/applications/video/gnome-mplayer/default.nix4
-rw-r--r--pkgs/applications/video/kdenlive/default.nix18
-rw-r--r--pkgs/applications/video/kdenlive/kdenlive-newmlt.patch70
-rw-r--r--pkgs/applications/video/kino/default.nix16
-rw-r--r--pkgs/applications/video/mkvtoolnix/default.nix40
-rw-r--r--pkgs/applications/video/vlc/default.nix33
-rw-r--r--pkgs/applications/virtualization/nova/client.nix20
-rw-r--r--pkgs/applications/virtualization/nova/convert.patch12
-rw-r--r--pkgs/applications/virtualization/nova/default.nix94
-rw-r--r--pkgs/applications/virtualization/qemu/0.13.nix10
-rw-r--r--pkgs/applications/virtualization/virt-viewer/default.nix50
-rw-r--r--pkgs/applications/virtualization/virtualbox/default.nix18
-rw-r--r--pkgs/applications/virtualization/virtualbox/guest-additions/default.nix42
-rw-r--r--pkgs/applications/virtualization/xen/default.nix26
-rw-r--r--pkgs/applications/window-managers/awesome/cmake284.patch40
-rw-r--r--pkgs/applications/window-managers/awesome/default.nix16
-rw-r--r--pkgs/applications/window-managers/compiz/core.nix3
-rw-r--r--pkgs/applications/window-managers/compiz/gdk-deprecated.patch14
-rw-r--r--pkgs/applications/window-managers/dwm/default.nix4
-rw-r--r--pkgs/applications/window-managers/icewm/default.nix6
-rw-r--r--pkgs/applications/window-managers/jwm/default.nix11
-rw-r--r--pkgs/applications/window-managers/ratpoison/default.nix17
-rw-r--r--pkgs/applications/window-managers/trayer/default.nix28
-rw-r--r--pkgs/applications/window-managers/xmonad/default.nix21
-rw-r--r--pkgs/applications/window-managers/xmonad/xmonad-contrib.nix24
-rw-r--r--pkgs/applications/window-managers/xmonad/xmonad-extras.nix21
268 files changed, 5695 insertions, 1818 deletions
diff --git a/pkgs/applications/audio/amarok/default.nix b/pkgs/applications/audio/amarok/default.nix
index e47a06e27621..d1e79bae0828 100644
--- a/pkgs/applications/audio/amarok/default.nix
+++ b/pkgs/applications/audio/amarok/default.nix
@@ -6,11 +6,11 @@ stdenv.mkDerivation rec {
   name = "${pname}-${version}";
 
   pname = "amarok";
-  version = "2.3.2";
+  version = "2.4.3";
 
   src = fetchurl {
     url = "mirror://kde/stable/${pname}/${version}/src/${name}.tar.bz2";
-    sha256 = "0dw2928vkd42h3d8nsb8i4xhp8qfj1zsfc1m9wrzrsxl0vd6j9c4";
+    sha256 = "0242psqci1b6wfhrrds14h4c4qin9s83cxk1259d9hqcsgn4ir3c";
   };
 
   QT_PLUGIN_PATH="${qtscriptgenerator}/lib/qt4/plugins";
diff --git a/pkgs/applications/audio/amarok/live.nix b/pkgs/applications/audio/amarok/live.nix
new file mode 100644
index 000000000000..e90ca8748274
--- /dev/null
+++ b/pkgs/applications/audio/amarok/live.nix
@@ -0,0 +1,37 @@
+{ stdenv, fetchgit, fetchgitrevision
+, lib, cmake, qt4, qtscriptgenerator, perl, gettext, curl
+, libxml2, mysql, taglib, taglib_extras, loudmouth , kdelibs, automoc4, phonon
+, strigi, soprano, qca2, libmtp, liblastfm, libgpod, pkgconfig
+, repository ? "git://git.kde.org/amarok"
+, branch ? "heads/master"
+, rev ? fetchgitrevision repository branch
+, src ? fetchgit {
+    url = repository;
+    rev = rev;
+  }
+}:
+
+stdenv.mkDerivation rec {
+  name = "${pname}-${version}";
+
+  pname = "amarok";
+  version = "live";
+
+  inherit src;
+
+  QT_PLUGIN_PATH="${qtscriptgenerator}/lib/qt4/plugins";
+  buildInputs = [ cmake qt4 qtscriptgenerator perl stdenv.gcc.libc gettext curl
+    libxml2 mysql taglib taglib_extras loudmouth kdelibs automoc4 phonon strigi
+    soprano qca2 libmtp liblastfm libgpod pkgconfig ];
+
+  postInstall = ''
+    mkdir -p $out/nix-support
+    echo ${qtscriptgenerator} > $out/nix-support/propagated-user-env-packages
+  '';
+  meta = {
+    description = "Popular music player for KDE";
+    license = "GPL";
+    homepage = http://amarok.kde.org;
+    inherit (kdelibs.meta) maintainers;
+  };
+}
diff --git a/pkgs/applications/audio/ardour/ardour3.nix b/pkgs/applications/audio/ardour/ardour3.nix
new file mode 100644
index 000000000000..dea27cb6a552
--- /dev/null
+++ b/pkgs/applications/audio/ardour/ardour3.nix
@@ -0,0 +1,48 @@
+{ stdenv, fetchsvn, alsaLib, aubio, boost, cairomm, curl, fftw,
+fftwSinglePrec, flac, glib, glibmm, gtk, gtkmm, jackaudio,
+libgnomecanvas, libgnomecanvasmm, liblo, libmad, libogg, librdf,
+librdf_raptor, librdf_rasqal, libsamplerate, libsigcxx, libsndfile,
+libusb, libuuid, libxml2, libxslt, pango, perl, pkgconfig, python }:
+
+let
+  rev = "9942";
+in
+
+stdenv.mkDerivation {
+  name = "ardour3-svn-${rev}";
+
+  src = fetchsvn {
+    url = http://subversion.ardour.org/svn/ardour2/branches/3.0;
+    inherit rev;
+    sha256 = "5f463e5a67bcb1ee6b4d24c25307419ea14ce52130819054b775e377c31a0664";
+  };
+
+  buildInputs = [ alsaLib aubio boost cairomm curl fftw fftwSinglePrec
+    flac glib glibmm gtk gtkmm jackaudio libgnomecanvas
+    libgnomecanvasmm liblo libmad libogg librdf librdf_raptor
+    librdf_rasqal libsamplerate libsigcxx libsndfile libusb libuuid
+    libxml2 libxslt pango perl pkgconfig python ];
+
+  patchPhase = ''
+    printf '#include "ardour/svn_revision.h"\nnamespace ARDOUR { const char* svn_revision = \"${rev}\"; }\n' > libs/ardour/svn_revision.cc
+    sed -e 's|^#!/usr/bin/perl.*$|#!${perl}/bin/perl|g' -i tools/fmt-bindings
+    sed -e 's|^#!/usr/bin/env.*$|#!${perl}/bin/perl|g' -i tools/*.pl
+  '';
+
+  configurePhase = "python waf configure --prefix=$out";
+
+  buildPhase = "python waf";
+
+  installPhase = "python waf install";
+
+  meta = with stdenv.lib; {
+    description = "Multi-track hard disk recording software";
+    longDescription = ''
+      Also read "The importance of Paying Something" on their homepage, please!
+    '';
+    homepage = http://ardour.org/;
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.goibhniu ];
+  };
+}
diff --git a/pkgs/applications/audio/audacious/default.nix b/pkgs/applications/audio/audacious/default.nix
index 66db7efa3e6e..5124ff5d6dd9 100644
--- a/pkgs/applications/audio/audacious/default.nix
+++ b/pkgs/applications/audio/audacious/default.nix
@@ -4,20 +4,20 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "audacious-2.4.0";
+  name = "audacious-3.0";
   
   src = fetchurl {
-    url = "http://distfiles.atheme.org/${name}.tgz";
-    sha256 = "1n6mfy2j7lqv5d9r92n1frbs7acplfip5vssqp0j9z5qkidx98pj";
+    url = "http://distfiles.atheme.org/${name}.tar.gz";
+    sha256 = "0kj78hgf73fmbm6y3idir2kavbnnlv0jb9ka0pcsb12sxb994s68";
   };
 
   pluginsSrc = fetchurl {
-    url = "http://distfiles.atheme.org/audacious-plugins-2.4.0.tgz";
-    sha256 = "04rsfh7c54ffz6qavl3li5haa7jnaa42m4p1w0s4qpiiw3pvbaf5";
+    url = "http://distfiles.atheme.org/audacious-plugins-3.0.tar.gz";
+    sha256 = "0hhxk1mxnnrb1shshpf1nf8mqpc9q1qpsljwn4jzylcnwy6pq4rw";
   };
   
   # `--enable-amidiplug' is to prevent configure from looking in /proc/asound.
-  configureFlags = "--enable-amidiplug";
+  configureFlags = "--enable-amidiplug --disable-oss";
   
   buildInputs =
     [ gettext pkgconfig glib gtk libmowgli libmcs libxml2 dbus_glib
@@ -46,6 +46,8 @@ stdenv.mkDerivation rec {
       )
     '';
 
+  enableParallelBuilding = true;
+
   meta = {
     description = "Audacious, a media player forked from the Beep Media Player, which was itself an XMMS fork";
     homepage = http://audacious-media-player.org/;
diff --git a/pkgs/applications/audio/audacity/default.nix b/pkgs/applications/audio/audacity/default.nix
index 8d72402866f6..f2e2a130c0ac 100644
--- a/pkgs/applications/audio/audacity/default.nix
+++ b/pkgs/applications/audio/audacity/default.nix
@@ -1,22 +1,31 @@
 { stdenv, fetchurl, wxGTK, pkgconfig, gettext, gtk, glib, zlib, perl, intltool,
-  libogg, libvorbis, libmad
+  libogg, libvorbis, libmad, alsaLib, libsndfile, libsamplerate, flac, lame,
+  expat, id3lib, ffmpeg, portaudio
   }:
 
-stdenv.mkDerivation {
-  name = "audacity-1.3.7";
+stdenv.mkDerivation rec {
+  version = "1.3.13";
+  name = "audacity-${version}";
 
   NIX_CFLAGS_COMPILE = "-fPIC -lgtk-x11-2.0 -lglib-2.0 -lgobject-2.0 -lz";
 
   src = fetchurl {
-    url = mirror://sourceforge/audacity/audacity-fullsrc-1.3.7.tar.bz2;
-    sha256 = "0b4arafpdyjjk52l6n7aw518hzm65iv9w5g39jqr2bmvn6a9qivi";
+    url = "mirror://sourceforge/audacity/audacity-minsrc-${version}-beta.tar.bz2";
+    sha256 = "4c2eda638e16e16dfddd202e86ccbe1d170b04c26cfb2c12ffcba0b79e7e1e83";
   };
   buildInputs = [ wxGTK pkgconfig gettext gtk glib zlib intltool perl 
-    libogg libvorbis libmad];
+    libogg libvorbis libmad alsaLib libsndfile libsamplerate flac lame
+    expat id3lib ffmpeg portaudio];
+
+  configureFlags = [
+  ];
+
+  dontDisableStatic = true;
 
   meta = {
     description = "Sound editor with graphical UI";
     homepage = http://audacity.sourceforge.net;
     license = "GPLv2+";
+    platforms = with stdenv.lib.platforms; linux;
   };
 }
diff --git a/pkgs/applications/audio/bmp-plugins/musepack/builder.sh b/pkgs/applications/audio/bmp-plugins/musepack/builder.sh
deleted file mode 100644
index 4b78abf73ac1..000000000000
--- a/pkgs/applications/audio/bmp-plugins/musepack/builder.sh
+++ /dev/null
@@ -1,6 +0,0 @@
-source $stdenv/setup
-
-ensureDir "$out/lib/bmp/Input"
-installFlags="install libdir=$out/lib/bmp/Input"
-
-genericBuild
diff --git a/pkgs/applications/audio/bmp-plugins/musepack/default.nix b/pkgs/applications/audio/bmp-plugins/musepack/default.nix
deleted file mode 100644
index 141476642dee..000000000000
--- a/pkgs/applications/audio/bmp-plugins/musepack/default.nix
+++ /dev/null
@@ -1,11 +0,0 @@
-{stdenv, fetchurl, pkgconfig, bmp, libmpcdec, taglib}:
-
-stdenv.mkDerivation {
-  name = "bmp-plugin-musepack-1.2";
-  builder = ./builder.sh;
-  src = fetchurl {
-    url = http://files2.musepack.net/linux/plugins/bmp-musepack-1.2.tar.bz2;
-    md5 = "5fe0c9d341ca37d05c780a478f829a5f";
-  };
-  buildInputs = [pkgconfig bmp libmpcdec taglib];
-}
diff --git a/pkgs/applications/audio/bmp-plugins/wma/default.nix b/pkgs/applications/audio/bmp-plugins/wma/default.nix
deleted file mode 100644
index 617db6232a7d..000000000000
--- a/pkgs/applications/audio/bmp-plugins/wma/default.nix
+++ /dev/null
@@ -1,19 +0,0 @@
-{stdenv, fetchurl, pkgconfig, bmp}:
-
-stdenv.mkDerivation {
-  name = "bmp-plugin-wma-1.0.5";
-  
-  src = fetchurl {
-    url = http://mcmcc.bat.ru/xmms-wma/xmms-wma-1.0.5.tar.bz2;
-    md5 = "5d62a0f969617aeb40096362c7a8a506";
-  };
-  
-  buildInputs = [pkgconfig bmp];
-
-  buildFlags = "-f Makefile.bmp";
-  
-  installPhase = ''
-    ensureDir "$out/lib/bmp/Input"
-    cp libwma.so "$out/lib/bmp/Input"
-  '';
-}
diff --git a/pkgs/applications/audio/bmp/default.nix b/pkgs/applications/audio/bmp/default.nix
deleted file mode 100644
index bb3c9d6d43b6..000000000000
--- a/pkgs/applications/audio/bmp/default.nix
+++ /dev/null
@@ -1,21 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, alsaLib, esound, libogg, libvorbis, id3lib
-, glib, gtk, libglade
-}:
-
-stdenv.mkDerivation {
-  name = "bmp-0.9.7.1";
-  src = fetchurl {
-    url = mirror://sourceforge/beepmp/bmp-0.9.7.1.tar.gz;
-    md5 = "c25d5a8d49cc5851d13d525a20023c4c";
-  };
-
-  buildInputs = [
-    pkgconfig alsaLib esound libogg libvorbis id3lib libglade
-  ];
-
-  meta = {
-    description = "Beep Media Player, an XMMS fork";
-  };
-
-  propagatedBuildInputs = [glib gtk];
-}
diff --git a/pkgs/applications/audio/cdparanoia/default.nix b/pkgs/applications/audio/cdparanoia/default.nix
index 6fa69beee20e..6bd9e0b376e9 100644
--- a/pkgs/applications/audio/cdparanoia/default.nix
+++ b/pkgs/applications/audio/cdparanoia/default.nix
@@ -1,15 +1,15 @@
-{stdenv, fetchurl}:
+{ stdenv, fetchurl }:
 
-stdenv.mkDerivation {
-  name = "cdparanoia-III-alpha9.8";
+stdenv.mkDerivation rec {
+  name = "cdparanoia-III-10.2";
+  
   src = fetchurl {
-    url = http://downloads.xiph.org/releases/cdparanoia/cdparanoia-III-alpha9.8.src.tgz;
-    md5 = "7218e778b5970a86c958e597f952f193";
+    url = "http://downloads.xiph.org/releases/cdparanoia/${name}.src.tgz";
+    sha256 = "1pv4zrajm46za0f6lv162iqffih57a8ly4pc69f7y0gfyigb8p80";
   };
   
-  patches = [./fix.patch];
-
   meta = {
     homepage = http://xiph.org/paranoia;
+    description = "A tool and library for reading digital audio from CDs";
   };
 }
diff --git a/pkgs/applications/audio/cdparanoia/fix.patch b/pkgs/applications/audio/cdparanoia/fix.patch
deleted file mode 100644
index 4a1c526c7d8c..000000000000
--- a/pkgs/applications/audio/cdparanoia/fix.patch
+++ /dev/null
@@ -1,46 +0,0 @@
-*** cdparanoia-III-alpha9.8/interface/utils.h	Thu Apr 20 00:41:04 2000
---- cdparanoia-III-alpha9.8-old/interface/utils.h	Wed Jan 19 21:44:08 2005
-***************
-*** 110,117 ****
-      case CDDA_MESSAGE_LOGIT:
-        d->errorbuf=catstring(d->errorbuf,s);
-        break;
--     case CDDA_MESSAGE_FORGETIT:
--     default:
-      }
-    }
-  }
---- 110,115 ----
-***************
-*** 125,132 ****
-      case CDDA_MESSAGE_LOGIT:
-        d->messagebuf=catstring(d->messagebuf,s);
-        break;
--     case CDDA_MESSAGE_FORGETIT:
--     default:
-      }
-    }
-  }
---- 123,128 ----
-***************
-*** 167,174 ****
-  	}
-        }
-        break;
--     case CDDA_MESSAGE_FORGETIT:
--     default:
-      }
-    }
-    if(malloced)free(buffer);
---- 163,168 ----
-***************
-*** 203,210 ****
-  	if(!malloced)*messages=catstring(*messages,"\n");
-  	}
-        break;
--     case CDDA_MESSAGE_FORGETIT:
--     default:
-      }
-    }
-    if(malloced)free(buffer);
---- 197,202 ----
diff --git a/pkgs/applications/audio/gmu/default.nix b/pkgs/applications/audio/gmu/default.nix
new file mode 100644
index 000000000000..bdda1c6d8d96
--- /dev/null
+++ b/pkgs/applications/audio/gmu/default.nix
@@ -0,0 +1,35 @@
+{stdenv, fetchurl, SDL, SDL_gfx, SDL_image, tremor, flac, mpg123, libmikmod
+, speex
+, keymap ? "newdefault"
+, conf ? "unknown"
+}:
+
+stdenv.mkDerivation rec {
+  name = "gmu-0.7.2";
+  
+  src = fetchurl {
+    url = http://wejp.k.vu/files/gmu-0.7.2.tar.gz;
+    sha256 = "0gvhwhhlj64lc425wqch4g6v59ldd5i3rxll3zdcrdgk2vkh8nys";
+  };
+
+  buildInputs = [ SDL SDL_gfx SDL_image tremor flac mpg123 libmikmod speex ];
+
+  NIX_LDFLAGS = "-lgcc_s";
+
+  preBuild = ''
+    makeFlags="$makeFlags PREFIX=$out"
+  '';
+
+  postInstall = ''
+    cp ${keymap}.keymap $out/share/gmu/default.keymap
+    cp gmuinput.${conf}.conf $out/share/gmu/gmuinput.conf
+    ensureDir $out/etc/gmu
+    cp gmu.${conf}.conf $out/etc/gmu/gmu.conf
+  '';
+
+  meta = {
+    homepage = http://wejp.k.vu/projects/gmu;
+    description = "Open source music player for portable gaming consoles and handhelds";
+    license = "GPLv2";
+  };
+}
diff --git a/pkgs/applications/audio/hydrogen/default.nix b/pkgs/applications/audio/hydrogen/default.nix
new file mode 100644
index 000000000000..765f5559914e
--- /dev/null
+++ b/pkgs/applications/audio/hydrogen/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchurl, 
+  alsaLib, boost, glib, jackaudio, libarchive, liblrdf, libsndfile,
+  pkgconfig, qt4, scons, subversion }:
+
+stdenv.mkDerivation rec {
+  version = "0.9.5";
+  name = "hydrogen-${version}";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/hydrogen/hydrogen-${version}.tar.gz";
+    sha256 = "1hyri49va2ss26skd6p9swkx0kbr7ggifbahkrcfgj8yj7pp6g4n";
+  };
+
+  buildInputs = [ 
+    alsaLib boost glib jackaudio libarchive liblrdf libsndfile
+    pkgconfig qt4 scons subversion 
+  ];
+
+  patches = [ ./scons-env.patch ];
+
+  # why doesn't scons find librdf?
+  buildPhase = ''
+    scons prefix=$out libarchive=1 lrdf=0 install
+  '';
+
+  installPhase = ":";
+
+  meta = with stdenv.lib; {
+    description = "Advanced drum machine";
+    homepage = http://www.hydrogen-music.org;
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.goibhniu ];
+  };
+}
diff --git a/pkgs/applications/audio/hydrogen/scons-env.patch b/pkgs/applications/audio/hydrogen/scons-env.patch
new file mode 100644
index 000000000000..4ffa1f91e91d
--- /dev/null
+++ b/pkgs/applications/audio/hydrogen/scons-env.patch
@@ -0,0 +1,20 @@
+--- hydrogen-0.9.5/Sconstruct	2011-03-15 13:22:35.000000000 +0100
++++ hydrogen-0.9.5/Sconstruct	2011-04-17 16:06:54.000000000 +0200
+@@ -178,7 +178,7 @@
+ 
+ 	includes.append( "libs/hydrogen/include" )
+ 	
+-	env = Environment( options = opts ) 
++	env = Environment( options = opts, ENV = os.environ ) 
+ 
+ 
+ 	#location of qt4.py
+@@ -379,7 +379,7 @@
+ 
+ includes, a , b = get_platform_flags( opts )
+ 
+-env = Environment(options = opts, CPPPATH = includes)
++env = Environment(options = opts, ENV = os.environ)
+ 
+ 
+ Help(opts.GenerateHelpText(env))
diff --git a/pkgs/applications/audio/lash/default.nix b/pkgs/applications/audio/lash/default.nix
new file mode 100644
index 000000000000..3bbc9e4277b4
--- /dev/null
+++ b/pkgs/applications/audio/lash/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, fetchurl, alsaLib, gtk, jackaudio, libuuid, libxml2
+, makeWrapper, pkgconfig, readline }:
+
+assert libuuid != null;
+
+stdenv.mkDerivation  rec {
+  name = "lash-${version}";
+  version = "0.5.4";
+
+  src = fetchurl {
+    url = "mirror://savannah/lash/${name}.tar.gz";
+    sha256 = "05kc4brcx8mncai0rj2gz4s4bsrsy9q8xlnaddf75i0m8jl7snhh";
+  };
+
+  patches = [ ./socket.patch ];
+
+  buildInputs = [ alsaLib gtk jackaudio libuuid libxml2 makeWrapper
+    pkgconfig readline ];
+
+  postInstall = ''
+    for i in lash_control lash_panel
+      do wrapProgram "$out/bin/$i" --prefix LD_LIBRARY_PATH ":" "${libuuid}/lib"
+    done
+  '';
+
+  meta = with stdenv.lib; {
+    description = "LASH Audio Session Handler";
+    longDescription = ''
+      Session management system for GNU/Linux audio applications.
+    '';
+    homepage = http://www.nongnu.org/lash;
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.goibhniu ];
+  };
+}
diff --git a/pkgs/applications/audio/lash/socket.patch b/pkgs/applications/audio/lash/socket.patch
new file mode 100644
index 000000000000..c28259214443
--- /dev/null
+++ b/pkgs/applications/audio/lash/socket.patch
@@ -0,0 +1,16 @@
+Via http://bugs.gentoo.org/show_bug.cgi?id=229603
+
+--- lash-0.5.4/liblash/socket.c	2008-06-26 15:20:44.227064193 +0200
++++ lash-0.5.4/liblash/socket.c	2008-06-26 15:21:18.245063129 +0200
+@@ -20,6 +20,11 @@ 
+ 
+ #define _POSIX_SOURCE /* addrinfo */
+ 
++#ifdef LASH_BUILD
++#define _GNU_SOURCE
++#include "config.h"
++#endif /* LASH_BUILD */
++
+ #include <stdint.h>
+ #include <sys/types.h>
+ #include <sys/socket.h>
diff --git a/pkgs/applications/audio/lingot/default.nix b/pkgs/applications/audio/lingot/default.nix
new file mode 100644
index 000000000000..e93f6ffc584d
--- /dev/null
+++ b/pkgs/applications/audio/lingot/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchurl, pkgconfig, intltool, gtk, alsaLib, libglade }:
+
+stdenv.mkDerivation {
+  name = "lingot-0.9.0";
+
+  src = fetchurl {
+    url = http://download.savannah.gnu.org/releases/lingot/lingot-0.9.0.tar.gz;
+    sha256 = "07z129lp8m4sz608q409wb11c639w7cbn497r7bscgg08p6c07xb";
+  };
+
+  buildInputs = [ pkgconfig intltool gtk alsaLib libglade ];
+
+  configureFlags = "--disable-jack";
+
+  meta = {
+    description = "Not a Guitar-Only tuner";
+    homepage = http://www.nongnu.org/lingot/;
+    license = "GPLv2+";
+    platforms = with stdenv.lib.platforms; linux;
+    maintainers = with stdenv.lib.maintainers; [viric];
+  };
+}
diff --git a/pkgs/applications/audio/lmms/default.nix b/pkgs/applications/audio/lmms/default.nix
new file mode 100644
index 000000000000..8cdb99412f44
--- /dev/null
+++ b/pkgs/applications/audio/lmms/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchurl, SDL, alsaLib, cmake, fftw, jackaudio, libogg,
+libsamplerate, libsndfile, pkgconfig, pulseaudio, qt4 }:
+
+stdenv.mkDerivation  rec {
+  name = "lmms-${version}";
+  version = "0.4.10";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/lmms/${name}.tar.bz2";
+    sha256 = "035cqmxcbr9ipnicdv5l7h05q2hqbavxkbaxyq06ppnv2y7fxwrb";
+  };
+
+  buildInputs = [ SDL alsaLib cmake fftw jackaudio libogg
+    libsamplerate libsndfile pkgconfig pulseaudio qt4 ];
+
+  meta = with stdenv.lib; {
+    description = "Linux MultiMedia Studio";
+    homepage = "http://lmms.sourceforge.net";
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.goibhniu ];
+  };
+}
diff --git a/pkgs/applications/audio/mpg321/default.nix b/pkgs/applications/audio/mpg321/default.nix
index 23cc92132b95..4ca0cc8f8476 100644
--- a/pkgs/applications/audio/mpg321/default.nix
+++ b/pkgs/applications/audio/mpg321/default.nix
@@ -1,17 +1,20 @@
 {stdenv, fetchurl, libao, libmad, libid3tag, zlib}:
 
-stdenv.mkDerivation {
-  name = "mpg321-0.2.10";
+stdenv.mkDerivation rec {
+  name = "mpg321-0.2.13-2";
+
   src = fetchurl {
-    url = mirror://sourceforge/mpg321/mpg321-0.2.10.tar.gz;
-    sha256 = "db0c299592b8f1f704f41bd3fc3a2bf138658108588d51af61638c551af1b0d4";
+    url = "mirror://sourceforge/mpg321/0.2.13/${name}.tar.gz";
+    sha256 = "0zx9xyr97frlyrwyk2msm9h1sn2b84vqaxcy5drbzcd2n585lwlx";
   };
 
   buildInputs = [libao libid3tag libmad zlib];
 
   meta = {
-    description = "Command-line MP3 player.";
+    description = "mpg321, a command-line MP3 player";
     homepage = http://mpg321.sourceforge.net/;
     license = "GPLv2";
+    maintainers = [ stdenv.lib.maintainers.ludo ];
+    platforms = stdenv.lib.platforms.gnu;
   };
 }
diff --git a/pkgs/applications/audio/puredata/default.nix b/pkgs/applications/audio/puredata/default.nix
new file mode 100644
index 000000000000..e2563b8fe06f
--- /dev/null
+++ b/pkgs/applications/audio/puredata/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchurl, alsaLib, autoconf, automake, fftw, gettext, glib,
+libX11, libtool, tcl, tk }:
+
+stdenv.mkDerivation  rec {
+  name = "puredata-${version}";
+  version = "0.43-0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/pure-data/pd-${version}.src.tar.gz";
+    sha256 = "1qfq7x8vj12kr0cdrnbvmxfhc03flicc6vcc8bz6hwrrakwciyz2";
+  };
+
+  buildInputs = [ alsaLib autoconf automake fftw gettext glib libX11
+    libtool tcl tk ];
+
+  preConfigure = ''
+    ./autogen.sh
+  '';
+
+  meta = with stdenv.lib; {
+    description = ''Real-time graphical programming environment for
+                    audio, video, and graphical processing'';
+    homepage = http://puredata.info;
+    license = licenses.bsd3;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.goibhniu ];
+  };
+}
diff --git a/pkgs/applications/audio/qjackctl/default.nix b/pkgs/applications/audio/qjackctl/default.nix
index dbe32f862f26..4cdea1a21ce3 100644
--- a/pkgs/applications/audio/qjackctl/default.nix
+++ b/pkgs/applications/audio/qjackctl/default.nix
@@ -1,18 +1,19 @@
-{ stdenv, fetchurl, qt4, alsaLib, jackaudio }:
+{ stdenv, fetchurl, qt4, alsaLib, jackaudio, dbus }:
 
-stdenv.mkDerivation {
-  name = "qjackctl-0.3.3";
+stdenv.mkDerivation rec {
+  version = "0.3.7";
+  name = "qjackctl-${version}";
 
   # some dependencies such as killall have to be installed additionally
 
   src = fetchurl {
-    url = http://downloads.sourceforge.net/qjackctl/qjackctl-0.3.3.tar.gz;
-    sha256 = "1z9v208fs79ka6ni3p5v5xb0k5y1wqqm2a9cf903387b9p3fhpxj";
+    url = "mirror://sourceforge/qjackctl/${name}.tar.gz";
+    sha256 = "1gynym21d8d4d38qyl817qg0v8360brcpga4wcdapccbgpaz3c28";
   };
 
-  buildInputs = [ qt4 alsaLib jackaudio ];
+  buildInputs = [ qt4 alsaLib jackaudio dbus ];
 
-  meta = { 
+  meta = {
     description = "qt jackd control gui tool";
     homepage = http://qjackctl.sourceforge.net/;
     license = "GPL";
diff --git a/pkgs/applications/audio/qtractor/default.nix b/pkgs/applications/audio/qtractor/default.nix
new file mode 100644
index 000000000000..7634ecc01da2
--- /dev/null
+++ b/pkgs/applications/audio/qtractor/default.nix
@@ -0,0 +1,25 @@
+{ alsaLib, autoconf, automake, dssi, fetchurl, gtk, jackaudio,
+ladspaH, ladspaPlugins, liblo, libmad, libsamplerate, libsndfile,
+libtool, libvorbis, pkgconfig, qt4, rubberband, stdenv }:
+
+stdenv.mkDerivation rec {
+  version = "0.5.0";
+  name = "qtractor-${version}";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/qtractor/${name}.tar.gz";
+    sha256 = "de5991d2d29b2713d73a90ab29efc24db0be68d8e9ca328062d53d229e902e89";
+  };
+
+  buildInputs = [ alsaLib autoconf automake dssi gtk jackaudio ladspaH
+    ladspaPlugins liblo libmad libsamplerate libsndfile libtool
+    libvorbis pkgconfig qt4 rubberband ];
+
+  meta = with stdenv.lib; {
+    description = "Audio/MIDI multi-track sequencer";
+    homepage = http://qtractor.sourceforge.net;
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.goibhniu ];
+  };
+}
diff --git a/pkgs/applications/audio/rakarrack/default.nix b/pkgs/applications/audio/rakarrack/default.nix
new file mode 100644
index 000000000000..87ab88079ec2
--- /dev/null
+++ b/pkgs/applications/audio/rakarrack/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchurl, alsaLib, alsaUtils, fltk, jackaudio, libXft,
+libXpm, libjpeg, libpng, libsamplerate, libsndfile, zlib }:
+
+stdenv.mkDerivation  rec {
+  name = "rakarrack-${version}";
+  version = "0.6.1";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/rakarrack/${name}.tar.bz2";
+    sha256 = "1rpf63pdn54c4yg13k7cb1w1c7zsvl97c4qxcpz41c8l91xd55kn";
+  };
+
+  buildInputs = [ alsaLib alsaUtils fltk jackaudio libXft libXpm libjpeg
+    libpng libsamplerate libsndfile zlib ];
+
+  meta = with stdenv.lib; {
+    description = "multi-effects processor emulating a guitar effects pedalboard";
+    homepage = http://rakarrack.sourceforge.net;
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.goibhniu ];
+  };
+}
diff --git a/pkgs/applications/audio/seq24/default.nix b/pkgs/applications/audio/seq24/default.nix
new file mode 100644
index 000000000000..9f168f54eafd
--- /dev/null
+++ b/pkgs/applications/audio/seq24/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, fetchurl, alsaLib, gtkmm, jackaudio, pkgconfig }:
+
+stdenv.mkDerivation  rec {
+  name = "seq24-${version}";
+  version = "0.9.2";
+
+  src = fetchurl {
+    url = "http://launchpad.net/seq24/trunk/${version}/+download/${name}.tar.gz";
+    sha256 = "07n80zj95i80vjmsflnlbqx5vv90qmp5f6a0zap8d30849l4y258";
+  };
+
+  buildInputs = [ alsaLib gtkmm jackaudio pkgconfig ];
+
+  meta = with stdenv.lib; {
+    description = "minimal loop based midi sequencer";
+    homepage = "http://www.filter24.org/seq24";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.goibhniu ];
+  };
+}
diff --git a/pkgs/applications/audio/sonic-visualiser/default.nix b/pkgs/applications/audio/sonic-visualiser/default.nix
new file mode 100644
index 000000000000..d3ac4c4168c8
--- /dev/null
+++ b/pkgs/applications/audio/sonic-visualiser/default.nix
@@ -0,0 +1,53 @@
+# TODO add plugins having various licenses, see http://www.vamp-plugins.org/download.html
+
+{ stdenv, fetchurl, alsaLib, bzip2, fftw, jackaudio, libX11, liblo,
+libmad, libogg, librdf, librdf_raptor, librdf_rasqal, libsamplerate,
+libsndfile, makeWrapper, pulseaudio, qt4, redland, rubberband, vampSDK
+}:
+
+stdenv.mkDerivation {
+  name = "sonic-visualiser-1.8";
+
+  src = fetchurl {
+    url = http://downloads.sourceforge.net/sv1/sonic-visualiser-1.8.tar.gz;
+    sha256 = "16ik6q9n92wljvnqcv7hyzb9v3yp3ixxp6df9kasf53fii973dh7";
+  };
+
+  buildInputs =
+    [ libsndfile qt4 fftw /* should be fftw3f ??*/ bzip2 librdf rubberband
+      libsamplerate vampSDK alsaLib librdf_raptor librdf_rasqal redland
+      # optional
+      jackaudio
+      # portaudio
+      pulseaudio
+      libmad
+      libogg # ?
+      # fishsound
+      liblo
+      libX11
+      makeWrapper
+    ];
+
+  buildPhase = ''
+    for i in sonic-visualiser svapp svcore svgui; 
+      do cd $i && qmake -makefile PREFIX=$out && cd ..;
+    done
+    make
+  '';
+
+  installPhase = ''
+    ensureDir $out/{bin,share/sonic-visualiser}
+    cp sonic-visualiser/sonic-visualiser $out/bin
+    cp -r sonic-visualiser/samples $out/share/sonic-visualiser/samples
+    wrapProgram $out/bin/sonic-visualiser --prefix LD_LIBRARY_PATH : ${libX11}/lib
+  '';
+
+  meta = { 
+    description = "View and analyse contents of music audio files";
+    homepage = http://www.sonicvisualiser.org/;
+    license = "GPLv2";
+    maintainers = [ stdenv.lib.maintainers.marcweber 
+      stdenv.lib.maintainers.goibhniu ];
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/applications/audio/sonic-visualizer/default.nix b/pkgs/applications/audio/sonic-visualizer/default.nix
deleted file mode 100644
index 6e40baa1c360..000000000000
--- a/pkgs/applications/audio/sonic-visualizer/default.nix
+++ /dev/null
@@ -1,45 +0,0 @@
-# TODO add plugins having various licenses, see http://www.vamp-plugins.org/download.html
-
-{ stdenv, fetchurl, libsndfile, qt, fftw, librdf, rubberband
-, libsamplerate, vampSDK, alsaLib, librdf_raptor, librdf_rasqal
-, redland, jackaudio, pulseaudio, libmad, libogg, liblo, bzip2 }:
-
-stdenv.mkDerivation {
-  name = "sonic-visualizer-1.6";
-
-  src = fetchurl {
-    url = http://downloads.sourceforge.net/sv1/sonic-visualiser-1.6.tar.bz2;
-    sha256 = "1dbqqa7anii2jnjpfwm4sr83nn4bwmz68xw4n6clycsz5iqk52f5";
-  };
-
-  buildInputs =
-    [ libsndfile qt fftw /* should be fftw3f ??*/ bzip2 librdf rubberband
-      libsamplerate vampSDK alsaLib librdf_raptor librdf_rasqal redland
-      # optional
-      jackaudio
-      # portaudio
-      pulseaudio
-      libmad
-      libogg # ?
-      # fishsound
-      liblo
-    ];
-
-  buildPhase = ''
-    qmake -makefile PREFIX=$out && make
-  '';
-
-  installPhase = ''
-    ensureDir $out/{bin,share/sv}
-    cp sv/sonic-visualiser $out/bin
-    cp -r sv/samples $out/share/sv/samples
-  '';
-
-  meta = { 
-    description = "View and analyse contents of music audio files";
-    homepage = http://www.sonicvisualiser.org/;
-    license = "GPLv2";
-    maintainers = [ stdenv.lib.maintainers.marcweber ];
-    platforms = stdenv.lib.platforms.linux;
-  };
-}
diff --git a/pkgs/applications/audio/specimen/default.nix b/pkgs/applications/audio/specimen/default.nix
new file mode 100644
index 000000000000..31b17b70ff30
--- /dev/null
+++ b/pkgs/applications/audio/specimen/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchsvn, alsaLib, autoconf, automake, gtk, jackaudio,
+libgnomecanvas, libsamplerate, libsndfile, libtool, libxml2, phat,
+pkgconfig }:
+
+stdenv.mkDerivation  rec {
+  name = "specimen-svn-89";
+
+  # The released version won't compile with newer versions of jack
+  src = fetchsvn {
+    url = http://zhevny.com/svn/specimen/trunk;
+    rev = 89;
+    sha256 = "1i24nchw14cbjv7kmzs7cvmis2xv4r7bxghi8d6gq5lprwk8xydf";
+  };
+
+  preConfigure = "sh autogen.sh";
+
+  buildInputs = [ alsaLib autoconf automake gtk jackaudio
+    libgnomecanvas libsamplerate libsndfile libtool libxml2 phat
+    pkgconfig ];
+
+  meta = with stdenv.lib; {
+    description = "MIDI controllable audio sampler";
+    homepage = http://zhevny.com/specimen/;
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.goibhniu ];
+  };
+}
diff --git a/pkgs/applications/audio/spotify/default.nix b/pkgs/applications/audio/spotify/default.nix
new file mode 100644
index 000000000000..eb783e60fc5f
--- /dev/null
+++ b/pkgs/applications/audio/spotify/default.nix
@@ -0,0 +1,63 @@
+{ fetchurl, stdenv, dpkg, xlibs, qt4, alsaLib, makeWrapper }:
+
+assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux";
+
+let version = "0.5.2.84"; in
+
+stdenv.mkDerivation {
+  name = "spotify-${version}";
+
+  src =
+    if stdenv.system == "i686-linux" then 
+      fetchurl {
+        url = "http://repository.spotify.com/pool/non-free/s/spotify/spotify-client-qt_${version}.g6d797eb-1_i386.deb";
+        sha256 = "0l1pvvkkssng0yc7zlgxr39jx3cs6i71sspmm4xb84y1bl045pas";
+      }
+    else if stdenv.system == "x86_64-linux" then 
+      fetchurl {
+        url = "http://repository.spotify.com/pool/non-free/s/spotify/spotify-client-qt_${version}.g6d797eb-1_amd64.deb";
+        sha256 = "1wi1z3dyzjz13mkb0r2ilm914p8sg06923sv872nclrl102qbbni";
+      }
+    else throw "Spotify not supported on this platform.";
+
+  buildInputs = [ dpkg makeWrapper ];
+
+  unpackPhase = "true";
+  
+  installPhase =
+    ''
+      mkdir -p $out
+      dpkg-deb -x $src $out
+      mv $out/usr/* $out/
+      rmdir $out/usr
+
+      patchelf \
+        --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
+        --set-rpath ${stdenv.lib.makeLibraryPath [ xlibs.libXScrnSaver xlibs.libX11 qt4 alsaLib stdenv.gcc.gcc ]}:${stdenv.gcc.gcc}/lib64 \
+        $out/bin/spotify
+
+      preload=$out/libexec/spotify/libpreload.so
+      mkdir -p $out/libexec/spotify
+      gcc -shared ${./preload.c} -o $preload -ldl -DOUT=\"$out\" -fPIC
+
+      wrapProgram $out/bin/spotify --set LD_PRELOAD $preload
+    ''; # */
+
+  dontStrip = true;
+  dontPatchELF = true;
+
+  meta = {
+    homepage = https://www.spotify.com/download/previews/;
+    description = "Spotify for Linux allows you to play music from the Spotify music service";
+    license = "unfree";
+    maintainers = [ stdenv.lib.maintainers.eelco ];
+
+    longDescription =
+      ''
+        Spotify is a digital music streaming service.  This package
+        provides the Spotify client for Linux.  At present, it does not
+        work with free Spotify accounts; it requires a Premium or
+        Unlimited account.
+      '';
+  };
+}
diff --git a/pkgs/applications/audio/spotify/preload.c b/pkgs/applications/audio/spotify/preload.c
new file mode 100644
index 000000000000..42d482c21e43
--- /dev/null
+++ b/pkgs/applications/audio/spotify/preload.c
@@ -0,0 +1,66 @@
+/* Spotify looks for its theme data in /usr/share/spotify/theme.  This
+   LD_PRELOAD library intercepts open() and stat() calls to redirect
+   them to the corresponding location in $out. */
+
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <stdarg.h>
+#include <stdlib.h>
+#include <dlfcn.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <limits.h>
+
+char themeDir [] = "/usr/share/spotify/theme";
+char realThemeDir [] = OUT "/share/spotify/theme";
+
+const char * rewrite(const char * path, char * buf)
+{
+    if (strncmp(path, themeDir, sizeof(themeDir) - 1) != 0) return path;
+    if (snprintf(buf, PATH_MAX, "%s%s", realThemeDir, path + sizeof(themeDir) - 1) >= PATH_MAX)
+        abort();
+    return buf;
+}
+
+int open(const char *path, int flags, ...)
+{
+    char buf[PATH_MAX];
+    int (*_open) (const char *, int, mode_t) = dlsym(RTLD_NEXT, "open");
+    mode_t mode = 0;
+    if (flags & O_CREAT) {
+        va_list ap;
+        va_start(ap, flags);
+        mode = va_arg(ap, mode_t);
+        va_end(ap);
+    }
+    return _open(rewrite(path, buf), flags, mode);
+}
+
+int open64(const char *path, int flags, ...)
+{
+    char buf[PATH_MAX];
+    int (*_open64) (const char *, int, mode_t) = dlsym(RTLD_NEXT, "open64");
+    mode_t mode = 0;
+    if (flags & O_CREAT) {
+        va_list ap;
+        va_start(ap, flags);
+        mode = va_arg(ap, mode_t);
+        va_end(ap);
+    }
+    return _open64(rewrite(path, buf), flags, mode);
+}
+
+int __xstat64(int ver, const char *path, struct stat64 *st)
+{
+    char buf[PATH_MAX];
+    int (*___xstat64) (int ver, const char *, struct stat64 *) = dlsym(RTLD_NEXT, "__xstat64");
+    return ___xstat64(ver, rewrite(path, buf), st);
+}
+
+int access(const char *path, int mode)
+{
+    char buf[PATH_MAX];
+    int (*_access) (const char *path, int mode) = dlsym(RTLD_NEXT, "access");
+    return _access(rewrite(path, buf), mode);
+}
diff --git a/pkgs/applications/audio/vkeybd/default.nix b/pkgs/applications/audio/vkeybd/default.nix
new file mode 100644
index 000000000000..b751e4da33ed
--- /dev/null
+++ b/pkgs/applications/audio/vkeybd/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchurl, alsaLib, libX11, makeWrapper, tcl, tk }:
+
+stdenv.mkDerivation  rec {
+  name = "vkeybd-${version}";
+  version = "0.1.18d";
+
+  src = fetchurl {
+    url = "ftp://ftp.suse.com/pub/people/tiwai/vkeybd/${name}.tar.bz2";
+    sha256 = "0107b5j1gf7dwp7qb4w2snj4bqiyps53d66qzl2rwj4jfpakws5a";
+  };
+
+  buildInputs = [ alsaLib libX11 makeWrapper tcl tk ];
+
+  configurePhase = ''
+    ensureDir $out/bin
+    sed -e "s@/usr/local@$out@" -i Makefile
+  '';
+
+  makeFlags = [ "TKLIB=-ltk8.5" "TCLLIB=-ltcl8.5" ];
+
+  postInstall = ''
+    wrapProgram $out/bin/vkeybd --set TK_LIBRARY "${tk}/lib/${tk.libPrefix}"
+  '';
+
+  meta = with stdenv.lib; {
+    description = "Virtual MIDI keyboard";
+    homepage = http://www.alsa-project.org/~tiwai/alsa.html;
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.goibhniu ];
+  };
+}
diff --git a/pkgs/applications/audio/vorbis-tools/default.nix b/pkgs/applications/audio/vorbis-tools/default.nix
index 91d9ba00a0f5..5db7cc30cf8c 100644
--- a/pkgs/applications/audio/vorbis-tools/default.nix
+++ b/pkgs/applications/audio/vorbis-tools/default.nix
@@ -2,18 +2,14 @@
 , speex, flac}:
 
 stdenv.mkDerivation {
-  name = "vorbis-tools-1.1.1";
+  name = "vorbis-tools-1.4.0";
   src = fetchurl {
-    url = http://downloads.xiph.org/releases/vorbis/vorbis-tools-1.1.1.tar.gz;
-    sha256 = "617b4aa69e600c215b34fa3fd5764bc1d9d205d9d7d9fe7812bde7ec956fcaad";
+    url = http://downloads.xiph.org/releases/vorbis/vorbis-tools-1.4.0.tar.gz;
+    sha256 = "1g12bnh5ah08v529y72kfdz5lhvy75iaz7f9jskyby23m9dkk2d3";
   };
 
-  # FIXME: Vorbis-tools expects `libOggFLAC', but this library was
-  # merged with `libFLAC' as of FLAC 1.1.3.
   buildInputs = [ libogg libvorbis libao pkgconfig curl speex glibc flac ];
 
-  patches = [ ./ogg123-curlopt-mute.patch ];
-
   meta = {
     longDescription = ''
       A set of command-line tools to manipulate Ogg Vorbis audio
diff --git a/pkgs/applications/audio/vorbis-tools/ogg123-curlopt-mute.patch b/pkgs/applications/audio/vorbis-tools/ogg123-curlopt-mute.patch
deleted file mode 100644
index 6437909411ea..000000000000
--- a/pkgs/applications/audio/vorbis-tools/ogg123-curlopt-mute.patch
+++ /dev/null
@@ -1,13 +0,0 @@
---- vorbis-tools-1.1.1/ogg123/http_transport.c	2005-06-13 15:11:44.000000000 +0200
-+++ vorbis-tools-1.1.1/ogg123/http_transport.c	2008-02-12 18:38:41.000000000 +0100
-@@ -116,7 +116,9 @@ void set_curl_opts (http_private_t *priv
-   if (inputOpts.ProxyTunnel)
-     curl_easy_setopt (handle, CURLOPT_HTTPPROXYTUNNEL, inputOpts.ProxyTunnel);
-   */
-+#ifdef CURLOPT_MUTE
-   curl_easy_setopt(handle, CURLOPT_MUTE, 1);
-+#endif
-   curl_easy_setopt(handle, CURLOPT_ERRORBUFFER, private->error);
-   curl_easy_setopt(handle, CURLOPT_PROGRESSFUNCTION, progress_callback);
-   curl_easy_setopt(handle, CURLOPT_PROGRESSDATA, private);
-
diff --git a/pkgs/applications/audio/xsynth-dssi/default.nix b/pkgs/applications/audio/xsynth-dssi/default.nix
new file mode 100644
index 000000000000..528f0b3412c1
--- /dev/null
+++ b/pkgs/applications/audio/xsynth-dssi/default.nix
@@ -0,0 +1,37 @@
+{ stdenv, fetchurl, alsaLib, autoconf, automake, dssi, gtk, jackaudio,
+ladspaH, ladspaPlugins, liblo, pkgconfig }:
+
+stdenv.mkDerivation  rec {
+  name = "xsynth-dssi-${version}";
+  version = "0.9.4";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/dssi/${name}.tar.gz";
+    sha256 = "00nwv2pqjbmxqdc6xdm0cljq6z05lv4y6bibmhz1kih9lm0lklnk";
+  };
+
+  buildInputs = [ alsaLib autoconf automake dssi gtk jackaudio ladspaH
+    ladspaPlugins liblo pkgconfig ];
+
+  installPhase = ''
+    ensureDir $out/bin
+    ensureDir $out/lib
+    cp src/Xsynth_gtk $out/bin
+    cp src/.libs/* $out/lib
+  '';
+
+  meta = with stdenv.lib; {
+    description = "classic-analog (VCOs-VCF-VCA) style software synthesizer";
+    longDescription = ''
+      Xsynth-DSSI is a classic-analog (VCOs-VCF-VCA) style software
+      synthesizer which operates as a plugin for the DSSI Soft Synth
+      Interface.  DSSI is a plugin API for software instruments (soft
+      synths) with user interfaces, permitting them to be hosted
+      in-process by audio applications.
+    '';
+    homepage = "http://dssi.sourceforge.net/download.html#Xsynth-DSSI";
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.goibhniu ];
+  };
+}
diff --git a/pkgs/applications/audio/yoshimi/default.nix b/pkgs/applications/audio/yoshimi/default.nix
new file mode 100644
index 000000000000..1dda4be3739b
--- /dev/null
+++ b/pkgs/applications/audio/yoshimi/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, fetchurl, alsaLib, boost, cmakeCurses, fftwSinglePrec, fltk
+, jackaudio, libsndfile, mesa, minixml, pkgconfig, zlib }:
+
+assert stdenv ? glibc;
+
+stdenv.mkDerivation  rec {
+  name = "yoshimi-${version}";
+  version = "0.060.10";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/yoshimi/${name}.tar.bz2";
+    sha256 = "0y67w7y515hx2bi5gfjgsw1hdah1bdrrvcfmqyjsvn7jbd0q47v1";
+  };
+
+  buildInputs = [ alsaLib boost cmakeCurses fftwSinglePrec fltk
+    jackaudio libsndfile mesa minixml pkgconfig zlib ];
+
+  preConfigure = ''
+    cd src
+  '';
+
+  cmakeFlags = [ "-DFLTK_MATH_LIBRARY=${stdenv.glibc}/lib/libm.so" ];
+
+  meta = with stdenv.lib; {
+    description = "high quality software synthesizer based on ZynAddSubFX";
+    longDescription = ''
+      Yoshimi delivers the same synthesizer capabilities as
+      ZynAddSubFX along with very good Jack and Alsa midi/audio
+      functionality on Linux
+    '';
+    homepage = http://yoshimi.sourceforge.net;
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.goibhniu ];
+  };
+}
diff --git a/pkgs/applications/audio/zynaddsubfx/default.nix b/pkgs/applications/audio/zynaddsubfx/default.nix
new file mode 100644
index 000000000000..2931cfe41f63
--- /dev/null
+++ b/pkgs/applications/audio/zynaddsubfx/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchurl, alsaLib, fftw, fltk, minixml, zlib }:
+
+stdenv.mkDerivation  rec {
+  name = "zynaddsubfx-${version}";
+  version = "2.4.1";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/zynaddsubfx/ZynAddSubFX-${version}.tar.bz2";
+    sha256 = "1zn5lgh76rrbfj8d4jys2gc1j2pqrbdd18ywfdrk0s7jq4inwyfg";
+  };
+
+  buildInputs = [ alsaLib fftw fltk minixml zlib ];
+
+  preConfigure = "cd src";
+
+  installPhase = "mkdir -p $out/bin; cp zynaddsubfx $out/bin";
+
+  meta = with stdenv.lib; {
+    description = "high quality software synthesizer";
+    homepage = http://zynaddsubfx.sourceforge.net;
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.goibhniu ];
+  };
+}
diff --git a/pkgs/applications/display-managers/slim/default.nix b/pkgs/applications/display-managers/slim/default.nix
index b00fb6d2dc7b..2ea53fd4e55a 100644
--- a/pkgs/applications/display-managers/slim/default.nix
+++ b/pkgs/applications/display-managers/slim/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl, x11, libjpeg, libpng, libXmu, freetype, pam}:
 
 stdenv.mkDerivation rec {
-  name = "slim-1.3.1";
+  name = "slim-1.3.2";
 
   src = fetchurl {
     url = "http://download.berlios.de/slim/${name}.tar.gz";
-    sha256 = "0xqgzvg6h1bd29140mcgg9r16vcmskz7zmym7i7jlz7x9c1a9mxc";
+    sha256 = "1f42skdp5k1zrb364s3i0ps5wmx9szz9h192i2dkn9az00jh2mpi";
   };
 
   patches = [
@@ -22,8 +22,6 @@ stdenv.mkDerivation rec {
     # Don't set PAM_RHOST to "localhost", it confuses ConsoleKit
     # (which assumes that a non-empty string means a remote session).
     ./pam2.patch
-    
-    ./slim-1.3.1-gcc4.4.patch
   ];
 
   buildInputs = [x11 libjpeg libpng libXmu freetype pam];
diff --git a/pkgs/applications/display-managers/slim/slim-1.3.1-gcc4.4.patch b/pkgs/applications/display-managers/slim/slim-1.3.1-gcc4.4.patch
deleted file mode 100644
index 71b028ec080b..000000000000
--- a/pkgs/applications/display-managers/slim/slim-1.3.1-gcc4.4.patch
+++ /dev/null
@@ -1,17 +0,0 @@
-Patch to allow compilation with gcc-4.4
-
-Notified by Daniel J. - from Debian bug tracker
-
-http://bugs.gentoo.org/252745
-
---- a/switchuser.h	2008-11-11 19:40:18.000000000 +0000
-+++ a/switchuser.h	2008-11-11 19:40:28.000000000 +0000
-@@ -18,6 +18,7 @@
- #include <pwd.h>
- #include <grp.h>
- #include <paths.h>
-+#include <cstdio>
- #include <iostream>
- #include "const.h"
- #include "cfg.h"
-
diff --git a/pkgs/applications/editors/eclipse/default.nix b/pkgs/applications/editors/eclipse/default.nix
index eb12aa0819ed..bc53dfc70f32 100644
--- a/pkgs/applications/editors/eclipse/default.nix
+++ b/pkgs/applications/editors/eclipse/default.nix
@@ -1,153 +1,163 @@
 { stdenv, fetchurl, patchelf, makeDesktopItem, makeWrapper
 , freetype, fontconfig, libX11, libXext, libXrender, zlib
 , glib, gtk, libXtst, jre
- # defaulting to this version because not all installable plugins work with 3.5.2 yet
- # can also be set to "latest"
-, version ? "3.5.1"
 }:
 
-/*
-  Note: Eclipse stores various Eclipse instance specific data in ~/.eclipse/*-instance/...
-  The '*' depends on the executable location of Eclipse.
-
-  So if an Eclipse dependency such as gtk changes a different Eclipse setup directory will be used and
-  the plugins and update site list and more global settings seem to be gone.
-
-  Staring Eclipse from ~/.nix-profile/bin/eclipse doesn't help.
-
-  So I suggest copying the store path to ~/eclipse and run ~/eclipse/bin/eclipse instead.
+assert stdenv ? glibc;
 
-  However this still has some drawbacks: If you run nix-collect-garbage the gtk
-  libs the wrapper refers to might be gone. It should be easy for you to
-  replace the imortant lines in the wrapper.
+let
 
-  You can also put this eclipse wrapper script (which was removed from
-  all-packages.nix -r 18458)
-  to your packageOverrides section and use that to run eclipse/eclipse.
+  buildEclipse =
+    { name, src, description }:
 
-  Its parameterized by system because you may want to run both: i686 and x86_64 systems.
+    stdenv.mkDerivation rec {
+      inherit name src;
 
-    eclipseRunner =
-      pkgs.stdenv.mkDerivation {
-      name = "nix-eclipse-runner-script-${stdenv.system}";
+      desktopItem = makeDesktopItem {
+        name = "Eclipse";
+        exec = "eclipse";
+        icon = "eclipse";
+        comment = "Integrated Development Environment";
+        desktopName = "Eclipse IDE";
+        genericName = "Integrated Development Environment";
+        categories = "Application;Development;";
+      };
 
-      phases = "installPhase";
-      installPhase = ''
-        ensureDir $out/bin
-        target=$out/bin/nix-run-eclipse-${stdenv.system}
-        cat > $target << EOF
-        #!/bin/sh
-        export PATH=${pkgs.jre}/bin:\$PATH
-        export LD_LIBRARY_PATH=${pkgs.gtkLibs216.glib}/lib:${pkgs.gtkLibs216.gtk}/lib:${pkgs.xlibs.libXtst}/lib
-        # If you run out of XX space try these? -vmargs -Xms512m -Xmx2048m -XX:MaxPermSize=256m
-        eclipse="\$1"; shift
-        exec \$eclipse -vmargs -Xms512m -Xmx2048m -XX:MaxPermSize=256m "\$@"
-        EOF
-        chmod +x $target
-      '';
+      buildInputs = [ makeWrapper patchelf ];
+
+      buildCommand = ''
+        # Unpack tarball.
+        ensureDir $out
+        tar xfvz $src -C $out
+
+        # Patch binaries.
+        interpreter=$(echo ${stdenv.glibc}/lib/ld-linux*.so.2)
+        patchelf --set-interpreter $interpreter $out/eclipse/eclipse
+        patchelf --set-rpath ${freetype}/lib:${fontconfig}/lib:${libX11}/lib:${libXrender}/lib:${zlib}/lib $out/eclipse/libcairo-swt.so
+
+        # Create wrapper script.  Pass -configuration to store
+        # settings in ~/.eclipse/org.eclipse.platform_<version> rather
+        # than ~/.eclipse/org.eclipse.platform_<version>_<number>.
+        productId=$(sed 's/id=//; t; d' $out/eclipse/.eclipseproduct)
+        productVersion=$(sed 's/version=//; t; d' $out/eclipse/.eclipseproduct)
+        
+        makeWrapper $out/eclipse/eclipse $out/bin/eclipse \
+          --prefix PATH : ${jre}/bin \
+          --prefix LD_LIBRARY_PATH : ${glib}/lib:${gtk}/lib:${libXtst}/lib \
+          --add-flags "-configuration \$HOME/.eclipse/''${productId}_$productVersion/configuration"
+
+        # Create desktop item.
+        ensureDir $out/share/applications
+        cp ${desktopItem}/share/applications/* $out/share/applications
+      ''; # */
 
       meta = {
-        description = "provide environment to run Eclipse";
-        longDescription = ''
-          Is there one distribution providing support for up to date Eclipse installations?
-          There are various reasons why not.
-          Installing binaries just works. Get Eclipse binaries form eclipse.org/downloads
-          install this wrapper then run Eclipse like this:
-          nix-run-eclipse $PATH_TO_ECLIPSE/eclipse/eclipse
-          and be happy. Everything works including update sites.
-        '';
-        maintainers = [pkgs.lib.maintainers.marcweber];
-        platforms = pkgs.lib.platforms.linux;
+        homepage = http://www.eclipse.org/;
+        inherit description;
       };
-    };
-
-*/
 
+    };
+    
+in {
 
-let
+  eclipse_sdk_35 = buildEclipse {
+    name = "eclipse-sdk-3.5.2";
+    description = "Eclipse Classic";
+    src =
+      if stdenv.system == "x86_64-linux" then
+        fetchurl {
+          url = http://archive.eclipse.org/eclipse/downloads/drops/R-3.5.2-201002111343/eclipse-SDK-3.5.2-linux-gtk-x86_64.tar.gz;
+          md5 = "54e2ce0660b2b1b0eb4267acf70ea66d";
+        }
+      else
+        fetchurl {
+          url = http://archive.eclipse.org/eclipse/downloads/drops/R-3.5.2-201002111343/eclipse-SDK-3.5.2-linux-gtk.tar.gz;
+          md5 = "bde55a2354dc224cf5f26e5320e72dac";
+        };
+  };
 
-  v = if version == "latest" then "3.5.2" else version;
+  # !!! Use mirror://eclipse/.
 
-in
+  eclipse_sdk_36 = buildEclipse {
+    name = "eclipse-sdk-3.6.2";
+    description = "Eclipse Classic";
+    src =
+      if stdenv.system == "x86_64-linux" then
+        fetchurl {
+          url = http://ftp.ing.umu.se/mirror/eclipse/eclipse/downloads/drops/R-3.6.2-201102101200/eclipse-SDK-3.6.2-linux-gtk-x86_64.tar.gz;
+          sha256 = "0dfcfadcd6337c897fbfd5b292de481931dfce12d43289ecb93691fd27dd47f4";
+        }
+      else
+        fetchurl {
+          url = http://ftp.ing.umu.se/mirror/eclipse/eclipse/downloads/drops/R-3.6.2-201102101200/eclipse-SDK-3.6.2-linux-gtk.tar.gz;
+          sha256 = "1bh8ykliqr8wbciv13vpiy50rvm7yszk7y8dslr796dbwhi5b1cj";
+        };
+  };
 
-assert stdenv ? glibc;
+  eclipse_cpp_36 = buildEclipse {
+    name = "eclipse-cpp-3.6.2";
+    description = "Eclipse IDE for C/C++ Developers";
+    src =
+      if stdenv.system == "x86_64-linux" then
+        fetchurl {
+          url = http://ftp-stud.fht-esslingen.de/pub/Mirrors/eclipse/technology/epp/downloads/release/helios/SR2/eclipse-cpp-helios-SR2-linux-gtk-x86_64.tar.gz;
+          sha1 = "6f914e11fa15a900c46825e4aa8299afd76e7e65";
+        }
+      else
+        fetchurl {
+          url = http://ftp-stud.fht-esslingen.de/pub/Mirrors/eclipse/technology/epp/downloads/release/helios/SR2/eclipse-cpp-helios-SR2-linux-gtk.tar.gz;
+          sha1 = "1156e4bc0253ae3a3a4e54839e4944dc64d3108f";
+        };
+  };
 
-stdenv.mkDerivation rec {
-  name = "eclipse-${v}";
-  
-  src =
-    if v == "3.5.2" then
+  eclipse_modeling_36 = buildEclipse {
+    name = "eclipse-modeling-3.6.2";
+    description = "Eclipse Modeling Tools (includes Incubating components)";
+    src =
       if stdenv.system == "x86_64-linux" then
         fetchurl {
-          url = http://ftp-stud.fht-esslingen.de/pub/Mirrors/eclipse/eclipse/downloads/drops/R-3.5.2-201002111343/eclipse-SDK-3.5.2-linux-gtk-x86_64.tar.gz;
-          md5 = "54e2ce0660b2b1b0eb4267acf70ea66d";
+          url = http://ftp-stud.fht-esslingen.de/pub/Mirrors/eclipse/technology/epp/downloads/release/helios/SR2/eclipse-modeling-helios-SR2-incubation-linux-gtk-x86_64.tar.gz;
+          sha1 = "e96f5f006298f68476f4a15a2be8589158d5cc61";
         }
       else
         fetchurl {
-          url = http://mirror.selfnet.de/eclipse/eclipse/downloads/drops/R-3.5.2-201002111343/eclipse-SDK-3.5.2-linux-gtk.tar.gz;
-          md5 = "bde55a2354dc224cf5f26e5320e72dac";
+          url = http://ftp-stud.fht-esslingen.de/pub/Mirrors/eclipse/technology/epp/downloads/release/helios/SR2/eclipse-modeling-helios-SR2-incubation-linux-gtk.tar.gz;
+          sha1 = "696377895bb26445de39d82a916b7e69edb1d939";
+        };
+  };
+
+  eclipse_sdk_37 = buildEclipse {
+    name = "eclipse-sdk-3.7";
+    description = "Eclipse Classic";
+    src =
+      if stdenv.system == "x86_64-linux" then
+        fetchurl {
+          url = http://eclipse.ialto.com/eclipse/downloads/drops/R-3.7-201106131736/eclipse-SDK-3.7-linux-gtk-x86_64.tar.gz;
+          sha256 = "00ig3ww98r8imf32sx5npm6csn5nx288gvdk6w653nijni0di16j";
         }
-    else if v == "3.5.1" then
-     if stdenv.system == "x86_64-linux" then
-       fetchurl {
-        url = http://ftp.ing.umu.se/mirror/eclipse/eclipse/downloads/drops/R-3.5.1-200909170800/eclipse-SDK-3.5.1-linux-gtk-x86_64.tar.gz;
-        sha256 = "132zd7q9q29h978wnlsfbrlszc85r1wj30yqs2aqbv3l5xgny1kk";
-       }
-     else
-       fetchurl {
-        url = http://mirrors.linux-bg.org/eclipse/eclipse/downloads/drops/R-3.5.1-200909170800/eclipse-SDK-3.5.1-linux-gtk.tar.gz;
-        sha256 = "0a0lpa7gxg91zswpahi6fvg3csl4csvlym4z2ad5cc1d4yvicp56";
-      }
-    else if v == "3.6.1" then
-     if stdenv.system == "x86_64-linux" then
-       fetchurl {
-        url = http://ftp.ing.umu.se/mirror/eclipse/eclipse/downloads/drops/R-3.6.1-201009090800/eclipse-SDK-3.6.1-linux-gtk-x86_64.tar.gz;
-        sha256 = "1cg9rrb5w978sdqbzz9lnli1lds9zhb6wfsj3wp725bqf1i6v9lg";
-       }
-     else
-       fetchurl {
-        url = http://ftp.ing.umu.se/mirror/eclipse/eclipse/downloads/drops/R-3.6.1-201009090800/eclipse-SDK-3.6.1-linux-gtk.tar.gz;
-        sha256 = "0s48rjaswi8m5gan1zlqvfwb4l06x5nslkq41wpkrbyj9ka8gh4x";
-      }
-    else throw "no source for eclipse version ${v} known";
-
-  desktopItem = makeDesktopItem {
-    name = "Eclipse";
-    exec = "eclipse";
-    icon = "eclipse";
-    comment = "Integrated Development Environment";
-    desktopName = "Eclipse IDE";
-    genericName = "Integrated Development Environment";
-    categories = "Application;Development;";
+      else
+        fetchurl {
+          url = http://eclipse.ialto.com/eclipse/downloads/drops/R-3.7-201106131736/eclipse-SDK-3.7-linux-gtk.tar.gz;
+          sha256 = "08rgw85cam51l98mzb39fdc3ykb369v8pap93qhknbs6a3f5dnff";
+        };
   };
 
-  buildInputs = [ makeWrapper patchelf ];
-  
-  buildCommand = ''
-    # Unpack tarball
-    ensureDir $out
-    tar xfvz $src -C $out
-    
-    # Patch binaries
-    interpreter=$(echo ${stdenv.glibc}/lib/ld-linux*.so.2)
-    patchelf --set-interpreter $interpreter $out/eclipse/eclipse
-    patchelf --set-rpath ${freetype}/lib:${fontconfig}/lib:${libX11}/lib:${libXrender}/lib:${zlib}/lib $out/eclipse/libcairo-swt.so
-
-    # Create wrapper script
-    makeWrapper $out/eclipse/eclipse $out/bin/eclipse \
-      --prefix PATH : ${jre}/bin \
-      --prefix LD_LIBRARY_PATH : ${glib}/lib:${gtk}/lib:${libXtst}/lib
-    
-    # Create desktop item
-    ensureDir $out/share/applications
-    cp ${desktopItem}/share/applications/* $out/share/applications
-  '';
-  
-  meta = {
-    homepage = http://www.eclipse.org/;
-    description = "A extensible multi-language software development environment";
-    longDescription = ''
-    '';
+  eclipse_cpp_37 = buildEclipse {
+    name = "eclipse-cpp-3.7";
+    description = "Eclipse IDE for C/C++ Developers";
+    src =
+      if stdenv.system == "x86_64-linux" then
+        fetchurl {
+          url = http://eclipse.ialto.com/technology/epp/downloads/release/indigo/R/eclipse-cpp-indigo-incubation-linux-gtk-x86_64.tar.gz;
+          sha256 = "14ppc9g9igzvj1pq7jl01vwhzb66nmzbl9wsdl1sf3xnwa9wnqk3";
+        }
+      else
+        fetchurl {
+          url = http://eclipse.ialto.com/technology/epp/downloads/release/indigo/R/eclipse-cpp-indigo-incubation-linux-gtk.tar.gz;
+          sha256 = "1cvg1vgyazrkinwzlvlf0dpl197p4784752srqybqylyj5psdi3b";
+        };
   };
-  
+
+
 }
+
diff --git a/pkgs/applications/editors/emacs-23/default.nix b/pkgs/applications/editors/emacs-23/default.nix
index 4bdb4f132c2f..5de1b38bb41d 100644
--- a/pkgs/applications/editors/emacs-23/default.nix
+++ b/pkgs/applications/editors/emacs-23/default.nix
@@ -8,22 +8,28 @@ assert (libXft != null) -> libpng != null;	# probably a bug
 assert stdenv.isDarwin -> libXaw != null;	# fails to link otherwise
 
 stdenv.mkDerivation rec {
-  name = "emacs-23.2";
+  name = "emacs-23.3";
 
   builder = ./builder.sh;
 
   src = fetchurl {
     url = "mirror://gnu/emacs/${name}.tar.bz2";
-    sha256 = "1i96hp91s86jawrqjhfxm5y2sjxizv99009128b4bh06bgx6dm7z";
+    sha256 = "0kfa546qi0idkwk29gclgi13qd8q54pcqgy9qwjknlclszprdp3a";
   };
 
-  buildInputs = [
-    ncurses x11 texinfo libXaw Xaw3d libXpm dbus libpng libjpeg libungif
-    libtiff librsvg gtk (if gtk != null then pkgconfig else null) libXft gconf
-  ];
+  buildInputs = 
+    [ ncurses x11 texinfo libXaw Xaw3d libXpm libpng libjpeg libungif
+      libtiff librsvg libXft gconf
+    ] 
+    ++ stdenv.lib.optionals (gtk != null) [ gtk pkgconfig ]
+    ++ stdenv.lib.optional stdenv.isLinux dbus;
 
   configureFlags =
-    stdenv.lib.optionals (gtk != null) [ "--with-x-toolkit=gtk" "--with-xft" ];
+    stdenv.lib.optionals (gtk != null) [ "--with-x-toolkit=gtk" "--with-xft"]
+
+    # On NixOS, help Emacs find `crt*.o'.
+    ++ stdenv.lib.optional (stdenv ? glibc)
+         [ "--with-crt-dir=${stdenv.glibc}/lib" ];
 
   doCheck = true;
 
diff --git a/pkgs/applications/editors/emacs-modes/bbdb/builder.sh b/pkgs/applications/editors/emacs-modes/bbdb/builder.sh
deleted file mode 100644
index b860adbb745f..000000000000
--- a/pkgs/applications/editors/emacs-modes/bbdb/builder.sh
+++ /dev/null
@@ -1,12 +0,0 @@
-source "$stdenv/setup" || exit 1
-
-unpackPhase &&							\
-cd bbdb-*.* && patchPhase &&					\
-./configure --prefix="$out"					\
-            --with-package-dir="$out/share/emacs/site-lisp" &&	\
-make && make install-pkg &&					\
-mkdir -p "$out/info" &&						\
-make -C texinfo install-pkg &&					\
-mv "$out/share/emacs/site-lisp/lisp/bbdb/"*			\
-   "$out/share/emacs/site-lisp" &&				\
-rm -rf "$out/share/emacs/site-lisp/lisp"
diff --git a/pkgs/applications/editors/emacs-modes/bbdb/default.nix b/pkgs/applications/editors/emacs-modes/bbdb/default.nix
index 51474a197174..52afebc6297b 100644
--- a/pkgs/applications/editors/emacs-modes/bbdb/default.nix
+++ b/pkgs/applications/editors/emacs-modes/bbdb/default.nix
@@ -11,7 +11,20 @@ stdenv.mkDerivation {
   patches = [ ./install-infodir.patch ];
 
   buildInputs = [emacs texinfo ctags];
-  builder = ./builder.sh;
+  configureFlags = "--with-package-dir=$$out/share/emacs/site-lisp";
+  preInstall = "ensureDir $out/info";
+  installTargets = "install-pkg texinfo";
+  postInstall = ''
+    mv  $out/info $out/share/
+    mv "$out/share/emacs/site-lisp/lisp/bbdb/"* $out/share/emacs/site-lisp/
+    mv $out/share/emacs/site-lisp/etc/bbdb $out/share/
+    rm -rf $out/share/emacs/site-lisp/{lisp,etc}
+    mv bits $out/share/bbdb/
+    # Make optional modules from bbdb available for import, but symlink
+    # them into the site-lisp directory to make it obvious that they are
+    # not a genuine part of the distribution.
+    ln -s "$out/share/bbdb/bits/"*.el $out/share/emacs/site-lisp/
+  '';
 
   meta = {
     description = "The Insidious Big Brother Database (BBDB), a contact management utility for Emacs";
diff --git a/pkgs/applications/editors/emacs-modes/magit/default.nix b/pkgs/applications/editors/emacs-modes/magit/default.nix
index dcd0b9c5ba49..0746dd5b3bec 100644
--- a/pkgs/applications/editors/emacs-modes/magit/default.nix
+++ b/pkgs/applications/editors/emacs-modes/magit/default.nix
@@ -1,20 +1,25 @@
 { stdenv, fetchurl, emacs, texinfo }:
 
 let
-  version = "0.8.2";
+  version = "1.0.0";
 in
 stdenv.mkDerivation {
   name = "magit-${version}";
 
   src = fetchurl {
-    url = "http://github.com/downloads/philjackson/magit/magit-${version}.tar.gz";
-    sha256 = "fc02c23e3e8994e9c3e3299d560d0cbfed888dcc66088f06b8cea3bc89cd6ae8";
+    url = "http://github.com/downloads/magit/magit/magit-${version}.tar.gz";
+    sha256 = "1hfdl90d96zin31v8x4p8zx5f0x0i5i9hccysx6q3prdgw9r6wzq";
   };
 
   buildInputs = [emacs texinfo];
 
+  configurePhase =
+    '' sed -i Makefile \
+           -e "s|^PREFIX=.*$|PREFIX=$out|g ; s|/etc/emacs/|$out/etc/emacs/|"
+    '';
+
   meta = {
-    description = "An an interface to Git, implemented as an extension to Emacs.";
+    description = "Magit, an Emacs interface to Git";
 
     longDescription = ''
       With Magit, you can inspect and modify your Git repositories with
@@ -31,6 +36,6 @@ stdenv.mkDerivation {
     license = "GPLv3+";
     homepage = "http://github.com/philjackson/magit";
     platforms = stdenv.lib.platforms.all;
-    maintainers = [ stdenv.lib.maintainers.simons ];
+    maintainers = with stdenv.lib.maintainers; [ simons ludo ];
   };
 }
diff --git a/pkgs/applications/editors/emacs-modes/org/default.nix b/pkgs/applications/editors/emacs-modes/org/default.nix
index 559bc957f071..18ea2797bec5 100644
--- a/pkgs/applications/editors/emacs-modes/org/default.nix
+++ b/pkgs/applications/editors/emacs-modes/org/default.nix
@@ -1,11 +1,11 @@
 { fetchurl, stdenv, emacs, texinfo, which }:
 
 stdenv.mkDerivation rec {
-  name = "org-7.01f";
+  name = "org-7.5";
 
   src = fetchurl {
     url = "http://orgmode.org/${name}.tar.gz";
-    sha256 = "1db7s57g8gh8w0464n18lxpcz270x9ns63b2blhkz8wrdnk57fia";
+    sha256 = "978822bc4c5f9f67450fbaa8572f1d4217406b7e28551278c9f23f7e9515cd4b";
   };
 
   buildInputs = [ emacs texinfo ];
@@ -19,11 +19,21 @@ stdenv.mkDerivation rec {
            -e "s|^prefix=.*$|prefix=$out|g"
     '';
 
+  #XXX: fails because of missing UTILITIES/manfull.pl, currently not
+  # included in the release tarball, but git.
+
+  #postBuild =
+  #  '' make doc
+  #  '';
+
   installPhase =
     '' make install install-info
 
        ensureDir "$out/share/doc/${name}"
-       cp -v doc/orgcard*.{pdf,txt} "$out/share/doc/${name}"
+       cp -v doc/org*.{html,pdf,txt} "$out/share/doc/${name}"
+
+       ensureDir "$out/share/org"
+       cp -R contrib "$out/share/org/contrib"
     '';
 
   meta = {
@@ -39,7 +49,7 @@ stdenv.mkDerivation rec {
 
     license = "GPLv3+";
 
-    maintainers = [ stdenv.lib.maintainers.ludo ];
+    maintainers = [ stdenv.lib.maintainers.ludo stdenv.lib.maintainers.chaoflow ];
     platforms = stdenv.lib.platforms.gnu;  # arbitrary choice
   };
 }
diff --git a/pkgs/applications/editors/emacs-modes/proofgeneral/default.nix b/pkgs/applications/editors/emacs-modes/proofgeneral/default.nix
index d8316886c34e..ce01d4b92046 100644
--- a/pkgs/applications/editors/emacs-modes/proofgeneral/default.nix
+++ b/pkgs/applications/editors/emacs-modes/proofgeneral/default.nix
@@ -1,25 +1,20 @@
 { stdenv, fetchurl, emacs, texinfo, texLive, perl, which, automake }:
 
-let
-  pname = "ProofGeneral";
-  version = "3.7.1.1";
-  name = "${pname}-${version}";
-  website = "http://proofgeneral.inf.ed.ac.uk";
-in
-
-stdenv.mkDerivation {
-  inherit name;
+stdenv.mkDerivation (rec {
+  name = "ProofGeneral-4.0";
 
   src = fetchurl {
-    url = "http://www.cl.cam.ac.uk/research/hvg/Isabelle/dist/contrib/${name}.tar.gz";
-    sha256 = "ae430590d6763618df50a662a37f0627d3c3c8f31372f6f0bb2116b738fc92d8";
+    url = http://proofgeneral.inf.ed.ac.uk/releases/ProofGeneral-4.0.tgz;
+    sha256 = "1ang2lsc97vl70fkgypfsr1ivdzsdliq3bkvympj30wnc7ayzbmq";
   };
 
   sourceRoot = name;
 
   buildInputs = [ emacs texinfo texLive perl which ];
 
-  patchPhase =
+  patches = [ ./emacs-23.3.patch ];
+
+  postPatch =
     '' sed -i "Makefile" \
            -e "s|^\(\(DEST_\)\?PREFIX\)=.*$|\1=$out|g ; \
                s|/sbin/install-info|install-info|g"
@@ -27,6 +22,8 @@ stdenv.mkDerivation {
        sed -i "bin/proofgeneral" -e's/which/type -p/g'
     '';
 
+  preBuild = "make clean";
+
   installPhase =
     # Copy `texinfo.tex' in the right place so that `texi2pdf' works.
     '' cp -v "${automake}/share/"automake-*/texinfo.tex doc
@@ -39,8 +36,8 @@ stdenv.mkDerivation {
       Proof General is a generic front-end for proof assistants (also known as
       interactive theorem provers), based on the customizable text editor Emacs.
     '';
-    homepage = website;
+    homepage = http://proofgeneral.inf.ed.ac.uk;
     license = "GPLv2+";
     platforms = stdenv.lib.platforms.gnu;  # arbitrary choice
   };
-}
+})
diff --git a/pkgs/applications/editors/emacs-modes/proofgeneral/emacs-23.3.patch b/pkgs/applications/editors/emacs-modes/proofgeneral/emacs-23.3.patch
new file mode 100644
index 000000000000..9bbc21a82b84
--- /dev/null
+++ b/pkgs/applications/editors/emacs-modes/proofgeneral/emacs-23.3.patch
@@ -0,0 +1,45 @@
+diff -Nuar ProofGeneral-4.0/contrib/mmm/mmm-mode.el ProofGeneral-4.0-nix/contrib/mmm/mmm-mode.el
+--- ProofGeneral-4.0/contrib/mmm/mmm-mode.el	2010-10-11 00:56:57.000000000 +0200
++++ ProofGeneral-4.0-nix/contrib/mmm/mmm-mode.el	2011-05-14 21:55:12.000000000 +0200
+@@ -160,9 +160,9 @@
+      (mmm-add-hooks)
+      (mmm-fixup-skeleton)
+      (make-local-variable 'font-lock-fontify-region-function)
+-     (make-local-variable 'font-lock-beginning-of-syntax-function)
++     (make-local-variable 'syntax-begin-function)
+      (setq font-lock-fontify-region-function 'mmm-fontify-region
+-	   font-lock-beginning-of-syntax-function 'mmm-beginning-of-syntax)
++	   syntax-begin-function 'mmm-beginning-of-syntax)
+      (setq mmm-mode t)
+      (condition-case err
+ 	 (mmm-apply-all)
+@@ -190,7 +190,7 @@
+     (mmm-update-submode-region)
+     (setq font-lock-fontify-region-function
+ 	  (get mmm-primary-mode 'mmm-fontify-region-function)
+-	  font-lock-beginning-of-syntax-function
++	  syntax-begin-function
+ 	  (get mmm-primary-mode 'mmm-beginning-of-syntax-function))
+     (mmm-update-font-lock-buffer)
+     (mmm-refontify-maybe)
+diff -Nuar ProofGeneral-4.0/contrib/mmm/mmm-region.el ProofGeneral-4.0-nix/contrib/mmm/mmm-region.el
+--- ProofGeneral-4.0/contrib/mmm/mmm-region.el	2010-10-11 00:56:57.000000000 +0200
++++ ProofGeneral-4.0-nix/contrib/mmm/mmm-region.el	2011-05-14 21:58:01.000000000 +0200
+@@ -548,7 +548,7 @@
+ 	    (put mode 'mmm-fontify-region-function
+ 		 font-lock-fontify-region-function))
+ 	  (put mode 'mmm-beginning-of-syntax-function
+-	       font-lock-beginning-of-syntax-function))
++	       syntax-begin-function))
+ 	;; Get variables
+ 	(setq global-vars (mmm-get-locals 'global)
+ 	      buffer-vars (mmm-get-locals 'buffer)
+@@ -768,7 +768,7 @@
+   ;; For some reason `font-lock-fontify-block' binds this to nil, thus
+   ;; preventing `mmm-beginning-of-syntax' from doing The Right Thing.
+   ;; I don't know why it does this, but let's undo it here.
+-  (let ((font-lock-beginning-of-syntax-function 'mmm-beginning-of-syntax))
++  (let ((syntax-begin-function 'mmm-beginning-of-syntax))
+     (mapc #'(lambda (elt)
+ 		(when (get (car elt) 'mmm-font-lock-mode)
+ 		  (mmm-fontify-region-list (car elt) (cdr elt))))
diff --git a/pkgs/applications/editors/kdevelop/default.nix b/pkgs/applications/editors/kdevelop/default.nix
index 1b72f8f0b7fb..e5b749c37947 100644
--- a/pkgs/applications/editors/kdevelop/default.nix
+++ b/pkgs/applications/editors/kdevelop/default.nix
@@ -1,18 +1,23 @@
 { stdenv, fetchurl, kdevplatform, cmake, pkgconfig, automoc4, shared_mime_info,
-  kdebase_workspace, gettext, perl }:
+  kdebase_workspace, gettext, perl, kdeutils, kdesdk }:
 
+let
+  okteta = if kdeutils ? okteta then kdeutils.okteta else kdesdk.okteta;
+in
 stdenv.mkDerivation rec {
   name = "${pname}-${version}";
-  version = "4.0.2";
+  version = "4.2.3";
   pname = "kdevelop";
 
   src = fetchurl {
     url = "mirror://kde/stable/${pname}/${version}/src/${name}.tar.bz2";
-    sha256 = "1y8ydx0fcmsab31qf5id5r5fcmp3j2l8mibvbbjfy66xgxarmnpc";
+    sha256 = "0ay3d2s5442pvdsx9lyfzb986kh6848qhbls9ff982f0glzqdcya";
   };
 
   buildInputs = [ kdevplatform cmake pkgconfig automoc4 shared_mime_info
-    kdebase_workspace gettext stdenv.gcc.libc perl ];
+    kdebase_workspace gettext stdenv.gcc.libc perl okteta ];
+
+  NIX_CFLAGS_COMPILE = "-I${okteta}/include/KDE";
 
   meta = with stdenv.lib; {
     maintainers = [ maintainers.urkud ];
diff --git a/pkgs/applications/editors/leksah/default.nix b/pkgs/applications/editors/leksah/default.nix
index dfed15096190..f8a5d6a712fe 100644
--- a/pkgs/applications/editors/leksah/default.nix
+++ b/pkgs/applications/editors/leksah/default.nix
@@ -1,27 +1,28 @@
-{cabal, gtk, glib, binary, binaryShared, deepseq, hslogger, ltk, network, parsec,
- leksahServer, processLeksah, regexBase, regexTDFA, utf8String, gtksourceview2,
- makeWrapper}:
+{ cabal, binary, binaryShared, deepseq, glib, gtk, gtksourceview2
+, hslogger, leksahServer, ltk, mtl, network, parsec, processLeksah
+, regexBase, regexTdfa, strict, time, utf8String
+}:
 
-cabal.mkDerivation (self : {
+cabal.mkDerivation (self: {
   pname = "leksah";
-  version = "0.8.0.8";
-  sha256 = "1d6n5dlnqlqfckg9f611qf9lvi6b7ghrkk1l0myh6h667fxh8a1r";
-
-  propagatedBuildInputs =
-    [gtk glib binary binaryShared deepseq hslogger ltk network parsec
-     leksahServer processLeksah regexBase regexTDFA utf8String gtksourceview2];
-  extraBuildInputs = [makeWrapper];
-
-  # postInstall =
-  #   ''
-  #     wrapProgram $out/bin/leksah --prefix XDG_DATA_DIRS : ${gtk2hs.gtksourceview}/share
-  #   '';
-  
+  version = "0.10.0.4";
+  sha256 = "1g12w1kl63fxzz1c2x237yrqkaja9awiqyyipkdms5iql0ini7bw";
+  isLibrary = true;
+  isExecutable = true;
+  buildDepends = [
+    binary binaryShared deepseq glib gtk gtksourceview2 hslogger
+    leksahServer ltk mtl network parsec processLeksah regexBase
+    regexTdfa strict time utf8String
+  ];
+  noHaddock = true;
   meta = {
-    homepage = http://leksah.org/;
-    description = "An Integrated Development Environment for Haskell written in Haskell";
+    homepage = "http://www.leksah.org";
+    description = "Haskell IDE written in Haskell";
     license = "GPL";
-    maintainers = [self.stdenv.lib.maintainers.andres];
+    platforms = self.stdenv.lib.platforms.linux;
+    maintainers = [
+      self.stdenv.lib.maintainers.andres
+      self.stdenv.lib.maintainers.simons
+    ];
   };
-})  
-
+})
diff --git a/pkgs/applications/editors/texmacs/default.nix b/pkgs/applications/editors/texmacs/default.nix
index 5cd4d6684fc2..d765449851ad 100644
--- a/pkgs/applications/editors/texmacs/default.nix
+++ b/pkgs/applications/editors/texmacs/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, guile, libX11, libXext, xmodmap, which, makeWrapper,
+{stdenv, fetchurl, guile, libX11, libXext, xmodmap, which, makeWrapper, freetype,
  tex ? null,
  aspell ? null,
  ghostscriptX ? null,
@@ -9,7 +9,7 @@
 
 let 
   pname = "TeXmacs";
-  version = "1.0.7.6";
+  version = "1.0.7.10";
   extraFontsSrc = fetchurl {
     url = "ftp://ftp.texmacs.org/pub/TeXmacs/fonts/TeXmacs-extra-fonts-1.0-noarch.tar.gz";
     sha256 = "0hylgjmd95y9yahbblmawkkw0i71vb145xxv2xqrmff81301n6k7";
@@ -40,10 +40,10 @@ stdenv.mkDerivation rec {
 
   src = fetchurl {
     url = "ftp://ftp.texmacs.org/pub/${pname}/targz/${name}-src.tar.gz";
-    sha256 = "0x4qy3ai9nmz1i90mbqi1n2vgwyllxwmlpllfwcz0fad7yby7msh";
+    sha256 = "02gqalr775r4xyfy4bq3qq1h3pkarsxjb6ami7lgxfgmyg6ca5kn";
   };
 
-  buildInputs = [ guile libX11 libXext makeWrapper ];
+  buildInputs = [ guile libX11 libXext makeWrapper ghostscriptX freetype ];
 
   patchPhase = (if tex == null then ''
     gunzip < ${fullFontsSrc} | (cd TeXmacs && tar xvf -)
diff --git a/pkgs/applications/editors/zile/default.nix b/pkgs/applications/editors/zile/default.nix
index c81815da750e..d8acf24cbf5d 100644
--- a/pkgs/applications/editors/zile/default.nix
+++ b/pkgs/applications/editors/zile/default.nix
@@ -1,11 +1,11 @@
 { fetchurl, stdenv, ncurses, help2man }:
 
 stdenv.mkDerivation rec {
-  name = "zile-2.3.21";
+  name = "zile-2.3.24";
 
   src = fetchurl {
     url = "mirror://gnu/zile/${name}.tar.gz";
-    sha256 = "1cmw98khpyk0yv3fn94506fm7589adfbs57czrdsm4q8xf2xrj4i";
+    sha256 = "12by1f5nbk2qcq0f35aqjq5g54nsnajk2rk5060icsjc86pv52r1";
   };
 
   buildInputs = [ ncurses ];
diff --git a/pkgs/applications/graphics/ImageMagick/default.nix b/pkgs/applications/graphics/ImageMagick/default.nix
index 7ec65f3de941..a4bd960655cd 100644
--- a/pkgs/applications/graphics/ImageMagick/default.nix
+++ b/pkgs/applications/graphics/ImageMagick/default.nix
@@ -12,19 +12,20 @@
 , libtool
 , jasper
 , libX11
+, xz
 , tetex ? null
 , librsvg ? null
 }:
 
 let
-  version = "6.6.5-4";
+  version = "6.6.9-4";
 in
 stdenv.mkDerivation rec {
   name = "ImageMagick-${version}";
 
   src = fetchurl {
-    url = "mirror://imagemagick/${name}.tar.bz2";
-    sha256 = "1s3l98xc1gnxi2wdg3sy9723f6qf5yk81wln8ghn2z9kvi09w7gw";
+    url = "mirror://imagemagick/${name}.tar.xz";
+    sha256 = "035j3i3cm29bwc9lipn838gznswrc69g7mwh8h9jj24ss2dmqrf1";
   };
 
   configureFlags = ''
@@ -34,10 +35,13 @@ stdenv.mkDerivation rec {
     ${if librsvg != null then "--with-rsvg" else ""}
   '';
 
-  buildInputs =
-    [ bzip2 freetype graphviz ghostscript libjpeg libpng
-      libtiff libxml2 zlib tetex librsvg libtool jasper libX11
-    ];
+  propagatedBuildInputs =
+    [ bzip2 freetype ghostscript libjpeg libpng libtiff libxml2 zlib librsvg
+    libtool jasper libX11 ];
+
+  buildInputs = [ tetex graphviz ];
+
+  buildNativeInputs = [ xz ];
 
   preConfigure = if tetex != null then
     ''
diff --git a/pkgs/applications/graphics/darktable/default.nix b/pkgs/applications/graphics/darktable/default.nix
new file mode 100644
index 000000000000..c0ebb95a67a2
--- /dev/null
+++ b/pkgs/applications/graphics/darktable/default.nix
@@ -0,0 +1,47 @@
+{ stdenv, fetchurl,
+  GConf, atk, cairo, cmake, curl, dbus_glib, exiv2, glib,
+  gnome_keyring, gphoto2, gtk, ilmbase, intltool, lcms, lcms2,
+  lensfun, libXau, libXdmcp, libexif, libglade, libgphoto2, libjpeg,
+  libpng, libpthreadstubs, libraw1394, librsvg, libtiff, libxcb,
+  openexr, pixman, pkgconfig, sqlite}:
+
+stdenv.mkDerivation rec {
+  version = "0.9.1";
+  name = "darktable-${version}";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/darktable/darktable-${version}.tar.gz";
+    sha256 = "b687a5f1b2a6c8aa230c1dc3ef83bf74a103e3ebe1c61cdea95a612a7375f21e";
+  };
+
+  buildInputs = [
+    GConf atk cairo cmake curl dbus_glib exiv2 glib gnome_keyring gtk
+    ilmbase intltool lcms lcms2 lensfun libXau libXdmcp libexif
+    libglade libgphoto2 libjpeg libpng libpthreadstubs libraw1394
+    librsvg libtiff libxcb openexr pixman pkgconfig sqlite];
+
+  preConfigure = ''
+    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${gtk}/include/gtk-2.0"
+    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${gtk}/lib/gtk-2.0/include"
+    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${cairo}/include/cairo"
+    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${atk}/include/atk-1.0"
+    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${ilmbase}/include/OpenEXR"
+    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${openexr}/include/OpenEXR"
+  '';
+
+  cmakeFlags = [
+    "-DPTHREAD_INCLUDE_DIR=${stdenv.glibc}/include"
+    "-DPTHREAD_LIBRARY=${stdenv.glibc}/lib/libpthread.so"
+    "-DCMAKE_BUILD_TYPE=Release"
+    "-DGTK2_GLIBCONFIG_INCLUDE_DIR=${glib}/lib/glib-2.0/include"
+    "-DGTK2_GDKCONFIG_INCLUDE_DIR=${gtk}/lib/gtk-2.0/include"
+  ];
+
+  meta = with stdenv.lib; {
+    description = "Virtual lighttable and darkroom for photographers";
+    homepage = http://darktable.sourceforge.net;
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.goibhniu ];
+  };
+}
diff --git a/pkgs/applications/graphics/djview/default.nix b/pkgs/applications/graphics/djview/default.nix
index 5ebb070ef1f4..85388ffa6012 100644
--- a/pkgs/applications/graphics/djview/default.nix
+++ b/pkgs/applications/graphics/djview/default.nix
@@ -9,6 +9,10 @@ stdenv.mkDerivation {
 
 	buildInputs = [djvulibre qt4];
 
+  passthru = {
+    mozillaPlugin = "/lib/netscape/plugins";
+  };
+
 	meta = {
 		homepage = http://djvu.sourceforge.net/djview4.html;
 		description = "A new portable DjVu viewer and browser plugin";
diff --git a/pkgs/applications/graphics/fbida/default.nix b/pkgs/applications/graphics/fbida/default.nix
index f7482e0bfe75..ea7cb81a48e5 100644
--- a/pkgs/applications/graphics/fbida/default.nix
+++ b/pkgs/applications/graphics/fbida/default.nix
@@ -1,34 +1,33 @@
-a :  
-let 
-  fetchurl = a.fetchurl;
+{ stdenv, fetchurl, libjpeg, libexif, giflib, libtiff, libpng
+, pkgconfig, freetype, fontconfig
+}:
 
-  version = a.lib.attrByPath ["version"] "2.07" a; 
-  buildInputs = with a; [
-    libjpeg libexif giflib libtiff libpng
-      imagemagick ghostscript which curl 
-      pkgconfig freetype fontconfig
-  ];
-in
-rec {
+stdenv.mkDerivation rec {
+  name = "fbida-2.07";
+  
   src = fetchurl {
-    url = "http://dl.bytesex.org/releases/fbida/fbida-${version}.tar.gz";
+    url = "http://dl.bytesex.org/releases/fbida/${name}.tar.gz";
     sha256 = "0i6v3fvjc305pfw48sglb5f22lwxldmfch6mjhqbcp7lqkkxw435";
   };
 
-  inherit buildInputs;
-  configureFlags = [];
-  makeFlags = [
-    "prefix=$out"
-    "verbose=yes"
-    ];
+  preBuild =
+    ''
+      # Fetch a segfault in exiftran (http://bugs.gentoo.org/284753).
+      # `fbida' contains a copy of some internal libjpeg source files.
+      # If these do not match with the actual libjpeg, exiftran may
+      # fail.
+      tar xvf ${libjpeg.src}
+      for i in jpegint.h jpeglib.h jinclude.h transupp.c transupp.h; do
+        cp jpeg-*/$i jpeg/
+      done
+    '';
+
+  buildInputs =
+    [ pkgconfig libexif libjpeg giflib libpng giflib freetype fontconfig ];
+  
+  makeFlags = [ "prefix=$(out)" "verbose=yes" ];
 
-  /* doConfigure should be removed if not needed */
-  phaseNames = ["doMakeInstall" (a.doPatchShebangs "$out/bin")];
-      
-  name = "fbida-" + version;
   meta = {
-    description = "Framebuffer image viewing programs";
-    maintainers = [
-    ];
+    description = "Image viewing and manipulation programs";
   };
 }
diff --git a/pkgs/applications/graphics/feh/default.nix b/pkgs/applications/graphics/feh/default.nix
index e9d86aca52d5..c36e79fbc3a2 100644
--- a/pkgs/applications/graphics/feh/default.nix
+++ b/pkgs/applications/graphics/feh/default.nix
@@ -1,15 +1,15 @@
 { stdenv, fetchurl, x11, imlib2, libjpeg, libpng, giblib
-, libXinerama }:
+, libXinerama, curl }:
 
 stdenv.mkDerivation {
-  name = "feh-1.6.1";
+  name = "feh-1.14.2";
 
   src = fetchurl {
-    url = http://www.chaosdorf.de/~derf/feh/feh-1.6.1.tar.bz2;
-    sha256 = "1mv09b34ar0dx4wl22xak2g554xgpylicqy5zbnk3bh66vn9pxz2";
+    url = http://feh.finalrewind.org/feh-1.14.2.tar.bz2;
+    sha256 = "117g1caihil88a3q0qy9gqj521l3illlsk56cgxhpc2am6ch5nwr";
   };
 
-  buildInputs = [x11 imlib2 giblib libjpeg libpng libXinerama];
+  buildInputs = [x11 imlib2 giblib libjpeg libpng libXinerama curl];
 
   preBuild = ''
     makeFlags="PREFIX=$out"
diff --git a/pkgs/applications/graphics/freecad/cmakeinstall.patch b/pkgs/applications/graphics/freecad/cmakeinstall.patch
new file mode 100644
index 000000000000..6b8f9fb1a60f
--- /dev/null
+++ b/pkgs/applications/graphics/freecad/cmakeinstall.patch
@@ -0,0 +1,55 @@
+Index: src/3rdParty/salomesmesh/CMakeLists.txt
+===================================================================
+--- a/src/3rdParty/salomesmesh/CMakeLists.txt	(revision 4193)
++++ a/src/3rdParty/salomesmesh/CMakeLists.txt	(working copy)
+@@ -191,7 +191,7 @@
+ INCLUDE_DIRECTORIES(src/StdMeshers)
+ 
+ ADD_LIBRARY(StdMeshers SHARED ${StdMeshers_source_files})
+-TARGET_LINK_LIBRARIES(StdMeshers SMESH TKernel TKMath TKAdvTools f2c)
++TARGET_LINK_LIBRARIES(StdMeshers SMESH TKernel TKMath TKAdvTools f2c gfortran)
+ SET(StdMeshers_CFLAGS "")
+ IF(WIN32)
+   SET(StdMeshers_CFLAGS "-DSTDMESHERS_EXPORTS -DMEFISTO2D_EXPORTS")
+@@ -218,9 +218,9 @@
+     # Libraries are installed by default in /usr/local/lib/SMESH-5.1.2.7
+     INSTALL(TARGETS SMDS Driver DriverSTL DriverDAT DriverUNV
+             SMESHDS SMESH StdMeshers
+-            DESTINATION /usr/local/lib/${INSTALL_PATH_NAME})
++            DESTINATION lib)
+     # Headers are installed by default in /usr/local/include/SMESH-5.1.2.7
+     INSTALL(DIRECTORY inc/
+-            DESTINATION /usr/local/include/${INSTALL_PATH_NAME}
++            DESTINATION include
+             FILES_MATCHING PATTERN "*.h*")
+ ENDIF(UNIX)
+Index: src/3rdParty/Pivy-0.5/CMakeLists.txt
+===================================================================
+--- a/src/3rdParty/Pivy-0.5/CMakeLists.txt	(revision 4193)
++++ a/src/3rdParty/Pivy-0.5/CMakeLists.txt	(working copy)
+@@ -56,6 +56,7 @@
+     set_target_properties(coin PROPERTIES OUTPUT_NAME "_coin")
+     set_target_properties(coin PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin/pivy)
+     set_target_properties(coin PROPERTIES PREFIX "")
++    install(TARGETS coin DESTINATION bin/pivy)
+ endif(MSVC)
+ 
+ fc_copy_sources_outpath("bin/pivy" "coin"
+Index: CMakeLists.txt
+===================================================================
+--- a/CMakeLists.txt	(revision 4193)
++++ a/CMakeLists.txt	(working copy)
+@@ -57,13 +57,6 @@
+ 
+ # ================================================================================
+ 
+-
+-if(WIN32)
+-    SET(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR})
+-else(WIN32)
+-    SET(CMAKE_INSTALL_PREFIX "/usr/lib/freecad")
+-endif(WIN32)
+-
+ # ================================================================================
+ # == Win32 is default behaviour use the LibPack copied in Source tree ============
+ if(MSVC)
diff --git a/pkgs/applications/graphics/freecad/default.nix b/pkgs/applications/graphics/freecad/default.nix
new file mode 100644
index 000000000000..cfe97e12476d
--- /dev/null
+++ b/pkgs/applications/graphics/freecad/default.nix
@@ -0,0 +1,47 @@
+{ fetchsvn, stdenv, cmake, coin3d, xercesc, ode, eigen, qt4, opencascade, gts,
+boost, zlib,
+python, swig, gfortran, soqt, libf2c, pyqt4, makeWrapper }:
+
+# It builds but fails to install
+
+stdenv.mkDerivation rec {
+  name = "freecad-${version}";
+  version = "svn-${src.rev}";
+
+  src = fetchsvn {
+    url = https://free-cad.svn.sourceforge.net/svnroot/free-cad/trunk;
+    rev = "4184";
+    sha256 = "26bd8407ce38f070b81ef39145aed093eed3c200d165a605b8169162d66568ce";
+  };
+
+  buildInputs = [ cmake coin3d xercesc ode eigen qt4 opencascade gts boost
+    zlib python swig gfortran soqt libf2c pyqt4 makeWrapper ];
+
+  enableParallelBuilding = true;
+
+  # The freecad people are used to boost 1.42, and we have newer boost that
+  # require the -DBOOST_FILESYSTEM_VERSION=2 for freecad to build
+  # For zlib to build in i686-linux, as g++ plus glibc defines _LARGEFILE64_SOURCE,
+  # we need the -D-FILE_OFFSET_BITS=64 indication for zlib headers to work.
+  NIX_CFLAGS_COMPILE = "-DBOOST_FILESYSTEM_VERSION=2 -D_FILE_OFFSET_BITS=64";
+
+  # This should work on both x86_64, and i686 linux
+  preBuild = ''
+    export NIX_LDFLAGS="-L${gfortran.gcc}/lib64 -L${gfortran.gcc}/lib $NIX_LDFLAGS";
+  '';
+
+  postInstall = ''
+    wrapProgram $out/bin/FreeCAD --prefix PYTHONPATH : $PYTHONPATH \
+      --set COIN_GL_NO_CURRENT_CONTEXT_CHECK 1
+  '';
+
+  patches = [ ./cmakeinstall.patch ./pythonpath.patch ];
+
+  meta = {
+    homepage = http://free-cad.sourceforge.net/;
+    license = [ "GPLv2+" "LGPLv2+" ];
+    description = "General purpose Open Source 3D CAD/MCAD/CAx/CAE/PLM modeler";
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/applications/graphics/freecad/pythonpath.patch b/pkgs/applications/graphics/freecad/pythonpath.patch
new file mode 100644
index 000000000000..849c778aedba
--- /dev/null
+++ b/pkgs/applications/graphics/freecad/pythonpath.patch
@@ -0,0 +1,19 @@
+http://sourceforge.net/apps/phpbb/free-cad/viewtopic.php?f=4&t=847&p=6364
+
+Index: src/Main/MainGui.cpp
+===================================================================
+--- a/src/Main/MainGui.cpp	(revision 4193)
++++ a/src/Main/MainGui.cpp	(working copy)
+@@ -149,10 +149,10 @@
+     // http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=559846

+     putenv("LANG=C");

+     putenv("LC_ALL=C");

+-    putenv("PYTHONPATH=");

++    //putenv("PYTHONPATH=");

+ #else

+     setlocale(LC_NUMERIC, "C");

+-    _putenv("PYTHONPATH=");

++    //_putenv("PYTHONPATH=");

+ #endif

+ 

+     // Name and Version of the Application

diff --git a/pkgs/applications/graphics/geeqie/default.nix b/pkgs/applications/graphics/geeqie/default.nix
index 076c0360a083..3e15eb8f8670 100644
--- a/pkgs/applications/graphics/geeqie/default.nix
+++ b/pkgs/applications/graphics/geeqie/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, pkgconfig, gtk, libpng, exiv2, lcms
-, intltool, gettext, libchamplain }:
+, intltool, gettext, libchamplain, fbida }:
 
 stdenv.mkDerivation rec {
   name = "geeqie-1.0";
@@ -23,6 +23,14 @@ stdenv.mkDerivation rec {
       libchamplain
     ];
 
+  postInstall =
+    ''
+      # Allow geeqie to find exiv2 and exiftran, necessary to
+      # losslessly rotate JPEG images.
+      sed -i $out/lib/geeqie/geeqie-rotate \
+          -e '1 a export PATH=${exiv2}/bin:${fbida}/bin:$PATH'
+    '';
+
   meta = {
     description = "Geeqie, a lightweight GTK+ based image viewer";
 
diff --git a/pkgs/applications/graphics/giv/build.patch b/pkgs/applications/graphics/giv/build.patch
new file mode 100644
index 000000000000..639d881f4159
--- /dev/null
+++ b/pkgs/applications/graphics/giv/build.patch
@@ -0,0 +1,44 @@
+Get the environment propagated to scons forked childs, and correct the dicom plugin about
+a typedef of size_t that failed at least on x86_64-linux.
+
+diff --git a/SConstruct b/SConstruct
+index 16eccd9..603e931 100644
+--- a/SConstruct
++++ b/SConstruct
+@@ -7,8 +7,7 @@ else:
+     cppflags = ['-O2']
+     variant = 'Release'
+ 
+-env = Environment(LIBPATH=[],
+-                  CPPFLAGS = cppflags)
++env = Environment(ENV = os.environ)
+ 
+ env['SBOX'] = False
+ 
+diff --git a/giv/SConstruct b/giv/SConstruct
+index 047839a..2c267aa 100644
+--- a/giv/SConstruct
++++ b/giv/SConstruct
+@@ -3,8 +3,9 @@
+ 
+ import sys
+ import re
++import os
+ 
+-env = Environment()
++env = Environment(ENV = os.environ)
+ 
+ src = ["giv.c",
+        "giv-backstore.c",
+diff --git a/src/plugins/dcmtk/SConstruct.standalone b/src/plugins/dcmtk/SConstruct.standalone
+index ffce001..74246f8 100644
+--- a/src/plugins/dcmtk/SConstruct.standalone
++++ b/src/plugins/dcmtk/SConstruct.standalone
+@@ -1,4 +1,6 @@
+-env = Environment()
++import os
++
++env = Environment(ENV = os.environ)
+ 
+ variant = "Debug"
+ 
diff --git a/pkgs/applications/graphics/giv/default.nix b/pkgs/applications/graphics/giv/default.nix
new file mode 100644
index 000000000000..d32ef5bbebc9
--- /dev/null
+++ b/pkgs/applications/graphics/giv/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchurl, gdk_pixbuf, scons, pkgconfig, gtk, glib,
+  pcre, cfitsio, perl, gob2, vala, libtiff }:
+
+stdenv.mkDerivation rec {
+  name = "giv-0.9.19";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/giv/${name}.tar.gz";
+    sha256 = "07sgpp4k27417ymavcvil4waq6ac2mj08g42g1l52l435xm5mnh7";
+  };
+
+  # It built code to be put in a shared object without -fPIC
+  NIX_CFLAGS_COMPILE = "-fPIC";
+
+  prePatch = ''
+    sed -i s,/usr/bin/perl,${perl}/bin/perl, doc/eperl
+    sed -i s,/usr/local,$out, SConstruct 
+  '';
+
+  patches = [ ./build.patch ./union.patch ];
+
+  buildPhase = "scons";
+
+  installPhase = "scons install";
+
+  buildInputs = [ gdk_pixbuf pkgconfig gtk glib scons pcre cfitsio perl gob2 vala libtiff ];
+
+  meta = {
+    description = "Cross platform image and hierarchical vector viewer based";
+    homepage = http://giv.sourceforge.net/giv/;
+    license = "GPLv2+";
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/applications/graphics/giv/union.patch b/pkgs/applications/graphics/giv/union.patch
new file mode 100644
index 000000000000..f12fce036135
--- /dev/null
+++ b/pkgs/applications/graphics/giv/union.patch
@@ -0,0 +1,38 @@
+Already reported uptream
+
+diff --git a/src/giv-data.h b/src/giv-data.h
+index 64e7696..d34bfe4 100644
+--- a/src/giv-data.h
++++ b/src/giv-data.h
+@@ -88,7 +88,7 @@ typedef struct
+ typedef struct
+ {
+   gint op;
+-  union
++  struct
+   {
+     struct
+     {
+diff --git a/src/giv_types.h b/src/giv_types.h
+index 02abebe..c3cfb78 100644
+--- a/src/giv_types.h
++++ b/src/giv_types.h
+@@ -11,13 +11,11 @@ typedef struct {
+ 
+ typedef struct {
+   gint op;
+-  union {
+-    struct {
+-      gdouble x,y;
+-    } point;
+-    double arc_dev;
+-    text_mark_t *text_object;
+-  } data;
++  struct {
++    gdouble x,y;
++  } point;
++  double arc_dev;
++  text_mark_t *text_object;
+ } point_t;
+ 
+ typedef struct {
diff --git a/pkgs/applications/graphics/hugin/default.nix b/pkgs/applications/graphics/hugin/default.nix
index b1a940b9b56d..795417dbf5b3 100644
--- a/pkgs/applications/graphics/hugin/default.nix
+++ b/pkgs/applications/graphics/hugin/default.nix
@@ -3,11 +3,11 @@
  glew, libXmu, libXi }:
 
 stdenv.mkDerivation rec {
-  name = "hugin-2010.0.0";
+  name = "hugin-2010.4.0";
 
   src = fetchurl {
-    url = "mirror://sourceforge/hugin/${name}.tar.gz";
-    sha256 = "08xm7ggfrh536lqvdzw7zg09p2awbclw5r7i8c59gf092w1cac7d";
+    url = "mirror://sourceforge/hugin/${name}.tar.bz2";
+    sha256 = "13n3p4f39mbdydsjqy48csjgvv30lfcwvln5y5dyy95lyrfwcp6l";
   };
 
   NIX_CFLAGS_COMPILE = "-I${ilmbase}/include/OpenEXR";
diff --git a/pkgs/applications/graphics/inkscape/default.nix b/pkgs/applications/graphics/inkscape/default.nix
index 08adb7902dae..0da9bf0b41c0 100644
--- a/pkgs/applications/graphics/inkscape/default.nix
+++ b/pkgs/applications/graphics/inkscape/default.nix
@@ -4,11 +4,11 @@
 , gsl, python, pyxml, lxml, poppler }:
 
 stdenv.mkDerivation rec {
-  name = "inkscape-0.48.0";
+  name = "inkscape-0.48.1";
 
   src = fetchurl {
     url = "mirror://sourceforge/inkscape/${name}.tar.bz2";
-    sha256 = "0w72xf76vxpm3fpslmix0x71l2rd2sdhrvgwx2vk7hxfjqdxib1n";
+    sha256 = "11mvwil787pj3kx3qvjqvd6z5hlk40i6g95g4vs52hrp2ifs9ga4";
   };
 
   patches = [ ./configure-python-libs.patch ]; 
diff --git a/pkgs/applications/graphics/jbrout/default.nix b/pkgs/applications/graphics/jbrout/default.nix
new file mode 100644
index 000000000000..7c3826369ee9
--- /dev/null
+++ b/pkgs/applications/graphics/jbrout/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, fetchsvn, buildPythonPackage, python, pyGtkGlade, makeWrapper, pyexiv2, lxml, pil, fbida, which }:
+
+buildPythonPackage {
+  name = "jbrout-338";
+  version = "338";
+  src = fetchsvn {
+    url = "http://jbrout.googlecode.com/svn/trunk";
+    rev = "338";
+    sha256 = "0257ni4vkxgd0qhs73fw5ppw1qpf11j8fgwsqc03b1k1yv3hk4hf";
+  };
+
+  doCheck = false;
+# XXX: preConfigure to avoid this
+#  File "/nix/store/vnyjxn6h3rbrn49m25yyw7i1chlxglhw-python-2.7.1/lib/python2.7/zipfile.py", line 348, in FileHeader
+#    len(filename), len(extra))
+#struct.error: ushort format requires 0 <= number <= USHRT_MAX
+
+  preConfigure = ''
+    find | xargs touch
+  '';
+
+  postInstall = ''
+    ensureDir $out/bin
+    echo '#!/bin/sh' > $out/bin/jbrout
+    echo "python $out/lib/python2.7/site-packages/jbrout-src-py2.7.egg/jbrout/jbrout.py" >> $out/bin/jbrout
+    chmod +x $out/bin/jbrout
+
+    wrapProgram $out/bin/jbrout \
+            --set PYTHONPATH "$out/lib/python:$(toPythonPath ${pyGtkGlade})/gtk-2.0:$(toPythonPath ${pyexiv2}):$(toPythonPath ${lxml}):$(toPythonPath ${pil}):$PYTHONPATH" \
+            --set PATH "${fbida}/bin:${which}/bin:$PATH"
+  '';
+
+  buildInputs = [ python pyGtkGlade makeWrapper pyexiv2 lxml pil fbida which ];
+  meta = {
+    homepage = "http://code.google.com/p/jbrout";
+    description = "jBrout is a photo manager";
+  };
+}
diff --git a/pkgs/applications/graphics/kipi-plugins/default.nix b/pkgs/applications/graphics/kipi-plugins/default.nix
index c3fe93a77ea8..96ab03a2784d 100644
--- a/pkgs/applications/graphics/kipi-plugins/default.nix
+++ b/pkgs/applications/graphics/kipi-plugins/default.nix
@@ -1,20 +1,21 @@
-{ stdenv, fetchurl, cmake, qt4, kdelibs, automoc4, phonon, qimageblitz, qca2,
-kdegraphics, kdepimlibs, libxml2, libxslt, gettext, opencv, libgpod, gtk }:
+{ stdenv, fetchurl, kdelibs, qimageblitz, qca2, libkexiv2, libkdcraw, libkipi
+, libksane, kdepimlibs, libxml2, libxslt, gettext, opencv, libgpod, gdk_pixbuf
+, qjson , pkgconfig }:
 
 stdenv.mkDerivation rec {
-  name = "kipi-plugins-1.5.0";
+  name = "kipi-plugins-1.9.0";
 
   src = fetchurl { 
     url = "mirror://sourceforge/kipi/${name}.tar.bz2";
-    sha256 = "1wsqh0lbsqyzdfmb9f53bmmypw00n80p62ym4pnxb8w0zwlhbkbw";
+    sha256 = "0k4k9v1rj7129n0s0i5pvv4rabx0prxqs6sca642fj95cxc6c96m";
   };
 
-  buildInputs = [ cmake qt4 kdelibs kdegraphics automoc4 phonon qimageblitz qca2 kdepimlibs 
-    libxml2 libxslt gettext opencv libgpod gtk ];
+  buildInputs =
+    [ kdelibs libkexiv2 libkdcraw libkipi qimageblitz qca2 kdepimlibs libxml2
+      libksane libxslt gettext opencv libgpod gdk_pixbuf qjson
+    ];
 
-  KDEDIRS = kdegraphics;
-
-  patches = [ ./find-gdk.patch ];
+  buildNativeInputs = [ pkgconfig ];
 
   meta = {
     description = "Photo Management Program";
diff --git a/pkgs/applications/graphics/kipi-plugins/find-gdk.patch b/pkgs/applications/graphics/kipi-plugins/find-gdk.patch
deleted file mode 100644
index 22dcf0323fcb..000000000000
--- a/pkgs/applications/graphics/kipi-plugins/find-gdk.patch
+++ /dev/null
@@ -1,16 +0,0 @@
-diff --git a/cmake/modules/FindGdk.cmake b/cmake/modules/FindGdk.cmake
-index 033959a..ff61961 100644
---- a/cmake/modules/FindGdk.cmake
-+++ b/cmake/modules/FindGdk.cmake
-@@ -23,8 +23,9 @@ else (GDK_INCLUDE_DIR AND GDK_LIBRARIES)
-     set(GDK_DEFINITIONS ${_GDKCflags})
-   endif(NOT WIN32)
- 
--  FIND_PATH(GDK_INCLUDE_DIR gdk-pixbuf/gdk-pixbuf.h /usr/include/gtk-2.0
--    ${_GDKIncDir}
-+  FIND_PATH(GDK_INCLUDE_DIR gdk-pixbuf/gdk-pixbuf.h
-+    HINTS ${_GDKIncDir}
-+	PATH_SUFFIXES gtk-2.0
-   )
-   
-   FIND_LIBRARY(GDK_LIBRARIES NAMES gdk_pixbuf-2.0
diff --git a/pkgs/applications/graphics/minidjvu/default.nix b/pkgs/applications/graphics/minidjvu/default.nix
new file mode 100644
index 000000000000..8f7ba7929147
--- /dev/null
+++ b/pkgs/applications/graphics/minidjvu/default.nix
@@ -0,0 +1,26 @@
+{stdenv, fetchurl, libtiff, gettext }:
+
+stdenv.mkDerivation {
+  name = "minidjvu-0.8";
+  src = fetchurl {
+    url = mirror://sourceforge/minidjvu/minidjvu-0.8.tar.gz;
+    sha256 = "0jmpvy4g68k6xgplj9zsl6brg6vi81mx3nx2x9hfbr1f4zh95j79";
+  };
+
+  patchPhase = ''
+    sed -i s,/usr/bin/gzip,gzip, Makefile.in
+  '';
+
+  buildInputs = [ libtiff gettext];
+
+  preInstall = ''
+    ensureDir $out/lib
+  '';
+
+  meta = {
+    homepage = http://djvu.sourceforge.net/djview4.html;
+    description = "Black-and-white djvu page encoder and decoder that use interpage information";
+    license = "GPLv2+";
+    maintainers = [ stdenv.lib.maintainers.viric ];
+  };
+}
diff --git a/pkgs/applications/graphics/ocrad/default.nix b/pkgs/applications/graphics/ocrad/default.nix
new file mode 100644
index 000000000000..88ca6a6c5417
--- /dev/null
+++ b/pkgs/applications/graphics/ocrad/default.nix
@@ -0,0 +1,34 @@
+{ fetchurl, stdenv }:
+
+stdenv.mkDerivation rec {
+  name = "ocrad-0.21";
+
+  src = fetchurl {
+    url = "mirror://gnu/ocrad/${name}.tar.gz";
+    sha256 = "1k58ha70r0cqahssx67hfgyzia9ymf691yay06n7nrkbklii3isf";
+  };
+
+  doCheck = true;
+
+  meta = {
+    description = "GNU Ocrad, optical character recognition (OCR) program & library";
+
+    longDescription =
+      '' GNU Ocrad is an OCR (Optical Character Recognition) program based on
+         a feature extraction method.  It reads images in pbm (bitmap), pgm
+         (greyscale) or ppm (color) formats and produces text in byte (8-bit)
+         or UTF-8 formats.
+
+         Also includes a layout analyser able to separate the columns or
+         blocks of text normally found on printed pages.
+
+         Ocrad can be used as a stand-alone console application, or as a
+         backend to other programs.
+      '';
+
+    license = "GPLv3+";
+
+    maintainers = [ stdenv.lib.maintainers.ludo ];
+    platforms = stdenv.lib.platforms.gnu;  # arbitrary choice
+  };
+}
diff --git a/pkgs/applications/graphics/paraview/default.nix b/pkgs/applications/graphics/paraview/default.nix
index 99bed17c966c..88e3d32080c5 100644
--- a/pkgs/applications/graphics/paraview/default.nix
+++ b/pkgs/applications/graphics/paraview/default.nix
@@ -1,20 +1,41 @@
-{ fetchurl, stdenv, cmake, qt4 }:
+{ fetchurl, stdenv, cmake, qt4
+, hdf5
+, mpich2
+, python
+, libxml2
+, mesa
+}:
 
 stdenv.mkDerivation rec {
-  name = "paraview-3.8.1";
+  name = "paraview-3.10.1";
   src = fetchurl {
-    url = "http://www.paraview.org/files/v3.8/ParaView-3.8.1.tar.gz";
-    sha256 = "0g169vc956gifkd90lcini63dkr5x3id3hkwcwxzriqamxr72r1p";
+    url = "http://www.paraview.org/files/v3.10/ParaView-3.10.1.tar.gz";
+    sha256 = "1z2wvywpd3rvz4jhfs3mi35hsx4yqkdim58d075jx9kg7gifwga5";
   };
 
+  # [  5%] Generating vtkGLSLShaderLibrary.h
+  # ../../../bin/ProcessShader: error while loading shared libraries: libvtksys.so.pv3.10: cannot open shared object file: No such file or directory
   preConfigure = ''
-    export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/paraview-3.8"
+    export NIX_LDFLAGS="$NIX_LDFLAGS -rpath $out/lib/paraview-3.10 -rpath ../../../bin -rpath ../../bin"
   '';
+  cmakeFlags = [
+#    "-DPARAVIEW_USE_MPI:BOOL=ON"
+    "-DPARAVIEW_USE_SYSTEM_HDF5:BOOL=ON"
+    "-DVTK_USE_SYSTEM_LIBXML2:BOOL=ON"
+    "-DPARAVIEW_ENABLE_PYTHON:BOOL=ON"
+#  use -DPARAVIEW_INSTALL_THIRD_PARTY_LIBRARIES:BOOL=OFF \ to fix make install error: http://www.cmake.org/pipermail/paraview/2011-February/020268.html
+    "-DPARAVIEW_INSTALL_THIRD_PARTY_LIBRARIES:BOOL=OFF"
+    "-DCMAKE_SKIP_BUILD_RPATH=ON"
+    "-DVTK_USE_RPATH:BOOL=ON"
+    "-DPARAVIEW_INSTALL_DEVELOPMENT=ON"
+#    "-DPYTHON_INCLUDE_DIR=${python}/include"
+#    "-DPYTHON_LIBRARY="
+  ];
 
   # I don't enable it due to memory bounds
   enableParallelBuilding = false;
 
-  buildInputs = [ cmake qt4 ];
+  buildInputs = [ cmake qt4 hdf5 mpich2 python libxml2 mesa ];
 
   meta = {
     homepage = "http://www.paraview.org/";
diff --git a/pkgs/applications/graphics/tesseract/default.nix b/pkgs/applications/graphics/tesseract/default.nix
new file mode 100644
index 000000000000..07a160a2e486
--- /dev/null
+++ b/pkgs/applications/graphics/tesseract/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchurl, libtiff }:
+
+let
+  f = lang : sha256 : let
+      src = fetchurl {
+        url = "http://tesseract-ocr.googlecode.com/files/${lang}.traineddata.gz";
+        inherit sha256;
+      };
+    in 
+      "gunzip -c ${src} > $out/share/tessdata/${lang}.traineddata";
+
+  extraLanguages = ''
+    ${f "cat" "1qndk8qygw9bq7nzn7kzgxkm3jhlq7jgvdqpj5id4rrcaavjvifw"}
+    ${f "rus" "0yjzks189bgcmi2vr4v0l0fla11qdrw3cb1nvpxl9mdis8qr9vcc"}
+    ${f "spa" "1q1hw3qi95q5ww3l02fbhjqacxm34cp65fkbx10wjdcg0s5p9q2x"}
+    ${f "nld" "0cbqfhl2rwb1mg4y1140nw2vhhcilc0nk7bfbnxw6bzj1y5n49i8"}
+  '';
+in
+
+stdenv.mkDerivation {
+  name = "tesseract-3.0.0";
+
+  src = fetchurl {
+    url = http://tesseract-ocr.googlecode.com/files/tesseract-3.00.tar.gz;
+    sha256 = "111r9hy1rcs2ch4kdi9dkzwch3xg38vv379sf3cjpkswkigx8clw";
+  };
+
+  buildInputs = [ libtiff ];
+
+  postInstall = extraLanguages;
+
+  meta = {
+    description = "OCR engine";
+    homepage = http://code.google.com/p/tesseract-ocr/;
+    license = "Apache2.0";
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/applications/graphics/xscreensaver/default.nix b/pkgs/applications/graphics/xscreensaver/default.nix
index 82d5bcc0b3af..7458626769a4 100644
--- a/pkgs/applications/graphics/xscreensaver/default.nix
+++ b/pkgs/applications/graphics/xscreensaver/default.nix
@@ -1,30 +1,29 @@
 { stdenv, fetchurl, pkgconfig, bc, perl, pam
 , libXext, libXScrnSaver, libX11, libXrandr, libXmu, libXxf86vm, libXrender
 , libXxf86misc
-, libjpeg, mesa, gtk , libxml2, libglade}:
+, libjpeg, mesa, gtk, libxml2, libglade
+}:
 
 stdenv.mkDerivation rec {
-  version = "5.12";
+  version = "5.14";
   name = "xscreensaver-${version}";
 
   src = fetchurl {
     url = "http://www.jwz.org/xscreensaver/${name}.tar.gz";
-    sha256="1knvxxr50iq3wrx1qsgg174gzv7xg8c74i1a66ff55f8flksa7di";
+    sha256 = "08zhxccdny7198x4yi3hm7jrw98bi3mnc1c4fwhmf5rf8l7h9siy";
   };
 
   buildInputs =
     [ pkgconfig bc perl libjpeg mesa gtk libxml2 libglade pam
-    libXext libXScrnSaver libX11 libXrandr libXmu libXxf86vm libXrender
-    libXxf86misc ];
+      libXext libXScrnSaver libX11 libXrandr libXmu libXxf86vm libXrender
+      libXxf86misc
+    ];
 
   configureFlags =
-    [
-      "--with-gl" "--with-pam" "--with-pixbuf" "--with-proc-interrupts"
-
+    [ "--with-gl" "--with-pam" "--with-pixbuf" "--with-proc-interrupts"
       "--with-dpms-ext" "--with-randr-ext" "--with-xinerama-ext"
       "--with-xf86vmode-ext" "--with-xf86gamma-ext" "--with-randr-ext"
       "--with-xshm-ext" "--with-xdbe-ext" "--without-readdisplay"
-
       "--with-x-app-defaults=\${out}/share/xscreensaver/app-defaults"
     ];
 
diff --git a/pkgs/applications/misc/adobe-reader/default.nix b/pkgs/applications/misc/adobe-reader/default.nix
index 24d01dae0595..6182931de96e 100644
--- a/pkgs/applications/misc/adobe-reader/default.nix
+++ b/pkgs/applications/misc/adobe-reader/default.nix
@@ -1,15 +1,15 @@
-{ stdenv, fetchurl, libX11, cups, glib, pango, atk, gtk, zlib, libxml2 }:
+{ stdenv, fetchurl, libX11, cups, gtkLibs, zlib, libxml2 }:
 
 assert stdenv.system == "i686-linux";
 
 stdenv.mkDerivation {
-  name = "adobe-reader-9.4-1";
+  name = "adobe-reader-9.4.2-1";
   
   builder = ./builder.sh;
   
   src = fetchurl {
-    url = http://ardownload.adobe.com/pub/adobe/reader/unix/9.x/9.4.0/enu/AdbeRdr9.4-1_i486linux_enu.tar.bz2;
-    sha256 = "093msw0b5k3ab0vv7bh4n81fxp51s2lynvsm076i5jvlp71l8adf";
+    url = http://ardownload.adobe.com/pub/adobe/reader/unix/9.x/9.4.2/enu/AdbeRdr9.4.2-1_i486linux_enu.tar.bz2;
+    sha256 = "0xm8ngr7lslhxli9ly1g2w7ichip88vpf7lfx1ma0liaw4m2gv0h";
   };
 
   # !!! Adobe Reader contains copies of OpenSSL, libcurl, and libicu.
@@ -17,7 +17,13 @@ stdenv.mkDerivation {
   # versions.
   
   libPath = stdenv.lib.makeLibraryPath
-    [ stdenv.gcc.gcc libX11 glib pango atk gtk zlib libxml2 cups ];
+    [ stdenv.gcc.gcc libX11 zlib libxml2 cups 
+      gtkLibs.pango
+      gtkLibs.atk
+      gtkLibs.gtk
+      gtkLibs.glib
+      gtkLibs.gdk_pixbuf
+    ];
   
   meta = {
     description = "Adobe Reader, a viewer for PDF documents";
diff --git a/pkgs/applications/misc/bitcoin/default.nix b/pkgs/applications/misc/bitcoin/default.nix
new file mode 100644
index 000000000000..9d9ddb056daa
--- /dev/null
+++ b/pkgs/applications/misc/bitcoin/default.nix
@@ -0,0 +1,44 @@
+{ fetchurl, stdenv, openssl, db4, boost, zlib, glib, libSM, gtk, wxGTK, miniupnpc }:
+
+stdenv.mkDerivation rec {
+  version = "0.3.24";
+  name = "bitcoin-${version}";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/project/bitcoin/Bitcoin/${name}/${name}-src.tar.gz";
+    sha256 = "18n8i37c478b275m2x82411i1fsw8l34qm1k65ynnw38fpaj4h3r";
+  };
+
+  buildInputs = [ openssl db4 boost zlib glib libSM gtk wxGTK miniupnpc ];
+
+  preConfigure = ''
+    cd src
+    substituteInPlace makefile.unix \
+      --replace "-Wl,-Bstatic" "" \
+      --replace "-Wl,-Bdynamic" "" \
+      --replace "DEBUGFLAGS=-g -D__WXDEBUG__" "DEBUGFLAGS=" \
+  '';
+
+  makefile = "makefile.unix";
+
+  buildFlags = "bitcoin bitcoind";
+
+  installPhase = ''
+    ensureDir $out/bin
+    cp bitcoin $out/bin
+    cp bitcoind $out/bin
+  '';
+
+  meta = { 
+      description = "Bitcoin is a peer-to-peer currency";
+      longDescription=''
+Bitcoin is a free open source peer-to-peer electronic cash system that is
+completely decentralized, without the need for a central server or trusted
+parties.  Users hold the crypto keys to their own money and transact directly
+with each other, with the help of a P2P network to check for double-spending.
+      '';
+      homepage = "http://www.bitcoin.org/";
+      maintainers = [ stdenv.lib.maintainers.roconnor ];
+      license = "MIT";
+  };
+}
diff --git a/pkgs/applications/misc/blender/default.nix b/pkgs/applications/misc/blender/default.nix
index 87d91e59823e..75d737e5996e 100644
--- a/pkgs/applications/misc/blender/default.nix
+++ b/pkgs/applications/misc/blender/default.nix
@@ -1,23 +1,26 @@
-{stdenv, fetchurl, cmake, mesa, gettext, python, libjpeg, libpng, zlib, openal, SDL
-, openexr, libsamplerate, libXi, libtiff, ilmbase }:
+{ stdenv, fetchurl, SDL, cmake, gettext, ilmbase, libXi, libjpeg,
+libpng, libsamplerate, libtiff, mesa, openal, openexr, openjpeg,
+python, zlib }:
 
 stdenv.mkDerivation rec {
-  name = "blender-2.50a1";
+  name = "blender-2.57";
 
   src = fetchurl {
     url = "http://download.blender.org/source/${name}.tar.gz";
-    sha256 = "1cik05fmf9b8z3qpwsm6q9h1ia87w1piz87hxhfs24jw6l5pyiwr";
+    sha256 = "1f4l0zkfmbd8ydzwvmb5jw89y7ywd9k8m2f1b3hrdpgjcqhq3lcb";
   };
 
-  buildInputs = [ cmake mesa gettext python libjpeg libpng zlib openal SDL openexr libsamplerate
-    libXi libtiff ilmbase ];
+  buildInputs = [ cmake mesa gettext python libjpeg libpng zlib openal
+    SDL openexr libsamplerate libXi libtiff ilmbase openjpeg ];
 
-  cmakeFlags = [ "-DOPENEXR_INC=${openexr}/include/OpenEXR" "-DWITH_OPENCOLLADA=OFF"
-    "-DPYTHON_LIBPATH=${python}/lib" ];
+  patchPhase = ''
+      sed -e "s@/usr/local@${python}@" -i build_files/cmake/FindPythonLibsUnix.cmake
+  '';
 
-  NIX_CFLAGS_COMPILE = "-iquote ${ilmbase}/include/OpenEXR -I${python}/include/${python.libPrefix}";
+  cmakeFlags = [ "-DOPENEXR_INC=${openexr}/include/OpenEXR"
+    "-DWITH_OPENCOLLADA=OFF" "-DWITH_INSTALL_PORTABLE=OFF"];
 
-  patches = [ ./python-chmod.patch ];
+  NIX_CFLAGS_COMPILE = "-iquote ${ilmbase}/include/OpenEXR -I${python}/include/${python.libPrefix}";
 
   meta = { 
     description = "3D Creation/Animation/Publishing System";
diff --git a/pkgs/applications/misc/blender/python-chmod.patch b/pkgs/applications/misc/blender/python-chmod.patch
deleted file mode 100644
index bda04b1cbb41..000000000000
--- a/pkgs/applications/misc/blender/python-chmod.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-As the code copied from the nix store, the files there do not have the 'writeable' permission.
-Hence this fix, needed on nix but not on usual LSB linuces.
-diff --git a/source/creator/CMakeLists.txt b/source/creator/CMakeLists.txt
-index 386ef1b..6a180fa 100644
---- a/source/creator/CMakeLists.txt
-+++ b/source/creator/CMakeLists.txt
-@@ -152,6 +152,7 @@ IF(WITH_INSTALL)
- 				COMMAND mkdir ${TARGETDIR}/.blender/python # PYTHONPATH and PYTHONHOME is set here
- 				COMMAND mkdir ${TARGETDIR}/.blender/python/lib/
- 				COMMAND cp -R ${PYTHON_LIBPATH}/python${PYTHON_VERSION} ${TARGETDIR}/.blender/python/lib/
-+        COMMAND chmod -R +w ${TARGETDIR}/.blender/python/lib/
-         
- 				COMMAND rm -rf ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/distutils
- 				COMMAND rm -rf ${TARGETDIR}/.blender/python/lib/python${PYTHON_VERSION}/lib2to3
diff --git a/pkgs/applications/misc/calibre/default.nix b/pkgs/applications/misc/calibre/default.nix
index 3dc6a427f25e..f892cf175c1d 100644
--- a/pkgs/applications/misc/calibre/default.nix
+++ b/pkgs/applications/misc/calibre/default.nix
@@ -1,6 +1,6 @@
 { stdenv, fetchurl, python, pyqt4, sip, popplerQt4, pkgconfig, libpng
-, imagemagick, libjpeg, fontconfig, podofo, qt4, mechanize, lxml, dateutil
-, pil, cssutils, beautifulsoap, makeWrapper, unrar, chmlib
+, imagemagick, libjpeg, fontconfig, podofo, qt4
+, pil, makeWrapper, unrar, chmlib, pythonPackages
 }:
 
 stdenv.mkDerivation rec {
@@ -15,8 +15,9 @@ stdenv.mkDerivation rec {
 
   buildInputs =
     [ python pyqt4 sip popplerQt4 pkgconfig libpng imagemagick libjpeg
-      fontconfig podofo qt4 mechanize lxml dateutil pil makeWrapper
-      cssutils beautifulsoap chmlib
+      fontconfig podofo qt4 pil makeWrapper chmlib 
+      pythonPackages.mechanize pythonPackages.lxml pythonPackages.dateutil
+      pythonPackages.cssutils pythonPackages.beautifulsoap pythonPackages.sqlite3
     ];
 
   installPhase = ''
diff --git a/pkgs/applications/misc/djvulibre/default.nix b/pkgs/applications/misc/djvulibre/default.nix
index 0826f7241c4c..b1001976ea04 100644
--- a/pkgs/applications/misc/djvulibre/default.nix
+++ b/pkgs/applications/misc/djvulibre/default.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, lib, useQt3 ? false, libjpeg, libtiff, libpng, ghostscript
 , libungif, zlib, x11, libX11, mesa, qt3 }:
 
-stdenv.mkDerivation {
-  name = "djvulibre-3.5.22";
+stdenv.mkDerivation rec {
+  name = "djvulibre-3.5.24";
 
   src = fetchurl {
-    url = mirror://sourceforge/djvu/djvulibre-3.5.22.tar.gz;
-    sha256 = "1gphi67qiq1ky7k8vymkwcgla80cwy8smk1rla6grxdqipwl54ix";
+    url = "mirror://sourceforge/djvu/${name}.tar.gz";
+    sha256 = "0d1592cmc7scg2jzah47mnvbqldhxb1x9vxm7y64a3iasa0lqwy0";
   };
 
   buildInputs = [ libjpeg libtiff libpng ghostscript zlib libungif ] ++
diff --git a/pkgs/applications/misc/dmenu/default.nix b/pkgs/applications/misc/dmenu/default.nix
index a9ea63368c5d..2a55512ff26e 100644
--- a/pkgs/applications/misc/dmenu/default.nix
+++ b/pkgs/applications/misc/dmenu/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl, libX11, libXinerama}:
 
 stdenv.mkDerivation rec {
-  name = "dmenu-4.1.1";
+  name = "dmenu-4.4";
 
   src = fetchurl {
     url = "http://dl.suckless.org/tools/${name}.tar.gz";
-    sha256 = "02p687yi3fmnpkbvnskpryz54dc4i8pzf1spxc554s91wrd7fpwy";
+    sha256 = "016hfnmk4kb2n3slxrg4z27p2l8x1awqsig961syssw4p1zybpav";
   };
 
   buildInputs = [ libX11 libXinerama ];
diff --git a/pkgs/applications/misc/epdfview/default.nix b/pkgs/applications/misc/epdfview/default.nix
index 4d88096d0423..3ce652c1a332 100644
--- a/pkgs/applications/misc/epdfview/default.nix
+++ b/pkgs/applications/misc/epdfview/default.nix
@@ -1,9 +1,9 @@
 { stdenv, fetchurl, pkgconfig, gtk, poppler }:
 stdenv.mkDerivation rec {
-  name = "epdfview-0.1.7";
+  name = "epdfview-0.1.8";
   src = fetchurl {
     url = "http://trac.emma-soft.com/epdfview/chrome/site/releases/${name}.tar.bz2";
-    sha256 = "1s2af09ij5jjqryv4dl10flsdk5p953qp94dymn93fnl93rv1yqa";
+    sha256 = "1w7qybh8ssl4dffi5qfajq8mndw7ipsd92vkim03nywxgjp4i1ll";
   };
   buildInputs = [ pkgconfig gtk poppler ];
   meta = {
diff --git a/pkgs/applications/misc/evince/default.nix b/pkgs/applications/misc/evince/default.nix
index 986825426135..ac81a09c96d8 100644
--- a/pkgs/applications/misc/evince/default.nix
+++ b/pkgs/applications/misc/evince/default.nix
@@ -3,16 +3,16 @@
 , libgnome, libgnomeui, scrollkeeper, libxslt
 , libglade, gnome_keyring, dbus, dbus_glib
 , poppler, libspectre, djvulibre, shared_mime_info
-, makeWrapper, which
+, makeWrapper, which, ghostscript
 , recentListSize ? null # 5 is not enough, allow passing a different number
 }:
 
 stdenv.mkDerivation rec {
-  name = "evince-2.26.0";
+  name = "evince-2.32.0";
 
   src = fetchurl {
-    url = "http://ftp.gnome.org/pub/GNOME/sources/evince/2.26/${name}.tar.bz2";
-    sha256 = "1wsl5vdrj0829wq223dryq5p7izgzsz6mfl4igix7b5wga42zff1";
+    url = "http://ftp.gnome.org/pub/GNOME/sources/evince/2.32/${name}.tar.bz2";
+    sha256 = "2a4c91ae38f8b5028cebb91b9da9ddc50ea8ae3f3d429df89ba351da2d787ff7";
   };
 
   buildInputs = [
@@ -21,10 +21,13 @@ stdenv.mkDerivation rec {
     scrollkeeper gnome_keyring
     libxslt  # for `xsltproc'
     dbus dbus_glib poppler libspectre djvulibre makeWrapper which
+    ghostscript
   ];
 
   configureFlags = "--with-libgnome --enable-dbus --enable-pixbuf "
 
+    # Do not use nautilus
+    + " --disable-nautilus "
     # Do not update Scrollkeeper's database (GNOME's help system).
     + "--disable-scrollkeeper";
 
@@ -37,7 +40,7 @@ stdenv.mkDerivation rec {
     # Tell Glib/GIO about the MIME info directory, which is used
     # by `g_file_info_get_content_type ()'.
     wrapProgram "$out/bin/evince" \
-      --set XDG_DATA_DIRS "${shared_mime_info}/share"
+      --prefix XDG_DATA_DIRS : "${shared_mime_info}/share:$out/share"
   '';
 
   meta = {
@@ -53,4 +56,4 @@ stdenv.mkDerivation rec {
 
     license = "GPLv2+";
   };
-}
\ No newline at end of file
+}
diff --git a/pkgs/applications/misc/fetchmail/default.nix b/pkgs/applications/misc/fetchmail/default.nix
index f80ea6ef453e..79d27eea8487 100644
--- a/pkgs/applications/misc/fetchmail/default.nix
+++ b/pkgs/applications/misc/fetchmail/default.nix
@@ -1,18 +1,33 @@
-args: with args;
+{ stdenv, fetchurl, openssl }:
+
+let
+  version = "6.3.20";
+in
 stdenv.mkDerivation {
-  name="fetchmail-6.3.8";
+  name="fetchmail-${version}";
+
   src = fetchurl {
-    url = http://download.berlios.de/fetchmail/fetchmail-6.3.8.tar.bz2;
-    sha256 = "5612f9af367f641e0efd084f44fcf1889669e711dbd8c60f6b7953e494d1b09b";
+    url = "http://download.berlios.de/fetchmail/fetchmail-${version}.tar.bz2";
+    sha256 = "22e94f11d885cb9330a197fd80217d44f65e6b087e4d4b4d83e573adfc24aa7b";
   };
 
   buildInputs = [ openssl ];
 
   configureFlags = "--with-ssl=${openssl}";
 
-  patches = [ ./security-fix.patch ];
-
   meta = {
-    homepage = http://www.fetchmail.info;
+    homepage = "http://www.fetchmail.info/";
+    description = "a full-featured remote-mail retrieval and forwarding utility";
+    longDescription = ''
+      A full-featured, robust, well-documented remote-mail retrieval and
+      forwarding utility intended to be used over on-demand TCP/IP links
+      (such as SLIP or PPP connections). It supports every remote-mail
+      protocol now in use on the Internet: POP2, POP3, RPOP, APOP, KPOP,
+      all flavors of IMAP, ETRN, and ODMR. It can even support IPv6 and
+      IPSEC.
+    '';
+
+    platforms = stdenv.lib.platforms.unix;
+    maintainers = [ stdenv.lib.maintainers.simons ];
   };
 }
diff --git a/pkgs/applications/misc/flite/default.nix b/pkgs/applications/misc/flite/default.nix
deleted file mode 100644
index 8a2414ec885a..000000000000
--- a/pkgs/applications/misc/flite/default.nix
+++ /dev/null
@@ -1,29 +0,0 @@
-{ stdenv, fetchurl }:
-
-stdenv.mkDerivation {
-  name = "flite-1.3-release";
-
-  src = fetchurl {
-    url = http://www.speech.cs.cmu.edu/flite/packed/flite-1.3/flite-1.3-release.tar.gz;
-    sha256 = "12wanxx57bbqgkag54dlqzv6h2kr9053p0z8mkxs0mqy03vja8lj";
-  };
-
-  buildPhase =
-    ''
-      unset buildPhase
-      ensureDir $out/lib
-      buildPhase
-    '';
-
-  installPhase =
-    ''
-      ensureDir $out/share/flite
-      cp -r bin $out
-    '';
-
-  meta = { 
-    description = "Flite text to speech engine";
-    homepage = http://www.speech.cs.cmu.edu/flite/download.html;
-    license = "BSD as-is";
-  };
-}
diff --git a/pkgs/applications/misc/googleearth/default.nix b/pkgs/applications/misc/googleearth/default.nix
index 7e2a12adb018..aa4807a34f5a 100644
--- a/pkgs/applications/misc/googleearth/default.nix
+++ b/pkgs/applications/misc/googleearth/default.nix
@@ -1,16 +1,16 @@
-{ stdenv, fetchurl, glibc, mesa, freetype, glib, libSM, libICE, libXi, libXv,
-libXrender, libXrandr, libXfixes, libXcursor, libXinerama, libXext, libX11, qt4,
-zlib }:
+{ stdenv, fetchurl, glibc, mesa, freetype, glib, libSM, libICE, libXi, libXv
+, libXrender, libXrandr, libXfixes, libXcursor, libXinerama, libXext, libX11, qt4
+, zlib, fontconfig }:
 
 /* I haven't found any x86_64 package from them */
 assert stdenv.system == "i686-linux";
 
 stdenv.mkDerivation {
-  name = "googleearth-5.2.0001";
+  name = "googleearth-6.0.3.2197";
 
   src = fetchurl {
     url = http://dl.google.com/earth/client/current/GoogleEarthLinux.bin;
-    sha256 = "2e6fcbd2384446e2a6eed8ca23173e32c5f3f9ae4d1168e2e348c3924fd2bf30";
+    sha256 = "0bcpmnlk03382x577qbnbw3i6y08hr3qmg85pqj35scnl6van74c";
   };
 
   buildNativeInputs = [
@@ -32,6 +32,7 @@ stdenv.mkDerivation {
     libX11 
     qt4
     zlib
+    fontconfig
   ];
 
   phases = "unpackPhase installPhase";
diff --git a/pkgs/applications/misc/grip/default.nix b/pkgs/applications/misc/grip/default.nix
index 6b08069054c8..02fac4d42142 100644
--- a/pkgs/applications/misc/grip/default.nix
+++ b/pkgs/applications/misc/grip/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, gtk, glib, pkgconfig, libgnome, libgnomeui, vte
-, curl, cdparanoia, libid3tag }:
+, curl, cdparanoia, libid3tag, ncurses }:
 
 stdenv.mkDerivation {
   name = "grip-3.2.0";
@@ -9,9 +9,9 @@ stdenv.mkDerivation {
     sha256 = "1jh5x35rq15n8ivlp9wbdx8x9mj6agf5rfdv8sd6gai851zsclas";
   };
 
-  buildInputs = [ gtk glib pkgconfig libgnome libgnomeui vte curl cdparanoia libid3tag ];
+  buildInputs = [ gtk glib pkgconfig libgnome libgnomeui vte curl cdparanoia libid3tag ncurses ];
 
-  meta = { 
+  meta = {
     description = "GTK+-based audio CD player/ripper";
     homepage = http://nostatic.org/grip;
     license = "GPLv2";
diff --git a/pkgs/applications/misc/gv/default.nix b/pkgs/applications/misc/gv/default.nix
index ff1ff5293a53..efce2c935614 100644
--- a/pkgs/applications/misc/gv/default.nix
+++ b/pkgs/applications/misc/gv/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, Xaw3d, ghostscriptX, perl }:
 
 stdenv.mkDerivation rec {
-  name = "gv-3.7.1";
+  name = "gv-3.7.2";
 
   src = fetchurl {
     url = "mirror://gnu/gv/${name}.tar.gz";
-    sha256 = "0541p3jlxvvw4136250rizybrl8sqyg03avy0w4r4kiw9w5f31ys";
+    sha256 = "1cj03rb7xs0l3krax4z2llwnldh876p1h3p5vql4gygcxki8vhk2";
   };
 
   buildInputs = [ Xaw3d ghostscriptX perl ];
diff --git a/pkgs/applications/misc/hello/ex-2/default.nix b/pkgs/applications/misc/hello/ex-2/default.nix
index 62b0059c7ac4..2c62159225dd 100644
--- a/pkgs/applications/misc/hello/ex-2/default.nix
+++ b/pkgs/applications/misc/hello/ex-2/default.nix
@@ -1,13 +1,11 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "hello-2.6";
+  name = "hello-2.7";
 
-  x = 108;
-  
   src = fetchurl {
     url = "mirror://gnu/hello/${name}.tar.gz";
-    sha256 = "1h6fjkkwr7kxv0rl5l61ya0b49imzfaspy7jk9jas1fil31sjykl";
+    sha256 = "1h17p5lgg47lbr2cnp4qqkr0q0f0rpffyzmvs7bvc6vdrxdknngx";
   };
 
   doCheck = true;
diff --git a/pkgs/applications/misc/ikiwiki/default.nix b/pkgs/applications/misc/ikiwiki/default.nix
index 93748e21abad..7fde09c2175b 100644
--- a/pkgs/applications/misc/ikiwiki/default.nix
+++ b/pkgs/applications/misc/ikiwiki/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchurl, perl, gettext, makeWrapper, lib, PerlMagick,
-  TextMarkdown, URI, HTMLParser, HTMLScrubber, HTMLTemplate, TimeDate,
-  CGISession, CGIFormBuilder, DBFile, LocaleGettext, RpcXML, XMLSimple
+{ stdenv, fetchurl, perl, gettext, makeWrapper, lib, PerlMagick, YAML
+, TextMarkdown, URI, HTMLParser, HTMLScrubber, HTMLTemplate, TimeDate
+, CGISession, CGIFormBuilder, DBFile, LocaleGettext, RpcXML, XMLSimple
 , gitSupport ? false
 , git ? null
 , monotoneSupport ? false
@@ -13,23 +13,22 @@ assert monotoneSupport -> (monotone != null);
 
 let
   name = "ikiwiki";
-  version = "3.20100704";
+  version = "3.20110715";
 in
 stdenv.mkDerivation {
   name = "${name}-${version}";
 
   src = fetchurl {
     url = "http://ftp.de.debian.org/debian/pool/main/i/ikiwiki/${name}_${version}.tar.gz";
-    sha256 = "1kakh2bf9k0fhvqhn9p9g4wwck64if2y9z23zmlcrm02bw1m6lr9";
+    sha256 = "ef9cbe5ddf484e6b75de05cc6a5b51dfdff1f5920b1c4c66309b1409266df9c7";
   };
 
   buildInputs = [ perl TextMarkdown URI HTMLParser HTMLScrubber HTMLTemplate
     TimeDate gettext makeWrapper DBFile CGISession CGIFormBuilder LocaleGettext
-    RpcXML XMLSimple PerlMagick]
+    RpcXML XMLSimple PerlMagick YAML]
     ++ stdenv.lib.optionals gitSupport [git]
     ++ stdenv.lib.optionals monotoneSupport [monotone];
 
-
   patchPhase = ''
     sed -i s@/usr/bin/perl@${perl}/bin/perl@ pm_filter mdwn2man
     sed -i s@/etc/ikiwiki@$out/etc@ Makefile.PL
@@ -42,11 +41,11 @@ stdenv.mkDerivation {
   configurePhase = "perl Makefile.PL PREFIX=$out";
 
   postInstall = ''
-    for a in $out/bin/*; do
+    for a in "$out/bin/"*; do
       wrapProgram $a --suffix PERL5LIB : $PERL5LIB --prefix PATH : ${perl}/bin:$out/bin \
-      ${lib.optionalString (git != null)
+      ${lib.optionalString gitSupport
         ''--prefix PATH : ${git}/bin \''}
-      ${lib.optionalString (monotone != null)
+      ${lib.optionalString monotoneSupport
         ''--prefix PATH : ${monotone}/bin \''}
       ${lib.concatMapStrings (x: "--prefix PATH : ${x}/bin ") extraUtils}
     done
diff --git a/pkgs/applications/misc/jbidwatcher/default.nix b/pkgs/applications/misc/jbidwatcher/default.nix
new file mode 100644
index 000000000000..56c547ce4357
--- /dev/null
+++ b/pkgs/applications/misc/jbidwatcher/default.nix
@@ -0,0 +1,50 @@
+{ stdenv, fetchurl, java }:
+
+stdenv.mkDerivation rec {
+  pname = "jbidwatcher";
+  version = "2.1.5";
+
+  name = "${pname}-${version}";
+
+  src = fetchurl {
+    url = "http://www.jbidwatcher.com/download/JBidwatcher-${version}.jar";
+    sha256 = "0nrs9ly56cqn33dm1sjm53pzj1cf7jncwn4c8v0xyva4jqyz2y5p";
+  };
+
+  buildInputs = [ java ];
+
+  jarfile = "$out/share/java/${pname}/JBidwatcher.jar";
+
+  unpackPhase = "true";
+
+  buildPhase = "true";
+
+  installPhase = ''
+    ensureDir "$out/bin"
+    echo > "$out/bin/${pname}" "#!/bin/sh"
+    echo >>"$out/bin/${pname}" "${java}/bin/java -Xmx512m -jar ${jarfile}"
+    chmod +x "$out/bin/${pname}"
+    install -D -m644 ${src} ${jarfile}
+  '';
+
+  meta = {
+    homepage = "http://www.jbidwatcher.com/";
+    description = "monitor and snipe Ebay auctions";
+    license = "LGPL";
+
+    longDescription = ''
+      A Java-based application allowing you to monitor auctions you're
+      not part of, submit bids, snipe (bid at the last moment), and
+      otherwise track your auction-site experience. It includes
+      adult-auction management, MANY currencies (pound, dollar (US,
+      Canada, Australian, and New Taiwanese) and euro, presently),
+      drag-and-drop of auction URLs, an original, unique and powerful
+      'multisniping' feature, a relatively nice UI, and is known to work
+      cleanly under Linux, Windows, Solaris, and MacOSX from the same
+      binary.
+    '';
+
+    platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
+    maintainers = [ stdenv.lib.maintainers.simons ];
+  };
+}
diff --git a/pkgs/applications/misc/k3b/default.nix b/pkgs/applications/misc/k3b/default.nix
index 756adb03f75d..ff2451761dc6 100644
--- a/pkgs/applications/misc/k3b/default.nix
+++ b/pkgs/applications/misc/k3b/default.nix
@@ -1,29 +1,25 @@
 { stdenv, fetchurl, cmake, qt4, perl, shared_mime_info, libvorbis, taglib
 , ffmpeg, flac, libsamplerate, libdvdread, lame, libsndfile, libmad, gettext
-, kdelibs, kdemultimedia, cdrdao, cdrtools, dvdplusrwtools
-, automoc4, phonon, makeWrapper
+, kdelibs, kdemultimedia, automoc4, phonon, makeWrapper
 }:
 
 stdenv.mkDerivation rec {
-  name = "k3b-2.0.1";
+  name = "k3b-2.0.2";
   src = fetchurl {
     url = "mirror://sourceforge/k3b/${name}.tar.bz2";
-    sha256 = "1dyd3i2hqd5xs9rz4f8k74zca91j9sp72lhl0zws2cvqc474ccc6";
+    sha256 = "1kdpylz3w9bg02jg4mjhqz8bq1yb4xi4fqfl9139qcyjq4lny5xg";
   };
 
   buildInputs = [ cmake qt4 perl shared_mime_info libvorbis taglib
                   ffmpeg flac libsamplerate libdvdread lame libsndfile
-                  libmad gettext stdenv.gcc.libc cdrdao cdrtools
-                  kdelibs kdemultimedia automoc4 phonon dvdplusrwtools
+                  libmad gettext stdenv.gcc.libc
+                  kdelibs kdemultimedia automoc4 phonon
                   makeWrapper ];
 
-  postInstall = ''
-    wrapProgram $out/bin/k3b --suffix PATH : "${cdrdao}/bin:${dvdplusrwtools}/bin:${cdrtools}/bin"
-  '';
-
   meta = with stdenv.lib; {
     description = "CD/DVD Burning Application for KDE";
     license = licenses.gpl2Plus;
     maintainers = [ maintainers.sander maintainers.urkud ];
+    platforms = with stdenv.lib.platforms; linux;
   };
 }
diff --git a/pkgs/applications/misc/kde-wacomtablet/default.nix b/pkgs/applications/misc/kde-wacomtablet/default.nix
new file mode 100644
index 000000000000..6da0b8410a0c
--- /dev/null
+++ b/pkgs/applications/misc/kde-wacomtablet/default.nix
@@ -0,0 +1,20 @@
+{ stdenv, fetchurl, automoc4, cmake, kdelibs }:
+
+stdenv.mkDerivation rec {
+  name = "wacomtablet-1.2.5";
+
+  src = fetchurl {
+    url = "http://kde-apps.org/CONTENT/content-files/114856-${name}.tar.gz";
+    sha256 = "11hfab6sqmhvd0m1grc9m9yfi0p7rk0bycj9wqgkgbc8cwgps6sf";
+  };
+
+  buildInputs = [ automoc4 cmake kdelibs ];
+
+  meta = with stdenv.lib; {
+    description = "KDE Wacom graphic tablet configuration tool";
+    license = "GPLv2";
+    homepage = http://kde-apps.org/content/show.php/wacom+tablet?content=114856;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.goibhniu maintainers.urkud ];
+  };
+}
diff --git a/pkgs/applications/misc/keepassx/default.nix b/pkgs/applications/misc/keepassx/default.nix
new file mode 100644
index 000000000000..375a1ae2419a
--- /dev/null
+++ b/pkgs/applications/misc/keepassx/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, fetchurl, bzip2, qt4, libX11, xextproto, libXtst }:
+
+stdenv.mkDerivation rec {
+  name = "keepassx-0.4.3";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/keepassx/${name}.tar.gz";
+    sha256 = "cd901a0611ce57e62cf6df7eeeb1b690b5232302bdad8626994eb54adcfa1e85";
+  };
+
+  configurePhase = ''
+    qmake PREFIX=$out 
+  '';
+
+  buildInputs = [ bzip2 qt4 libX11 xextproto libXtst ];
+
+  meta = {
+    description = "Qt password manager compatible with its Win32 and Pocket PC versions";
+    homepage = http://www.keepassx.org/;
+    license = stdenv.lib.licenses.gpl2;
+    maintainers = with stdenv.lib.maintainers; [qknight];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/applications/misc/krename/default.nix b/pkgs/applications/misc/krename/default.nix
index af0ad61e6699..373824b419f4 100644
--- a/pkgs/applications/misc/krename/default.nix
+++ b/pkgs/applications/misc/krename/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, automoc4, kdelibs, taglib, exiv2, podofo, gettext}:
+{ stdenv, fetchurl, cmake, automoc4, kdelibs, taglib, exiv2, podofo, gettext, qt, phonon }:
 
 stdenv.mkDerivation rec {
   name = "krename-4.0.4";
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "12qhclw1vbg5bv6619qd4408y8d1w26499gcr8gwhgfzk0v83hic";
   };
 
-  buildInputs = [ cmake automoc4 kdelibs taglib exiv2 podofo gettext ];
+  buildInputs = [ cmake automoc4 kdelibs taglib exiv2 podofo gettext qt phonon ];
 
   meta = {
     homepage = http://www.krename.net;
diff --git a/pkgs/applications/misc/krusader/default.nix b/pkgs/applications/misc/krusader/default.nix
index 3286c8addb3b..f395e64ddb54 100644
--- a/pkgs/applications/misc/krusader/default.nix
+++ b/pkgs/applications/misc/krusader/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, cmake, qt4, perl, gettext, kdelibs, kdebase, automoc4, phonon}:
+{stdenv, fetchurl, cmake, qt4, perl, gettext, kdelibs, kde_baseapps, automoc4, phonon}:
 
 stdenv.mkDerivation rec {
   name = "krusader-2.2.0-beta1";
@@ -6,7 +6,7 @@ stdenv.mkDerivation rec {
     url = "mirror://sourceforge/krusader/${name}.tar.bz2";
     sha256 = "0rbk0hw8p1bb03w74gspljbzhvpbs3dcr6ckp38gh5r80mcmqfbs";
   };
-  buildInputs = [ cmake qt4 perl gettext kdelibs automoc4 phonon kdebase ];
+  buildInputs = [ cmake qt4 perl gettext kdelibs automoc4 phonon kde_baseapps ];
   meta = {
     description = "Norton/Total Commander clone for KDE";
     license = "GPL";
diff --git a/pkgs/applications/misc/lyx/default.nix b/pkgs/applications/misc/lyx/default.nix
index 2b646714706e..faddeb70e998 100644
--- a/pkgs/applications/misc/lyx/default.nix
+++ b/pkgs/applications/misc/lyx/default.nix
@@ -1,18 +1,18 @@
 # I haven't put much effort into this expressions .. so some optional depencencies may be missing - Marc
 { fetchurl, stdenv, texLive, python, makeWrapper
-, libX11, qt
+, libX11, qt, xz
 }:
 
 stdenv.mkDerivation rec {
-  version = "1.6.5";
+  version = "2.0.0";
   name = "lyx-${version}";
 
   src = fetchurl {
-    url = "ftp://ftp.lyx.org/pub/lyx/stable/1.6.x/${name}.tar.bz2";
-    sha256 = "0xxj37l4ghaa2ij5nfxlg90rfw0znipigjlh271mfmwjw9ykcw1n";
+    url = "ftp://ftp.lyx.org/pub/lyx/stable/2.0.x/${name}.tar.xz";
+    sha256 = "a790951d6ed660b254e82d682b478665f119dd522ab4759fdeb5cd8d42f66f61";
   };
 
-  buildInputs = [texLive qt python makeWrapper ];
+  buildInputs = [texLive qt python makeWrapper xz ];
 
   # don't ask me why it can't find libX11.so.6
   postInstall = ''
diff --git a/pkgs/applications/misc/makeself/default.nix b/pkgs/applications/misc/makeself/default.nix
new file mode 100644
index 000000000000..08edc32e87e1
--- /dev/null
+++ b/pkgs/applications/misc/makeself/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "makeself-2.1.5";
+  src = fetchurl {
+    url = "http://megastep.org/makeself/makeself.run";
+    sha256 = "0khs19xpid4ng0igrjyz3vsi6a5xyixrrrhgdxpdhd2wnf5nc9w2";
+  };
+  unpackPhase = "sh ${src}";
+  installPhase = ''
+    cd ${name}
+    ensureDir $out/{bin,share/{${name},man/man1}}
+    mv makeself.lsm README $out/share/${name}
+    mv makeself.sh $out/bin/makeself
+    mv makeself.1  $out/share/man/man1/
+    mv makeself-header.sh $out/share/${name}
+    sed -e 's|HEADER=`dirname $0`/makeself-header.sh|HEADER=`dirname $0`/../share/${name}/makeself-header.sh|' -i $out/bin/makeself
+  '';
+  meta = {
+    homepage = http://megastep.org/makeself;
+    description = "Utility to create self-extracting packages";
+  };
+}
diff --git a/pkgs/applications/misc/merkaartor/default.nix b/pkgs/applications/misc/merkaartor/default.nix
index 4c29855da07a..6d10cbb8c21f 100644
--- a/pkgs/applications/misc/merkaartor/default.nix
+++ b/pkgs/applications/misc/merkaartor/default.nix
@@ -1,23 +1,23 @@
-{stdenv, fetchurl, qt, boost}:
+{stdenv, fetchurl, qt4, boost}:
 
-stdenv.mkDerivation {
-  name = "merkaartor-0.16.0";
+stdenv.mkDerivation rec {
+  name = "merkaartor-0.17.2";
   src = fetchurl {
-    url = http://www.merkaartor.org/downloads/source/merkaartor-0.16.0.tar.bz2;
-    sha256 = "0l33vgwwkqj65i86qq5j33bbf6q02hs8r1frjnd7icqdaqqv08d7";
+    url = "http://merkaartor.be/attachments/download/253/merkaartor-0.17.2.tar.bz2";
+    sha256 = "0akhp9czzn39132mgj9h38nlh4l9ibzn3vh93bfs685zxyn4yps2";
   };
 
   configurePhase = ''
     qmake -makefile PREFIX=$out
   '';
 
-  buildInputs = [ qt boost ];
+  buildInputs = [ qt4 boost ];
 
   meta = {
     description = "An openstreetmap editor";
     homepage = http://merkaartor.org/;
     license = "GPLv2+";
-    maintainers = with stdenv.lib.maintainers; [viric];
-    platforms = qt.meta.platforms;
+    maintainers = with stdenv.lib.maintainers; [viric urkud];
+    inherit (qt4.meta) platforms;
   };
 }
diff --git a/pkgs/applications/misc/mysql-workbench/default.nix b/pkgs/applications/misc/mysql-workbench/default.nix
index e373392155a7..28f463278d84 100644
--- a/pkgs/applications/misc/mysql-workbench/default.nix
+++ b/pkgs/applications/misc/mysql-workbench/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, makeWrapper, autoconf, automake, boost, file, gettext
+{ stdenv, fetchurl, makeWrapper, boost, file, gettext
 , glib, glibc, gnome_keyring, gtk, gtkmm, intltool, libctemplate, libglade
 , libgnome, libsigcxx, libtool, libuuid, libxml2, libzip, lua, mesa, mysql
 , pango, paramiko, pcre, pexpect, pkgconfig, pycrypto, python, sqlite
@@ -6,22 +6,20 @@
 
 stdenv.mkDerivation rec {
   pname = "mysql-workbench";
-  version = "5.2.30";
+  version = "5.2.33";
   name = "${pname}-${version}";
 
   src = fetchurl {
     url = "http://mirror.services.wisc.edu/mysql/Downloads/MySQLGUITools/mysql-workbench-gpl-${version}-src.tar.gz";
-    sha256 = "0dlhnq7pv2ccgm0d7a3hzf9jxa09jzw36h0ljs9vw9q5nyd5kq71";
+    sha256 = "193iikz0wfm3yvazficxfiqb84f34psq0bcasp3l41n9dygbgldc";
   };
 
-  buildInputs = [ autoconf automake boost file gettext glib glibc gnome_keyring gtk gtkmm intltool
+  buildInputs = [ boost file gettext glib glibc gnome_keyring gtk gtkmm intltool
     libctemplate libglade libgnome libsigcxx libtool libuuid libxml2 libzip lua makeWrapper mesa
     mysql paramiko pcre pexpect pkgconfig pycrypto python sqlite ];
 
   preConfigure = ''
     substituteInPlace $(pwd)/frontend/linux/workbench/mysql-workbench.in --replace "catchsegv" "${glibc}/bin/catchsegv"
-
-    ./autogen.sh --prefix=$out
   '';
 
   postInstall = ''
@@ -29,6 +27,7 @@ stdenv.mkDerivation rec {
       --prefix LD_LIBRARY_PATH : "${python}/lib" \
       --prefix LD_LIBRARY_PATH : "$(cat ${stdenv.gcc}/nix-support/orig-gcc)/lib64" \
       --prefix PATH : "${gnome_keyring}/bin" \
+      --prefix PATH : "${python}/bin" \
       --set PYTHONPATH $PYTHONPATH \
       --run '
 # The gnome-keyring-daemon must be running.  To allow for environments like
@@ -57,7 +56,7 @@ mkfifo $FIFOCTL
 ) &
 
 exec 19> $FIFOCTL
-            ' 
+            '
   '';
 
   meta = with stdenv.lib; {
diff --git a/pkgs/applications/misc/nut/default.nix b/pkgs/applications/misc/nut/default.nix
new file mode 100644
index 000000000000..3d4e51360212
--- /dev/null
+++ b/pkgs/applications/misc/nut/default.nix
@@ -0,0 +1,30 @@
+{stdenv, fetchurl, pkgconfig, neon, libusb, hal, openssl, udev}:
+
+stdenv.mkDerivation {
+  name = "nut-2.6.1";
+  src = fetchurl {
+    url = http://www.networkupstools.org/source/2.6/nut-2.6.1.tar.gz;
+    sha256 = "f5c46b856c0cf5b7f0e4b22d82b670af64cc98717a90eaac8723dd402a181c00";
+  };
+
+  buildInputs = [pkgconfig neon libusb hal openssl udev];
+
+  configureFlags = [
+    "--with-all"
+    "--without-snmp" # Until we have it ...
+    "--without-powerman" # Until we have it ...
+    "--without-cgi"
+  ];
+
+  meta = {
+    description = "Network UPS Tools";
+    longDescription = ''
+      Network UPS Tools is a collection of programs which provide a common
+      interface for monitoring and administering UPS, PDU and SCD hardware.
+      It uses a layered approach to connect all of the parts.
+    '';
+    homepage = http://www.networkupstools.org/;
+    platforms = with stdenv.lib.platforms; linux;
+    maintainers = with stdenv.lib.maintainers; [ pierron ];
+  };
+}
diff --git a/pkgs/applications/misc/qgis/default.nix b/pkgs/applications/misc/qgis/default.nix
index b49275a65619..7e27736ee7e4 100644
--- a/pkgs/applications/misc/qgis/default.nix
+++ b/pkgs/applications/misc/qgis/default.nix
@@ -1,24 +1,19 @@
-args: with args;
-let inherit (builtins) getAttr;
-    edf = composableDerivation.edf;
-    optionIncLib = name : attr : " -D${name}_INCLUDE_DIR=${getAttr attr args}/incclude"
-                               + " -D${name}_LIBRARY=${getAttr attr args}/lib "; # lib 64?
-in
-composableDerivation.composableDerivation {} {
+{ stdenv, fetchurl, gdal, cmake, qt4, flex, bison, proj, geos, x11, sqlite, gsl,
+  pyqt4, qwt, fcgi, python }:
 
-  buildInputs = [ gdal cmake qt flex bison proj geos x11 sqlite gsl pyqt4];
-    cfgOption = [
-                  # without this option it can't find sqlite libs yet (missing symbols..) (TODO)
-                  "-DWITH_INTERNAL_SQLITE3=TRUE"
-                ];
+stdenv.mkDerivation rec {
+  name = "qgis-1.6.0";
 
-  name = "qgis-1.4.0";
+  buildInputs = [ gdal qt4 flex bison proj geos x11 sqlite gsl pyqt4 qwt
+    fcgi ];
+
+  buildNativeInputs = [ cmake python];
+
+  patches = [ ./r14988.diff ];
 
-  # src = args.fetchsvn { url=https://svn.qgis.org/repos/qgis/trunk/qgis;
-  #                md5="ac0560e0a2d4e6258c8639f1e9b56df3"; rev="7704"; };
   src = fetchurl {
-    url = http://download.osgeo.org/qgis/src/qgis_1.4.0.tar.gz;
-    sha256 = "1nn71j9pnkqcprwvzqnybh6ybl0zp50jj04lm769bnjbxknpxq5v";
+    url = "http://qgis.org/downloads/${name}.tar.bz2";
+    sha256 = "0vlz1z3scj3k6nxf3hzfiq7k2773i6xvk6dvj4axs2f4njpnx7pr";
   };
 
   meta = {
@@ -27,18 +22,4 @@ composableDerivation.composableDerivation {} {
     # you can choose one of the following licenses:
     license = [ "GPL" ];
   };
-
-  phases = "unpackPhase buildPhase installPhase";
-  buildPhase = ''pwd; mkdir build; cd build;  VERBOSE=1 cmake -DCMAKE_INSTALL_PREFIX=$out ''${cfgOption} ..'';
-
-  postUnpack = ''
-    export CMAKE_SYSTEM_LIBRARY_PATH=
-    for i in $buildInputs $propagatedBuildInputs; do
-      CMAKE_SYSTEM_LIBRARY_PATH=$i/lib:$CMAKE_SYSTEM_LIBRARY_PATH
-    done
-  '';
-
-  #configurePhase="./autogen.sh --prefix=\$out --with-gdal=\$gdal/bin/gdal-config --with-qtdir=\$qt";
-  # buildPhases="unpackPhase buildPhase";
-
 }
diff --git a/pkgs/applications/misc/qgis/r14988.diff b/pkgs/applications/misc/qgis/r14988.diff
new file mode 100644
index 000000000000..95d55047e1da
--- /dev/null
+++ b/pkgs/applications/misc/qgis/r14988.diff
@@ -0,0 +1,38 @@
+Index: qgis/python/core/conversions.sip
+===================================================================
+--- qgis/python/core/conversions.sip	(revision 14323)
++++ qgis/python/core/conversions.sip	(revision 14988)
+@@ -16,4 +16,5 @@
+ 
+ %Feature QSETINT_CONVERSION
++%Feature QSETTYPE_CONVERSION
+ 
+ %ModuleHeaderCode
+@@ -321,5 +322,5 @@
+ %End
+ 
+-
++%If (QSETTYPE_CONVERSION)
+ template <TYPE>
+ %MappedType QSet<TYPE>
+@@ -395,6 +396,5 @@
+ 
+ };
+-
+-
++%End
+ 
+ template<TYPE>
+Index: qgis/python/CMakeLists.txt
+===================================================================
+--- qgis/python/CMakeLists.txt	(revision 14330)
++++ qgis/python/CMakeLists.txt	(revision 14988)
+@@ -44,4 +44,8 @@
+ ENDIF(NOT PYQT4_VERSION_NUM LESS 263941)
+ 
++IF(NOT PYQT4_VERSION_NUM LESS 264194)	# 0x040802
++  SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} QSETTYPE_CONVERSION)
++ENDIF(NOT PYQT4_VERSION_NUM LESS 264194)
++
+ # core module
+ FILE(GLOB sip_files_core core/*.sip)
diff --git a/pkgs/applications/misc/qgis/trunk.nix b/pkgs/applications/misc/qgis/trunk.nix
deleted file mode 100644
index e7e79b47a764..000000000000
--- a/pkgs/applications/misc/qgis/trunk.nix
+++ /dev/null
@@ -1,23 +0,0 @@
-{qgis, fetchurl,  sourceFromHead, python, sip}:
-qgis.merge {
-
-  name = "qgis-trunk";
-
-  buildInputs = [ sip python ];
-
-  preConfigure = ''
-    export PYTHONPATH=$(toPythonPath ${sip})
-  '';
-
-  cfgOption = [
-                # without this option it can't find sqlite libs yet (missing symbols..) (TODO)
-                "-DWITH_INTERNAL_SQLITE3=TRUE"
-                "-DPYTHON_EXECUTABLE=${python}/bin/python"
-              ];
-
-  # REGION AUTO UPDATE:    { name="qgis"; type="svn"; url="https://svn.osgeo.org/qgis/trunk/qgis"; }
-  src = sourceFromHead "qgis-13572.tar.gz"
-               (fetchurl { url = "http://mawercer.de/~nix/repos/qgis-13572.tar.gz"; sha256 = "fd4c0e19919901cbee7ead7522acdbecbf17c5b9050e34ef91f8ea6e2736bec8"; });
-  # END
-
-}
diff --git a/pkgs/applications/misc/redshift/default.nix b/pkgs/applications/misc/redshift/default.nix
new file mode 100644
index 000000000000..6d6234b8d3ef
--- /dev/null
+++ b/pkgs/applications/misc/redshift/default.nix
@@ -0,0 +1,28 @@
+{ fetchurl, stdenv,
+  libX11, libXrandr, libXxf86vm, libxcb, pkgconfig, python,
+  randrproto, xcbutil, xf86vidmodeproto }:
+
+stdenv.mkDerivation rec {
+  name = "redshift";
+  version = "1.6";
+  src = fetchurl {
+    url = "http://launchpad.net/${name}/trunk/${version}/+download/${name}-${version}.tar.bz2";
+    sha256 = "0g46zhqnx3y2fssmyjgaardzhjw1j29l1dbc2kmccw9wxqfla1wi";
+  };
+
+  buildInputs = [ libX11 libXrandr libXxf86vm libxcb pkgconfig python
+                  randrproto xcbutil xf86vidmodeproto ];
+
+  meta = {
+    description = "changes the color temperature of your screen gradually";
+    longDescription = ''
+      The color temperature is set according to the position of the
+      sun. A different color temperature is set during night and
+      daytime. During twilight and early morning, the color
+      temperature transitions smoothly from night to daytime
+      temperature to allow your eyes to slowly adapt.
+      '';
+    license = "GPLv3+";
+    homepage = "http://jonls.dk/redshift";
+  }; 
+}
\ No newline at end of file
diff --git a/pkgs/applications/misc/rxvt_unicode/default.nix b/pkgs/applications/misc/rxvt_unicode/default.nix
index 029d8675ddf6..89bce3ff99f2 100644
--- a/pkgs/applications/misc/rxvt_unicode/default.nix
+++ b/pkgs/applications/misc/rxvt_unicode/default.nix
@@ -1,8 +1,9 @@
-{ stdenv, fetchurl, perlSupport, libX11, libXt, libXft, ncurses, perl }:
+{ stdenv, fetchurl, perlSupport, libX11, libXt, libXft, ncurses, perl,
+  fontconfig, freetype, pkgconfig, libXrender }:
 
 let 
   name = "rxvt-unicode";
-  version = "9.07";
+  version = "9.10";
   n = "${name}-${version}";
 in
 
@@ -11,18 +12,21 @@ stdenv.mkDerivation (rec {
   name = "${n}${if perlSupport then "-with-perl" else ""}";
 
   src = fetchurl {
-    url = "http://dist.schmorp.de/rxvt-unicode/rxvt-unicode-9.07.tar.bz2";
-    sha256 = "18y5mb3cm1gawjm723q5r7yk37s9drzg39kna036i694m2667865";
+    url = "http://dist.schmorp.de/rxvt-unicode/Attic/rxvt-unicode-${version}.tar.bz2";
+    sha256 = "1c238f7e545b1a8da81239b826fb2a7d196c73effbcbd211db7a50995a0a067a";
   };
 
   buildInputs =
-    [ libX11 libXt libXft ncurses /* required to build the terminfo file */ ]
+    [ libX11 libXt libXft ncurses /* required to build the terminfo file */ 
+      fontconfig freetype pkgconfig libXrender ]
     ++ stdenv.lib.optional perlSupport perl;
 
   preConfigure =
     ''
       configureFlags="${if perlSupport then "--enable-perl" else "--disable-perl"}";
       export TERMINFO=$out/share/terminfo # without this the terminfo won't be compiled by tic, see man tic
+      NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${freetype}/include/freetype2"
+      NIX_LDFLAGS="$NIX_LDFLAGS -lfontconfig -lXrender "
     ''
     # make urxvt find its perl file lib/perl5/site_perl is added to PERL5LIB automatically
     + stdenv.lib.optionalString perlSupport ''
diff --git a/pkgs/applications/misc/sakura/default.nix b/pkgs/applications/misc/sakura/default.nix
index 0ae81fcf00fb..0121c17aace2 100644
--- a/pkgs/applications/misc/sakura/default.nix
+++ b/pkgs/applications/misc/sakura/default.nix
@@ -1,9 +1,9 @@
 { stdenv, fetchurl, cmake, pkgconfig, gtk, vte, pixman, gettext, perl }:
 stdenv.mkDerivation rec {
-  name = "sakura-2.3.8";
+  name = "sakura-2.4.0";
   src = fetchurl {
     url = "http://www.pleyades.net/david/projects/sakura/${name}.tar.bz2";
-    sha256 = "1gfjh1xxqgna0njh0pd4srnbmj67ir4b13slrdri6bm80shfbz8l";
+    sha256 = "12k9ra5b3vgslry5wc40lf4a64mh3p9wy7qfirr8alyvgvw2pb0h";
   };
   buildInputs = [ cmake pkgconfig gtk vte pixman gettext perl ];
   meta = {
diff --git a/pkgs/applications/misc/semnotes/default.nix b/pkgs/applications/misc/semnotes/default.nix
index e994b567cea0..fbc4df3a0b77 100644
--- a/pkgs/applications/misc/semnotes/default.nix
+++ b/pkgs/applications/misc/semnotes/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, qt4, kdelibs, soprano, automoc4, phonon }:
+{ stdenv, fetchurl, cmake, qt4, kdelibs, soprano, automoc4, phonon, shared_desktop_ontologies }:
 stdenv.mkDerivation {
   name = "semnotes-0.4.0-1";
 
@@ -7,7 +7,7 @@ stdenv.mkDerivation {
     sha256 = "1zh5jfh7pyhyz5fbzcgzyckdg0ny7sf8s16yy6rjw9n021zz5i7m";
   };
 
-  buildInputs = [ cmake qt4 kdelibs automoc4 phonon soprano ];
+  buildInputs = [ cmake qt4 kdelibs automoc4 phonon soprano shared_desktop_ontologies ];
 
   meta = with stdenv.lib; {
     description = "Semantic note-taking tool for KDE based on Nepomuk-KDE";
diff --git a/pkgs/applications/misc/surf/default.nix b/pkgs/applications/misc/surf/default.nix
new file mode 100644
index 000000000000..3164f0c1a94a
--- /dev/null
+++ b/pkgs/applications/misc/surf/default.nix
@@ -0,0 +1,29 @@
+{stdenv, fetchurl, gtk, webkit, pkgconfig, glib, libsoup, patches ? null}:
+
+stdenv.mkDerivation rec {
+  name = "surf-${version}";
+  version="0.4.1";
+
+  src = fetchurl {
+    url = "http://dl.suckless.org/surf/surf-${version}.tar.gz";
+    sha256 = "0im5psjw0r8av3zjyy2wqcl6y5ylwnrab5kfcwc23bsbx2irnw4k";
+  };
+
+  buildInputs = [ gtk webkit pkgconfig glib libsoup ];
+
+  # Allow users set their own list of patches
+  inherit patches;
+
+  buildPhase = " make ";
+
+# `-lX11' to make sure libX11's store path is in the RPATH
+  NIX_LDFLAGS = "-lX11";
+  preConfigure = [ ''sed -i "s@PREFIX = /usr/local@PREFIX = $out@g" config.mk'' ];
+
+  meta = { 
+      description = "surf is a simple web browser based on WebKit/GTK+. It is able to display websites and follow links. It supports the XEmbed protocol which makes it possible to embed it in another application. Furthermore, one can point surf to another URI by setting its XProperties.";
+      homepage = http://surf.suckless.org;
+      license = "MIT";
+      platforms = stdenv.lib.platforms.linux;
+  };
+}
diff --git a/pkgs/applications/misc/taskjuggler/default.nix b/pkgs/applications/misc/taskjuggler/default.nix
index 3812f7edd972..25cdd1f16463 100644
--- a/pkgs/applications/misc/taskjuggler/default.nix
+++ b/pkgs/applications/misc/taskjuggler/default.nix
@@ -1,21 +1,23 @@
 {stdenv, fetchurl,
-zlib, libpng, perl, expat, qt,
+zlib, libpng, libjpeg, perl, expat, qt,
 libX11, libXext, libSM, libICE,
 withKde, kdelibs, kdebase
 }:
 
 stdenv.mkDerivation rec {
-  name = "taskjuggler-2.4.1";
+  name = "taskjuggler-2.4.3";
   src = fetchurl {
     url = "http://www.taskjuggler.org/download/${name}.tar.bz2";
-    md5 = "18e0cec8b2ec69220ae7c9a790c16819";
+    sha256 = "14gkxa2vwfih5z7fffbavps7m44z5bq950qndigw2icam5ks83jl";
   };
 
   buildInputs =
-    [zlib libpng libX11 libXext libSM libICE perl expat]
+    [zlib libpng libX11 libXext libSM libICE perl expat libjpeg]
     ++ (if withKde then [kdelibs] else [])
     ;
 
+  patches = [ ./timezone-glibc.patch ];
+
   preConfigure = ''
     for i in $(grep -R "/bin/bash" .  | sed 's/:.*//'); do
       substituteInPlace $i --replace /bin/bash $(type -Pp bash)
@@ -34,6 +36,14 @@ stdenv.mkDerivation rec {
     for i in Examples/FirstProject/AccountingSoftware.tjp; do
       substituteInPlace $i --replace "icalreport" "# icalreport"
     done
+
+    for i in TestSuite/testdir TestSuite/createrefs \
+      TestSuite/Scheduler/Correct/Expression.sh; do
+      substituteInPlace $i --replace '/bin/rm' 'rm'
+    done
+
+    # Some tests require writing at $HOME
+    HOME=$TMPDIR
   '';
 
   configureFlags = "
@@ -41,7 +51,7 @@ stdenv.mkDerivation rec {
     --x-includes=${libX11}/include
     --x-libraries=${libX11}/lib
     --with-qt-dir=${qt}
-    --with-kde-support=${if withKde then "yes" else "no"}
+    --with-kde-support=${if withKde then "yes" else "no"} --with-ical-support=${if withKde then "yes" else "no"}
   ";
 
   preInstall = ''
diff --git a/pkgs/applications/misc/taskjuggler/timezone-glibc.patch b/pkgs/applications/misc/taskjuggler/timezone-glibc.patch
new file mode 100644
index 000000000000..f599e8a1730c
--- /dev/null
+++ b/pkgs/applications/misc/taskjuggler/timezone-glibc.patch
@@ -0,0 +1,48 @@
+From the discussion in http://groups.google.com/group/taskjuggler-users/browse_thread/thread/f65a3efd4dcae2fc/a44c711a9d28ebee?show_docid=a44c711a9d28ebee
+
+From: Chris Schlaeger <cs@kde.org>
+Date: Sat, 27 Feb 2010 06:33:35 +0000 (+0100)
+Subject: Try to fix time zone check for glibc 2.11.
+X-Git-Url: http://www.taskjuggler.org/cgi-bin/gitweb.cgi?p=taskjuggler.git;a=commitdiff_plain;h=2382ed54f90c3c899badb3f56aaa2b3b5dba361e;hp=c666c5068312fec7db75e17d1c567d94127d1dda
+
+Try to fix time zone check for glibc 2.11.
+
+Reported-by: Lee <pFQh8RQn4fqB@dyweni.com>
+---
+
+diff --git a/taskjuggler/Utility.cpp b/taskjuggler/Utility.cpp
+index 5e2bf21..9b7fce2 100644
+--- a/taskjuggler/Utility.cpp
++++ b/taskjuggler/Utility.cpp
+@@ -206,16 +206,28 @@ setTimezone(const char* tZone)
+ 
+     /* To validate the tZone value we call tzset(). It will convert the zone
+      * into a three-letter acronym in case the tZone value is good. If not, it
+-     * will just copy the wrong value to tzname[0] (glibc < 2.5) or fall back
+-     * to UTC. */
++     * will
++     * - copy the wrong value to tzname[0] (glibc < 2.5)
++     * - or fall back to UTC (glibc >= 2.5 && < 2.11)
++     * - copy the part before the '/' to tzname[0] (glibc >= 2.11).
++     */
+     tzset();
++    char* region = new(char[strlen(tZone) + 1]);
++    region[0] = 0;
++    if (strchr(tZone, '/'))
++    {
++        strcpy(region, tZone);
++        *strchr(region, '/') = 0;
++    }
+     if (timezone2tz(tZone) == 0 &&
+-        (strcmp(tzname[0], tZone) == 0 ||
++        (strcmp(tzname[0], tZone) == 0 || strcmp(tzname[0], region) == 0 ||
+          (strcmp(tZone, "UTC") != 0 && strcmp(tzname[0], "UTC") == 0)))
+     {
+         UtilityError = QString(i18n("Illegal timezone '%1'")).arg(tZone);
++        delete region;
+         return false;
+     }
++    delete region;
+ 
+     if (!LtHashTab)
+         return true;
diff --git a/pkgs/applications/misc/vifm/default.nix b/pkgs/applications/misc/vifm/default.nix
new file mode 100644
index 000000000000..6f270f5c7cf2
--- /dev/null
+++ b/pkgs/applications/misc/vifm/default.nix
@@ -0,0 +1,48 @@
+x@{builderDefsPackage
+  , ncurses
+  , ...}:
+builderDefsPackage
+(a :  
+let 
+  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ 
+    [];
+
+  buildInputs = map (n: builtins.getAttr n x)
+    (builtins.attrNames (builtins.removeAttrs x helperArgNames));
+  sourceInfo = rec {
+    baseName="vifm";
+    version="0.6.3";
+    name="${baseName}-${version}";
+    url="mirror://sourceforge/project/${baseName}/${baseName}/${name}.tar.bz2";
+    hash="1v5kiifjk7iyqrzjd94wn6a5dz4j3krl06pbp1ps9g3zdq2w2skv";
+  };
+in
+rec {
+  src = a.fetchurl {
+    url = sourceInfo.url;
+    sha256 = sourceInfo.hash;
+  };
+
+  inherit (sourceInfo) name version;
+  inherit buildInputs;
+
+  /* doConfigure should be removed if not needed */
+  phaseNames = ["doConfigure" "doMakeInstall"];
+      
+  meta = {
+    description = "A vi-like file manager";
+    maintainers = with a.lib.maintainers;
+    [
+      raskin
+    ];
+    platforms = with a.lib.platforms;
+      linux;
+    license = a.lib.licenses.gpl2;
+  };
+  passthru = {
+    updateInfo = {
+      downloadPage = "http://vifm.sf.net";
+    };
+  };
+}) x
+
diff --git a/pkgs/applications/misc/xchm/default.nix b/pkgs/applications/misc/xchm/default.nix
index b574b5fa5ec9..aed55c67c100 100644
--- a/pkgs/applications/misc/xchm/default.nix
+++ b/pkgs/applications/misc/xchm/default.nix
@@ -1,10 +1,10 @@
 {stdenv, fetchurl, wxGTK, chmlib}:
 
 stdenv.mkDerivation {
-  name = "xchm-1.17";
+  name = "xchm-1.18";
   src = fetchurl {
-    url = mirror://sourceforge/xchm/xchm-1.17.tar.gz;
-    sha256 = "0yizisn4833nnpd4apallyg8iv334y00hv3awbsbc0ks2zf93x0n";
+    url = mirror://sourceforge/xchm/xchm-1.18.tar.gz;
+    sha256 = "1wvvyzqbmj3c6i46x4vpxkawjwmmp276r84ifvlzaj5q4b52g5gw";
   };
   buildInputs = [wxGTK chmlib];
 
diff --git a/pkgs/applications/misc/xmobar/default.nix b/pkgs/applications/misc/xmobar/default.nix
index 6bf91529a2b3..8271049861eb 100644
--- a/pkgs/applications/misc/xmobar/default.nix
+++ b/pkgs/applications/misc/xmobar/default.nix
@@ -1,12 +1,20 @@
-{cabal, X11, mtl, parsec, stm, utf8String, X11Xft}:
+{ cabal, mtl, parsec, stm, time, utf8String, X11 }:
 
-cabal.mkDerivation (self : {
+cabal.mkDerivation (self: {
   pname = "xmobar";
-  name = "${self.fname}";
-  version = "0.9.2";
-  sha256 = "361295f5dc912512a2eb644ecd331562a271243192be6215cb071e44f50c7c66";
-  extraBuildInputs = [X11 mtl parsec stm utf8String X11Xft];
+  version = "0.13";
+  sha256 = "0ijava0vn2dmc6v57i6x663rvxz3ryb2gqks18qk1qli4k0m3hf7";
+  isLibrary = false;
+  isExecutable = true;
+  buildDepends = [ mtl parsec stm time utf8String X11 ];
   meta = {
-    description = "xmobar is a minimalistic text based status bar";
+    homepage = "http://projects.haskell.org/xmobar/";
+    description = "A Minimalistic Text Based Status Bar";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [
+      self.stdenv.lib.maintainers.andres
+      self.stdenv.lib.maintainers.simons
+    ];
   };
 })
diff --git a/pkgs/applications/misc/xneur/default.nix b/pkgs/applications/misc/xneur/default.nix
index c7a302c6589f..bdaaaa43c74a 100644
--- a/pkgs/applications/misc/xneur/default.nix
+++ b/pkgs/applications/misc/xneur/default.nix
@@ -1,5 +1,6 @@
 { stdenv, fetchurl, pkgconfig, xorg, pcre, GStreamer, glib, libxml2
-, aspell, cairo, imlib2, xosd, libnotify, gtk, pango, atk, enchant }:
+, aspell, cairo, imlib2, xosd, libnotify, gtk, pango, atk, enchant,
+ gdk_pixbuf}:
 
 let s = import ./src-for-default.nix; in
 
@@ -13,7 +14,7 @@ stdenv.mkDerivation rec {
   buildInputs =
     [ xorg.libX11 pkgconfig pcre GStreamer glib libxml2 aspell cairo
       xorg.libXpm imlib2 xosd xorg.libXt xorg.libXext xorg.libXi libnotify
-      gtk pango enchant
+      gtk pango enchant gdk_pixbuf
     ];
 
   preConfigure = ''
@@ -27,6 +28,8 @@ stdenv.mkDerivation rec {
     export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${cairo}/include/cairo"
     export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${pango}/include/pango-1.0"
     export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${atk}/include/atk-1.0"
+    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${gdk_pixbuf}/include/gdk-pixbuf-2.0"
+    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${gdk_pixbuf}/lib/gdk-pixbuf-2.0/include"
 
     export NIX_LDFLAGS="$NIX_LDFLAGS -lnotify"
   '';
diff --git a/pkgs/applications/misc/xneur/src-for-default.nix b/pkgs/applications/misc/xneur/src-for-default.nix
index 04a22cea79ab..a7db13bd81d1 100644
--- a/pkgs/applications/misc/xneur/src-for-default.nix
+++ b/pkgs/applications/misc/xneur/src-for-default.nix
@@ -1,9 +1,9 @@
 rec {
-   version="0.11.1";
-   name="xneur-0.11.1";
-   hash="12r2wv1glnx3ilqkrypff9r3mxzk1m3yma3khmam1b0z32lfbxxx";
+   version="0.13.0";
+   name="xneur-0.13.0";
+   hash="19z8nnfj9paf877k0nrqy6dih69l81svxymqg6llh7ndgkw20hgd";
    url="http://dists.xneur.ru/release-${version}/tgz/xneur-${version}.tar.bz2";
-   advertisedUrl="http://dists.xneur.ru/release-0.11.1/tgz/xneur-0.11.1.tar.bz2";
+   advertisedUrl="http://dists.xneur.ru/release-0.13.0/tgz/xneur-0.13.0.tar.bz2";
   
   
 }
diff --git a/pkgs/applications/misc/xpdf/default.nix b/pkgs/applications/misc/xpdf/default.nix
index 4a9425070dee..8b375fb26595 100644
--- a/pkgs/applications/misc/xpdf/default.nix
+++ b/pkgs/applications/misc/xpdf/default.nix
@@ -8,7 +8,7 @@ assert enablePDFtoPPM -> freetype != null;
 assert useT1Lib -> t1lib != null;
 
 stdenv.mkDerivation {
-  name = "xpdf-3.02pl4";
+  name = "xpdf-3.02pl5";
 
   src = fetchurl {
     url = ftp://ftp.foolabs.com/pub/xpdf/xpdf-3.02.tar.gz;
@@ -36,6 +36,10 @@ stdenv.mkDerivation {
       url = ftp://ftp.foolabs.com/pub/xpdf/xpdf-3.02pl4.patch;
       sha256 = "1c48h7aizx0ngmzlzw0mpja1w8vqyy3pg62hyxp7c60k86al715h";
     })
+    (fetchurl {
+      url = ftp://ftp.foolabs.com/pub/xpdf/xpdf-3.02pl5.patch;
+      sha256 = "1fki66pw56yr6aw38f6amrx7wxwcxbx4704pjqq7pqqr784b7z4j";
+    })
     ./xpdf-3.02-protection.patch
   ];
 
diff --git a/pkgs/applications/misc/xterm/default.nix b/pkgs/applications/misc/xterm/default.nix
index 55d6a9c16b02..e0df36efcb89 100644
--- a/pkgs/applications/misc/xterm/default.nix
+++ b/pkgs/applications/misc/xterm/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, xorg, ncurses, freetype, pkgconfig }:
 
 stdenv.mkDerivation rec {
-  name = "xterm-231";
+  name = "xterm-268";
   
   src = fetchurl {
     url = "ftp://invisible-island.net/xterm/${name}.tgz";
-    sha256 = "0qlz5nkdqkahdg9kbd1ni96n69srj1pd9yggwrw3z0kghaajb2sr";
+    sha256 = "1hr886mgr74k146fjppnq1pmg6f95l00v88cfwac3rms5lx7ckap";
   };
   
   buildInputs =
@@ -20,6 +20,9 @@ stdenv.mkDerivation rec {
       --enable-mini-luit --with-tty-group=tty
     '';
 
+  # Work around broken "plink.sh".
+  NIX_LDFLAGS = "-lXmu -lXt -lICE -lX11";
+
   # Hack to get xterm built with the feature of releasing a possible setgid of 'utmp',
   # decided by the sysadmin to allow the xterm reporting to /var/run/utmp
   # If we used the configure option, that would have affected the xterm installation,
diff --git a/pkgs/applications/misc/zathura/default.nix b/pkgs/applications/misc/zathura/default.nix
index 6c6b469f18d4..2e58a028a30f 100644
--- a/pkgs/applications/misc/zathura/default.nix
+++ b/pkgs/applications/misc/zathura/default.nix
@@ -1,27 +1,27 @@
 { stdenv, fetchurl, pkgconfig, gtk, poppler }:
+
 stdenv.mkDerivation rec {
-  name = "zathura-0.0.5";
+  name = "zathura-0.0.8.4";
+  
   src = fetchurl {
-    #url = "https://pwmt.org/zathura/download/{name}.tar.gz"
-    # Site's SSL cert is invalid, and I dunno how to pass --insecure to curl.
-    # Thanks Mark Weber for mirroring this tarball.
-    url = "http://mawercer.de/~nix/${name}.tar.gz";
-    sha256 = "e4dfbcceafc7bcb5c4e1ff349822c610db6378906ab65aabba8be246d7ee9b52";
+    url = "http://pwmt.org/download/${name}.tar.gz";
+    sha256 = "03iq6n7bpgrkq3l8b2ab3flcfxrqpxc1f3ycn31xr2b6bjwi72qn";
   };
+  
   buildInputs = [ pkgconfig gtk poppler ];
-  patchPhase = ''
-    substituteInPlace config.mk --replace 'PREFIX = /usr' "PREFIX = $out"
-  '';
+
+  makeFlags = "PREFIX=$(out)";
+  
   meta = {
     homepage = https://pwmt.org/zathura/;
     description = "A highly customizable and functional PDF viewer";
     longDescription = ''
-      zathura is a highly customizable and functional PDF viewer based on the
+      Zathura is a highly customizable and functional PDF viewer based on the
       poppler rendering library and the gtk+ toolkit. The idea behind zathura
       is an application that provides a minimalistic and space saving interface
       as well as an easy usage that mainly focuses on keyboard interaction.
     '';
     license = "free";
-    platforms = with stdenv.lib.platforms; linux;
+    platforms = stdenv.lib.platforms.linux;
   };
 }
diff --git a/pkgs/applications/networking/browsers/chromium/default.nix b/pkgs/applications/networking/browsers/chromium/default.nix
index db8adeeb45fc..74f80ccdab95 100644
--- a/pkgs/applications/networking/browsers/chromium/default.nix
+++ b/pkgs/applications/networking/browsers/chromium/default.nix
@@ -1,57 +1,60 @@
-{ GConf, alsaLib, atk, bzip2, cairo, cups, dbus, dbus_glib,
-  expat, fetchurl, ffmpeg, fontconfig, freetype, glib, gtk,
-  libX11, libXScrnSaver, libXdamage, libXext, libXrender, libXt,
-  libgcrypt, libjpeg, libpng, makeWrapper, nspr, nss, pango,
-  patchelf, stdenv, unzip, zlib }:
+{ GConf, alsaLib, bzip2, cairo, cups, dbus, dbus_glib, expat
+, fetchurl, ffmpeg, fontconfig, freetype, gtkLibs, libX11
+, libXScrnSaver, libXdamage, libXext, libXrender, libXt, libXtst
+, libgcrypt, libjpeg, libpng, makeWrapper, nspr, nss, patchelf
+, stdenv, unzip, zlib, pam }:
 
 assert stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux" ;
 
 stdenv.mkDerivation rec {
   name = "chrome-${version}";
-  version = "65039";
+  version = "88807";
   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 = "1ad7kwd1w1958mb3pwzhshawrf2nlxdsf0gy7d2q4qnx5d809vws";
+        url = "http://commondatastorage.googleapis.com/chromium-browser-continuous/Linux_x64/${version}/chrome-linux.zip";
+        sha256 = "c158f58fa8220782ec8dec4170f90c564b978d1c6ead298cc2f67e84613f17b1";
       }
     else if stdenv.system == "i686-linux" then
       fetchurl {
-        url = "http://build.chromium.org/buildbot/snapshots/chromium-rel-linux/${version}/chrome-linux.zip";
-        sha256 = "06hz3gvv3623ldrj141w3mnzw049yylvv9b9q5r6my8icm722phf";
+        url = "http://commondatastorage.googleapis.com/chromium-browser-continuous/Linux/${version}/chrome-linux.zip";
+        sha256 = "01sr882c7hr53001p8bnk5vyj8zfjm6r3i4a6wxzxd17xjh1bcxb";
       }
     else throw "Chromium is not supported on this platform.";
 
   phases = "unpackPhase installPhase";
 
-  buildInputs = [makeWrapper unzip];
+  buildInputs = [ makeWrapper unzip ];
 
   libPath =
     stdenv.lib.makeLibraryPath
-       [ GConf alsaLib atk bzip2 cairo cups dbus dbus_glib expat
-         ffmpeg fontconfig freetype glib gtk libX11 libXScrnSaver
-         libXdamage libXext libXrender libXt libgcrypt libjpeg libpng
-         nspr nss pango stdenv.gcc.gcc zlib stdenv.gcc.libc ];
+       [ GConf alsaLib bzip2 cairo cups dbus dbus_glib expat
+         ffmpeg fontconfig freetype libX11 libXScrnSaver
+         libXdamage libXext libXrender libXt libXtst libgcrypt libjpeg
+         libpng nspr nss stdenv.gcc.gcc zlib stdenv.gcc.libc
+         gtkLibs.glib gtkLibs.gtk gtkLibs.gdk_pixbuf gtkLibs.pango
+         pam
+       ];
 
   installPhase = ''
     ensureDir $out/bin
-    ensureDir $out/chrome
-    ensureDir $out/lib
-
-    cp -R * $out/chrome
-    ln -s $out/chrome/chrome $out/bin/chrome
-    ${patchelf}/bin/patchelf --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" --set-rpath ${libPath}:$out/lib:${stdenv.gcc.gcc}/lib64:${stdenv.gcc.gcc}/lib $out/chrome/chrome
-
-    ln -s ${nss}/lib/libsmime3.so $out/lib/libsmime3.so.1d
-    ln -s ${nss}/lib/libnssutil3.so $out/lib/libnssutil3.so.1d
-    ln -s ${nss}/lib/libssl3.so $out/lib/libssl3.so.1d
-    ln -s ${nss}/lib/libnss3.so $out/lib/libnss3.so.1d
-    ln -s ${nspr}/lib/libnspr4.so $out/lib/libnspr4.so.0d
-    ln -s ${nspr}/lib/libplds4.so $out/lib/libplds4.so.0d
-    ln -s ${nspr}/lib/libplc4.so $out/lib/libplc4.so.0d
+    ensureDir $out/libexec/chrome
+
+    cp -R * $out/libexec/chrome
+    
+    ${patchelf}/bin/patchelf \
+      --interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
+      --set-rpath ${libPath}:$out/lib:${stdenv.gcc.gcc}/lib64:${stdenv.gcc.gcc}/lib \
+      $out/libexec/chrome/chrome
+
+    makeWrapper $out/libexec/chrome/chrome $out/bin/chrome \
+      --prefix LD_LIBRARY_PATH : "${nss}/lib"
   '';
 
-  meta = {
+  meta =  with stdenv.lib; {
     description = "Chromium, an open source web browser";
+    homepage = http://www.chromium.org/;
+    maintainers = [ maintainers.goibhniu ];
+    license = licenses.bsd3;
   };
 }
diff --git a/pkgs/applications/networking/browsers/conkeror/default.nix b/pkgs/applications/networking/browsers/conkeror/default.nix
index d7e87e4015b5..2bf25ccd546c 100644
--- a/pkgs/applications/networking/browsers/conkeror/default.nix
+++ b/pkgs/applications/networking/browsers/conkeror/default.nix
@@ -1,13 +1,13 @@
 { stdenv, fetchurl, unzip }:
 stdenv.mkDerivation {
-  name = "conkeror-0.9.2";
+  name = "conkeror-0.9.3-20110606";
   src = fetchurl {
-    url = http://repo.or.cz/w/conkeror.git/snapshot/efacc207b0d6c7b3899fc584c9f48547b18da076.zip;
-    sha256 = "1bkrrskrmhpx2xp90zgi5jrz4akynkxv2nzk5hzg0a17ikdi5ql8";
+    url = http://repo.or.cz/w/conkeror.git/snapshot/0d883dfd5e61e7d0b8a96a079d69b46af064fdca.zip;
+    sha256 = "0h21fw78iq4hljy5p98mpy0wgd5wpx9a0jdwv7l5wrds5vp23dhh";
   };
   buildInputs = [ unzip ];
   installPhase = ''
-    cp -r . $out
+    cp -v -r . $out
   '';
   meta = {
     description = "A keyboard-oriented, customizable, extensible web browser";
diff --git a/pkgs/applications/networking/browsers/elinks/default.nix b/pkgs/applications/networking/browsers/elinks/default.nix
index e06bfe538c00..1587a2e34953 100644
--- a/pkgs/applications/networking/browsers/elinks/default.nix
+++ b/pkgs/applications/networking/browsers/elinks/default.nix
@@ -9,8 +9,10 @@ stdenv.mkDerivation rec {
     sha256 = "1li4vlbq8wvnigxlkzb15490y90jg6y9yzzrqpqcz2h965w5869d";
   };
 
+  patches = [ ./gc-init.patch ];
+
   buildInputs = [ python perl ncurses x11 bzip2 zlib openssl spidermonkey guile gpm ];
-  
+
   configureFlags =
     ''
       --enable-finger --enable-html-highlight --with-guile
diff --git a/pkgs/applications/networking/browsers/elinks/gc-init.patch b/pkgs/applications/networking/browsers/elinks/gc-init.patch
new file mode 100644
index 000000000000..de06f563d6e6
--- /dev/null
+++ b/pkgs/applications/networking/browsers/elinks/gc-init.patch
@@ -0,0 +1,17 @@
+Fix libgc initialization in the presence of Guile 2.0.
+
+--- elinks-0.12pre5/src/main/main.c	2009-07-07 14:23:17.000000000 +0200
++++ elinks-0.12pre5/src/main/main.c	2011-04-28 23:20:15.000000000 +0200
+@@ -339,6 +339,11 @@ int
+ main(int argc, char *argv[])
+ {
+ #ifdef CONFIG_GC
++	/* Guile 2.x uses libgc too and it initializes it this way, so we
++	 * must make sure to initialize it the same way, or it will just
++	 * segfault.  */
++	GC_all_interior_pointers = 0;
++
+ 	GC_INIT();
+ 	GC_set_warn_proc(gc_warning);
+ #endif
+
diff --git a/pkgs/applications/networking/browsers/firefox/3.6.nix b/pkgs/applications/networking/browsers/firefox/3.6.nix
index f119f301dbb7..e26b59732152 100644
--- a/pkgs/applications/networking/browsers/firefox/3.6.nix
+++ b/pkgs/applications/networking/browsers/firefox/3.6.nix
@@ -12,14 +12,14 @@
 
 rec {
 
-  firefoxVersion = "3.6.13";
+  firefoxVersion = "3.6.16";
   
-  xulVersion = "1.9.2.13"; # this attribute is used by other packages
+  xulVersion = "1.9.2.16"; # 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 = "1d1bc70d651bce4006687f5762638563c0494267";
+    sha1 = "38124597440b7d60aa568adeef23659575841e92";
   };
 
 
@@ -97,9 +97,11 @@ rec {
       rm -f $out/bin/run-mozilla.sh
     ''; # */
 
+    enableParallelBuilding = true;
+
     meta = {
       description = "Mozilla Firefox XUL runner";
-      homepage = http://www.mozilla.com/en-US/firefox/;
+      homepage = http://www.mozilla.org/en-US/firefox/;
     };
 
     passthru = { inherit gtk; version = xulVersion; };
@@ -139,7 +141,7 @@ rec {
 
     meta = {
       description = "Mozilla Firefox - the browser, reloaded";
-      homepage = http://www.mozilla.com/en-US/firefox/;
+      homepage = http://www.mozilla.org/en-US/firefox/;
     };
 
     passthru = {
diff --git a/pkgs/applications/networking/browsers/firefox/4.0.nix b/pkgs/applications/networking/browsers/firefox/5.0.nix
index 49802f9a0ee0..1cc625edf7cb 100644
--- a/pkgs/applications/networking/browsers/firefox/4.0.nix
+++ b/pkgs/applications/networking/browsers/firefox/5.0.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl, pkgconfig, gtk, pango, perl, python, zip, libIDL
 , libjpeg, libpng, zlib, cairo, dbus, dbus_glib, bzip2, xlibs
 , freetype, fontconfig, file, alsaLib, nspr, nss, libnotify
-, libvpx, yasm, mesa, wirelesstools
+, yasm, mesa, sqlite
 
 , # If you want the resulting program to call itself "Firefox" instead
   # of "Shiretoko" or whatever, enable this option.  However, those
@@ -11,18 +11,21 @@
   enableOfficialBranding ? false
 }:
 
+assert stdenv.gcc ? libc && stdenv.gcc.libc != null;
+
 rec {
 
-  firefoxVersion = "4.0b7";
+  firefoxVersion = "5.0.1";
   
-  xulVersion = "2.0b7"; # this attribute is used by other packages
+  xulVersion = "5.0.1"; # this attribute is used by other packages
 
   
   src = fetchurl {
     url = "http://releases.mozilla.org/pub/mozilla.org/firefox/releases/${firefoxVersion}/source/firefox-${firefoxVersion}.source.tar.bz2";
-    sha256 = "02cc466a92af828ff3bc563d4515bd98064cf5f136b5871e072b9408fb4db128";
+    sha1 = "c93b3513e160d87535a9d61c5e06a6a701e9cd3e";
   };
 
+  
   commonConfigureFlags =
     [ "--enable-optimize"
       "--disable-debug"
@@ -31,13 +34,15 @@ rec {
       "--with-system-zlib"
       "--with-system-bz2"
       "--with-system-nspr"
-      #"--with-system-nss"
+      # "--with-system-nss"
       # "--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
+      "--enable-system-sqlite"
       "--disable-crashreporter"
       "--disable-tests"
       "--disable-necko-wifi" # maybe we want to enable this at some point
+      "--disable-installer" 
+      "--disable-updater"
     ];
 
 
@@ -47,12 +52,12 @@ rec {
     inherit src;
 
     buildInputs =
-    [ pkgconfig gtk perl zip libIDL libjpeg libpng zlib cairo bzip2
+      [ pkgconfig gtk perl zip libIDL libjpeg libpng zlib cairo bzip2
         python dbus dbus_glib pango freetype fontconfig xlibs.libXi
         xlibs.libX11 xlibs.libXrender xlibs.libXft xlibs.libXt file
-        alsaLib nspr /* nss */ libnotify xlibs.pixman libvpx yasm mesa
-	wirelesstools xlibs.libXScrnSaver xlibs.scrnsaverproto
-	xlibs.libXext xlibs.xextproto
+        alsaLib nspr /* nss */ libnotify xlibs.pixman yasm mesa
+	xlibs.libXScrnSaver xlibs.scrnsaverproto
+	xlibs.libXext xlibs.xextproto sqlite
       ];
 
     configureFlags =
@@ -60,18 +65,22 @@ rec {
         "--disable-javaxpcom"
       ] ++ commonConfigureFlags;
 
-    # !!! Temporary hack.
-    preBuild = ''
-     export NIX_ENFORCE_PURITY=
-    '';
-
+    enableParallelBuilding = true;
+      
     # Hack to work around make's idea of -lbz2 dependency
-    preConfigure = ''
-     find . -name Makefile.in -execdir sed -i '{}' -e '1ivpath %.so ${
-       stdenv.lib.concatStringsSep ":" 
-         (map (s : s + "/lib") (buildInputs ++ [stdenv.gcc.libc]))
-     }' ';'
-    '';
+    preConfigure =
+      ''
+        find . -name Makefile.in -execdir sed -i '{}' -e '1ivpath %.so ${
+          stdenv.lib.concatStringsSep ":" 
+            (map (s : s + "/lib") (buildInputs ++ [stdenv.gcc.libc]))
+        }' ';'
+      '';
+
+    # !!! Temporary hack.
+    preBuild =
+      ''
+        export NIX_ENFORCE_PURITY=
+      '';
 
     installFlags = "SKIP_GRE_REGISTRATION=1";
 
@@ -99,7 +108,7 @@ rec {
 
     meta = {
       description = "Mozilla Firefox XUL runner";
-      homepage = http://www.mozilla.com/en-US/firefox/;
+      homepage = http://www.mozilla.org/en-US/firefox/;
     };
 
     passthru = { inherit gtk; version = xulVersion; };
@@ -111,10 +120,12 @@ rec {
 
     inherit src;
 
+    enableParallelBuilding = true;
+      
     buildInputs =
       [ pkgconfig gtk perl zip libIDL libjpeg zlib cairo bzip2 python
         dbus dbus_glib pango freetype fontconfig alsaLib nspr libnotify
-        xlibs.pixman libvpx yasm mesa wirelesstools
+        xlibs.pixman yasm mesa sqlite
       ];
 
     propagatedBuildInputs = [xulrunner];
@@ -122,32 +133,28 @@ rec {
     configureFlags =
       [ "--enable-application=browser"
         "--with-libxul-sdk=${xulrunner}/lib/xulrunner-devel-${xulrunner.version}"
+        "--enable-chrome-format=jar"
       ]
       ++ commonConfigureFlags
       ++ stdenv.lib.optional enableOfficialBranding "--enable-official-branding";
 
-    postInstall = ''
-      libDir=$(cd $out/lib && ls -d firefox-[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 firefox -register..."
-      $out/bin/firefox -register
-    ''; # */
-
     # Hack to work around make's idea of -lbz2 dependency
-    preConfigure = ''
-     find . -name Makefile.in -execdir sed -i '{}' -e '1ivpath %.so ${
-       stdenv.lib.concatStringsSep ":" 
-         (map (s : s + "/lib") (buildInputs ++ [stdenv.gcc.libc]))
-     }' ';'
-    '';
+    preConfigure =
+      ''
+        find . -name Makefile.in -execdir sed -i '{}' -e '1ivpath %.so ${
+          stdenv.lib.concatStringsSep ":" 
+            (map (s : s + "/lib") (buildInputs ++ [stdenv.gcc.libc]))
+        }' ';'
+      '';
+
+    postInstall =
+      ''
+        ln -s ${xulrunner}/lib/xulrunner-${xulrunner.version} $(echo $out/lib/firefox-*)/xulrunner
+      ''; # */
 
     meta = {
       description = "Mozilla Firefox - the browser, reloaded";
-      homepage = http://www.mozilla.com/en-US/firefox/;
+      homepage = http://www.mozilla.org/en-US/firefox/;
     };
 
     passthru = {
diff --git a/pkgs/applications/networking/browsers/firefox/3.5.nix b/pkgs/applications/networking/browsers/firefox/6.0.nix
index a5a35578b134..7535cfb201ef 100644
--- a/pkgs/applications/networking/browsers/firefox/3.5.nix
+++ b/pkgs/applications/networking/browsers/firefox/6.0.nix
@@ -1,6 +1,7 @@
 { stdenv, fetchurl, pkgconfig, gtk, pango, perl, python, zip, libIDL
 , libjpeg, libpng, zlib, cairo, dbus, dbus_glib, bzip2, xlibs
-, freetype, fontconfig, file, alsaLib, nspr, nss
+, freetype, fontconfig, file, alsaLib, nspr, nss, libnotify
+, yasm, mesa, sqlite
 
 , # If you want the resulting program to call itself "Firefox" instead
   # of "Shiretoko" or whatever, enable this option.  However, those
@@ -10,19 +11,21 @@
   enableOfficialBranding ? false
 }:
 
+assert stdenv.gcc ? libc && stdenv.gcc.libc != null;
+
 rec {
 
-  firefoxVersion = "3.5.10";
+  firefoxVersion = "6.0";
   
-  xulVersion = "1.9.1.10"; # this attribute is used by other packages
+  xulVersion = "6.0"; # 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 = "9e84dee03f003eaf79df12de9d13ac8f6c4cd9b1";
+    sha256 = "0ws96gc1mkmilgsikirhmqc6s7m0bcyh58820l08wd82r9abagyc";
   };
 
-
+  
   commonConfigureFlags =
     [ "--enable-optimize"
       "--disable-debug"
@@ -31,16 +34,19 @@ rec {
       "--with-system-zlib"
       "--with-system-bz2"
       "--with-system-nspr"
-      #"--with-system-nss"
+      # "--with-system-nss"
       # "--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
+      "--enable-system-sqlite"
       "--disable-crashreporter"
       "--disable-tests"
+      "--disable-necko-wifi" # maybe we want to enable this at some point
+      "--disable-installer" 
+      "--disable-updater"
     ];
 
 
-  xulrunner = stdenv.mkDerivation {
+  xulrunner = stdenv.mkDerivation rec {
     name = "xulrunner-${xulVersion}";
     
     inherit src;
@@ -49,7 +55,9 @@ rec {
       [ pkgconfig gtk perl zip libIDL libjpeg libpng zlib cairo bzip2
         python dbus dbus_glib pango freetype fontconfig xlibs.libXi
         xlibs.libX11 xlibs.libXrender xlibs.libXft xlibs.libXt file
-        alsaLib nspr /* nss */
+        alsaLib nspr /* nss */ libnotify xlibs.pixman yasm mesa
+	xlibs.libXScrnSaver xlibs.scrnsaverproto
+	xlibs.libXext xlibs.xextproto sqlite
       ];
 
     configureFlags =
@@ -57,10 +65,22 @@ rec {
         "--disable-javaxpcom"
       ] ++ commonConfigureFlags;
 
+    enableParallelBuilding = true;
+      
+    # Hack to work around make's idea of -lbz2 dependency
+    preConfigure =
+      ''
+        find . -name Makefile.in -execdir sed -i '{}' -e '1ivpath %.so ${
+          stdenv.lib.concatStringsSep ":" 
+            (map (s : s + "/lib") (buildInputs ++ [stdenv.gcc.libc]))
+        }' ';'
+      '';
+
     # !!! Temporary hack.
-    preBuild = ''
-     export NIX_ENFORCE_PURITY=
-    '';
+    preBuild =
+      ''
+        export NIX_ENFORCE_PURITY=
+      '';
 
     installFlags = "SKIP_GRE_REGISTRATION=1";
 
@@ -88,7 +108,7 @@ rec {
 
     meta = {
       description = "Mozilla Firefox XUL runner";
-      homepage = http://www.mozilla.com/en-US/firefox/;
+      homepage = http://www.mozilla.org/en-US/firefox/;
     };
 
     passthru = { inherit gtk; version = xulVersion; };
@@ -100,9 +120,12 @@ rec {
 
     inherit src;
 
+    enableParallelBuilding = true;
+      
     buildInputs =
       [ pkgconfig gtk perl zip libIDL libjpeg zlib cairo bzip2 python
-        dbus dbus_glib pango freetype fontconfig alsaLib nspr
+        dbus dbus_glib pango freetype fontconfig alsaLib nspr libnotify
+        xlibs.pixman yasm mesa sqlite
       ];
 
     propagatedBuildInputs = [xulrunner];
@@ -110,24 +133,28 @@ rec {
     configureFlags =
       [ "--enable-application=browser"
         "--with-libxul-sdk=${xulrunner}/lib/xulrunner-devel-${xulrunner.version}"
+        "--enable-chrome-format=jar"
       ]
       ++ commonConfigureFlags
       ++ stdenv.lib.optional enableOfficialBranding "--enable-official-branding";
 
-    postInstall = ''
-      libDir=$(cd $out/lib && ls -d firefox-[0-9]*)
-      test -n "$libDir"
+    # Hack to work around make's idea of -lbz2 dependency
+    preConfigure =
+      ''
+        find . -name Makefile.in -execdir sed -i '{}' -e '1ivpath %.so ${
+          stdenv.lib.concatStringsSep ":" 
+            (map (s : s + "/lib") (buildInputs ++ [stdenv.gcc.libc]))
+        }' ';'
+      '';
 
-      ln -s ${xulrunner}/lib/xulrunner-${xulrunner.version} $out/lib/$libDir/xulrunner
-
-      # Register extensions etc. !!! is this needed anymore?
-      echo "running firefox -register..."
-      $out/bin/firefox -register
-    ''; # */
+    postInstall =
+      ''
+        ln -s ${xulrunner}/lib/xulrunner-${xulrunner.version} $(echo $out/lib/firefox-*)/xulrunner
+      ''; # */
 
     meta = {
       description = "Mozilla Firefox - the browser, reloaded";
-      homepage = http://www.mozilla.com/en-US/firefox/;
+      homepage = http://www.mozilla.org/en-US/firefox/;
     };
 
     passthru = {
diff --git a/pkgs/applications/networking/browsers/firefox/7.0.nix b/pkgs/applications/networking/browsers/firefox/7.0.nix
new file mode 100644
index 000000000000..d9e94ead33a4
--- /dev/null
+++ b/pkgs/applications/networking/browsers/firefox/7.0.nix
@@ -0,0 +1,184 @@
+{ stdenv, fetchurl, pkgconfig, gtk, pango, perl, python, zip, libIDL
+, libjpeg, libpng, zlib, cairo, dbus, dbus_glib, bzip2, xlibs
+, freetype, fontconfig, file, alsaLib, nspr, nss, libnotify
+, yasm, mesa, sqlite
+
+, # If you want the resulting program to call itself "Firefox" instead
+  # of "Shiretoko" or whatever, enable this option.  However, those
+  # binaries may not be distributed without permission from the
+  # Mozilla Foundation, see
+  # http://www.mozilla.org/foundation/trademarks/.
+  enableOfficialBranding ? false
+}:
+
+assert stdenv.gcc ? libc && stdenv.gcc.libc != null;
+
+rec {
+
+  firefoxVersion = "7.0b1";
+  
+  xulVersion = "7.0"; # this attribute is used by other packages
+
+  
+  src = fetchurl {
+    url = "http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/${firefoxVersion}-candidates/build1/source/firefox-${firefoxVersion}.source.tar.bz2";
+    sha256 = "0s8lv07nggdf8ad2yx7sgq1mfy1dvzir0f6x4km911yc9qyhwmwk";
+  };
+  
+  commonConfigureFlags =
+    [ "--enable-optimize"
+      "--disable-debug"
+      "--enable-strip"
+      "--with-system-jpeg"
+      "--with-system-zlib"
+      "--with-system-bz2"
+      "--with-system-nspr"
+      # "--with-system-nss"
+      # "--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"
+      "--disable-crashreporter"
+      "--disable-tests"
+      "--disable-necko-wifi" # maybe we want to enable this at some point
+      "--disable-installer" 
+      "--disable-updater"
+    ];
+
+
+  xulrunner = stdenv.mkDerivation rec {
+    name = "xulrunner-${xulVersion}";
+    
+    inherit src;
+
+    buildInputs =
+      [ pkgconfig gtk perl zip libIDL libjpeg libpng zlib cairo bzip2
+        python dbus dbus_glib pango freetype fontconfig xlibs.libXi
+        xlibs.libX11 xlibs.libXrender xlibs.libXft xlibs.libXt file
+        alsaLib nspr /* nss */ libnotify xlibs.pixman yasm mesa
+        xlibs.libXScrnSaver xlibs.scrnsaverproto
+        xlibs.libXext xlibs.xextproto sqlite
+      ];
+
+    configureFlags =
+      [ "--enable-application=xulrunner"
+        "--disable-javaxpcom"
+      ] ++ commonConfigureFlags;
+
+    enableParallelBuilding = true;
+      
+    # Hack to work around make's idea of -lbz2 dependency
+    preConfigure =
+      ''
+        find . -name Makefile.in -execdir sed -i '{}' -e '1ivpath %.so ${
+          stdenv.lib.concatStringsSep ":" 
+            (map (s : s + "/lib") (buildInputs ++ [stdenv.gcc.libc]))
+        }' ';'
+        cp -i security/coreconf/Linux{2.6,3.0}.mk
+        cp -i security/coreconf/Linux{2.6,3.1}.mk
+        cp -i security/coreconf/Linux{2.6,3.2}.mk
+        cp -i security/coreconf/Linux{2.6,3.3}.mk
+
+        export NIX_LDFLAGS="$NIX_LDFLAGS -L$out/lib/xulrunner-${xulVersion}"
+      '';
+
+    # !!! Temporary hack.
+    preBuild =
+      ''
+        export NIX_ENFORCE_PURITY=
+      '';
+
+    installFlags = "SKIP_GRE_REGISTRATION=1";
+
+    postInstall = ''
+      # Fix some references to /bin paths in the Xulrunner shell script.
+      substituteInPlace $out/bin/xulrunner \
+          --replace /bin/pwd "$(type -tP pwd)" \
+          --replace /bin/ls "$(type -tP ls)"
+
+      # Fix run-mozilla.sh search
+      libDir=$(cd $out/lib && ls -d xulrunner-[0-9]*)
+      echo libDir: $libDir
+      test -n "$libDir"
+      cd $out/bin
+      mv xulrunner ../lib/$libDir/
+
+      for i in $out/lib/$libDir/*; do 
+          file $i;
+          if file $i | grep executable &>/dev/null; then 
+              echo -e '#! /bin/sh\n"'"$i"'" "$@"' > "$out/bin/$(basename "$i")";
+              chmod a+x "$out/bin/$(basename "$i")";
+          fi;
+      done;
+      for i in $out/lib/$libDir/{xpcshell,plugin-container,*.so}; do
+              patchelf --set-rpath "$(patchelf --print-rpath "$i"):$out/lib/$libDir" $i || true
+      done;
+      rm -f $out/bin/run-mozilla.sh
+    ''; # */
+
+    meta = {
+      description = "Mozilla Firefox XUL runner";
+      homepage = http://www.mozilla.com/en-US/firefox/;
+    };
+
+    passthru = { inherit gtk; version = xulVersion; };
+  };
+
+
+  firefox = stdenv.mkDerivation rec {
+    name = "firefox-${firefoxVersion}";
+
+    inherit src;
+
+    enableParallelBuilding = true;
+      
+    buildInputs =
+      [ pkgconfig gtk perl zip libIDL libjpeg zlib cairo bzip2 python
+        dbus dbus_glib pango freetype fontconfig alsaLib nspr libnotify
+        xlibs.pixman yasm mesa sqlite file
+      ];
+
+    propagatedBuildInputs = [xulrunner];
+
+    configureFlags =
+      [ "--enable-application=browser"
+        "--with-libxul-sdk=${xulrunner}/lib/xulrunner-devel-${xulrunner.version}"
+        "--enable-chrome-format=jar"
+	"--disable-elf-hack"
+      ]
+      ++ commonConfigureFlags
+      ++ stdenv.lib.optional enableOfficialBranding "--enable-official-branding";
+
+    # Hack to work around make's idea of -lbz2 dependency
+    preConfigure =
+      ''
+        find . -name Makefile.in -execdir sed -i '{}' -e '1ivpath %.so ${
+          stdenv.lib.concatStringsSep ":" 
+            (map (s : s + "/lib") (buildInputs ++ [stdenv.gcc.libc]))
+        }' ';'
+      '';
+
+    postInstall =
+      ''
+        ln -s ${xulrunner}/lib/xulrunner-${xulrunner.version} $(echo $out/lib/firefox-*)/xulrunner
+        for j in $out/bin/*; do 
+	    i="$(readlink "$j")";
+            file $i;
+            if file $i | grep executable &>/dev/null; then 
+	        rm "$out/bin/$(basename "$i")"
+                echo -e '#! /bin/sh\n"'"$i"'" "$@"' > "$out/bin/$(basename "$i")"
+                chmod a+x "$out/bin/$(basename "$i")"
+            fi;
+        done;
+      ''; # */
+
+    meta = {
+      description = "Mozilla Firefox - the browser, reloaded";
+      homepage = http://www.mozilla.com/en-US/firefox/;
+    };
+
+    passthru = {
+      inherit gtk xulrunner nspr;
+      isFirefox3Like = true;
+    };
+  };
+}
diff --git a/pkgs/applications/networking/browsers/firefox/binary.nix b/pkgs/applications/networking/browsers/firefox/binary.nix
deleted file mode 100644
index 73e002435b88..000000000000
--- a/pkgs/applications/networking/browsers/firefox/binary.nix
+++ /dev/null
@@ -1,55 +0,0 @@
-args: with args;
-
-assert stdenv.system == "i686-linux";
-
-stdenv.mkDerivation {
-  name = "firefox-3b1";
-
-  src = 
-	fetchurl {
-		url = ftp://ftp.mozilla.org/pub/firefox/releases/3.0b1/linux-i686/en-US/firefox-3.0b1.tar.bz2;
-		sha256 = "1cpcc5b07zdqyd5kiwhb4dqhy2mzbf97plsglcp6bc9054cmsylk";
-	};
-  buildInputs = [
-    pkgconfig gtk perl zip libIDL libXi libjpeg libpng zlib cairo
-    python curl coreutils atk pango glib libX11 libXrender 
-    freetype fontconfig libXft libXt
-  ];
-
-  buildPhase = "
-    additionalRpath='';
-    for i in \$buildInputs ${stdenv.glibc} ${stdenv.gcc.gcc}; do 
-      additionalRpath=\$additionalRpath:\$i/lib;  
-    done
-    for i in firefox-bin ; do
-      oldrpath=$(patchelf --print-rpath \$i)
-      patchelf --set-rpath \$oldrpath\$additionalRpath \$i
-      patchelf --set-interpreter ${stdenv.glibc}/lib/ld-linux.so.2 \$i
-    done
-  ";
-
-  installPhase = "
-    export dontPatchELF=1;
-    mkdir -p \$out
-    cp -r . \$out/firefox
-    mkdir -p \$out/bin
-    ln -s \$out/firefox/firefox \$out/bin/firefox
-
-    sed -e 's@moz_libdir=.*@moz_libdir='\$out'/firefox/@' -i \$out/bin/firefox 
-    sed -e 's@moz_libdir=.*@&\\nexport PATH=\$PATH:${coreutils}/bin@' -i \$out/bin/firefox 
-    sed -e 's@`/bin/pwd@`${coreutils}/bin/pwd@' -i \$out/bin/firefox 
-    sed -e 's@`/bin/ls@`${coreutils}/bin/ls@' -i \$out/bin/firefox 
-
-    strip -S \$out/firefox/*.so || true
-
-    echo \"running firefox -register...\"
-    \$out/firefox/firefox-bin -register || false
-  ";
-
-  meta = {
-    description = "Mozilla Firefox - the browser, reloaded";
-  };
-
-  passthru = {inherit gtk;};
-}
-
diff --git a/pkgs/applications/networking/browsers/firefox/writable-copies.patch b/pkgs/applications/networking/browsers/firefox/writable-copies.patch
deleted file mode 100644
index e3c7752c0310..000000000000
--- a/pkgs/applications/networking/browsers/firefox/writable-copies.patch
+++ /dev/null
@@ -1,23 +0,0 @@
-diff -rc mozilla-orig/xpcom/io/nsLocalFileUnix.cpp mozilla/xpcom/io/nsLocalFileUnix.cpp
-*** mozilla-orig/xpcom/io/nsLocalFileUnix.cpp	2004-04-03 01:48:18.000000000 +0200
---- mozilla/xpcom/io/nsLocalFileUnix.cpp	2004-10-05 19:48:04.000000000 +0200
-***************
-*** 634,639 ****
---- 634,640 ----
-          // get the dirs old permissions
-          if (NS_FAILED(rv = GetPermissions(&oldPerms)))
-              return rv;
-+         oldPerms |= 0200;
-          if (NS_FAILED(rv = newParent->Create(DIRECTORY_TYPE, oldPerms)))
-              return rv;
-      } else {    // dir exists lets try to use leaf
-***************
-*** 758,763 ****
---- 759,765 ----
-          // get the old permissions
-          PRUint32 myPerms;
-          GetPermissions(&myPerms);
-+         myPerms |= 0200;
-  
-          // Create the new file with the old file's permissions, even if write
-          // permission is missing.  We can't create with write permission and
diff --git a/pkgs/applications/networking/browsers/firefox/xlibs.patch b/pkgs/applications/networking/browsers/firefox/xlibs.patch
deleted file mode 100644
index a656fbf9beb4..000000000000
--- a/pkgs/applications/networking/browsers/firefox/xlibs.patch
+++ /dev/null
@@ -1,10 +0,0 @@
---- mozilla/layout/build/Makefile.in.orig	2007-01-13 14:23:19.000000000 -0200
-+++ mozilla/layout/build/Makefile.in	2007-01-13 14:24:55.000000000 -0200
-@@ -282,5 +282,6 @@ LDFLAGS += -Wl,-LD_LAYOUT:lgot_buffer=50
- endif
- endif
- 
-+LDFLAGS += -lX11 -lXrender
- 
- export:: $(BUILD_DATE)
- 
\ No newline at end of file
diff --git a/pkgs/applications/networking/browsers/icecat-3/default.nix b/pkgs/applications/networking/browsers/icecat-3/default.nix
index 6be0ce4b4f30..a63584fda289 100644
--- a/pkgs/applications/networking/browsers/icecat-3/default.nix
+++ b/pkgs/applications/networking/browsers/icecat-3/default.nix
@@ -9,13 +9,13 @@
 # http://thread.gmane.org/gmane.comp.gnu.gnuzilla/1376 .
 #assert stdenv.isLinux -> (wirelesstools != null);
 
-let version = "3.6.9"; in
+let version = "3.6.15"; in
 stdenv.mkDerivation {
   name = "icecat-${version}";
 
   src = fetchurl {
     url = "mirror://gnu/gnuzilla/${version}/icecat-${version}.tar.xz";
-    sha256 = "041rdhhcaak0w0lg0wd1fdl9vlk9a466sh6y17dfz389nswyy8wr";
+    sha256 = "1px018bd81c81a4hbz0qgf89pkshkbhg4abwq1d26dwy8128cxwg";
   };
 
   buildInputs =
diff --git a/pkgs/applications/networking/browsers/icecat-4/default.nix b/pkgs/applications/networking/browsers/icecat-4/default.nix
new file mode 100644
index 000000000000..5d6f5c3acb0d
--- /dev/null
+++ b/pkgs/applications/networking/browsers/icecat-4/default.nix
@@ -0,0 +1,118 @@
+{ fetchurl, stdenv, xz, pkgconfig, gtk, pango, perl, python, ply, zip, libIDL
+, libjpeg, libpng, zlib, cairo, dbus, dbus_glib, bzip2, xlibs, alsaLib
+, libnotify, gnomevfs, libgnomeui
+, freetype, fontconfig, wirelesstools ? null, pixman
+, application ? "browser" }:
+
+# Build the WiFi stuff on Linux-based systems.
+# FIXME: Disable for now until it can actually be built:
+# http://thread.gmane.org/gmane.comp.gnu.gnuzilla/1376 .
+#assert stdenv.isLinux -> (wirelesstools != null);
+
+let version = "4.0.1.1"; in
+stdenv.mkDerivation {
+  name = "icecat-${version}";
+
+  src = fetchurl {
+    url = "mirror://gnu/gnuzilla/${version}/icecat-${version}.tar.xz";
+    sha256 = "1f1y1834pv8f5fmfb5d4d5gj2v7bxsk3k9b9g832bwq0h5203yvg";
+  };
+
+  buildInputs =
+    [ xz libgnomeui libnotify gnomevfs alsaLib
+      pkgconfig gtk perl zip libIDL libjpeg libpng zlib cairo bzip2 pixman
+      python ply dbus dbus_glib pango freetype fontconfig
+      xlibs.libXi xlibs.libX11 xlibs.libXrender xlibs.libXft xlibs.libXt
+    ]
+    ++ (stdenv.lib.optional false /* stdenv.isLinux */ wirelesstools);
+
+  patches = [
+    ./skip-gre-registration.patch ./rpath-link.patch
+  ];
+
+  configureFlags =
+    [ "--enable-application=${application}"
+      "--enable-libxul"
+      "--disable-javaxpcom"
+
+      "--enable-optimize"
+      "--disable-debug"
+      "--enable-strip"
+      "--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"
+    ]
+    ++ (stdenv.lib.optional true /* (!stdenv.isLinux) */ "--disable-necko-wifi");
+
+  postInstall = ''
+    export dontPatchELF=1;
+
+    # Strip some more stuff
+    strip -S "$out/lib/"*"/"* || true
+
+    # This fixes starting IceCat when there already is a running
+    # instance.  The `icecat' wrapper script actually expects to be
+    # in the same directory as `run-mozilla.sh', apparently.
+    libDir=$(cd $out/lib && ls -d icecat-[0-9]*)
+    test -n "$libDir"
+
+    if [ -f "$out/bin/icecat" ]
+    then
+        # Fix references to /bin paths in the IceCat shell script.
+        substituteInPlace $out/bin/icecat		\
+            --replace /bin/pwd "$(type -tP pwd)"	\
+            --replace /bin/ls "$(type -tP ls)"
+
+        cd $out/bin
+        mv icecat ../lib/$libDir/
+        ln -s ../lib/$libDir/icecat .
+
+        # Register extensions etc.
+        echo "running \`icecat -register'..."
+        (cd $out/lib/$libDir && LD_LIBRARY_PATH=. ./icecat-bin -register) || false
+    fi
+
+    if [ -f "$out/lib/$libDir/xpidl" ]
+    then
+        # XulRunner's IDL compiler.
+        echo "linking \`xpidl'..."
+        ln -s "$out/lib/$libDir/xpidl" "$out/bin"
+    fi
+
+    # Put the GNU IceCat icon in the right place.
+    ensureDir "$out/lib/$libDir/chrome/icons/default"
+    ln -s ../../../icons/default.xpm  "$out/lib/$libDir/chrome/icons/default/"
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "GNU IceCat, a free web browser based on Mozilla Firefox";
+
+    longDescription = ''
+      Gnuzilla is the GNU version of the Mozilla suite, and GNU IceCat
+      is the GNU version of the Firefox browser.  Its main advantage
+      is an ethical one: it is entirely free software.  While the
+      source code from the Mozilla project is free software, the
+      binaries that they release include additional non-free software.
+      Also, they distribute and recommend non-free software as
+      plug-ins.  In addition, GNU IceCat includes some privacy
+      protection features.
+    '';
+
+    homepage = http://www.gnu.org/software/gnuzilla/;
+    licenses = [ "GPLv2+" "LGPLv2+" "MPLv1+" ];
+
+    maintainers = [ stdenv.lib.maintainers.ludo ];
+    platforms = stdenv.lib.platforms.gnu;
+  };
+
+  passthru = {
+    inherit gtk version;
+    isFirefox3Like = true;
+  };
+}
diff --git a/pkgs/applications/networking/browsers/icecat-4/rpath-link.patch b/pkgs/applications/networking/browsers/icecat-4/rpath-link.patch
new file mode 100644
index 000000000000..d50784f13eea
--- /dev/null
+++ b/pkgs/applications/networking/browsers/icecat-4/rpath-link.patch
@@ -0,0 +1,14 @@
+Without this patch, IceCat ends up linking with
+`-Wl,-rpath-link=/bin -Wl-,-rpath-link=/lib'.
+
+--- icecat-3.5/js/src/configure	2009-07-04 18:03:01.000000000 +0200
++++ icecat-3.5/js/src/configure	2009-07-13 18:34:30.000000000 +0200
+@@ -4775,7 +4775,6 @@ HOST_AR='$(AR)'
+ HOST_AR_FLAGS='$(AR_FLAGS)'
+ 
+ MOZ_JS_LIBS='-L$(libdir) -lmozjs'
+-MOZ_FIX_LINK_PATHS='-Wl,-rpath-link,$(LIBXUL_DIST)/bin -Wl,-rpath-link,$(PREFIX)/lib'
+ 
+ MOZ_COMPONENT_NSPR_LIBS='-L$(LIBXUL_DIST)/bin $(NSPR_LIBS)'
+ MOZ_XPCOM_OBSOLETE_LIBS='-L$(LIBXUL_DIST)/lib -lxpcom_compat'
+
diff --git a/pkgs/applications/networking/browsers/icecat-4/skip-gre-registration.patch b/pkgs/applications/networking/browsers/icecat-4/skip-gre-registration.patch
new file mode 100644
index 000000000000..d1fb4e3f30ab
--- /dev/null
+++ b/pkgs/applications/networking/browsers/icecat-4/skip-gre-registration.patch
@@ -0,0 +1,12 @@
+Skip "GRE" registration since that assumes write access to `/etc'.
+
+--- icecat-3.0.1-g1/xulrunner/installer/Makefile.in	2008-07-27 12:52:16.000000000 +0200
++++ icecat-3.0.1-g1/xulrunner/installer/Makefile.in	2008-09-08 17:19:17.000000000 +0200
+@@ -71,6 +71,7 @@ $(MOZILLA_VERSION).system.conf: $(topsrc
+ 	printf "[%s]\nGRE_PATH=%s\nxulrunner=true\nabi=%s" \
+ 	  $(MOZILLA_VERSION) $(installdir) $(TARGET_XPCOM_ABI)> $@
+ 
++SKIP_GRE_REGISTRATION = yes
+ ifndef SKIP_GRE_REGISTRATION
+ # to register xulrunner per-user, override this with $HOME/.gre.d
+ regdir = /etc/gre.d
diff --git a/pkgs/applications/networking/browsers/konq-plugins/default.nix b/pkgs/applications/networking/browsers/konq-plugins/default.nix
index 815e1a16964c..656e24be0718 100644
--- a/pkgs/applications/networking/browsers/konq-plugins/default.nix
+++ b/pkgs/applications/networking/browsers/konq-plugins/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, kdelibs, cmake, qt4, automoc4, phonon, kdebase, gettext  }:
+{ stdenv, fetchurl, kdelibs, cmake, qt4, automoc4, phonon, kde_baseapps, gettext  }:
 
 stdenv.mkDerivation rec {
   name = "konq-plugins-${version}";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "1hn722rcdcwmhfnn89rnvp2b4d8gds4nm483ps3jkk83d7f2xmbi";
   };
 
-  buildInputs = [ cmake kdelibs qt4 automoc4 phonon kdebase gettext ];
+  buildInputs = [ cmake kdelibs qt4 automoc4 phonon kde_baseapps gettext ];
 
   patches = [ ./qt47.patch ];
 
diff --git a/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-10/builder.sh b/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-10/builder.sh
index 2574ecb73eec..4db487f5c51c 100644
--- a/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-10/builder.sh
+++ b/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-10/builder.sh
@@ -2,6 +2,7 @@ source $stdenv/setup
 
 dontStrip=1
 dontPatchELF=1
+sourceRoot=$TMPDIR
 
 unpackPhase() {
     tar xvzf $src;
@@ -15,7 +16,7 @@ unpackPhase() {
 
 installPhase() {
     ensureDir $out/lib/mozilla/plugins
-    cp -p libflashplayer.so $out/lib/mozilla/plugins
+    cp -pv libflashplayer.so $out/lib/mozilla/plugins
     patchelf --set-rpath "$rpath" $out/lib/mozilla/plugins/libflashplayer.so
 }
 
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 c20848eb2dac..462099ea8f2a 100644
--- a/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-10/default.nix
+++ b/pkgs/applications/networking/browsers/mozilla-plugins/flashplayer-10/default.nix
@@ -17,6 +17,7 @@
 , pango
 , cairo
 , atk
+, gdk_pixbuf
 , debug ? false
 
 /* you have to add ~/mm.cfg :
@@ -41,9 +42,9 @@ let
         throw "no x86_64 debugging version available"
       else {
         # -> http://labs.adobe.com/downloads/flashplayer10.html
-        version = "10.1_p2-r092710";
-        url = http://download.macromedia.com/pub/labs/flashplayer10/flashplayer_square_p2_64bit_linux_092710.tar.gz;
-        sha256 = "188dn08n3rb6w3hzq4snqvip5njxdyc8k8arp8xnlqw331lfvapx";
+        version = "10.3.181.34";
+        url = http://download.macromedia.com/pub/labs/flashplayer10/flashplayer10_2_p3_64bit_linux_111710.tar.gz;
+        sha256 = "1w2zs2f0q1vpx4ia9pj1k4p830dwz7ypyn302mi48wcpz1wzc1gg";
       }
     else if stdenv.system == "i686-linux" then
       if debug then {
@@ -52,11 +53,11 @@ let
         url = http://download.macromedia.com/pub/labs/flashplayer10/flashplayer_square_p2_32bit_debug_linux_092710.tar.gz;
         sha256 = "11w3mxa39l4mnlsqzlwbdh1sald549afyqbx2kbid7in5qzamlcc";
       } else {
-        version = "10.1.102.64";
+        version = "10.3.183.5";
         url = http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_10_linux.tar.gz;
-        sha256 = "1jfk9va3id0m6q6csg6gfycmryvi7kylbb7dswpsh6zh1zv00s62";
+        sha256 = "1kv7szpadgv0wwmi46vc05723qzsgclz68rij6x49l61sngzmw0x";
       }
-    else throw "flashplayer is not supported on this platform";
+    else throw "Flash Player is not supported on this platform";
 
 in
 
@@ -75,7 +76,7 @@ stdenv.mkDerivation {
 
   rpath = stdenv.lib.makeLibraryPath
     [ zlib alsaLib curl nss nspr fontconfig freetype expat libX11
-      libXext libXrender libXt gtk glib pango atk cairo
+      libXext libXrender libXt gtk glib pango atk cairo gdk_pixbuf
     ];
 
   buildPhase = ":";
diff --git a/pkgs/applications/networking/browsers/mozilla-plugins/gecko-mediaplayer/default.nix b/pkgs/applications/networking/browsers/mozilla-plugins/gecko-mediaplayer/default.nix
index d50486cd742a..ddb70e6d633e 100644
--- a/pkgs/applications/networking/browsers/mozilla-plugins/gecko-mediaplayer/default.nix
+++ b/pkgs/applications/networking/browsers/mozilla-plugins/gecko-mediaplayer/default.nix
@@ -3,11 +3,11 @@
 }:
 
 stdenv.mkDerivation rec {
-  name = "gecko-mediaplayer-0.9.99.rc1";
+  name = "gecko-mediaplayer-1.0.4";
 
   src = fetchurl {
     url = "http://gecko-mediaplayer.googlecode.com/files/${name}.tar.gz";
-    sha256 = "1ddp8z2a40wxdj7v20wqph9l4z4a47bjqzac7wlmmzjq7a9pbij2";
+    sha256 = "18asxxsqng303cxcww75k4r6syqjs7lylibv997kq0869kz4spsp";
   };
 
   buildInputs = [pkgconfig glib dbus dbus_glib browser x11 GConf browser.xulrunner];
diff --git a/pkgs/applications/networking/browsers/mozilla-plugins/google-talk-plugin/default.nix b/pkgs/applications/networking/browsers/mozilla-plugins/google-talk-plugin/default.nix
new file mode 100644
index 000000000000..3ae24bdddf98
--- /dev/null
+++ b/pkgs/applications/networking/browsers/mozilla-plugins/google-talk-plugin/default.nix
@@ -0,0 +1,92 @@
+{ stdenv, fetchurl, rpm, cpio, pkgsi686Linux, mesa, xorg, cairo
+, libpng, gtk, glib, fontconfig, freetype, curl
+}:
+
+with stdenv.lib;
+
+let
+
+  rpathNative = makeLibraryPath
+    [ stdenv.gcc.gcc
+      mesa
+      xorg.libXt
+      xorg.libX11
+      cairo
+      libpng
+      gtk
+      glib
+      fontconfig
+      freetype
+      curl
+    ];
+
+  rpath32 = makeLibraryPath
+    [ pkgsi686Linux.gtkLibs.gdk_pixbuf
+      pkgsi686Linux.gtkLibs.glib
+      pkgsi686Linux.gtkLibs.gtk
+      pkgsi686Linux.xorg.libX11
+      pkgsi686Linux.xorg.libXcomposite
+      pkgsi686Linux.xorg.libXfixes
+      pkgsi686Linux.xorg.libXrender
+      pkgsi686Linux.xorg.libXrandr
+      pkgsi686Linux.gcc.gcc
+      pkgsi686Linux.alsaLib
+      pkgsi686Linux.pulseaudio
+      pkgsi686Linux.dbus_glib
+      pkgsi686Linux.udev
+    ];
+
+in
+
+stdenv.mkDerivation {
+  name = "google-talk-plugin-2.107.0";
+
+  src =
+    if stdenv.system == "x86_64-linux" then
+      fetchurl {
+        url = "http://dl.google.com/linux/direct/google-talkplugin_current_x86_64.rpm";
+        sha256 = "01c8w221azvmqvxf5lgb8l151086d72ll5wnjndwn50dvi6rphvx";
+      }
+    else
+      throw "Google Talk does not support your platform.";
+
+  buildInputs = [ rpm cpio ];
+      
+  unpackPhase =
+    ''
+      rpm2cpio $src | cpio -i --make-directories -v
+    '';
+
+  installPhase =
+    ''
+      mkdir -p $out/lib/mozilla/plugins
+      cp opt/google/talkplugin/libnp*.so $out/lib/mozilla/plugins/
+
+      patchelf --set-rpath "${makeLibraryPath [ stdenv.gcc.gcc ]}:${stdenv.gcc.gcc}/lib64" \
+        $out/lib/mozilla/plugins/libnpgoogletalk64.so
+
+      patchelf --set-rpath "$out/libexec/google/talkplugin/lib:${rpathNative}:${stdenv.gcc.gcc}/lib64" \
+        $out/lib/mozilla/plugins/libnpgtpo3dautoplugin.so
+
+      mkdir -p $out/libexec/google/talkplugin
+      cp opt/google/talkplugin/GoogleTalkPlugin $out/libexec/google/talkplugin/
+      
+      mkdir -p $out/libexec/google/talkplugin/lib
+      cp opt/google/talkplugin/lib/libCg* $out/libexec/google/talkplugin/lib/
+
+      patchelf \
+        --set-interpreter ${pkgsi686Linux.glibc}/lib/ld-linux*.so.2 \
+        --set-rpath ${rpath32} \
+        $out/libexec/google/talkplugin/GoogleTalkPlugin
+    '';
+
+  dontStrip = true;
+  dontPatchELF = true;
+  
+  passthru.mozillaPlugin = "/lib/mozilla/plugins";
+
+  meta = {
+    homepage = http://www.google.com/chat/video/;
+    license = "unfree";
+  };
+}
\ No newline at end of file
diff --git a/pkgs/applications/networking/browsers/rekonq/default.nix b/pkgs/applications/networking/browsers/rekonq/default.nix
index f9b8061d5ebd..ee37c2450a64 100644
--- a/pkgs/applications/networking/browsers/rekonq/default.nix
+++ b/pkgs/applications/networking/browsers/rekonq/default.nix
@@ -2,12 +2,12 @@
 , gettext}:
 
 stdenv.mkDerivation rec {
-  name = "rekonq-0.6.1";
+  name = "rekonq-0.7.0";
   passthru = { inherit stdenv; };
 
   src = fetchurl {
     url = "mirror://sf/rekonq/${name}.tar.bz2";
-    sha256 = "1hgy8ph4k4ngdy1kr4w3qwkfdylapsj7rjpk8wxn97yc4qnk57by";
+    sha256 = "14gi8ic53jkam2v52zp4p965dw6pqhjm3xhqssm5vimx7hp0kc1w";
   };
 
   buildInputs = [ cmake qt4 kdelibs automoc4 phonon perl gettext ];
diff --git a/pkgs/applications/networking/browsers/uzbl/default.nix b/pkgs/applications/networking/browsers/uzbl/default.nix
index 05dfaa3e67ee..145e5de90b72 100644
--- a/pkgs/applications/networking/browsers/uzbl/default.nix
+++ b/pkgs/applications/networking/browsers/uzbl/default.nix
@@ -28,7 +28,8 @@ rec {
       --prefix GST_PLUGIN_PATH : ${a.webkit.gstreamer}/lib/gstreamer-* \
       --prefix GST_PLUGIN_PATH : ${a.webkit.gstPluginsBase}/lib/gstreamer-* \
       --prefix GST_PLUGIN_PATH : ${a.webkit.gstPluginsGood}/lib/gstreamer-* \
-      --prefix GST_PLUGIN_PATH : ${a.webkit.gstFfmpeg}/lib/gstreamer-* 
+      --prefix GST_PLUGIN_PATH : ${a.webkit.gstFfmpeg}/lib/gstreamer-* \
+      --prefix GIO_EXTRA_MODULES : ${a.glib_networking}/lib/gio/modules
     '';
 
   installFlags = "PREFIX=$out";
diff --git a/pkgs/applications/networking/browsers/w3m/default.nix b/pkgs/applications/networking/browsers/w3m/default.nix
index 6844e582026c..d5294c961e64 100644
--- a/pkgs/applications/networking/browsers/w3m/default.nix
+++ b/pkgs/applications/networking/browsers/w3m/default.nix
@@ -8,12 +8,12 @@
 assert sslSupport -> openssl != null;
 assert graphicsSupport -> x11 != null;
 
-stdenv.mkDerivation {
-  name = "w3m-0.5.2";
+stdenv.mkDerivation rec {
+  name = "w3m-0.5.3";
 
   src = fetchurl {
-    url = mirror://sourceforge/w3m/w3m-0.5.2.tar.gz;
-    md5 = "ba06992d3207666ed1bf2dcf7c72bf58";
+    url = "mirror://sourceforge/w3m/${name}.tar.gz";
+    sha256 = "1qx9f0kprf92r1wxl3sacykla0g04qsi0idypzz24b7xy9ix5579";
   };
 
   # Patch for the newer unstable boehm-gc 7.2alpha. Not all platforms use that
diff --git a/pkgs/applications/networking/ekiga/default.nix b/pkgs/applications/networking/ekiga/default.nix
index d411c3b0f57c..276df1ae7a15 100644
--- a/pkgs/applications/networking/ekiga/default.nix
+++ b/pkgs/applications/networking/ekiga/default.nix
@@ -3,7 +3,7 @@ x@{builderDefsPackage
   , perl, perlXMLParser, evolution_data_server, gnome_doc_utils, avahi
   , libsigcxx, gtk, dbus_glib, libnotify, libXext, xextproto, automake
   , autoconf, pkgconfig, libxml2, videoproto, unixODBC, db4, nspr, nss, zlib
-  , libXrandr, randrproto, which, libxslt, libtasn1
+  , libXrandr, randrproto, which, libxslt, libtasn1, gmp, nettle
   , ...}:
 builderDefsPackage
 (a :  
diff --git a/pkgs/applications/networking/esniper/default.nix b/pkgs/applications/networking/esniper/default.nix
new file mode 100644
index 000000000000..5aaf419d3897
--- /dev/null
+++ b/pkgs/applications/networking/esniper/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchurl, openssl, curl }:
+
+stdenv.mkDerivation {
+  name = "esniper-2.26.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/esniper/esniper-2-26-0.tgz";
+    sha256 = "5fd9a0f4b27b98deca303cd3d16c1ed060e05a165a40b2f4a9f8546db5e3877d";
+  };
+
+  buildInputs = [openssl curl];
+
+  postInstall = ''
+    sed -e  "2i export PATH=\"$out/bin:\$PATH\"" <"frontends/snipe" >"$out/bin/snipe"
+    chmod 555 "$out/bin/snipe"
+  '';
+
+  meta = {
+    description = "Simple, lightweight tool for sniping eBay auctions";
+    homepage = "http://esnipe.rsourceforge.net";
+    license = "GPLv2";
+
+    platforms = stdenv.lib.platforms.all;
+    maintainers = [ stdenv.lib.maintainers.simons ];
+  };
+}
+
+
diff --git a/pkgs/applications/networking/instant-messengers/bitlbee-otr/default.nix b/pkgs/applications/networking/instant-messengers/bitlbee-otr/default.nix
deleted file mode 100644
index 972c812b2566..000000000000
--- a/pkgs/applications/networking/instant-messengers/bitlbee-otr/default.nix
+++ /dev/null
@@ -1,38 +0,0 @@
-{ stdenv, fetchbzr, gnutls, glib, pkgconfig, libotr, libgcrypt
-, libxslt, xmlto, docbook_xsl, docbook_xml_dtd_42, perl }:
-
-let revision = "369"; in
-stdenv.mkDerivation rec {
-  name = "bitlbee-otr-r${revision}";
-  src = fetchbzr {
-    url = "http://khjk.org/~pesco/bitlbee-otr";
-    sha256 = "0fb7987ec4a321e07f22690ed6617db9f377fdf4e65a531d8da28a950817074f";
-    inherit revision;
-  };
-
-  patchPhase = ''
-    # Both OTR and GnuTLS depend on libgcrypt, but for some reason, `bitlbee'
-    # must be explicitly linked against it.
-    sed -i "configure" -e "s|-f \$""{i}/lib/libotr.a|0 -eq 0|g ;
-                           s|otrprefix=\$""{i}|otrprefix=\"${libotr}\"|g ;
-                           s|-lotr|-lotr -L${libgcrypt} -lgcrypt|g";
-  '';
-
-  buildInputs = [ gnutls glib pkgconfig libotr libgcrypt
-    libxslt xmlto docbook_xsl docbook_xml_dtd_42 perl
-  ];
-
-  meta = {
-    description = ''BitlBee, an IRC to other chat networks gateway.'';
-
-    longDescription = ''
-      This unofficial version adds support for communication encryption
-      and authentication via the OTR (off-the-record) library.
-    '';
-
-    # See also http://bugs.bitlbee.org/bitlbee/ticket/115 .
-    homepage = http://khjk.org/bitlbee-otr/;
-
-    license = "GPL";
-  };
-}
diff --git a/pkgs/applications/networking/instant-messengers/bitlbee/default.nix b/pkgs/applications/networking/instant-messengers/bitlbee/default.nix
index f207eaed7037..1d49e0d1ff78 100644
--- a/pkgs/applications/networking/instant-messengers/bitlbee/default.nix
+++ b/pkgs/applications/networking/instant-messengers/bitlbee/default.nix
@@ -1,16 +1,19 @@
-{ fetchurl, stdenv, gnutls, glib, pkgconfig, check }:
+{ fetchurl, stdenv, gnutls, glib, pkgconfig, check, libotr }:
 
 stdenv.mkDerivation rec {
-  name = "bitlbee-1.2.8";
+  name = "bitlbee-3.0.3";
 
   src = fetchurl {
     url = "mirror://bitlbee/src/${name}.tar.gz";
-    sha256 = "11lfxvra46mwcnlxvhnywv6xbp7zl3h27hsbfwdh16b6fy41n1is";
+    sha256 = "09dgwfqznd2cnqraksivmh132nnl99gwgplynjmfsyyf6y4pbjl2";
   };
 
-  buildInputs = [ gnutls glib pkgconfig ]
+  buildInputs = [ gnutls glib pkgconfig libotr ]
     ++ stdenv.lib.optional doCheck check;
 
+  configureFlags = [ "--otr=1" ];
+
+  preCheck = "mkdir tests/.depend";
   doCheck = true;
 
   meta = {
diff --git a/pkgs/applications/networking/instant-messengers/freetalk/01_callbacks_const_fix.diff b/pkgs/applications/networking/instant-messengers/freetalk/01_callbacks_const_fix.diff
new file mode 100644
index 000000000000..5fe871601229
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/freetalk/01_callbacks_const_fix.diff
@@ -0,0 +1,25 @@
+Description: Patch to fix FTBFS due to a modified const in src/callbacks.cc
+Forwarded: yes
+Origin: Ubuntu,
+https://bugs.launchpad.net/ubuntu/+source/freetalk/+bug/443241
+Bug-Debian: http://bugs.debian.org/560535
+Author: Jon Bernard <bernardj@gmail.com>
+--- 3.2-1.orig/src/callbacks.cc	2008-11-15 10:41:22.000000000 +0000
++++ 3.2-1/src/callbacks.cc	2009-10-21 15:50:49.000000000 +0100
+@@ -116,13 +116,13 @@ ft_msg_msg_handler (LmMessageHandler *ha
+ 		    LmMessage *msg, gpointer user_data)
+ {
+   LmMessageNode *root, *body, *x;
+-  const char *from, *msg_str, *type;
+-  char *ts = NULL;
++  const char *msg_str, *type;
++  char *from, *ts = NULL;
+ 
+   root = lm_message_get_node (msg);
+   body = lm_message_node_get_child (root, "body");
+ 
+-  from = lm_message_node_get_attribute (msg->node, "from");
++  from = (char *) lm_message_node_get_attribute (msg->node, "from");
+ 
+   /* since the file-transfer happens in-band with messages, we can no longer
+    * ignore messages with no 'body' */
diff --git a/pkgs/applications/networking/instant-messengers/freetalk/default.nix b/pkgs/applications/networking/instant-messengers/freetalk/default.nix
new file mode 100644
index 000000000000..cdbc4233cf48
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/freetalk/default.nix
@@ -0,0 +1,51 @@
+x@{builderDefsPackage
+  , guile, pkgconfig, glib, loudmouth, gmp, libidn, readline, libtool
+  , libunwind, ncurses
+  , ...}:
+builderDefsPackage
+(a :  
+let 
+  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ 
+    [];
+
+  buildInputs = map (n: builtins.getAttr n x)
+    (builtins.attrNames (builtins.removeAttrs x helperArgNames));
+  sourceInfo = rec {
+    baseName="freetalk";
+    version="3.2";
+    name="${baseName}-${version}";
+    url="mirror://savannah/${baseName}/${name}.tar.gz";
+    hash="12dn7yj9k5xsrrjlnma77wzpvsdxjccwla1q0wy3lacl5l2p0jms";
+  };
+in
+rec {
+  src = a.fetchurl {
+    url = sourceInfo.url;
+    sha256 = sourceInfo.hash;
+  };
+
+  inherit (sourceInfo) name version;
+  inherit buildInputs;
+
+  patches = [./01_callbacks_const_fix.diff];
+
+  /* doConfigure should be removed if not needed */
+  phaseNames = ["doPatch" "doConfigure" "doMakeInstall"];
+      
+  meta = {
+    description = "Console XMPP client";
+    maintainers = with a.lib.maintainers;
+    [
+      raskin
+    ];
+    platforms = with a.lib.platforms;
+      linux;
+    license = a.lib.licenses.gpl3Plus;
+  };
+  passthru = {
+    updateInfo = {
+      downloadPage = "http://www.gnu.org/software/freetalk/";
+    };
+  };
+}) x
+
diff --git a/pkgs/applications/networking/instant-messengers/kadu/config.patch b/pkgs/applications/networking/instant-messengers/kadu/config.patch
new file mode 100644
index 000000000000..263898ba0db1
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/kadu/config.patch
@@ -0,0 +1,15 @@
+diff --git a/.config b/.config
+index e0068bf..808ebf4 100644
+--- a/.config
++++ b/.config
+@@ -187,8 +187,8 @@ module_history_migration=m
+ # PL: Obsługa szyfrowania wiadomości przy pomocy OpenSSLa
+ # Platform: Linux, Mac OS X, Windows
+ # Needs: libcrypto, libssl
+-module_encryption_ng=m
+-module_encryption_ng_simlite=m
++module_encryption_ng=n
++module_encryption_ng_simlite=n
+ 
+ # Description: Auto away module
+ # PL: Obsługa automatycznej zmiany statusu po określonym czasie bezczynności
diff --git a/pkgs/applications/networking/instant-messengers/kadu/default.nix b/pkgs/applications/networking/instant-messengers/kadu/default.nix
index c35d71fbca0a..70c7d7234e0c 100644
--- a/pkgs/applications/networking/instant-messengers/kadu/default.nix
+++ b/pkgs/applications/networking/instant-messengers/kadu/default.nix
@@ -1,27 +1,33 @@
-{ stdenv, fetchurl, cmake, qt4, libgadu, libXScrnSaver, libsndfile, qca2
-, libX11, alsaLib }:
+{ stdenv, fetchurl, cmake, qt4, libgadu, libXScrnSaver, libsndfile, libX11,
+  alsaLib, aspell, libidn, qca2, phonon }:
 
 stdenv.mkDerivation {
 
-  name = "kadu-0.6.5.4";
+  name = "kadu-0.9.2";
 
   src = fetchurl {
-    url = http://www.kadu.net/download/stable/kadu-0.6.5.4.tar.bz2;
-    sha256 = "09bdcyx75lca1pl6x3vfpawmdjn5pfxvwivb9xdhk4bdvswxgv4x";
+    url = http://www.kadu.net/download/stable/kadu-0.9.2.tar.bz2;
+    sha256 = "05lpx7m2adx8vv4h62rsiwlgay24m6cxdbibg7vzl4xkq9ybv30b";
   };
-  
+
   buildInputs = [
-    cmake qt4 libgadu libXScrnSaver libsndfile qca2 libX11 alsaLib
+    cmake qt4 libgadu libXScrnSaver libsndfile libX11 alsaLib aspell libidn qca2 phonon
   ];
 
-  cmakeFlags = "-DENABLE_AUTODOWNLOAD=OFF";
+  configureFlags = "CPPFLAGS=-DQT_NO_DEBUG";
+
+  cmakeFlags = "-DENABLE_AUTODOWNLOAD=OFF -DBUILD_DESCRIPTION='NixOS' -DCMAKE_BUILD_TYPE=Release";
 
   prePatch = ''
     patchShebangs .
   '';
 
-  meta = { 
-    description = "An instance messanger client for the gadu-gadu network (most popular polish IM network)";
+  patches = [ ./config.patch ];
+
+  NIX_LDFLAGS="-lX11";
+
+  meta = {
+    description = "An instant-messenger client for the gadu-gadu network (most popular polish IM network)";
     homepage = http://www.kadu.net/w/English:Main_Page;
     license = "GPLv2";
     platforms = stdenv.lib.platforms.linux;
diff --git a/pkgs/applications/networking/instant-messengers/kadu/more-icons.patch b/pkgs/applications/networking/instant-messengers/kadu/more-icons.patch
deleted file mode 100644
index 60234d361f7c..000000000000
--- a/pkgs/applications/networking/instant-messengers/kadu/more-icons.patch
+++ /dev/null
@@ -1,12 +0,0 @@
---- kadu/.config	2010-01-18 17:13:31.000000000 +0100
-+++ kadu/.config	2010-09-28 21:21:48.000000000 +0200
-@@ -559,10 +559,10 @@ icons_glass16=y
- icons_glass22=y
- 
- # Desctiption: Tango 16x16 icons made by BlotoPosniegowe
--icons_tango16=n
-+icons_tango16=y
- 
- # Description: Oxygen 16x16 icons maintained by Piotr Pelzowski
--icons_oxygen16=n
-+icons_oxygen16=y
diff --git a/pkgs/applications/networking/instant-messengers/oneteam/default.nix b/pkgs/applications/networking/instant-messengers/oneteam/default.nix
new file mode 100644
index 000000000000..37f56a638068
--- /dev/null
+++ b/pkgs/applications/networking/instant-messengers/oneteam/default.nix
@@ -0,0 +1,90 @@
+x@{builderDefsPackage
+  , fetchgit, perl, xulrunner, cmake, perlPackages, zip, unzip, pkgconfig
+  , pulseaudio, gtkLibs, pixman, nspr, nss, libXScrnSaver, scrnsaverproto
+  , ...}:
+builderDefsPackage
+(a :  
+let 
+  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ 
+    ["fetchgit" "perlPackages" "gtkLibs"];
+
+  buildInputs = map (n: builtins.getAttr n x)
+    (builtins.attrNames (builtins.removeAttrs x helperArgNames)) ++ [
+      a.perlPackages.SubName a.gtkLibs.gtk a.gtkLibs.glib
+    ];
+  sourceInfo = rec {
+    baseName="oneteam";
+    version="git-head";
+    name="${baseName}-${version}";
+    url="git://git.process-one.net/oneteam/oneteam.git";
+    rev="066cd861ea4436bbe363f032c58a746a1cac7498";
+    hash="972310d6ef20db7dc749d7d935aa50889afe2004db2a07409830e09ef639f30a";
+    method="fetchgit";
+  };
+in
+rec {
+  srcDrv = a.fetchgit {
+    url = sourceInfo.url;
+    sha256 = sourceInfo.hash;
+    rev = sourceInfo.rev;
+  };
+
+  src=srcDrv + "/";
+
+  inherit (sourceInfo) name version;
+  inherit buildInputs;
+
+  /* doConfigure should be removed if not needed */
+  phaseNames = ["goComponents" "setVars" "fixComponents" "doCmake" 
+    "doMakeInstall" "goBack" "buildApp" "doDeploy"];
+
+  fixComponents = a.fullDepEntry ''
+    sed -e '1i#include <netinet/in.h>' -i src/rtp/otRTPDecoder.cpp src/rtp/otRTPEncoder.cpp
+  '' ["minInit" "doUnpack"];
+
+  setVars=a.noDepEntry ''
+    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${nspr}/include/nspr"
+  '';
+
+  cmakeBuildDir="cmake-build";
+  cmakeFlags=["-D XPCOM_GECKO_SDK=${xulrunner}/lib/xulrunner-devel-${xulrunner.version}"];
+
+  goComponents=a.fullDepEntry "cd src/components" ["doUnpack"];
+  goBack=a.noDepEntry "cd ../../..";
+
+  buildApp=a.fullDepEntry ''
+    perl build.pl XULAPP 1
+  '' ["addInputs"];
+
+  doDeploy = a.fullDepEntry ''
+    TARGET_DIR="$out/share/oneteam/app"
+    BUILD_DIR="$PWD"
+    ensureDir "$TARGET_DIR"
+    cd "$TARGET_DIR"
+    unzip "$BUILD_DIR/oneteam.xulapp"
+    ensureDir "$out/bin"
+    echo "#! ${a.stdenv.shell}" > "$out/bin/oneteam"
+    echo "\"${xulrunner}/bin/xulrunner\" \"$TARGET_DIR/application.ini\"" > "$out/bin/oneteam"
+    chmod a+x "$out/bin/oneteam"
+    ensureDir "$out/share/doc"
+    cp -r "$BUILD_DIR/docs" "$out/share/doc/oneteam"
+  '' ["defEnsureDir"];
+
+  meta = {
+    description = "An XMPP client";
+    maintainers = with a.lib.maintainers;
+    [
+      raskin
+    ];
+    platforms = with a.lib.platforms;
+      linux;
+    license = a.lib.licenses.gpl2;
+    homepage="http://oneteam.im";
+  };
+  passthru = {
+    updateInfo = {
+      downloadPage = "git://git.process-one.net/oneteam/oneteam.git";
+    };
+  };
+}) x
+
diff --git a/pkgs/applications/networking/instant-messengers/pidgin/default.nix b/pkgs/applications/networking/instant-messengers/pidgin/default.nix
index fac93102ea58..89c3a10a45e8 100644
--- a/pkgs/applications/networking/instant-messengers/pidgin/default.nix
+++ b/pkgs/applications/networking/instant-messengers/pidgin/default.nix
@@ -17,14 +17,14 @@
   , lib, python
   , openssl ? null
   , gnutls ? null
-  , voice ? null
+  , libgcrypt ? null
 } :
 
 stdenv.mkDerivation {
-  name = "pidgin-2.7.8";
+  name = "pidgin-2.9.0";
   src = fetchurl {
-    url = mirror://sourceforge/pidgin/pidgin-2.7.8.tar.bz2;
-    sha256 = "1ci173g1xshfi4pl9wqv9g3fwxyqvdz5v61bgqpfij0hl1ss9k4c";
+    url = mirror://sourceforge/pidgin/pidgin-2.9.0.tar.bz2;
+    sha256 = "1mygaap7cbak9n9zm4wshxnvb27a68w633d712vy2knr8z78xvi8";
   };
 
   inherit nss ncurses;
@@ -34,6 +34,7 @@ stdenv.mkDerivation {
     libxml2] 
   ++ (lib.optional (openssl != null) openssl)
   ++ (lib.optional (gnutls != null) gnutls)
+  ++ (lib.optional (libgcrypt != null) libgcrypt)
   ++
   [nss nspr farsight2
     libXScrnSaver ncurses python
@@ -45,7 +46,7 @@ stdenv.mkDerivation {
     pkgconfig gtk perl perlXMLParser gettext
   ];
 
-  patches = [./pidgin-makefile.patch];
+  patches = [./pidgin-makefile.patch ];
 
   configureFlags="--with-nspr-includes=${nspr}/include/nspr --with-nspr-libs=${nspr}/lib --with-nss-includes=${nss}/include/nss --with-nss-libs=${nss}/lib --with-ncurses-headers=${ncurses}/include --disable-meanwhile --disable-nm --disable-tcl"
   + (lib.optionalString (gnutls != null) " --enable-gnutls=yes --enable-nss=no")
diff --git a/pkgs/applications/networking/instant-messengers/vacuum/default.nix b/pkgs/applications/networking/instant-messengers/vacuum/default.nix
index a08cc2795bbb..41658be08a9d 100644
--- a/pkgs/applications/networking/instant-messengers/vacuum/default.nix
+++ b/pkgs/applications/networking/instant-messengers/vacuum/default.nix
@@ -1,6 +1,6 @@
 x@{builderDefsPackage
   , qt4, openssl
-  , xproto, libX11
+  , xproto, libX11, libXScrnSaver, scrnsaverproto
   , ...}:
 builderDefsPackage
 (a :  
@@ -11,11 +11,11 @@ let
   buildInputs = map (n: builtins.getAttr n x)
     (builtins.attrNames (builtins.removeAttrs x helperArgNames));
   sourceInfo = rec {
-    version="1.0.2";
+    version="1.1.0";
     baseName="vacuum";
     name="${baseName}-${version}";
-    url="http://vacuum-im.googlecode.com/files/${name}-source.tar.gz";
-    hash="01ndwxpgr8911f2nfyb6i7avmmlwfikn031q1s60js4lgbqdq3b7";
+    url="http://vacuum-im.googlecode.com/files/${name}.tar.gz";
+    hash="c956b0cf5cc0a1acee47a96f0b0e7ab5d716e48cac4a7fcbca496f901a219dcc";
   };
 in
 rec {
@@ -35,8 +35,6 @@ rec {
     sed -re 's/qHash[(][a-z ]*QUrl/vacuum_obsolete_&/' -i src/plugins/dataforms/dataforms.cpp
   '') ["minInit" "doUnpack"];
 
-  goSrcDir = ''cd vacuum-*/'';
-
   doQMake = a.fullDepEntry (''
     qmake INSTALL_PREFIX=$out -recursive vacuum.pro
   '') ["doUnpack" "addInputs"];
diff --git a/pkgs/applications/networking/irc/chatzilla/default.nix b/pkgs/applications/networking/irc/chatzilla/default.nix
index b981c105a0c9..a0197a99a509 100644
--- a/pkgs/applications/networking/irc/chatzilla/default.nix
+++ b/pkgs/applications/networking/irc/chatzilla/default.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl, unzip }:
 
 stdenv.mkDerivation rec {
-  name = "chatzilla-0.9.86";
+  name = "chatzilla-0.9.86.1";
   
   src = fetchurl {
     # Obtained from http://chatzilla.rdmsoft.com/xulrunner/.
-    url = http://chatzilla.rdmsoft.com/xulrunner/download/chatzilla-0.9.86-xr.zip;
-    sha256 = "1z8767arx2ncch0pzkdzhisjgmd45qianahz3xr8isvahv2klj5x";
+    url = http://chatzilla.rdmsoft.com/xulrunner/download/chatzilla-0.9.86.1-xr.zip;
+    sha256 = "06s4g0x7hsckd7wr904j8rzksvqhvcrhl9zwga2458rgafcbbghd";
   };
 
   buildInputs = [ unzip ];
diff --git a/pkgs/applications/networking/irc/quassel/default.nix b/pkgs/applications/networking/irc/quassel/default.nix
index 2be964db3312..8dcde90e538e 100644
--- a/pkgs/applications/networking/irc/quassel/default.nix
+++ b/pkgs/applications/networking/irc/quassel/default.nix
@@ -11,11 +11,11 @@ let
 
 in with stdenv; mkDerivation rec {
 
-  name = "quassel-0.6.1";
+  name = "quassel-0.7.1";
 
   src = fetchurl {
     url = "http://quassel-irc.org/pub/${name}.tar.bz2";
-    sha256 = "1v5mxligfygn7r7hm3b9by38qxigncfkp6w4n8ypp8ww6n8ml6z0";
+    sha256 = "1kby1yikiv5bpzkdri5dq39pxnsj9gjrcv1gigvy2jzy3g99qjli";
   };
 
   buildInputs = [ cmake qt4 ]
diff --git a/pkgs/applications/networking/linphone/default.nix b/pkgs/applications/networking/linphone/default.nix
new file mode 100644
index 000000000000..07ca19b63cc5
--- /dev/null
+++ b/pkgs/applications/networking/linphone/default.nix
@@ -0,0 +1,20 @@
+{ stdenv, fetchurl, intltool, pkgconfig, gtk, libglade, libosip, libexosip, speex,
+  readline, ffmpeg, alsaLib, SDL, libv4l, libtheora, libXv }:
+        
+stdenv.mkDerivation rec {
+  name = "linphone-3.4.3";
+
+  src = fetchurl {
+    url = "mirror://savannah/linphone/3.4.x/sources/${name}.tar.gz";
+    sha256 = "14k655z0kfmnm42nxhsl25rjim9swrr4kpnplkx3pd9b3yha1rwj";
+  };
+
+  buildInputs = [ intltool pkgconfig gtk libglade libosip libexosip speex readline
+    ffmpeg alsaLib SDL libv4l libtheora libXv ];
+
+  meta = {
+    homepage = http://www.linphone.org/;
+    description = "Open Source video SIP softphone";
+    license = "GPLv2+";
+  };
+}
diff --git a/pkgs/applications/networking/mailreaders/mutt/default.nix b/pkgs/applications/networking/mailreaders/mutt/default.nix
index ffe4ca327126..02870c70f646 100644
--- a/pkgs/applications/networking/mailreaders/mutt/default.nix
+++ b/pkgs/applications/networking/mailreaders/mutt/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, ncurses, which, perl
+{ stdenv, fetchurl, ncurses, which, perl, gpgme
 , sslSupport ? true
 , imapSupport ? true
 , headerCache ? true
@@ -12,18 +12,16 @@ assert headerCache -> gdbm != null;
 assert sslSupport -> openssl != null;
 assert saslSupport -> cyrus_sasl != null;
 
-stdenv.mkDerivation {
-  name = "mutt-1.5.20";
+stdenv.mkDerivation rec {
+  name = "mutt-1.5.21";
   
   src = fetchurl {
-    url = ftp://ftp.mutt.org/mutt/devel/mutt-1.5.20.tar.gz;
-    sha256 = "15m7m419r82awx4mr4nam25m0kpg0bs9vw1z4a4mrzvlkl3zqycm";
+    url = "ftp://ftp.mutt.org/mutt/devel/${name}.tar.gz";
+    sha256 = "1864cwz240gh0zy56fb47qqzwyf6ghg01037rb4p2kqgimpg6h91";
   };
 
-  patches = [ ./openssl.patch ];
-  
   buildInputs = [
-    ncurses which perl
+    ncurses which perl gpgme
     (if headerCache then gdbm else null)
     (if sslSupport then openssl else null)
     (if saslSupport then cyrus_sasl else null)
@@ -33,7 +31,7 @@ stdenv.mkDerivation {
     "--with-mailpath=" "--enable-smtp"
 
     # This allows calls with "-d N", that output debug info into ~/.muttdebug*
-    "--enable-debug"
+    "--enable-debug" "--enable-pop" "--enable-imap" "--enable-gpgme"
 
     # The next allows building mutt without having anything setgid
     # set by the installer, and removing the need for the group 'mail'
diff --git a/pkgs/applications/networking/mailreaders/mutt/openssl.patch b/pkgs/applications/networking/mailreaders/mutt/openssl.patch
deleted file mode 100644
index 6476075d67de..000000000000
--- a/pkgs/applications/networking/mailreaders/mutt/openssl.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-Fixes a compilation problem with OpenSSL 1.0.0.
-From http://www.freebsd.org/cgi/query-pr.cgi?pr=146261
-
-diff -ru -x '*~' mutt-1.5.20-orig/mutt_ssl.c mutt-1.5.20/mutt_ssl.c
---- mutt-1.5.20-orig/mutt_ssl.c	2009-06-10 07:08:29.000000000 +0200
-+++ mutt-1.5.20/mutt_ssl.c	2010-07-24 10:46:08.000000000 +0200
-@@ -652,7 +652,7 @@
-   char *buf = NULL;
-   int bufsize;
-   /* needed to get the DNS subjectAltNames: */
--  STACK *subj_alt_names;
-+  STACK_OF(GENERAL_NAME) *subj_alt_names;
-   int subj_alt_names_count;
-   GENERAL_NAME *subj_alt_name;
-   /* did we find a name matching hostname? */
diff --git a/pkgs/applications/networking/mailreaders/notmuch/default.nix b/pkgs/applications/networking/mailreaders/notmuch/default.nix
new file mode 100644
index 000000000000..830ef82cf7a8
--- /dev/null
+++ b/pkgs/applications/networking/mailreaders/notmuch/default.nix
@@ -0,0 +1,84 @@
+{ fetchgit, stdenv, bash, emacs, gdb, git, glib, gmime, gnupg1, pkgconfig, talloc, xapian }:
+
+stdenv.mkDerivation rec {
+  name = "notmuch-0.6-rc4";
+
+  src = fetchgit {
+    url = "git://github.com/chaoflow/notmuch";
+    rev = "9f8ef78e0c6b28918f3edda06b59a9e8f9bef8e3";
+    sha256 = "c7c425c10a695ca22dfbdf5fe8e0dcb6a888edc0b3388023e7ff35f69acc0085";
+  };
+
+  buildInputs = [ bash emacs gdb git glib gmime gnupg1 pkgconfig talloc xapian ];
+
+  # XXX: Make me a loop
+  patchPhase = ''
+    substituteInPlace "test/atomicity" \
+      --replace "#!/bin/bash" "#!${bash}/bin/bash"
+    substituteInPlace "test/author-order" \
+      --replace "#!/bin/bash" "#!${bash}/bin/bash"
+    substituteInPlace "test/basic" \
+      --replace "#!/bin/bash" "#!${bash}/bin/bash"
+    substituteInPlace "test/crypto" \
+      --replace "#!/bin/bash" "#!${bash}/bin/bash"
+    substituteInPlace "test/dump-restore" \
+      --replace "#!/bin/bash" "#!${bash}/bin/bash"
+    substituteInPlace "test/emacs" \
+      --replace "#!/bin/bash" "#!${bash}/bin/bash"
+    substituteInPlace "test/emacs-large-search-buffer" \
+      --replace "#!/bin/bash" "#!${bash}/bin/bash"
+    substituteInPlace "test/encoding" \
+      --replace "#!/bin/bash" "#!${bash}/bin/bash"
+    substituteInPlace "test/from-guessing" \
+      --replace "#!/bin/bash" "#!${bash}/bin/bash"
+    substituteInPlace "test/json" \
+      --replace "#!/bin/bash" "#!${bash}/bin/bash"
+    substituteInPlace "test/long-id" \
+      --replace "#!/bin/bash" "#!${bash}/bin/bash"
+    substituteInPlace "test/maildir-sync" \
+      --replace "#!/bin/bash" "#!${bash}/bin/bash"
+    substituteInPlace "test/new" \
+      --replace "#!/bin/bash" "#!${bash}/bin/bash"
+    substituteInPlace "test/notmuch-test" \
+      --replace "#!/bin/bash" "#!${bash}/bin/bash"
+    substituteInPlace "test/raw" \
+      --replace "#!/bin/bash" "#!${bash}/bin/bash"
+    substituteInPlace "test/reply" \
+      --replace "#!/bin/bash" "#!${bash}/bin/bash"
+    substituteInPlace "test/search" \
+      --replace "#!/bin/bash" "#!${bash}/bin/bash"
+    substituteInPlace "test/search-by-folder" \
+      --replace "#!/bin/bash" "#!${bash}/bin/bash"
+    substituteInPlace "test/search-insufficient-from-quoting" \
+      --replace "#!/bin/bash" "#!${bash}/bin/bash"
+    substituteInPlace "test/search-output" \
+      --replace "#!/bin/bash" "#!${bash}/bin/bash"
+    substituteInPlace "test/search-position-overlap-bug" \
+      --replace "#!/bin/bash" "#!${bash}/bin/bash"
+    substituteInPlace "test/test-lib.sh" \
+      --replace "#!/bin/bash" "#!${bash}/bin/bash"
+    substituteInPlace "test/test-verbose" \
+      --replace "#!/bin/bash" "#!${bash}/bin/bash"
+    substituteInPlace "test/thread-naming" \
+      --replace "#!/bin/bash" "#!${bash}/bin/bash"
+    substituteInPlace "test/thread-order" \
+      --replace "#!/bin/bash" "#!${bash}/bin/bash"
+    substituteInPlace "test/uuencode" \
+      --replace "#!/bin/bash" "#!${bash}/bin/bash"
+  '';
+
+  postBuild = ''
+    make test
+  '';
+
+  meta = {
+    description = "Notmuch -- The mail indexer";
+
+    longDescription = "";
+
+    license = "GPLv3";
+
+    maintainers = [ stdenv.lib.maintainers.chaoflow ];
+    platforms = stdenv.lib.platforms.gnu;  # arbitrary choice
+  };
+}
diff --git a/pkgs/applications/networking/mailreaders/thunderbird/3.x.nix b/pkgs/applications/networking/mailreaders/thunderbird/3.x.nix
index 0242f22f396b..b644837b377f 100644
--- a/pkgs/applications/networking/mailreaders/thunderbird/3.x.nix
+++ b/pkgs/applications/networking/mailreaders/thunderbird/3.x.nix
@@ -11,14 +11,14 @@
     
 }:
 
-let version = "3.1.6"; in
+let version = "3.1.9"; 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 = "d9c089c64cc7a784e128d9c594ef649a35babe30";
+    sha1 = "22b153102939430180ae1873ce15ef52286ff08d";
   };
 
   buildInputs =
@@ -66,6 +66,6 @@ stdenv.mkDerivation {
 
   meta = {
     description = "Mozilla Thunderbird, a full-featured email client";
-    homepage = http://www.mozilla.com/en-US/thunderbird/;
+    homepage = http://www.mozilla.org/en-US/thunderbird/;
   };
 }
diff --git a/pkgs/applications/networking/mailreaders/thunderbird/5.x.nix b/pkgs/applications/networking/mailreaders/thunderbird/5.x.nix
new file mode 100644
index 000000000000..f80fde276542
--- /dev/null
+++ b/pkgs/applications/networking/mailreaders/thunderbird/5.x.nix
@@ -0,0 +1,83 @@
+{ stdenv, fetchurl, pkgconfig, gtk, perl, python, zip, libIDL
+, dbus_glib, bzip2, alsaLib, nspr, yasm, mesa, nss
+, libnotify, cairo, pixman, fontconfig
+
+, # 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 = "5.0"; in
+
+# from wikipedia: This Release no longer supports versions of Mac OS X
+# before Mac OS X 10.5 Leopard or Mac computers with PowerPC processors.
+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 = "392c3e0ef70b62c29a543f88b2b8d5a51bfe69a7";
+  };
+
+  buildInputs =
+    [ pkgconfig perl python zip bzip2 gtk dbus_glib alsaLib libIDL nspr libnotify
+      libnotify cairo pixman fontconfig yasm mesa nss
+    ];
+
+  patches = [
+    # Fix weird dependencies such as a so file which depends on "-lpthread".
+    ./thunderbird-build-deps.patch
+  ];
+
+  NIX_LDFLAGS = "-lpixman-1";
+
+  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-necko-wifi"
+      "--disable-tests"
+      "--enable-calendar"
+    ]
+    ++ 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 = with stdenv.lib; {
+    description = "Mozilla Thunderbird, a full-featured email client";
+    homepage = http://www.mozilla.org/en-US/thunderbird/;
+    license =
+      # Official branding implies thunderbird name and logo cannot be reuse,
+      # see http://www.mozilla.org/foundation/licensing.html
+      if enableOfficialBranding then licenses.proprietary else licenses.mpl11;
+    maintainers = with maintainers; [ pierron ];
+  };
+}
diff --git a/pkgs/applications/networking/mailreaders/thunderbird/thunderbird-build-deps.patch b/pkgs/applications/networking/mailreaders/thunderbird/thunderbird-build-deps.patch
new file mode 100644
index 000000000000..ac074e8c8812
--- /dev/null
+++ b/pkgs/applications/networking/mailreaders/thunderbird/thunderbird-build-deps.patch
@@ -0,0 +1,21 @@
+diff -x _inst -x _build -x .svn -ur comm-miramar/config/rules.mk comm-miramar.after/config/rules.mk
+--- comm-miramar/config/rules.mk	2011-06-24 22:13:31.000000000 +0200
++++ comm-miramar/config/rules.mk	2011-08-15 12:27:07.305556040 +0200
+@@ -851,9 +851,13 @@
+ 
+ ifndef _LIBNAME_RELATIVE_PATHS
+ 
+-LIBS_DEPS += $(filter -l%, $(LIBS))
+-HOST_LIBS_DEPS += $(filter -l%, $(HOST_LIBS))
+-DSO_LDOPTS_DEPS += $(filter -l%, $(EXTRA_DSO_LDOPTS))
++LIBS_DEPS += $(patsubst -l%,$(LIB_PREFIX)%$(DLL_SUFFIX),$(filter-out -lpthread -ldl -lrt -ljemalloc -lmozmalloc,$(filter -l%, $(LIBS))))
++HOST_LIBS_DEPS += $(patsubst -l%,$(LIB_PREFIX)%$(DLL_SUFFIX),$(filter-out -lpthread -ldl -lrt -ljemalloc -lmozmalloc,$(filter -l%, $(HOST_LIBS))))
++DSO_LDOPTS_DEPS += $(patsubst -l%,$(LIB_PREFIX)%$(DLL_SUFFIX),$(filter-out -lpthread -ldl -lrt -ljemalloc -lmozmalloc,$(filter -l%, $(EXTRA_DSO_LDOPTS))))
++
++LIBS_DEPS += $(patsubst -l%,$(LIB_PREFIX)%.$(LIB_SUFFIX),$(filter -ljemalloc -lmozmalloc, $(LIBS)))
++HOST_LIBS_DEPS += $(patsubst -l%,$(LIB_PREFIX)%.$(LIB_SUFFIX),$(filter -ljemalloc -lmozmalloc, $(HOST_LIBS)))
++DSO_LDOPTS_DEPS += $(patsubst -l%,$(LIB_PREFIX)%.$(LIB_SUFFIX),$(filter -ljemalloc -lmozmalloc, $(EXTRA_DSO_LDOPTS)))
+ 
+ _LIBDIRS = $(patsubst -L%,%,$(filter -L%, $(LIBS) $(HOST_LIBS) $(EXTRA_DSO_LDOPTS)))
+ ifneq (,$(_LIBDIRS))
+Seulement dans comm-miramar.after/config: rules.mk~
diff --git a/pkgs/applications/networking/mumble/default.nix b/pkgs/applications/networking/mumble/default.nix
new file mode 100644
index 000000000000..5c9e215f8764
--- /dev/null
+++ b/pkgs/applications/networking/mumble/default.nix
@@ -0,0 +1,45 @@
+{ stdenv, fetchurl, qt4, libvorbis, boost, speechd, protobuf, libsndfile,
+ avahi, dbus, libcap,
+jackSupport ? false, 
+jackaudio ? null }:
+
+
+stdenv.mkDerivation rec {
+  name = "mumble-" + version;
+  version = "1.2.2";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/mumble/${name}.tar.gz";
+    sha256 = "1s4vlkdfmyzx7h3i4060q0sf2xywl9sm6dpjhaa150blbcylwmic";
+  };
+
+  patchPhase = ''
+    sed -e s/qt_ja_JP.qm// -i src/mumble/mumble.pro src/mumble11x/mumble11x.pro
+    sed -e /qt_ja_JP.qm/d -i src/mumble/mumble_qt.qrc src/mumble11x/mumble_qt.qrc
+    patch -p1 < ${ ./mumble-jack-support.patch }
+  '';
+
+  configurePhase = ''
+    qmake CONFIG+=no-g15 CONFIG+=no-update \
+      CONFIG+=no-embed-qt-translations CONFIG+=no-ice \
+  '' 
+  + stdenv.lib.optionalString jackSupport ''
+    CONFIG+=no-oss CONFIG+=no-alsa CONFIG+=jackaudio
+  '';
+
+
+  buildInputs = [ qt4 libvorbis boost speechd protobuf libsndfile avahi dbus
+    libcap ]
+    ++ (stdenv.lib.optional jackSupport jackaudio);
+
+  installPhase = ''
+    ensureDir $out
+    cp -r ./release $out/bin
+  '';
+
+  meta = { 
+    homepage = http://mumble.sourceforge.net/;
+    description = "Low-latency, high quality voice chat software";
+    license = "BSD";
+  };
+}
diff --git a/pkgs/applications/networking/mumble/mumble-jack-support.patch b/pkgs/applications/networking/mumble/mumble-jack-support.patch
new file mode 100644
index 000000000000..7c18a33193df
--- /dev/null
+++ b/pkgs/applications/networking/mumble/mumble-jack-support.patch
@@ -0,0 +1,457 @@
+The patch was created by Filipe Coelho (falkTX) of the KXStudio
+project. http://kxstudio.sourceforge.net
+
+diff -U 3 -H -d -r -N -- mumble-1.2.2.orig/src/mumble/JackAudio.cpp mumble-1.2.2/src/mumble/JackAudio.cpp
+--- mumble-1.2.2.orig/src/mumble/JackAudio.cpp	1970-01-01 01:00:00.000000000 +0100
++++ mumble-1.2.2/src/mumble/JackAudio.cpp	2011-01-26 06:02:00.000000000 +0000
+@@ -0,0 +1,314 @@
++/* Copyright (C) 2011, Benjamin Jemlich <pcgod@users.sourceforge.net>
++   Copyright (C) 2011, Filipe Coelho <falktx@gmail.com>
++
++   All rights reserved.
++
++   Redistribution and use in source and binary forms, with or without
++   modification, are permitted provided that the following conditions
++   are met:
++
++   - Redistributions of source code must retain the above copyright notice,
++     this list of conditions and the following disclaimer.
++   - Redistributions in binary form must reproduce the above copyright notice,
++     this list of conditions and the following disclaimer in the documentation
++     and/or other materials provided with the distribution.
++   - Neither the name of the Mumble Developers nor the names of its
++     contributors may be used to endorse or promote products derived from this
++     software without specific prior written permission.
++
++   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
++   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
++   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
++   A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR
++   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
++   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
++   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
++   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
++   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
++   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
++   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++*/
++
++#include "JackAudio.h"
++#include "User.h"
++#include "Global.h"
++#include "MainWindow.h"
++#include "Timer.h"
++
++#include <cstring>
++
++static JackAudioSystem *jasys = NULL;
++
++class JackAudioInputRegistrar : public AudioInputRegistrar {
++        public:
++                JackAudioInputRegistrar();
++                virtual AudioInput *create();
++                virtual const QList<audioDevice> getDeviceChoices();
++                virtual void setDeviceChoice(const QVariant &, Settings &);
++                virtual bool canEcho(const QString &) const;
++};
++
++class JackAudioOutputRegistrar : public AudioOutputRegistrar {
++        public:
++                JackAudioOutputRegistrar();
++                virtual AudioOutput *create();
++                virtual const QList<audioDevice> getDeviceChoices();
++                virtual void setDeviceChoice(const QVariant &, Settings &);
++};
++
++class JackAudioInit : public DeferInit {
++        public:
++                JackAudioInputRegistrar *airJackAudio;
++                JackAudioOutputRegistrar *aorJackAudio;
++                void initialize() {
++                        jasys = new JackAudioSystem();
++                        jasys->init_jack();
++                        jasys->qmWait.lock();
++                        jasys->qwcWait.wait(&jasys->qmWait, 1000);
++                        jasys->qmWait.unlock();
++                        if (jasys->bJackIsGood) {
++                                airJackAudio = new JackAudioInputRegistrar();
++                                aorJackAudio = new JackAudioOutputRegistrar();
++                        } else {
++                                airJackAudio = NULL;
++                                aorJackAudio = NULL;
++                                delete jasys;
++                                jasys = NULL;
++                        }
++                };
++                void destroy() {
++                        if (airJackAudio)
++                                delete airJackAudio;
++                        if (aorJackAudio)
++                                delete aorJackAudio;
++                        if (jasys) {
++                                jasys->close_jack();
++                                delete jasys;
++                                jasys = NULL;
++                        }
++                };
++};
++
++static JackAudioInit jackinit; //unused
++
++JackAudioSystem::JackAudioSystem() {
++        bJackIsGood = false;
++        iSampleRate = 0;
++}
++
++JackAudioSystem::~JackAudioSystem() {
++}
++
++void JackAudioSystem::init_jack()
++{
++        client = jack_client_open("mumble", JackNullOption, 0);
++
++        if (client) {
++                in_port = jack_port_register(client, "input", JACK_DEFAULT_AUDIO_TYPE, JackPortIsInput, 0);
++                out_port = jack_port_register(client, "output", JACK_DEFAULT_AUDIO_TYPE, JackPortIsOutput, 0);
++                jack_set_process_callback(client, process_callback, this);
++                jack_set_sample_rate_callback(client, srate_callback, this);
++                jack_on_shutdown(client, shutdown_callback, this);
++
++                iSampleRate = jack_get_sample_rate(client);
++
++                if (jack_activate(client) || in_port == NULL || out_port == NULL) {
++                    client = NULL;
++                    return;
++                }
++
++                int port_flags;
++                unsigned i = -1;
++                const char** ports = jack_get_ports(client, 0, 0, JackPortIsPhysical);
++
++                if (ports) {
++                    while (ports[++i])
++                    {
++                        jack_port_t* port = jack_port_by_name(client, ports[i]);
++                        port_flags = jack_port_flags(port);
++
++                        if (port_flags & (JackPortIsPhysical|JackPortIsOutput) && strstr(jack_port_type(port), "audio")) {
++                            jack_connect(client, ports[i], jack_port_name(in_port));
++                        }
++                        if (port_flags & (JackPortIsPhysical|JackPortIsInput) && strstr(jack_port_type(port), "audio")) {
++                            jack_connect(client, jack_port_name(out_port), ports[i]);
++                        }
++                    }
++                }
++
++                jack_free(ports);
++
++                // If we made it this far, then everything is okay
++                qhInput.insert(QString(), tr("Hardware Ports"));
++                qhOutput.insert(QString(), tr("Hardware Ports"));
++                bJackIsGood = true;
++
++            } else {
++                bJackIsGood = false;
++                client = NULL;
++            }
++}
++
++void JackAudioSystem::close_jack()
++{
++        if (client) {
++                jack_deactivate(client);
++                jack_client_close(client);
++                client = NULL;
++        }
++}
++
++int JackAudioSystem::process_callback(jack_nframes_t nframes, void *arg)
++{
++        JackAudioSystem *jas = (JackAudioSystem*)arg;
++
++        if (jas && jas->bJackIsGood) {
++                AudioInputPtr ai = g.ai;
++                AudioOutputPtr ao = g.ao;
++                JackAudioInput *jai = (JackAudioInput*)(ai.get());
++                JackAudioOutput *jao = (JackAudioOutput*)(ao.get());
++
++                if (jai && jai->bRunning && jai->iMicChannels > 0 && !jai->isFinished()) {
++                        void* input = jack_port_get_buffer(jas->in_port, nframes);
++                        if ((float*)input != 0)
++                            jai->addMic(input, nframes);
++                }
++
++                if (jao && jao->bRunning && jao->iChannels > 0 && !jao->isFinished()) {
++                        jack_default_audio_sample_t* output = (jack_default_audio_sample_t*)jack_port_get_buffer(jas->out_port, nframes);
++                        memset(output, 0, sizeof(jack_default_audio_sample_t)*nframes); //TEST
++                        jao->mix(output, nframes);
++                }
++        }
++
++        return 0;
++}
++
++int JackAudioSystem::srate_callback(jack_nframes_t frames, void *arg)
++{
++        JackAudioSystem *jas = (JackAudioSystem*)arg;
++        jas->iSampleRate = frames;
++        return 0;
++}
++
++void JackAudioSystem::shutdown_callback(void *arg)
++{
++        JackAudioSystem *jas = (JackAudioSystem*)arg;
++        jas->bJackIsGood = false;
++}
++
++JackAudioInputRegistrar::JackAudioInputRegistrar() : AudioInputRegistrar(QLatin1String("JACK"), 10) {
++}
++
++AudioInput *JackAudioInputRegistrar::create() {
++        return new JackAudioInput();
++}
++
++const QList<audioDevice> JackAudioInputRegistrar::getDeviceChoices() {
++        QList<audioDevice> qlReturn;
++
++        QStringList qlInputDevs = jasys->qhInput.keys();
++        qSort(qlInputDevs);
++
++        foreach(const QString &dev, qlInputDevs) {
++                qlReturn << audioDevice(jasys->qhInput.value(dev), dev);
++        }
++
++        return qlReturn;
++}
++
++void JackAudioInputRegistrar::setDeviceChoice(const QVariant &choice, Settings &s) {
++        Q_UNUSED(choice);
++        Q_UNUSED(s);
++}
++
++bool JackAudioInputRegistrar::canEcho(const QString &osys) const {
++        Q_UNUSED(osys);
++        return false;
++}
++
++JackAudioOutputRegistrar::JackAudioOutputRegistrar() : AudioOutputRegistrar(QLatin1String("JACK"), 10) {
++}
++
++AudioOutput *JackAudioOutputRegistrar::create() {
++        return new JackAudioOutput();
++}
++
++const QList<audioDevice> JackAudioOutputRegistrar::getDeviceChoices() {
++        QList<audioDevice> qlReturn;
++
++        QStringList qlOutputDevs = jasys->qhOutput.keys();
++        qSort(qlOutputDevs);
++
++        foreach(const QString &dev, qlOutputDevs) {
++                qlReturn << audioDevice(jasys->qhOutput.value(dev), dev);
++        }
++
++        return qlReturn;
++}
++
++void JackAudioOutputRegistrar::setDeviceChoice(const QVariant &choice, Settings &s) {
++        Q_UNUSED(choice);
++        Q_UNUSED(s);
++}
++
++JackAudioInput::JackAudioInput() {
++        bRunning = true;
++        iMicChannels = 0;
++};
++
++JackAudioInput::~JackAudioInput() {
++        bRunning = false;
++        iMicChannels = 0;
++        qmMutex.lock();
++        qwcWait.wakeAll();
++        qmMutex.unlock();
++        wait();
++}
++
++void JackAudioInput::run() {
++        if (jasys && jasys->bJackIsGood) {
++            iMicFreq = jasys->iSampleRate;
++            iMicChannels = 1;
++            eMicFormat = SampleFloat;
++            initializeMixer();
++        }
++
++        qmMutex.lock();
++        while (bRunning)
++                qwcWait.wait(&qmMutex);
++        qmMutex.unlock();
++}
++
++JackAudioOutput::JackAudioOutput() {
++        bRunning = true;
++        iChannels = 0;
++}
++
++JackAudioOutput::~JackAudioOutput() {
++        bRunning = false;
++        iChannels = 0;
++        qmMutex.lock();
++        qwcWait.wakeAll();
++        qmMutex.unlock();
++        wait();
++}
++
++void JackAudioOutput::run() {
++        if (jasys && jasys->bJackIsGood) {
++            unsigned int chanmasks[32];
++
++            chanmasks[0] = SPEAKER_FRONT_LEFT;
++            chanmasks[1] = SPEAKER_FRONT_RIGHT;
++
++            eSampleFormat = SampleFloat;
++            iMixerFreq = jasys->iSampleRate;
++            iChannels = 1;
++            initializeMixer(chanmasks);
++        }
++
++        qmMutex.lock();
++        while (bRunning)
++                qwcWait.wait(&qmMutex);
++        qmMutex.unlock();
++}
+diff -U 3 -H -d -r -N -- mumble-1.2.2.orig/src/mumble/JackAudio.h mumble-1.2.2/src/mumble/JackAudio.h
+--- mumble-1.2.2.orig/src/mumble/JackAudio.h	1970-01-01 01:00:00.000000000 +0100
++++ mumble-1.2.2/src/mumble/JackAudio.h	2011-01-26 06:03:58.000000000 +0000
+@@ -0,0 +1,97 @@
++/* Copyright (C) 2011, Benjamin Jemlich <pcgod@users.sourceforge.net>
++   Copyright (C) 2011, Filipe Coelho <falktx@gmail.com>
++
++   All rights reserved.
++
++   Redistribution and use in source and binary forms, with or without
++   modification, are permitted provided that the following conditions
++   are met:
++
++   - Redistributions of source code must retain the above copyright notice,
++     this list of conditions and the following disclaimer.
++   - Redistributions in binary form must reproduce the above copyright notice,
++     this list of conditions and the following disclaimer in the documentation
++     and/or other materials provided with the distribution.
++   - Neither the name of the Mumble Developers nor the names of its
++     contributors may be used to endorse or promote products derived from this
++     software without specific prior written permission.
++
++   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
++   ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
++   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
++   A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR
++   CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
++   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
++   PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
++   PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
++   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
++   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
++   SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
++*/
++
++#ifndef _JACKAUDIO_H
++#define _JACKAUDIO_H
++
++#include "AudioInput.h"
++#include "AudioOutput.h"
++#include <jack/jack.h>
++
++class JackAudioOutput;
++class JackAudioInput;
++
++class JackAudioSystem : public QObject {
++        private:
++                Q_OBJECT
++                Q_DISABLE_COPY(JackAudioSystem)
++        protected:
++                jack_client_t* client;
++                jack_port_t* in_port;
++                jack_port_t* out_port;
++
++                static int process_callback(jack_nframes_t nframes, void *arg);
++                static int srate_callback(jack_nframes_t frames, void *arg);
++                static void shutdown_callback(void *arg);
++        public:
++                QHash<QString, QString> qhInput;
++                QHash<QString, QString> qhOutput;
++                bool bJackIsGood;
++                int iSampleRate;
++                QMutex qmWait;
++                QWaitCondition qwcWait;
++
++                void init_jack();
++                void close_jack();
++
++                JackAudioSystem();
++                ~JackAudioSystem();
++};
++
++class JackAudioInput : public AudioInput {
++                friend class JackAudioSystem;
++        private:
++                Q_OBJECT
++                Q_DISABLE_COPY(JackAudioInput)
++        protected:
++                QMutex qmMutex;
++                QWaitCondition qwcWait;
++        public:
++                JackAudioInput();
++                ~JackAudioInput();
++                void run();
++};
++
++class JackAudioOutput : public AudioOutput {
++                friend class JackAudioSystem;
++        private:
++                Q_OBJECT
++                Q_DISABLE_COPY(JackAudioOutput)
++        protected:
++                QMutex qmMutex;
++                QWaitCondition qwcWait;
++        public:
++                JackAudioOutput();
++                ~JackAudioOutput();
++                void run();
++};
++
++#endif
+diff -U 3 -H -d -r -N -- mumble-1.2.2.orig/src/mumble/mumble.pro mumble-1.2.2/src/mumble/mumble.pro
+--- mumble-1.2.2.orig/src/mumble/mumble.pro	2010-02-09 16:34:51.000000000 +0000
++++ mumble-1.2.2/src/mumble/mumble.pro	2011-01-26 01:45:55.000000000 +0000
+@@ -93,11 +93,17 @@
+ unix {
+   HAVE_PULSEAUDIO=$$system(pkg-config --modversion --silence-errors libpulse)
+   HAVE_PORTAUDIO=$$system(pkg-config --modversion --silence-errors portaudio-2.0)
++  HAVE_JACKAUDIO=$$system(pkg-config --modversion --silence-errors jack)
+ 
+   !isEmpty(HAVE_PORTAUDIO):!CONFIG(no-portaudio) {
+     CONFIG *= portaudio
+   }
+ 
++  !isEmpty(HAVE_JACKAUDIO):!CONFIG(no-jackaudio) {
++    CONFIG -= portaudio
++    CONFIG *= jackaudio
++  }
++
+   !isEmpty(HAVE_PULSEAUDIO):!CONFIG(no-pulseaudio) {
+     CONFIG -= portaudio
+     CONFIG *= pulseaudio
+@@ -110,6 +116,13 @@
+     QMAKE_CXXFLAGS_DEBUG *= -I../../speex/include -I../../speexbuild
+   }
+ 
++  jackaudio {
++        DEFINES *= USE_JACKAUDIO
++        PKGCONFIG *= jack
++        HEADERS *= JackAudio.h
++        SOURCES *= JackAudio.cpp
++  }
++
+   CONFIG *= link_pkgconfig
+ 
+   PKGCONFIG *= openssl sndfile
diff --git a/pkgs/applications/networking/newsreaders/pan/default.nix b/pkgs/applications/networking/newsreaders/pan/default.nix
index 299accef4e5d..7c7449dd5025 100644
--- a/pkgs/applications/networking/newsreaders/pan/default.nix
+++ b/pkgs/applications/networking/newsreaders/pan/default.nix
@@ -1,29 +1,25 @@
 { spellChecking ? true
 , stdenv, fetchurl, pkgconfig, gtk, gtkspell ? null
-, perl, pcre, gmime, gettext
+, perl, pcre, gmime, gettext, intltool
 }:
 
 assert spellChecking -> gtkspell != null;
 
+let version = "0.135"; in
+
 stdenv.mkDerivation {
-  name = "pan-0.133";
+  name = "pan-${version}";
 
   src = fetchurl {
-    url = http://pan.rebelbase.com/download/releases/0.133/source/pan-0.133.tar.bz2;
-    sha1 = "a0bd98ea1ba174800896611e3305a6b6d8dbde2f";
+    url = "http://pan.rebelbase.com/download/releases/${version}/source/pan-${version}.tar.bz2";
+    sha1 = "6cd93facf86615761279113badd7462e59399ae4";
   };
 
-  patches =
-    [ # Build on GCC 4.4.
-      (fetchurl {
-        url = "http://sources.gentoo.org/viewcvs.py/*checkout*/gentoo-x86/net-nntp/pan/files/pan-0.133-gcc44.patch?rev=1.1";
-        sha256 = "05xmgvcpl1gjcfab8xsdy400p55j59hp52fwa4qbwlqy3c35qv1v";
-      })
-    ];
-
-  buildInputs = [pkgconfig gtk perl pcre gmime gettext]
+  buildInputs = [ pkgconfig gtk perl gmime gettext intltool ]
     ++ stdenv.lib.optional spellChecking gtkspell;
 
+  enableParallelBuilding = true;
+
   meta = {
     description = "A GTK+-based Usenet newsreader good at both text and binaries";
     homepage = http://pan.rebelbase.com/;
diff --git a/pkgs/applications/networking/offrss/default.nix b/pkgs/applications/networking/offrss/default.nix
new file mode 100644
index 000000000000..9784d3692710
--- /dev/null
+++ b/pkgs/applications/networking/offrss/default.nix
@@ -0,0 +1,29 @@
+{stdenv, fetchurl, curl, libmrss}:
+
+stdenv.mkDerivation {
+  name = "offrss-1.1";
+
+  installPhase = ''
+    ensureDir $out/bin
+    cp offrss $out/bin
+  '';
+
+  crossAttrs = {
+    makeFlags = "CC=${stdenv.cross.config}-gcc";
+  };
+
+  buildInputs = [ curl libmrss ];
+
+  src = fetchurl {
+    url = http://vicerveza.homeunix.net/~viric/soft/offrss/offrss-1.1.tar.gz;
+    sha256 = "1l8c5sw368zbrcfq4wf963fbh29q9lqgsn0lbsiwz3vpybc8plp2";
+  };
+
+  meta = {
+    homepage = "http://vicerveza.homeunix.net/~viric/cgi-bin/offrss";
+    description = "Offline RSS/Atom reader";
+    license="AGPLv3+";
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; all;
+  };
+}
diff --git a/pkgs/applications/networking/ktorrent/default.nix b/pkgs/applications/networking/p2p/ktorrent/default.nix
index c4917c2b8fb0..dfd65f8d0cc8 100644
--- a/pkgs/applications/networking/ktorrent/default.nix
+++ b/pkgs/applications/networking/p2p/ktorrent/default.nix
@@ -1,23 +1,27 @@
-{ stdenv, fetchurl, cmake, automoc4, libktorrent, taglib, kdepimlibs, boost,
-  gettext, kdebase_workspace }:
+{ stdenv, fetchurl, cmake, automoc4, libktorrent, taglib, kdepimlibs, boost
+, gettext, kdebase_workspace, qt4, kdelibs, phonon }:
 
 stdenv.mkDerivation rec {
   name = pname + "-" + version;
 
   pname = "ktorrent";
-  version = "4.0.3";
+  version = "4.1.1";
 
   src = fetchurl {
     url = "${meta.homepage}/downloads/${version}/${name}.tar.bz2";
-    sha256 = "02hp52333w75mdywgsln28samf9ybr9yldg1jsw0b93lj44pfxli";
+    sha256 = "1h0fqh344sfwfbvnwhn00k8czb14568flapjf4754zss6bxpw4g4";
   };
 
   patches = [ ./find-workspace.diff ];
 
   KDEDIRS = libktorrent;
 
-  buildInputs = [ automoc4 cmake libktorrent taglib kdepimlibs boost gettext
-    kdebase_workspace ];
+  buildInputs =
+    [ cmake qt4 kdelibs automoc4 phonon libktorrent boost taglib kdepimlibs
+      gettext kdebase_workspace
+    ];
+
+  enableParallelBuilding = true;
 
   meta = {
     description = "KDE integrated BtTorrent client";
diff --git a/pkgs/applications/networking/ktorrent/find-workspace.diff b/pkgs/applications/networking/p2p/ktorrent/find-workspace.diff
index 472ceff490e1..472ceff490e1 100644
--- a/pkgs/applications/networking/ktorrent/find-workspace.diff
+++ b/pkgs/applications/networking/p2p/ktorrent/find-workspace.diff
diff --git a/pkgs/applications/networking/p2p/mldonkey/default.nix b/pkgs/applications/networking/p2p/mldonkey/default.nix
index ecc2e5f77941..541c0e105931 100644
--- a/pkgs/applications/networking/p2p/mldonkey/default.nix
+++ b/pkgs/applications/networking/p2p/mldonkey/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl, ocaml, zlib, bzip2, ncurses, file, gd, libpng }:
 
 stdenv.mkDerivation (rec {
-  name = "mldonkey-3.0.4";
+  name = "mldonkey-3.0.7";
   
   src = fetchurl {
     url = "mirror://sourceforge/mldonkey/${name}.tar.bz2";
-    sha256 = "0wnyi2m7126dq6r5zbqplgknnypzcx0p3q2mxcdfhp94ln7vn3f6";
+    sha256 = "1m5cfx79jiym93bx789lqc1bmwrkz1b1jilhga7d994jsjcw6c2n";
   };
   
   meta = {
diff --git a/pkgs/applications/networking/p2p/retroshare/default.nix b/pkgs/applications/networking/p2p/retroshare/default.nix
new file mode 100644
index 000000000000..be9847bc51cb
--- /dev/null
+++ b/pkgs/applications/networking/p2p/retroshare/default.nix
@@ -0,0 +1,28 @@
+{stdenv, fetchurl, qt, libupnp, gpgme, gnome_keyring, glib}:
+
+throw "still fails to build"
+
+stdenv.mkDerivation {
+  name = "retroshare-0.5.1d";
+
+  src = fetchurl {
+    url = mirror://sourceforge/retroshare/RetroShare-v0.5.1d.tar.gz;
+    sha256 = "15971wxx8djwcxn170jyn0mlh7cfzqsf031aa849wr9z234gwrcn";
+  };
+
+  buildInputs = [ qt libupnp gpgme gnome_keyring glib ];
+
+  buildPhase = ''
+    cd libbitdht/src
+    qmake libbitdht.pro PREFIX=$out
+    make
+    cd ../..
+    cd libretroshare/src
+    qmake libretroshare.pro PREFIX=$out
+    make
+    cd ../../src
+    qmake libretroshare.pro PREFIX=$out
+    make
+  '';
+
+}
diff --git a/pkgs/applications/networking/p2p/transmission/default.nix b/pkgs/applications/networking/p2p/transmission/default.nix
index 6d3d501887e6..a1269b09e377 100644
--- a/pkgs/applications/networking/p2p/transmission/default.nix
+++ b/pkgs/applications/networking/p2p/transmission/default.nix
@@ -1,16 +1,21 @@
-{ stdenv, fetchurl, pkgconfig, openssl, curl, intltool, gtkClient ? true, gtk }:
+{ stdenv, fetchurl, pkgconfig, openssl, curl, intltool, libevent, gtkClient ? true, gtk }:
 
 stdenv.mkDerivation rec {
-  name = "transmission-1.93";
+  name = "transmission-2.31";
   
   src = fetchurl {
-    url = "http://mirrors.m0k.org/transmission/files/${name}.tar.bz2";
-    sha256 = "0w0nsyw10h4lm57qc09ja4iqqwvzcjldnqxi4zp0ha5dkbxv3dz9";
+    url = "http://download.transmissionbt.com/files/${name}.tar.bz2";
+    sha256 = "0z0npasbrbii5qnjyk31v0kfr04kwm57dmnl2542bpx615q212zk";
   };
   
-  buildInputs = [ pkgconfig openssl curl intltool ] ++ stdenv.lib.optional gtkClient gtk;
+  buildInputs = [ pkgconfig openssl curl intltool libevent ] ++
+                stdenv.lib.optional gtkClient gtk;
   
   configureFlags = if gtkClient then "--enable-gtk" else "--disable-gtk";
+
+  postInstall = ''
+    rm $out/share/icons/hicolor/icon-theme.cache
+  '';
   
   meta = {
     description = "A fast, easy and free BitTorrent client";
diff --git a/pkgs/applications/networking/p2p/tribler/default.nix b/pkgs/applications/networking/p2p/tribler/default.nix
new file mode 100644
index 000000000000..89c28ae3512f
--- /dev/null
+++ b/pkgs/applications/networking/p2p/tribler/default.nix
@@ -0,0 +1,43 @@
+{ stdenv, fetchsvn, pythonPackages, makeWrapper, nettools }:
+
+stdenv.mkDerivation {
+  name = "tribler-5.3.9-pre21071";
+
+  src = fetchsvn {
+    url = http://svn.tribler.org/abc/branches/release-5.3.x;
+    rev = 21071;
+    sha256 = "0plzw5m9rligz66rbq8qr9sj0fiqx8gwmchdw3p4mwlwfx72gixm";
+  };
+
+  buildInputs = [ pythonPackages.python pythonPackages.wrapPython makeWrapper ];
+
+  pythonPath =
+    [ pythonPackages.wxPython pythonPackages.ssl pythonPackages.curses pythonPackages.apsw
+      pythonPackages.setuptools pythonPackages.m2crypto pythonPackages.sqlite3
+    ];
+
+  installPhase =
+    ''
+      substituteInPlace Tribler/Core/NATFirewall/guessip.py \
+          --replace /bin/netstat ${nettools}/bin/netstat \
+          --replace /sbin/ifconfig ${nettools}/sbin/ifconfig
+    
+      # Nasty hack; call wrapPythonPrograms to set program_PYTHONPATH.
+      wrapPythonPrograms
+      
+      mkdir -p $out/share/tribler
+      cp -prvd Tribler $out/share/tribler/
+
+      makeWrapper ${pythonPackages.python}/bin/python $out/bin/tribler \
+          --set _TRIBLERPATH $out/share/tribler \
+          --set PYTHONPATH $out/share/tribler:$program_PYTHONPATH \
+          --run 'cd $_TRIBLERPATH' \
+          --add-flags $out/share/tribler/Tribler/Main/tribler.py
+    '';
+
+  meta = {
+    homepage = http://www.tribler.org/;
+    description = "A completely decentralised P2P filesharing client based on the Bittorrent protocol";
+    license = "LGPLv2.1";
+  };
+}
diff --git a/pkgs/applications/networking/pjsip/default.nix b/pkgs/applications/networking/pjsip/default.nix
new file mode 100644
index 000000000000..14bc1ead49b2
--- /dev/null
+++ b/pkgs/applications/networking/pjsip/default.nix
@@ -0,0 +1,30 @@
+{stdenv, fetchurl, openssl, libsamplerate}:
+
+stdenv.mkDerivation rec {
+  name = "pjsip-1.8.10";
+
+  src = fetchurl {
+    url = http://www.pjsip.org/release/1.8.10/pjproject-1.8.10.tar.bz2;
+    sha256 = "1v2mgbgzn7d3msb406jmg69ms97a0rqg58asykx71dmjipbaiqc0";
+  };
+
+  buildInputs = [ openssl libsamplerate ];
+
+  postInstall = ''
+    ensureDir $out/bin
+    cp pjsip-apps/bin/pjsua-* $out/bin/pjsua
+    ensureDir $out/share/${name}/samples
+    cp pjsip-apps/bin/samples/*/* $out/share/${name}/samples
+  '';
+
+  # We need the libgcc_s.so.1 loadable (for pthread_cancel to work)
+  dontPatchELF = true;
+
+  meta = {
+    description = "SIP stack and media stack for presence, im, and multimedia communication";
+    homepage = http://pjsip.org/;
+    license = "GPLv2+";
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/applications/networking/remote/rdesktop/default.nix b/pkgs/applications/networking/remote/rdesktop/default.nix
index 24e18a75cc97..cceb70b74fbf 100644
--- a/pkgs/applications/networking/remote/rdesktop/default.nix
+++ b/pkgs/applications/networking/remote/rdesktop/default.nix
@@ -2,12 +2,12 @@
 
 stdenv.mkDerivation (rec {
   pname = "rdesktop";
-  version = "1.6.0";
+  version = "1.7.0";
   name = "${pname}-${version}";
 
   src = fetchurl {
     url = "mirror://sourceforge/${pname}/${name}.tar.gz";
-    sha256 = "0y890s5rv47ipcijcrmcy9988br22ipr4c1ppb88pjhlism6w0im";
+    sha256 = "0x2hnzvm0smnanin28n4mvzx9chpj2qnjfrxy307x21mgw6l5q1v";
   };
 
   buildInputs = [openssl libX11];
diff --git a/pkgs/applications/networking/siproxd/default.nix b/pkgs/applications/networking/siproxd/default.nix
new file mode 100644
index 000000000000..3395ba6947aa
--- /dev/null
+++ b/pkgs/applications/networking/siproxd/default.nix
@@ -0,0 +1,19 @@
+{ stdenv, fetchurl, libosip }:
+
+stdenv.mkDerivation {
+  name = "siproxd-0.8.0";
+  
+  src = fetchurl {
+    url = mirror://sourceforge/siproxd/siproxd-0.8.0.tar.gz;
+    sha256 = "0hl51z33cf68ki707jkrrjjc3a5vpaf49gbrsz3g4rfxypdhc0qs";
+  };
+
+  buildInputs = [ libosip ];
+
+  meta = {
+    homepage = http://siproxd.sourceforge.net/;
+    description = "A masquerading SIP Proxy Server";
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; linux;
+  };
+}
diff --git a/pkgs/applications/networking/skype/default.nix b/pkgs/applications/networking/skype/default.nix
index 7e066b5e380c..98cbfdb7c57d 100644
--- a/pkgs/applications/networking/skype/default.nix
+++ b/pkgs/applications/networking/skype/default.nix
@@ -1,18 +1,20 @@
-{stdenv, fetchurl, alsaLib, libXv, libXi, libXrender, libXrandr, zlib, glib
-, libXext, libX11, libXScrnSaver, libSM, qt4, libICE, freetype, fontconfig}:
+{ stdenv, fetchurl, alsaLib, libXv, libXi, libXrender, libXrandr, zlib, glib
+, libXext, libX11, libXScrnSaver, libSM, qt4, libICE, freetype, fontconfig
+, pulseaudio }:
 
 assert stdenv.system == "i686-linux";
 
 stdenv.mkDerivation rec {
-  name = "skype-2.1.0.81";
+  name = "skype-2.2.0.35";
 
   src = fetchurl {
     url = "http://download.skype.com/linux/${name}.tar.bz2";
-    sha256 = "1x18m4900c0ssaq95wv8mhhgwvw9fh66dszx7zq24zgvb2v1h4jz";
+    sha256 = "157ba3ci12bq0nv2m8wlsab45ib5sccqagyna8nixnhqw9q72sxm";
   };
 
   buildInputs = [
-    alsaLib 
+    alsaLib
+    pulseaudio
     stdenv.glibc 
     stdenv.gcc.gcc
     libXv
diff --git a/pkgs/applications/networking/sync/akunambol/default.nix b/pkgs/applications/networking/sync/akunambol/default.nix
new file mode 100644
index 000000000000..c27d8787bee6
--- /dev/null
+++ b/pkgs/applications/networking/sync/akunambol/default.nix
@@ -0,0 +1,16 @@
+{ stdenv, fetchgit, cmake, kdelibs, kdepimlibs, automoc4, funambol,liblikeback }:
+
+stdenv.mkDerivation rec {
+  name = "akunambol-20110304";
+
+  src = fetchgit {
+    url = git://anongit.kde.org/akunambol.git;
+    rev = "1d832bbbce84f474e3f1e5d2f9fa8a4079b0c8e5";
+    sha256 = "1d2x42lbw32qyawri7z0mrbafz36r035w5bxjpq51awyqjwkbb2d";
+  };
+
+  buildInputs = [ cmake automoc4 kdelibs kdepimlibs funambol liblikeback ];
+  KDEDIRS = liblikeback;
+
+  patches = [ ./non-latin.diff ];
+}
diff --git a/pkgs/applications/networking/sync/akunambol/non-latin.diff b/pkgs/applications/networking/sync/akunambol/non-latin.diff
new file mode 100644
index 000000000000..905a6a894bdf
--- /dev/null
+++ b/pkgs/applications/networking/sync/akunambol/non-latin.diff
@@ -0,0 +1,17 @@
+diff --git a/qtgui/standardsourcesettings.cpp b/qtgui/standardsourcesettings.cpp
+index a14a737..5d4712e 100644
+--- a/qtgui/standardsourcesettings.cpp
++++ b/qtgui/standardsourcesettings.cpp
+@@ -83,9 +83,9 @@ void StandardSourceSettings::populateCollections()
+     foreach( const Collection &collection, colls ) {
+         if (collection.contentMimeTypes().contains(source->getAkonadiMimeType())) {
+             i++;
+-            const char* dn = collection.name().toUtf8();
+-            LOG.debug("Adding collection id %lld named %s", collection.id(), dn);
+-            collections->addItem(dn);
++            LOG.debug("Adding collection id %lld named %s", collection.id(),
++                      collection.name().toLocal8Bit().data());
++            collections->addItem(collection.name());
+             idList.append(collection.id());
+         }
+     }
diff --git a/pkgs/applications/networking/sync/unison/default.nix b/pkgs/applications/networking/sync/unison/default.nix
index 7738ce43f99c..06bab807ebdd 100644
--- a/pkgs/applications/networking/sync/unison/default.nix
+++ b/pkgs/applications/networking/sync/unison/default.nix
@@ -1,26 +1,36 @@
-{stdenv, fetchurl, ocaml, lablgtk, fontschumachermisc, xset, makeWrapper}:
+{stdenv, fetchurl, ocaml, lablgtk, fontschumachermisc, xset, makeWrapper, ncurses
+, enableX11 ? true}:
 
+let
+  nativeCode = if stdenv.system == "armv5tel-linux" then false else true;
+in
 stdenv.mkDerivation (rec {
 
-  name = "unison-2.32.52";
+  name = "unison-2.40.63";
   src = fetchurl {
     url = "http://www.seas.upenn.edu/~bcpierce/unison/download/releases/${name}/${name}.tar.gz";
-    sha256 = "11844yh1gpjjapn8pvc14hla7g70spwqy6h61qk2is83mpafahhm";
+    sha256 = "17fd2bg5jxwbib87j6j2bjpwdm66whqm1fq46v70hfby79j00vkf";
   };
 
-  buildInputs = [ocaml makeWrapper];
+  buildInputs = [ ocaml makeWrapper ncurses ];
+
+  preBuild = if enableX11 then ''
+    sed -i "s|\(OCAMLOPT=.*\)$|\1 -I $(echo "${lablgtk}"/lib/ocaml/*/site-lib/lablgtk2)|" Makefile.OCaml
+  '' else "";
+
+  makeFlags = "INSTALLDIR=$(out)/bin/" + (if enableX11 then " UISTYLE=gtk2" else "")
+    + (if ! nativeCode then " NATIVE=false" else "");
 
-  preBuild = ''
-    sed -i "s|\(OCAMLOPT=.*\)$|\1 -I ${lablgtk}/lib/ocaml/lablgtk2|" Makefile.OCaml
-  '';
-  makeFlags = "UISTYLE=gtk2 INSTALLDIR=$(out)/bin/";
   preInstall = "ensureDir $out/bin";
-  postInstall = ''
+
+  postInstall = if enableX11 then ''
     for i in $(cd $out/bin && ls); do
       wrapProgram $out/bin/$i \
         --run "[ -n \"\$DISPLAY\" ] && (${xset}/bin/xset q | grep -q \"${fontschumachermisc}\" || ${xset}/bin/xset +fp \"${fontschumachermisc}/lib/X11/fonts/misc\")"
     done
-  '';
+  '' else "";
+
+  dontStrip = if ! nativeCode then true else false;
 
   meta = {
     homepage = http://www.cis.upenn.edu/~bcpierce/unison/;
diff --git a/pkgs/applications/office/abiword/default.nix b/pkgs/applications/office/abiword/default.nix
index 6e3d57b78a8b..fdfd60e98370 100644
--- a/pkgs/applications/office/abiword/default.nix
+++ b/pkgs/applications/office/abiword/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, pkgconfig, gtk, libglade, libgnomecanvas, fribidi
-, libpng, popt, libgsf, enchant, wv, librsvg, bzip2
+, libpng, popt, libgsf, enchant, wv, librsvg, bzip2, libjpeg
 }:
 
 stdenv.mkDerivation {
@@ -12,6 +12,6 @@ stdenv.mkDerivation {
 
   buildInputs =
     [ pkgconfig gtk libglade librsvg bzip2 libgnomecanvas fribidi libpng popt
-      libgsf enchant wv
+      libgsf enchant wv libjpeg
     ];
 }
diff --git a/pkgs/applications/office/gnucash/default.nix b/pkgs/applications/office/gnucash/default.nix
index 213e3fd0a457..3e20a350a791 100644
--- a/pkgs/applications/office/gnucash/default.nix
+++ b/pkgs/applications/office/gnucash/default.nix
@@ -1,39 +1,55 @@
-{ fetchurl, stdenv, pkgconfig, libxml2, gconf, glib, gtk
-, libglade, libgnomeui, libgtkhtml, gtkhtml, libgnomeprint, goffice, enchant
-, gettext, intltool, perl, guile, slibGuile, swig, isocodes, bzip2
-, makeWrapper }:
+{ fetchurl, stdenv, pkgconfig, libxml2, gconf, glib, gtk, libgnomeui, libofx
+, libgtkhtml, gtkhtml, libgnomeprint, goffice, enchant, gettext, libbonoboui
+, intltool, perl, guile, slibGuile, swig, isocodes, bzip2, makeWrapper
+}:
 
-stdenv.mkDerivation rec {
-  name = "gnucash-2.2.9";
+/* If you experience GConf errors when running GnuCash on NixOS, see
+ * http://wiki.nixos.org/wiki/Solve_GConf_errors_when_running_GNOME_applications
+ * for a possible solution.
+ */
+
+let
+  name = "gnucash-2.4.7";
+in
+stdenv.mkDerivation {
+  inherit name;
 
   src = fetchurl {
-    url = "http://ftp.at.gnucash.org/pub/gnucash/gnucash/sources/stable/${name}.tar.bz2";
-    sha256 = "0sj83mmshx50122n1i3y782p4b54k37n7sb4vldmqmhwww32925i";
+    url = "mirror://sourceforge/gnucash/${name}.tar.bz2";
+    sha256 = "eeb3b17f9081a544f8705db735df88ab3f468642a1d01552ea4e36bcb5b0730e";
   };
 
   buildInputs = [
-    pkgconfig libxml2 gconf glib gtk
-    libglade libgnomeui libgtkhtml gtkhtml libgnomeprint goffice enchant
-    gettext intltool perl guile slibGuile swig isocodes bzip2 makeWrapper
+    pkgconfig libxml2 gconf glib gtk libgnomeui libgtkhtml gtkhtml
+    libgnomeprint goffice enchant gettext intltool perl guile slibGuile
+    swig isocodes bzip2 makeWrapper libofx
   ];
 
-  preConfigure = ''
-    # The `.gnucash' directory, used by the test suite.
-    export GNC_DOT_DIR="$PWD/dot-gnucash"
-    echo "\$GNC_DOT_DIR set to \`$GNC_DOT_DIR'"
-  '';
+  configureFlags = "CFLAGS=-O3 CXXFLAGS=-O3 --disable-dbi --enable-ofx";
 
   postInstall = ''
+    sed -i $out/bin/update-gnucash-gconf                                \
+       -e 's|--config-source=[^ ]* --install-schema-file|--makefile-install-rule|'
     for prog in "$out/bin/"*
     do
-      wrapProgram "$prog"                                       \
-        --set SCHEME_LIBRARY_PATH "$SCHEME_LIBRARY_PATH"        \
-        --prefix GUILE_LOAD_PATH ":" "$GUILE_LOAD_PATH"
+      wrapProgram "$prog"                                               \
+        --set SCHEME_LIBRARY_PATH "$SCHEME_LIBRARY_PATH"                \
+        --prefix GUILE_LOAD_PATH ":" "$GUILE_LOAD_PATH"                 \
+        --prefix LD_LIBRARY_PATH ":" "${libgnomeui}/lib/libglade/2.0"   \
+        --prefix LD_LIBRARY_PATH ":" "${libbonoboui}/lib/libglade/2.0"  \
+        --set GCONF_CONFIG_SOURCE 'xml::~/.gconf'                       \
+        --prefix PATH ":" "${gconf}/bin"                                \
+        --suffix PATH ":" "$out/bin"
     done
   '';
 
+  # The following settings fix failures in the test suite. It's not required otherwise.
+  NIX_LDFLAGS = "-rpath=${guile}/lib";
+  preCheck = "export GNC_DOT_DIR=$PWD/dot-gnucash";
   doCheck = true;
 
+  enableParallelBuilding = true;
+
   meta = {
     description = "GnuCash, a personal and small-business financial-accounting application";
 
@@ -52,7 +68,7 @@ stdenv.mkDerivation rec {
 
     homepage = http://www.gnucash.org/;
 
-    maintainers = [ stdenv.lib.maintainers.ludo ];
+    maintainers = [ stdenv.lib.maintainers.ludo stdenv.lib.maintainers.simons ];
     platforms = stdenv.lib.platforms.gnu;
   };
 }
diff --git a/pkgs/applications/office/hledger-interest/default.nix b/pkgs/applications/office/hledger-interest/default.nix
new file mode 100644
index 000000000000..aea3a1f6aa1e
--- /dev/null
+++ b/pkgs/applications/office/hledger-interest/default.nix
@@ -0,0 +1,20 @@
+{ cabal, hledgerLib, mtl, time }:
+
+cabal.mkDerivation (self: {
+  pname = "hledger-interest";
+  version = "1.2";
+  sha256 = "1r5x6z0k33fpvqba6zlkhpm7b0rwwnli4q100psms89x0rrj7y2d";
+  isLibrary = false;
+  isExecutable = true;
+  buildDepends = [ hledgerLib mtl time ];
+  meta = {
+    homepage = "http://github.com/peti/hledger-interest";
+    description = "computes interest for a given account";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [
+      self.stdenv.lib.maintainers.andres
+      self.stdenv.lib.maintainers.simons
+    ];
+  };
+})
diff --git a/pkgs/applications/office/homebank/default.nix b/pkgs/applications/office/homebank/default.nix
index cfea3a2cb4e6..2994ba729e6a 100644
--- a/pkgs/applications/office/homebank/default.nix
+++ b/pkgs/applications/office/homebank/default.nix
@@ -2,7 +2,7 @@
 
 let
    download_root = "http://homebank.free.fr/public/";
-   name = "homebank-4.3";
+   name = "homebank-4.4";
    lastrelease = download_root + name + ".tar.gz";
    oldrelease = download_root + "old/" + name + ".tar.gz";
 in
@@ -12,7 +12,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     urls = [ lastrelease oldrelease ];
-    sha256 = "1r4bvyc2wnizjjc27hap6b4b01zjfp1x0rygylvi5n29jy6r2fn6";
+    sha256 = "1lp7vhimn7aa2b4ik857w7d7rbbqcwlsffk8s8lw4fjyaxrr7f0k";
   };
 
   buildInputs = [ pkgconfig gtk libofx intltool ];
diff --git a/pkgs/applications/office/keepnote/default.nix b/pkgs/applications/office/keepnote/default.nix
index dc7946d1e82e..514b8fd3151e 100644
--- a/pkgs/applications/office/keepnote/default.nix
+++ b/pkgs/applications/office/keepnote/default.nix
@@ -1,14 +1,15 @@
-{stdenv, fetchurl, buildPythonPackage, pygtk}:
+{ stdenv, fetchurl, buildPythonPackage, pythonPackages, pygtk }:
 
 buildPythonPackage {
   name = "keepnote-0.6.5";
+  namePrefix = "";
 
   src = fetchurl {
     url = http://rasm.ods.org/keepnote/download/keepnote-0.6.5.tar.gz;
     sha256 = "0kipcy90r50z4m9p8pyy9wi4dknsiwdrgy974xgakris2rh4lafw";
   };
 
-  propagatedBuildInputs = [ pygtk ];
+  propagatedBuildInputs = [ pythonPackages.sqlite3 pygtk ];
 
   # Testing fails.
   doCheck = false;
diff --git a/pkgs/applications/office/koffice/default.nix b/pkgs/applications/office/koffice/default.nix
index 4679c231e162..784b60070352 100644
--- a/pkgs/applications/office/koffice/default.nix
+++ b/pkgs/applications/office/koffice/default.nix
@@ -25,6 +25,7 @@ stdenv.mkDerivation rec {
         sha256 = "11h4rxdrv5vakym5786vr4bysi4627m53qqvk1vhxf3rkawvcafj";
       })
       ./wpd.patch
+      ./krita-exiv-0.21.diff
     ];
 
   buildInputs = [ cmake qt4 perl lcms exiv2 libxml2 libxslt boost glew
diff --git a/pkgs/applications/office/koffice/krita-exiv-0.21.diff b/pkgs/applications/office/koffice/krita-exiv-0.21.diff
new file mode 100644
index 000000000000..b8da1bd586c7
--- /dev/null
+++ b/pkgs/applications/office/koffice/krita-exiv-0.21.diff
@@ -0,0 +1,81 @@
+commit 7f6b2f2b9b2be1e4f257582a04b194c69f705bc7
+Author: Casper Boemann <cbr@boemann.dk>
+Date:   Sat Dec 4 10:44:02 2010 +0000
+
+    ------------------------------------------------------------------------
+    r1203267 | rempt | 2010-12-03 14:20:03 +0100 (Fri, 03 Dec 2010) | 1 line
+    Changed paths:
+       M /trunk/koffice/krita/ui/kis_aboutdata.h
+    
+    correct url for animtim
+    
+    ------------------------------------------------------------------------
+    r1203281 | uzak | 2010-12-03 14:43:32 +0100 (Fri, 03 Dec 2010) | 2 lines
+    Changed paths:
+       M /trunk/koffice/filters/kpresenter/powerpoint/pptstyle.cpp
+    
+    PPT: Fine tuned processing of the TextCFException structure for MS Office 2007.
+    
+    
+    ------------------------------------------------------------------------
+    r1203296 | danders | 2010-12-03 15:44:01 +0100 (Fri, 03 Dec 2010) | 3 lines
+    Changed paths:
+       M /trunk/koffice/kplato/libs/kernel/kptaccount.cpp
+    
+    Fix data loss on xml load.
+    BUG: 258685
+    
+    
+    ------------------------------------------------------------------------
+    r1203344 | bero | 2010-12-03 18:08:24 +0100 (Fri, 03 Dec 2010) | 2 lines
+    Changed paths:
+       M /trunk/koffice/krita/ui/kisexiv2/kis_exif_io.cpp
+    
+    Fix build with exiv2 0.21
+    
+    
+    
+    svn path=/branches/work/koffice-essen/; revision=1203491
+
+diff krita/ui/kisexiv2/kis_exif_io.cpp krita/ui/kisexiv2/kis_exif_io.cpp
+index 6eb7f30..c85da65 100644
+--- krita/ui/kisexiv2/kis_exif_io.cpp
++++ krita/ui/kisexiv2/kis_exif_io.cpp
+@@ -406,7 +406,11 @@ bool KisExifIO::saveTo(KisMetaData::Store* store, QIODevice* ioDevice, HeaderTyp
+                 v = kmdIntOrderedArrayToExifArray(entry.value());
+             } else if (exivKey == "Exif.Image.Artist") { // load as dc:creator
+                 KisMetaData::Value creator = entry.value().asArray()[0];
++#if EXIV2_MAJOR_VERSION == 0 && EXIV2_MINOR_VERSION <= 20
+                 v = kmdValueToExivValue(creator, Exiv2::ExifTags::tagType(exifKey.tag(), exifKey.ifdId()));
++#else
++                v = kmdValueToExivValue(creator, exifKey.defaultTypeId());
++#endif
+             } else if (exivKey == "Exif.Photo.OECF") {
+                 v = kmdOECFStructureToExifOECF(entry.value());
+             } else if (exivKey == "Exif.Photo.DeviceSettingDescription") {
+@@ -419,13 +423,25 @@ bool KisExifIO::saveTo(KisMetaData::Store* store, QIODevice* ioDevice, HeaderTyp
+                 Q_ASSERT(entry.value().type() == KisMetaData::Value::LangArray);
+                 QMap<QString, KisMetaData::Value> langArr = entry.value().asLangArray();
+                 if (langArr.contains("x-default")) {
++#if EXIV2_MAJOR_VERSION == 0 && EXIV2_MINOR_VERSION <= 20
+                     v = kmdValueToExivValue(langArr.value("x-default"), Exiv2::ExifTags::tagType(exifKey.tag(), exifKey.ifdId()));
++#else
++                    v = kmdValueToExivValue(langArr.value("x-default"), exifKey.defaultTypeId());
++#endif
+                 } else if (langArr.size() > 0) {
++#if EXIV2_MAJOR_VERSION == 0 && EXIV2_MINOR_VERSION <= 20
+                     v = kmdValueToExivValue(langArr.begin().value(), Exiv2::ExifTags::tagType(exifKey.tag(), exifKey.ifdId()));
++#else
++                    v = kmdValueToExivValue(langArr.begin().value(), exifKey.defaultTypeId());
++#endif
+                 }
+             } else {
+                 dbgFile << exifKey.tag();
++#if EXIV2_MAJOR_VERSION == 0 && EXIV2_MINOR_VERSION <= 20
+                 v = kmdValueToExivValue(entry.value(), Exiv2::ExifTags::tagType(exifKey.tag(), exifKey.ifdId()));
++#else
++                v = kmdValueToExivValue(entry.value(), exifKey.defaultTypeId());
++#endif
+             }
+             if (v && v->typeId() != Exiv2::invalidTypeId) {
+                 dbgFile << "Saving key" << exivKey; // << " of KMD value" << entry.value();
diff --git a/pkgs/applications/office/ledger/3.0.nix b/pkgs/applications/office/ledger/3.0.nix
new file mode 100644
index 000000000000..6c3a46943953
--- /dev/null
+++ b/pkgs/applications/office/ledger/3.0.nix
@@ -0,0 +1,45 @@
+{ stdenv, fetchgit, python, autoconf, automake, libtool, gettext, emacs, gmp
+, pcre, expat, boost, mpfr, git, texinfo }:
+
+let
+  rev = "cf35984971341b8a8688";
+in
+stdenv.mkDerivation {
+  name = "ledger3-${rev}";
+
+  src = fetchgit {
+    url = "git://github.com/jwiegley/ledger.git";
+    inherit rev;
+    sha256 = "4078983db9fc8d232fa71a31b47e505c531971b4515d6ef723e7d333a2352d2a";
+  };
+
+  buildInputs = [
+    python autoconf automake libtool gettext emacs gmp pcre expat boost mpfr
+    git texinfo
+  ];
+
+  buildPhase = ''
+    sed -i acprep \
+      -e 's|search_prefixes = .*|search_prefixes = ["${boost}"]|'
+    export MAKEFLAGS="-j$NIX_BUILD_CORES -l$NIX_BUILD_CORES"
+    python acprep update --no-pch --prefix=$out
+  '';
+
+  doCheck = true;
+
+  meta = {
+    homepage = "http://ledger-cli.org/";
+    description = "A double-entry accounting system with a command-line reporting interface";
+    license = "BSD";
+
+    longDescription = ''
+      Ledger is a powerful, double-entry accounting system that is accessed
+      from the UNIX command-line. This may put off some users, as there is
+      no flashy UI, but for those who want unparalleled reporting access to
+      their data, there really is no alternative.
+    '';
+
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.simons ];
+  };
+}
diff --git a/pkgs/applications/office/ledger/default.nix b/pkgs/applications/office/ledger/default.nix
index 14121e6281f4..1bc8e586e33f 100644
--- a/pkgs/applications/office/ledger/default.nix
+++ b/pkgs/applications/office/ledger/default.nix
@@ -1,48 +1,53 @@
-# TODO: fix a problem with patchelf(?)
-
-{stdenv, fetchurl, emacs, gmp, pcre}:
+# Patchelf fails to hard-code the library paths to ledger's
+# libamounts.so and libledger-2.6.3 shared objects:
+#
+# $ ldd ~/.nix-profile/bin/ledger
+#         linux-vdso.so.1 =>  (0x00007fff513ff000)
+#         libamounts.so.0 => not found
+#         libledger-2.6.3.so => not found
+#         libstdc++.so.6 => /nix/store/3r8kfi33y3lbrsvlx8vzwm74h8178y35-gcc-4.5.1/lib/../lib64/libstdc++.so.6 (0x00007f1f0feee000)
+#         libpcre.so.0 => /nix/store/kfhy189arpj3wrfzpgw8p9ac4g4hfgca-pcre-8.10/lib/libpcre.so.0 (0x00007f1f0fcd3000)
+#         libgmp.so.3 => /nix/store/ji6py9m9w2ray1bmpkmgig9llj1i2ggf-gmp-4.3.2/lib/libgmp.so.3 (0x00007f1f0fa7f000)
+#         libm.so.6 => /nix/store/vxycd107wjbhcj720hzkw2px7s7kr724-glibc-2.12.2/lib/libm.so.6 (0x00007f1f0f7fd000)
+#         libgcc_s.so.1 => /nix/store/3r8kfi33y3lbrsvlx8vzwm74h8178y35-gcc-4.5.1/lib/../lib64/libgcc_s.so.1 (0x00007f1f0f5e8000)
+#         libc.so.6 => /nix/store/vxycd107wjbhcj720hzkw2px7s7kr724-glibc-2.12.2/lib/libc.so.6 (0x00007f1f0f27d000)
+#         /nix/store/vxycd107wjbhcj720hzkw2px7s7kr724-glibc-2.12.2/lib/ld-linux-x86-64.so.2 (0x00007f1f101ef000)
+#
+# Fortunately, libtools builds the program with proper paths hard-coded
+# alread, so we don't need patchelf. Phew!
+
+{stdenv, fetchurl, emacs, gmp, pcre, expat}:
 
 let
-
-  pname = "ledger";
-  version = "2.6.1";
-  name = "${pname}-${version}";
-
+  name = "ledger-2.6.3";
 in
-
 stdenv.mkDerivation {
   inherit name;
 
   src = fetchurl {
-    url = "mirror://sourceforge/${pname}/${name}.tar.gz";
-    sha256 = "96830d77d3aa6bf6c5778f5dd52169f9b5203fb7daad0e12831abeb35b14f27a";
+    url = "https://github.com/downloads/jwiegley/ledger/${name}.tar.gz";
+    sha256 = "05zpnypcwgck7lwk00pbdlcwa347xsqifxh4zsbbn01m98bx1v5k";
   };
 
-  buildInputs = [ emacs gmp pcre ];
-
-  patches = [ ./const.patch ];
+  buildInputs = [ emacs gmp pcre expat ];
 
-  # Something goes wrong with pathelf...
-  # this is a small workaround: adds a small shell script for
-  # setting LD_LIBRARY_PATH
-  postInstall = ''
-    cd $out/bin
-    mv ledger ledger.bin
-    echo "#!/bin/sh" > ledger
-    echo "LD_LIBRARY_PATH=$out/lib $out/bin/ledger.bin "'"$@"' >> ledger
-    chmod +x ledger
-  '';
+  configureFlags = "CPPFLAGS=-DNDEBUG CFLAGS=-O3 CXXFLAGS=-O3";
+  dontPatchELF = true;
+  doCheck = true;
 
   meta = {
-    description =
-     "A double-entry accounting system with a command-line reporting interface";
+    homepage = "http://ledger-cli.org/";
+    description = "A double-entry accounting system with a command-line reporting interface";
+    license = "BSD";
+
     longDescription = ''
       Ledger is a powerful, double-entry accounting system that is accessed
       from the UNIX command-line. This may put off some users, as there is
       no flashy UI, but for those who want unparalleled reporting access to
       their data, there really is no alternative.
     '';
-    homepage = http://wiki.github.com/jwiegley/ledger;
-    license = "BSD";
+
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ stdenv.lib.maintainers.simons ];
   };
 }
diff --git a/pkgs/applications/office/openoffice/default.nix b/pkgs/applications/office/openoffice/default.nix
index 7c27bef0e451..5bc5cbf8c9b3 100644
--- a/pkgs/applications/office/openoffice/default.nix
+++ b/pkgs/applications/office/openoffice/default.nix
@@ -7,6 +7,7 @@
 }:
 
 let version = "3.2.1"; in
+
 stdenv.mkDerivation rec {
   name = "openoffice.org-${version}";
   builder = ./builder.sh;
@@ -19,7 +20,7 @@ stdenv.mkDerivation rec {
       sha256 = "0gj2hinhnzkazh44k1an05x5cj7n6721f2grqrkjh31cm38r9p6i";
     };
 
-  patches = [ ./oo.patch  ./root-required.patch ];
+  patches = [ ./oo.patch ./root-required.patch ./xlib.patch ];
 
   postPatch =
     /* Compiling with GCC 4.5 fails:
diff --git a/pkgs/applications/office/openoffice/go-oo.nix b/pkgs/applications/office/openoffice/go-oo.nix
index 35e39ff1cc79..241c2ff2a130 100644
--- a/pkgs/applications/office/openoffice/go-oo.nix
+++ b/pkgs/applications/office/openoffice/go-oo.nix
@@ -46,6 +46,7 @@ stdenv.mkDerivation rec {
     done
     sed '/-x $WGET/d' -i download
     ./download
+
     # Needed to find genccode
     PATH=$PATH:${icu}/sbin
 
@@ -53,6 +54,9 @@ stdenv.mkDerivation rec {
 
     set -x
     pushd build/${tag}
+
+    patch -p1 < ${./xlib.patch}
+
     # Fix svtools: hardcoded jpeg path
     sed -i -e 's,^JPEG3RDLIB=.*,JPEG3RDLIB=${libjpeg}/lib/libjpeg.so,' solenv/inc/libs.mk
     # Fix sysui: wants to create a tar for root
@@ -64,6 +68,7 @@ stdenv.mkDerivation rec {
     # Fix redland: wants to set rpath to /usr/local/lib
     sed -i -e 's,^CONFIGURE_FLAGS.*,& --prefix='$TMPDIR, redland/redland/makefile.mk \
       redland/raptor/makefile.mk redland/rasqal/makefile.mk
+
     popd
 
     set +x
diff --git a/pkgs/applications/office/openoffice/xlib.patch b/pkgs/applications/office/openoffice/xlib.patch
new file mode 100644
index 000000000000..d5f0ff9aa209
--- /dev/null
+++ b/pkgs/applications/office/openoffice/xlib.patch
@@ -0,0 +1,22 @@
+https://bugs.freedesktop.org/show_bug.cgi?id=31322
+
+diff -rc OOO320_m19-orig//vcl/unx/inc/dtint.hxx OOO320_m19//vcl/unx/inc/dtint.hxx
+*** OOO320_m19-orig//vcl/unx/inc/dtint.hxx	2010-05-26 20:34:28.000000000 +0200
+--- OOO320_m19//vcl/unx/inc/dtint.hxx	2011-02-15 17:04:32.134813676 +0100
+***************
+*** 36,42 ****
+  class SalDisplay;
+  class AllSettings;
+  
+! #ifndef _XLIB_H_
+  // forwards from X
+  struct Display;
+  struct XEvent;
+--- 36,42 ----
+  class SalDisplay;
+  class AllSettings;
+  
+! #if !defined(_XLIB_H_) && !defined(_X11_XLIB_H_)
+  // forwards from X
+  struct Display;
+  struct XEvent;
diff --git a/pkgs/applications/science/astronomy/gravit/default.nix b/pkgs/applications/science/astronomy/gravit/default.nix
new file mode 100644
index 000000000000..8af963f84bc1
--- /dev/null
+++ b/pkgs/applications/science/astronomy/gravit/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, fetchurl, SDL, SDL_ttf, SDL_image, mesa, lua5_0 }:
+
+let
+  name = "gravit-0.4.2";
+in
+stdenv.mkDerivation {
+  inherit name;
+
+  src = fetchurl {
+    url = "http://gravit.slowchop.com/dist/${name}.tar.gz";
+    sha256 = "f37f3ac256a4acbf575f709addaae8cb01eda4f85537affa28c45f2df6fddb07";
+  };
+
+  buildInputs = [mesa SDL SDL_ttf SDL_image lua5_0];
+
+  configureFlags = "CFLAGS=-O3 CXXFLAGS=-O3";
+
+  postInstall = ''
+    mv $out/etc/gravit $out/share/gravit/sample-config
+    rmdir $out/etc
+  '';
+
+  meta = {
+    homepage = "http://gravit.slowchop.com";
+    description = "A beautiful OpenGL-based gravity simulator";
+    license = "GPLv2";
+
+    longDescription = ''
+          Gravit is a gravity simulator which runs under Linux, Windows and
+      Mac OS X. It uses Newtonian physics using the Barnes-Hut N-body
+      algorithm. Although the main goal of Gravit is to be as accurate
+      as possible, it also creates beautiful looking gravity patterns.
+      It records the history of each particle so it can animate and
+      display a path of its travels. At any stage you can rotate your
+      view in 3D and zoom in and out.
+    '';
+
+    platforms = stdenv.lib.platforms.mesaPlatforms;
+    maintainers = [ stdenv.lib.maintainers.simons ];
+  };
+}
diff --git a/pkgs/applications/science/astronomy/stellarium/default.nix b/pkgs/applications/science/astronomy/stellarium/default.nix
new file mode 100644
index 000000000000..acf7721489a7
--- /dev/null
+++ b/pkgs/applications/science/astronomy/stellarium/default.nix
@@ -0,0 +1,31 @@
+{stdenv, fetchurl, cmake, freetype, libpng, mesa, gettext, openssl, qt4, perl, libiconv}:
+
+let
+  name = "stellarium-0.11.0";
+in
+stdenv.mkDerivation {
+  inherit name;
+
+  src = fetchurl {
+    url = "mirror://sourceforge/stellarium/${name}.tar.gz";
+    sha256 = "dbedf47dd0744fb325d67d63d1279101be7f4259af2a5e8027f1072012dd2587";
+  };
+
+  buildInputs = [ cmake freetype libpng mesa gettext openssl qt4 perl libiconv ];
+
+  cmakeFlags = "-DINTL_INCLUDE_DIR= -DINTL_LIBRARIES=";
+  preConfigure = ''
+    sed -i -e '/typedef void (\*__GLXextFuncPtr)(void);/d' src/core/external/GLee.h
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "an free open source planetarium";
+    homepage = http://stellarium.org/;
+    license = "GPL2";
+
+    platforms = stdenv.lib.platforms.linux; # should be mesaPlatforms, but we don't have qt on darwin
+    maintainers = [ stdenv.lib.maintainers.simons ];
+  };
+}
diff --git a/pkgs/applications/science/xplanet/default.nix b/pkgs/applications/science/astronomy/xplanet/default.nix
index 15e04c3835c3..15e04c3835c3 100644
--- a/pkgs/applications/science/xplanet/default.nix
+++ b/pkgs/applications/science/astronomy/xplanet/default.nix
diff --git a/pkgs/applications/science/chemistry/avogadro/default.nix b/pkgs/applications/science/chemistry/avogadro/default.nix
new file mode 100644
index 000000000000..702f4c28912f
--- /dev/null
+++ b/pkgs/applications/science/chemistry/avogadro/default.nix
@@ -0,0 +1,19 @@
+{ stdenv, fetchurl, cmake, qt4, zlib, eigen, openbabel }:
+
+stdenv.mkDerivation rec {
+  name = "avogadro-1.0.3";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/avogadro/${name}.tar.bz2";
+    sha256 = "0s44r78vm7hf4cs13d2qki3gf178gjj1ihph6rs04g6s4figvdpg";
+  };
+
+  buildInputs = [ qt4 eigen zlib openbabel ];
+
+  buildNativeInputs = [ cmake ];
+
+  meta = {
+    maintainers = [ stdenv.lib.maintainers.urkud ];
+    inherit (qt4.meta) platforms;
+  };
+}
diff --git a/pkgs/applications/science/electronics/gtkwave/default.nix b/pkgs/applications/science/electronics/gtkwave/default.nix
index 87a18c20e990..72c3f3e24356 100644
--- a/pkgs/applications/science/electronics/gtkwave/default.nix
+++ b/pkgs/applications/science/electronics/gtkwave/default.nix
@@ -1,10 +1,10 @@
 {stdenv, fetchurl, gtk, gperf, pkgconfig, bzip2, xz, tcl, tk, judy} :
 stdenv.mkDerivation rec {
-  name = "gtkwave-3.3.11";
+  name = "gtkwave-3.3.20";
 
   src = fetchurl {
     url = "mirror://sourceforge/gtkwave/${name}.tar.gz";
-    sha256 = "1krhxdpzj2ma3xisbk0d9yzhlk1i60hgkkfycc2nsqqirqrvdpbr";
+    sha256 = "0r2yh8a5rrxjzvykdmqlb098wws5c9k255saf2bsdchnigs8il3n";
   };
 
   buildInputs = [ gtk gperf pkgconfig bzip2 xz tcl tk judy];
diff --git a/pkgs/applications/science/logic/coq/default.nix b/pkgs/applications/science/logic/coq/default.nix
index a804d9f84e6a..35395bd25d1e 100644
--- a/pkgs/applications/science/logic/coq/default.nix
+++ b/pkgs/applications/science/logic/coq/default.nix
@@ -4,7 +4,7 @@
 {stdenv, fetchurl, ocaml, findlib, camlp5, lablgtk, ncurses}:
 
 let
-  version = "8.3";
+  version = "8.3pl1";
 in
 
 stdenv.mkDerivation {
@@ -12,7 +12,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "http://coq.inria.fr/V${version}/files/coq-${version}.tar.gz";
-    sha256 = "02iy4rxz1n1kc85fb3vs4xpxqfxjw87y2gvmi39fxrj8742qx0dx";
+    sha256 = "0a791gsbf17y2wi0a376n78pxkhpl0lkzifhy5d3mx3lpn376j9s";
   };
 
   buildInputs = [ ocaml findlib camlp5 ncurses lablgtk ];
@@ -23,7 +23,7 @@ stdenv.mkDerivation {
     configureFlagsArray=(
       -camldir ${ocaml}/bin
       -camlp5dir $(ocamlfind query camlp5)
-      -lablgtkdir ${lablgtk}/lib/ocaml/lablgtk2 -opt -coqide opt
+      -lablgtkdir ${lablgtk}/lib/ocaml/*/site-lib/lablgtk2 -opt -coqide opt
     )
   '';
 
@@ -38,9 +38,12 @@ stdenv.mkDerivation {
     substituteInPlace tools/beautify-archive --replace "/bin/rm" "$RM"
     substituteInPlace scripts/coqmktop.ml --replace \
       "\"-I\"; \"+lablgtk2\"" \
-      "\"-I\"; \"${lablgtk}/lib/ocaml/lablgtk2\"; \"-I\"; \"${lablgtk}/lib/ocaml/stublibs\""
+      "\"-I\"; \"$(echo "${lablgtk}"/lib/ocaml/*/site-lib/lablgtk2)\"; \"-I\"; \"$(echo "${lablgtk}"/lib/ocaml/*/site-lib/stublibs)\""
   '';
 
+  # This post install step is needed to build ssrcoqide from the ssreflect package
+  # It could be made optional, but I see little harm in including it in the default
+  # distribution -- roconnor
   postInstall = ''
    cp ide/*.cmi ide/ide.*a $out/lib/coq/ide/
   '';
diff --git a/pkgs/applications/science/logic/hol_light/default.nix b/pkgs/applications/science/logic/hol_light/default.nix
index f923095f857e..d835e351cac6 100644
--- a/pkgs/applications/science/logic/hol_light/default.nix
+++ b/pkgs/applications/science/logic/hol_light/default.nix
@@ -1,43 +1,36 @@
-{stdenv, writeText, writeTextFile, ocaml, findlib, camlp5_transitional, hol_light_sources}:
+{stdenv, fetchsvn, writeScript, ocaml, findlib, camlp5}:
 
-let
-  version = hol_light_sources.version;
+stdenv.mkDerivation rec {
+  name = "hol_light-20110813";
+  src = fetchsvn {
+    url = http://hol-light.googlecode.com/svn/trunk;
+    rev = "102";
+    sha256 = "5b972672db6aa1838dc5d130accd9ab6a62030c6b0c1dc4b69e42088b1ae86c9";
+  };
 
-  camlp5 = camlp5_transitional;
+  buildInputs = [ ocaml findlib camlp5 ];
 
-  hol_light_src_dir = "${hol_light_sources}/lib/hol_light/src";
+  start_script = ''
+    #!/bin/sh
+    cd "$out/lib/hol_light"
+    exec ${ocaml}/bin/ocaml -I "$(ocamlfind query camlp5)" -init make.ml
+  '';
 
-  pa_j_cmo = stdenv.mkDerivation {
-    name = "pa_j.cmo";
-    inherit ocaml camlp5; 
-    buildInputs = [ ocaml camlp5 findlib ];
-    buildCommand = ''
-      ocamlc -c \
-        -pp "camlp5r pa_lexer.cmo pa_extend.cmo q_MLast.cmo" \
-        -I "$(ocamlfind query camlp5)" \
-        -o $out \
-        "${hol_light_src_dir}/pa_j_`ocamlc -version | cut -c1-4`.ml"
-      '';
-    };
+  buildPhase = ''
+    make pa_j.ml
+    ocamlc -c \
+      -pp "camlp5r pa_lexer.cmo pa_extend.cmo q_MLast.cmo" \
+      -I "$(ocamlfind query camlp5)" \
+      pa_j.ml
+  '';
 
-  start_ml = writeText "start.ml" ''
-    Topdirs.dir_directory "${hol_light_src_dir}";;
-    Topdirs.dir_directory ("${camlp5}/lib/ocaml/"^Sys.ocaml_version^"/site-lib/camlp5");;
-    Topdirs.dir_load Format.std_formatter "camlp5o.cma";;
-    Topdirs.dir_load Format.std_formatter "${pa_j_cmo}";;
-    #use "${hol_light_src_dir}/make.ml";;
+  installPhase = ''
+    ensureDir "$out/lib/hol_light" "$out/bin"
+    cp -a  . $out/lib/hol_light
+    echo "${start_script}" > "$out/bin/hol_light"
+    chmod a+x "$out/bin/hol_light"
   '';
-in
-writeTextFile {
-  name = "hol_light-${version}";
-  destination = "/bin/start_hol_light";
-  executable = true;
-  text = ''
-      #!/bin/sh
-      exec ${ocaml}/bin/ocaml -init ${start_ml}
-    '';
-} // {
-  inherit (hol_light_sources) version src;
+
   meta = {
     description = "An interactive theorem prover based on Higher-Order Logic.";
     longDescription = ''
diff --git a/pkgs/applications/science/logic/hol_light/dmtcp_checkpoint.nix b/pkgs/applications/science/logic/hol_light/dmtcp_checkpoint.nix
deleted file mode 100644
index 9071d63c298a..000000000000
--- a/pkgs/applications/science/logic/hol_light/dmtcp_checkpoint.nix
+++ /dev/null
@@ -1,99 +0,0 @@
-{stdenv, writeTextFile, hol_light, dmtcp}:
-let
-  mkRestartScript = checkpointFile:
-    let filename = "hol_light_${checkpointFile.variant}_dmtcp"; in
-    writeTextFile {
-      name = "${filename}-${hol_light.version}";
-      destination = "/bin/${filename}";
-      executable = true;
-      text = ''
-        #!/bin/sh
-	exec ${dmtcp}/bin/dmtcp_restart --quiet ${checkpointFile}
-      '';
-    };
-
-  mkCkptFile =
-    { variant
-    , banner
-    , loads
-    , startCkpt ? null
-    , buildCommand ? ''
-        cp ${startCkpt} hol_light_restart.ckpt
-        (echo "$loadScript" | dmtcp_restart --quiet hol_light_restart.ckpt) || exit 0
-        cp hol_light_restart.ckpt $out
-      ''
-    }:
-    stdenv.mkDerivation rec {
-      name = "hol_light_${variant}_dmtcp.checkpoint-${hol_light.version}";
-      inherit variant banner buildCommand;
-      buildInputs = [ dmtcp hol_light ];
-      loadScript = ''
-        ${loads}
-        dmtcp_checkpoint "${banner}";;
-      '';
-    };
-in
-rec {
-  hol_light_core_dmtcp = mkRestartScript hol_light_core_dmtcp_ckpt;
-  hol_light_sosa_dmtcp = mkRestartScript hol_light_sosa_dmtcp_ckpt;
-  hol_light_card_dmtcp = mkRestartScript hol_light_card_dmtcp_ckpt;
-  hol_light_multivariate_dmtcp = mkRestartScript hol_light_multivariate_dmtcp_ckpt;
-  hol_light_complex_dmtcp = mkRestartScript hol_light_complex_dmtcp_ckpt;
-
-  hol_light_core_dmtcp_ckpt = mkCkptFile rec {
-    variant = "core";
-    banner = "";
-    loads = ''
-      #use "${./dmtcp_selfdestruct.ml}";;
-    '';
-    buildCommand = ''
-      (echo "$loadScript" | dmtcp_checkpoint --quiet ${hol_light}/bin/start_hol_light) || exit 0
-      mv ckpt* $out
-    '';
-  };
-
-  hol_light_multivariate_dmtcp_ckpt = mkCkptFile {
-    variant = "multivariate";
-    banner = "Preloaded with multivariate analysis";
-    loads = ''
-      loadt "Multivariate/make.ml";;
-    '';
-    startCkpt = hol_light_core_dmtcp_ckpt;
-  };
-
-  hol_light_sosa_dmtcp_ckpt = mkCkptFile {
-    variant = "sosa";
-    banner = "Preloaded with analysis and SOS";
-    loads = ''
-      loadt "Library/analysis.ml";;
-      loadt "Library/transc.ml";;
-      loadt "Examples/sos.ml";;
-      loadt "update_database.ml";;
-    '';
-    startCkpt = hol_light_core_dmtcp_ckpt;
-  };
-
-  hol_light_card_dmtcp_ckpt = mkCkptFile {
-    variant = "card";
-    banner = "Preloaded with cardinal arithmetic";
-    loads = ''
-      loadt "Library/card.ml";;
-      loadt "update_database.ml";;
-    '';
-    startCkpt = hol_light_core_dmtcp_ckpt;
-  };
-
-  hol_light_complex_dmtcp_ckpt = mkCkptFile {
-    variant = "complex";
-    banner = "Preloaded with multivariate-based complex analysis";
-    loads = ''
-      loadt "Multivariate/complexes.ml";;
-      loadt "Multivariate/canal.ml";;
-      loadt "Multivariate/transcendentals.ml";;
-      loadt "Multivariate/realanalysis.ml";;
-      loadt "Multivariate/cauchy.ml";;
-      loadt "Multivariate/complex_database.ml";;
-    '';
-    startCkpt = hol_light_multivariate_dmtcp_ckpt;
-  };
-}
diff --git a/pkgs/applications/science/logic/hol_light/dmtcp_selfdestruct.ml b/pkgs/applications/science/logic/hol_light/dmtcp_selfdestruct.ml
deleted file mode 100644
index f85a7a6c5fdf..000000000000
--- a/pkgs/applications/science/logic/hol_light/dmtcp_selfdestruct.ml
+++ /dev/null
@@ -1,19 +0,0 @@
-(* ------------------------------------------------------------------------- *)
-(* Create a standalone HOL image. Assumes that we are running under Linux    *)
-(* and have the program "dmtcp" available to create checkpoints.             *)
-(* ------------------------------------------------------------------------- *)
-
-let dmtcp_checkpoint, dmtcp_selfdestruct =
-  let call_dmtcp opts bannerstring =
-    let longer_banner = startup_banner ^ " with DMTCP" in
-    let complete_banner =
-      if bannerstring = "" then longer_banner
-      else longer_banner^"\n        "^bannerstring in
-    (Gc.compact(); Unix.sleep 1;
-     Format.print_string "Checkpointing..."; Format.print_newline();
-     try ignore(Unix.system ("dmtcp_command -bc " ^ opts))
-     with Unix.Unix_error _ -> ();
-     Format.print_string complete_banner;
-     Format.print_newline(); Format.print_newline())
-  in
-  call_dmtcp "", call_dmtcp "-q";;
diff --git a/pkgs/applications/science/logic/hol_light/parser_setup.patch b/pkgs/applications/science/logic/hol_light/parser_setup.patch
deleted file mode 100644
index 0ad17ca1a0b0..000000000000
--- a/pkgs/applications/science/logic/hol_light/parser_setup.patch
+++ /dev/null
@@ -1,34 +0,0 @@
-diff -Nuar hol_light/hol.ml hol_light.nixos/hol.ml
---- hol_light/hol.ml	2010-11-03 23:09:01.000000000 +0100
-+++ hol_light.nixos/hol.ml	2010-11-03 23:10:31.000000000 +0100
-@@ -11,8 +11,8 @@
- 
- let hol_version = "2.20++";;
- 
--let hol_dir = ref
--  (try Sys.getenv "HOLLIGHT_DIR" with Not_found -> Sys.getcwd());;
-+let hol_dir = ref "@HOL_LIGHT_SRC_DIR@";;
-+Topdirs.dir_directory "@HOL_LIGHT_SRC_DIR@";;
- 
- (* ------------------------------------------------------------------------- *)
- (* Should eventually change to "ref(Filename.temp_dir_name)".                *)
-@@ -23,19 +23,6 @@
- let temp_path = ref "/tmp";;
- 
- (* ------------------------------------------------------------------------- *)
--(* Load in parsing extensions.                                               *)
--(* For Ocaml < 3.10, use the built-in camlp4                                 *)
--(* and for Ocaml >= 3.10, use camlp5 instead.                                *)
--(* ------------------------------------------------------------------------- *)
--
--if let v = String.sub Sys.ocaml_version 0 4 in v >= "3.10"
--then (Topdirs.dir_directory "+camlp5";
--      Topdirs.dir_load Format.std_formatter "camlp5o.cma")
--else (Topdirs.dir_load Format.std_formatter "camlp4o.cma");;
--
--Topdirs.dir_load Format.std_formatter (Filename.concat (!hol_dir) "pa_j.cmo");;
--
--(* ------------------------------------------------------------------------- *)
- (* Load files from system and/or user-settable directories.                  *)
- (* Paths map initial "$/" to !hol_dir dynamically; use $$ to get the actual  *)
- (* $ character at the start of a directory.                                  *)
diff --git a/pkgs/applications/science/logic/hol_light/sources.nix b/pkgs/applications/science/logic/hol_light/sources.nix
deleted file mode 100644
index b45ca4a90349..000000000000
--- a/pkgs/applications/science/logic/hol_light/sources.nix
+++ /dev/null
@@ -1,28 +0,0 @@
-{stdenv, fetchsvn}:
-
-stdenv.mkDerivation rec {
-  name = "hol_light_sources-${version}";
-  version = "20101029";
-
-  src = fetchsvn {
-    url = http://hol-light.googlecode.com/svn/trunk;
-    rev = "64";
-    sha256 = "91e9cac62586039b13c11af245f85a743e299892b24b39d3c7b2ee13157e87c9";
-  };
-
-  buildCommand = ''
-    export HOL_DIR="$out/lib/hol_light"
-    ensureDir "$HOL_DIR"
-    cp -a "${src}" "$HOL_DIR/src"
-    cd "$HOL_DIR/src"
-    chmod +wX -R .
-    patch -p1 < ${./parser_setup.patch}
-    substituteInPlace hol.ml --subst-var-by HOL_LIGHT_SRC_DIR "$HOL_DIR/src"
-  '';
-
-  meta = {
-    description = "Sources for the HOL Light theorem prover";
-    homepage = http://www.cl.cam.ac.uk/~jrh13/hol-light/;
-    license = "BSD";
-  };
-}
diff --git a/pkgs/applications/science/logic/isabelle/default.nix b/pkgs/applications/science/logic/isabelle/default.nix
index b9e756e0423b..5705262f3771 100644
--- a/pkgs/applications/science/logic/isabelle/default.nix
+++ b/pkgs/applications/science/logic/isabelle/default.nix
@@ -3,7 +3,7 @@
 
 let
   pname = "Isabelle";
-  version = "2009-2";
+  version = "2011";
   name = "${pname}${version}";
   theories = ["HOL" "FOL" "ZF"];
 in
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "http://www.cl.cam.ac.uk/research/hvg/${pname}/dist/${name}.tar.gz";
-    sha256 = "f92a275b78bd8844de47a5902e339b58f3b768c07a7fb19d8e606b68499d5ac4";
+    sha256 = "ea85eb2a859891be387f020b2e45f8c9a0bd1d8bbc3902f28a429e9c61cb0b6a";
   };
 
   buildInputs = [ perl polyml nettools ];
diff --git a/pkgs/applications/science/logic/isabelle/settings.patch b/pkgs/applications/science/logic/isabelle/settings.patch
index dc9c611d4886..bf509a4bac46 100644
--- a/pkgs/applications/science/logic/isabelle/settings.patch
+++ b/pkgs/applications/science/logic/isabelle/settings.patch
@@ -1,34 +1,32 @@
-diff -Naur Isabelle2009-1/etc/settings Isabelle2009-1-patched/etc/settings
---- Isabelle2009-1/etc/settings	2009-12-02 12:04:07.000000000 +0100
-+++ Isabelle2009-1-patched/etc/settings	2009-12-04 16:15:40.000000000 +0100
-@@ -16,15 +16,8 @@
- # Only one of the sections below should be activated.
+diff -Nuar Isabelle2011/etc/settings Isabelle2011-fix/etc/settings
+--- Isabelle2011/etc/settings	2011-01-30 13:02:18.000000000 +0100
++++ Isabelle2011-fix/etc/settings	2011-05-14 22:56:04.000000000 +0200
+@@ -17,13 +17,7 @@
  
  # Poly/ML 5.x (automated settings)
--POLY_HOME="$(type -p poly)"; [ -n "$POLY_HOME" ] && POLY_HOME="$(dirname "$POLY_HOME")"
  ML_PLATFORM="$ISABELLE_PLATFORM"
--ML_HOME=$(choosefrom \
+-ML_HOME="$(choosefrom \
 -  "$ISABELLE_HOME/contrib/polyml/$ML_PLATFORM" \
 -  "$ISABELLE_HOME/../polyml/$ML_PLATFORM" \
 -  "/usr/local/polyml/$ML_PLATFORM" \
 -  "/usr/share/polyml/$ML_PLATFORM" \
 -  "/opt/polyml/$ML_PLATFORM" \
--  $POLY_HOME)
+-  "")"
 +ML_HOME=@ML_HOME@
  ML_SYSTEM=$("$ISABELLE_HOME/lib/scripts/polyml-version")
  ML_OPTIONS="-H 200"
  ML_SOURCES="$ML_HOME/../src"
-@@ -185,13 +178,7 @@
+@@ -175,13 +169,7 @@
  ###
  
  # Proof General home, look in a variety of places
--PROOFGENERAL_HOME=$(choosefrom \
+-PROOFGENERAL_HOME="$(choosefrom \
 -  "$ISABELLE_HOME/contrib/ProofGeneral" \
 -  "$ISABELLE_HOME/../ProofGeneral" \
 -  "/usr/local/ProofGeneral" \
 -  "/usr/share/ProofGeneral" \
 -  "/opt/ProofGeneral" \
--  "")
+-  "")"
 +PROOFGENERAL_HOME=@PROOFGENERAL_HOME@
  
  PROOFGENERAL_OPTIONS=""
diff --git a/pkgs/applications/science/logic/leo2/default.nix b/pkgs/applications/science/logic/leo2/default.nix
index eb3a13593480..04ab9a5b5ab3 100644
--- a/pkgs/applications/science/logic/leo2/default.nix
+++ b/pkgs/applications/science/logic/leo2/default.nix
@@ -11,10 +11,10 @@ let
     (builtins.attrNames (builtins.removeAttrs x helperArgNames));
   sourceInfo = rec {
     baseName="leo2";
-    version="1.2.6";
+    version="1.2.8";
     name="${baseName}_v${version}";
     url="http://www.ags.uni-sb.de/~leo/${name}.tgz";
-    hash="0gjgcm6nb9kzdl0y72sgvf2w2q92s1ix70lh6wjz9lj2qdf7gi1z";
+    hash="d46a94f5991623386eb9061cfb0d748e258359a8c690fded173d45303e0e9e3a";
   };
 in
 rec {
diff --git a/pkgs/applications/science/logic/matita/Makefile.patch b/pkgs/applications/science/logic/matita/Makefile.patch
new file mode 100644
index 000000000000..64c9a13f2d07
--- /dev/null
+++ b/pkgs/applications/science/logic/matita/Makefile.patch
@@ -0,0 +1,11 @@
+--- matita-0.5.8/Makefile	2009-12-01 18:21:00.000000000 -0500
++++ matita-0.5.8/Makefile	2010-09-16 10:33:59.665461260 -0400
+@@ -38,7 +38,7 @@
+ uninstall: $(foreach d,$(SUBDIRS),rec@uninstall@$(d))
+ 
+ rec@%:
+-	$(MAKE) -C $(word 2, $(subst @, ,$*)) $(word 1, $(subst @, ,$*)) DESTDIR=$(shell pwd)/$(DESTDIR)
++	$(MAKE) -C $(word 2, $(subst @, ,$*)) $(word 1, $(subst @, ,$*))
+ 
+ # {{{ Distribution stuff
+ 
diff --git a/pkgs/applications/science/logic/matita/configure.patch b/pkgs/applications/science/logic/matita/configure.patch
new file mode 100644
index 000000000000..9a3bbbb13f52
--- /dev/null
+++ b/pkgs/applications/science/logic/matita/configure.patch
@@ -0,0 +1,36 @@
+--- zzz/matita-0.5.8/configure	2009-12-01 18:21:00.000000000 -0500
++++ matita-0.5.8/configure	2010-09-07 19:57:29.732139550 -0400
+@@ -1895,6 +1895,7 @@
+ # look for METAS dir
+ 
+ LIBSPATH="`pwd`/components"
++OLDCAMLPATH="$OCAMLPATH"
+ OCAMLPATH="$LIBSPATH/METAS"
+ 
+ # creating META.*
+@@ -1917,7 +1918,7 @@
+ gdome2 \
+ http \
+ lablgtk2 \
+-lablgtksourceview2.gtksourceview2 \
++lablgtk2.gtksourceview \
+ lablgtkmathview \
+ mysql \
+ netstring \
+@@ -1951,14 +1952,14 @@
+ $FINDLIB_CREQUIRES \
+ lablgtk2.glade \
+ lablgtkmathview \
+-lablgtksourceview2.gtksourceview2 \
++lablgtk2.gtksourceview \
+ helm-xmldiff \
+ "
+ for r in $FINDLIB_LIBSREQUIRES $FINDLIB_REQUIRES
+ do
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $r ocaml library" >&5
+ $as_echo_n "checking for $r ocaml library... " >&6; }
+-  if OCAMLPATH=$OCAMLPATH $OCAMLFIND query $r &> /dev/null; then
++  if OCAMLPATH=$OCAMLPATH:$OLDCAMLPATH $OCAMLFIND query $r &> /dev/null; then
+     { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+ $as_echo "yes" >&6; }
+   else
diff --git a/pkgs/applications/science/logic/matita/default.nix b/pkgs/applications/science/logic/matita/default.nix
new file mode 100644
index 000000000000..6ac672193e27
--- /dev/null
+++ b/pkgs/applications/science/logic/matita/default.nix
@@ -0,0 +1,54 @@
+{stdenv, fetchurl, ocaml, camlp5, findlib, gdome2, ocaml_expat, gmetadom, ocaml_http, lablgtk, lablgtkmathview, ocaml_mysql, ocaml_sqlite3, ocamlnet, ulex08, camlzip, ocaml_pcre }:
+
+let
+  ocaml_version = (builtins.parseDrvName ocaml.name).version;
+  version = "0.5.8";
+  pname = "matita";
+
+in
+
+stdenv.mkDerivation {
+  name = "${pname}-${version}";
+
+  src = fetchurl {
+    url = "http://matita.cs.unibo.it/FILES/${pname}-${version}.orig.tar.gz";
+    sha256 = "04sxklfak71khy1f07ks5c6163jbpxv6fmaw03fx8gwwlvpmzglh";
+  };
+
+  buildInputs = [ocaml camlp5 findlib gdome2 ocaml_expat gmetadom ocaml_http lablgtk lablgtkmathview ocaml_mysql ocaml_sqlite3 ocamlnet ulex08 camlzip ocaml_pcre ];
+
+  postPatch = ''
+    BASH=$(type -tp bash)
+    substituteInPlace components/Makefile --replace "SHELL=/bin/bash" "SHELL=$BASH"
+    substituteInPlace matita/Makefile --replace "SHELL=/bin/bash" "SHELL=$BASH"
+    substituteInPlace configure --replace "ulex08" "ulex"
+    substituteInPlace components/METAS/meta.helm-content_pres.src --replace "ulex08" "ulex"
+    substituteInPlace components/content_pres/Makefile --replace "ulex08" "ulex"
+    substituteInPlace components/METAS/meta.helm-grafite_parser.src --replace "ulex08" "ulex"
+    substituteInPlace components/grafite_parser/Makefile --replace "ulex08" "ulex"
+    substituteInPlace configure --replace "zip" "camlzip"
+    substituteInPlace components/METAS/meta.helm-getter.src --replace "zip" "camlzip"
+    substituteInPlace components/METAS/meta.helm-xml.src --replace "zip" "camlzip"
+  '';
+
+  patches = [ ./configure.patch ./Makefile.patch ];
+
+  preConfigure = ''
+    # Setup for findlib.
+    OCAMLPATH=$(pwd)/components/METAS:$OCAMLPATH
+    RTDIR=$out/share/matita
+    export configureFlags="--with-runtime-dir=$RTDIR"
+  '';
+
+  postInstall = ''
+    ensureDir $out/bin
+    ln -vs $RTDIR/matita $RTDIR/matitac $RTDIR/matitaclean $RTDIR/matitadep $RTDIR/matitawiki $out/bin
+  '';
+
+  meta = {
+    homepage = http://matita.cs.unibo.it/;
+    description = "Matita is an experimental, interactive theorem prover";
+    license = "GPLv2+";
+    maintainers = [ stdenv.lib.maintainers.roconnor ];
+  };
+}
diff --git a/pkgs/applications/science/logic/ssreflect/default.nix b/pkgs/applications/science/logic/ssreflect/default.nix
index 61901d545d7a..5a51fe2136a1 100644
--- a/pkgs/applications/science/logic/ssreflect/default.nix
+++ b/pkgs/applications/science/logic/ssreflect/default.nix
@@ -1,13 +1,12 @@
 # TODO:
-# - ssrcoqide does not build successfully (missing coqide libraries in the coq installation).
-# - ssrcoq needs to be invoked with the explicit path to the ssreflect theory
-#   e.g.. ssrcoq -I /nix/store/rp09dlb2y2hpddb0xa7fyrgjlzb284ar-ssreflect-1.2/lib/coq/user-contrib/theories/
+# - coq needs to be invoked with the explicit path to the ssreflect theory
+#   e.g. coqide -R ~/.nix-profile/lib/coq/user-contrib/ ''
 
 {stdenv, fetchurl, ocaml, camlp5, coq}:
 
 let
   pname = "ssreflect";
-  version = "1.2";
+  version = "1.3pl1";
   name = "${pname}-${version}";
   webpage = http://www.msr-inria.inria.fr/Projects/math-components;
 in
@@ -16,18 +15,12 @@ stdenv.mkDerivation {
   inherit name;
 
   src = fetchurl {
-    url = "${webpage}/${name}.tgz";
-    sha256 = "0800b085e6a0caec5093c6c02aacdd8dfd9cc282177e8586f14f9a9e15f64d0b";
+    url = "${webpage}/${name}.tar.gz";
+    sha256 = "0ykrhqb68aanl5d4dmn0vnx8m34gg0jsbdhwx2852rqi7r00b9ri";
   };
 
   buildInputs = [ ocaml camlp5 coq ];
 
-  preBuild = ''
-    coq_makefile -f Make -o Makefile
-    substituteInPlace Makefile \
-      --replace 'install -D $$i $(COQLIB)' 'install -D $$i '$out'/lib/coq'
-  '';
-
   # this fails
   /*
   postBuild = ''
@@ -36,10 +29,9 @@ stdenv.mkDerivation {
   '';
   */
 
-  postInstall = ''
+  installPhase = ''
+    COQLIB=$out/lib/coq make -f Makefile.coq install -e
     ensureDir $out/bin
-    #cp -a bin/ssrcoq bin/ssrcoqide $out/bin
-    cp -a bin/ssrcoq $out/bin
   '';
 
   meta = {
diff --git a/pkgs/applications/science/logic/tptp/default.nix b/pkgs/applications/science/logic/tptp/default.nix
new file mode 100644
index 000000000000..3211b6ebdc01
--- /dev/null
+++ b/pkgs/applications/science/logic/tptp/default.nix
@@ -0,0 +1,87 @@
+x@{builderDefsPackage
+  , yap, tcsh, perl, patchelf, pkgsi686Linux
+  , ...}:
+builderDefsPackage
+(a :  
+let 
+  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ 
+    ["pkgsi686Linux"];
+
+  buildInputs = map (n: builtins.getAttr n x)
+    (builtins.attrNames (builtins.removeAttrs x helperArgNames));
+  sourceInfo = rec {
+    baseName="TPTP";
+    version="5.1.0";
+    name="${baseName}-${version}";
+    url="http://www.cs.miami.edu/~tptp/TPTP/Distribution/TPTP-v${version}.tgz";
+    hash="1wh2k575nn51ykg1jnwfwjqhg5x42k5vvn2spq09px26vhs4yksy";
+  };
+in
+rec {
+  src = a.fetchurl {
+    url = sourceInfo.url;
+    sha256 = sourceInfo.hash;
+  };
+
+  inherit (sourceInfo) name version;
+  inherit buildInputs;
+
+  /* doConfigure should be removed if not needed */
+  phaseNames = ["goTarget" "doUnpack" "fixPlace" "setVars" "installScripts" 
+    "patchBinaries" "makeLinks"];
+
+  goTarget = a.fullDepEntry ''
+    ensureDir "$out"/share/
+    cd "$out"/share/
+  '' ["defEnsureDir" "minInit"];
+
+  fixPlace = a.fullDepEntry ''
+    cd ..
+    mv TPTP-* tptp
+    cd tptp
+  '' ["minInit" "doUnpack"];
+
+  setVars = a.noDepEntry ''
+    export TPTP="$PWD"
+  '';
+
+  installScripts = a.fullDepEntry ''
+    tcsh "$out/share/tptp/Scripts/tptp2T_install" -default
+
+    sed -e 's@^ */bin/@@' -i TPTP2X/*
+
+    tcsh "$out/share/tptp/TPTP2X/tptp2X_install" -default
+  '' ["addInputs"];
+
+  makeLinks = a.fullDepEntry ''
+    ensureDir "$out/bin"
+    ln -s "../share/tptp/TPTP2X/tptp2X" "$out/bin"
+    ln -s "../share/tptp/Scripts/tptp2T" "$out/bin"
+    ln -s "../share/tptp/Scripts/tptp4X" "$out/bin"
+  '' ["defEnsureDir" "minInit"];
+
+  patchBinaries = a.fullDepEntry ''
+    patchelf --set-interpreter "${pkgsi686Linux.glibc}"/lib/ld-linux.so.* \
+      "Scripts/tptp4X"
+  '' ["addInputs"];
+      
+  meta = {
+    description = "Thousands of problems for theorem provers and tools";
+    maintainers = with a.lib.maintainers;
+    [
+      raskin
+    ];
+    # A GiB of data. Installation is unpacking and editing a few files.
+    # No sense in letting Hydra build it.
+    # Also, it is unclear what is covered by "verbatim" - we will edit configs
+    platforms = with a.lib.platforms;
+      [];
+    license = "verbatim-redistribution";
+  };
+  passthru = {
+    updateInfo = {
+      downloadPage = "http://tptp.org/";
+    };
+  };
+}) x
+
diff --git a/pkgs/applications/science/math/ecm/default.nix b/pkgs/applications/science/math/ecm/default.nix
new file mode 100644
index 000000000000..5d378a48dd9e
--- /dev/null
+++ b/pkgs/applications/science/math/ecm/default.nix
@@ -0,0 +1,27 @@
+{stdenv, fetchurl, gmp}:
+
+let
+  pname = "ecm";
+  version = "6.2.3";
+  name = "${pname}-${version}";
+in
+
+stdenv.mkDerivation {
+  inherit name;
+
+  src = fetchurl {
+      url = https://gforge.inria.fr/frs/download.php/22124/ecm-6.2.3.tar.gz;
+      sha256 = "1iwwhbz5vwl7j6dyh292hahc8yy16pq9mmm7mxy49zhxd81vy08p";
+    };
+
+  buildInputs = [ gmp ];
+
+  doCheck = true;
+
+  meta = {
+    description = "Elliptic Curve Method for Integer Factorization";
+    license = stdenv.lib.licenses.gpl2Plus;
+    homepage = http://ecm.gforge.inria.fr/;
+    maintainers = [ stdenv.lib.maintainers.roconnor ];
+  };
+}
diff --git a/pkgs/applications/science/math/eukleides/default.nix b/pkgs/applications/science/math/eukleides/default.nix
new file mode 100644
index 000000000000..9f65bcb8c148
--- /dev/null
+++ b/pkgs/applications/science/math/eukleides/default.nix
@@ -0,0 +1,37 @@
+{ stdenv, fetchurl, bison, flex, texinfo, readline, texLive }:
+
+let
+  name    = "eukleides";
+  version = "1.5.4";
+in
+stdenv.mkDerivation {
+  name = "${name}-${version}";
+
+  src = fetchurl {
+    url = "http://www.eukleides.org/files/${name}-${version}.tar.bz2";
+    sha256 = "0s8cyh75hdj89v6kpm3z24i48yzpkr8qf0cwxbs9ijxj1i38ki0q";
+  };
+
+  buildInputs = [bison flex texinfo readline texLive];
+
+  preConfigure = "sed -i 's/ginstall-info/install-info/g' doc/Makefile";
+  installPhase = "ensureDir $out/bin ; make PREFIX=$out install";
+
+  meta = {
+    description = "Geometry Drawing Language";
+    homepage = "http://www.eukleides.org/";
+    license = "GPLv2";
+
+    longDescription = ''
+      Eukleides is a computer language devoted to elementary plane
+      geometry. It aims to be a fairly comprehensive system to create
+      geometric figures, either static or dynamic. Eukleides allows to
+      handle basic types of data: numbers and strings, as well as
+      geometric types of data: points, vectors, sets (of points), lines,
+      circles and conics.
+    '';
+
+    platforms = stdenv.lib.platforms.all;
+    maintainers = [ stdenv.lib.maintainers.simons ];
+  };
+}
diff --git a/pkgs/applications/science/math/jags/default.nix b/pkgs/applications/science/math/jags/default.nix
new file mode 100644
index 000000000000..3043df15da74
--- /dev/null
+++ b/pkgs/applications/science/math/jags/default.nix
@@ -0,0 +1,17 @@
+{stdenv, fetchurl, gfortran, liblapack, blas}:
+
+stdenv.mkDerivation rec {
+  name = "JAGS-2.2.0";
+  src = fetchurl {
+    url = "mirror://sourceforge/mcmc-jags/${name}.tar.gz";
+    sha256 = "016xml4k99lmdwwjiabxin95k9p3q2zh4pcci8wwcqwlq5y205b6";
+  };
+  buildInputs = [gfortran liblapack blas];
+
+  meta = {
+    description = "JAGS: Just Another Gibbs Sampler";
+    license     = "GPL2";
+    homepage    = http://www-ice.iarc.fr/~martyn/software/jags/;
+    maintainers = [stdenv.lib.maintainers.andres];
+  };
+}
diff --git a/pkgs/applications/science/math/maxima/default.nix b/pkgs/applications/science/math/maxima/default.nix
index f99c1e46162e..f8f21d8909b4 100644
--- a/pkgs/applications/science/math/maxima/default.nix
+++ b/pkgs/applications/science/math/maxima/default.nix
@@ -1,22 +1,40 @@
-{ stdenv, fetchurl, clisp }:
+{ stdenv, fetchurl, sbcl, texinfo, perl, makeWrapper, rlwrap ? null, tk ? null, gnuplot ? null }:
 
 let
-    name    = "maxima";
-    version = "5.22.1";
+  name    = "maxima";
+  version = "5.25.0";
+
+  searchPath =
+    stdenv.lib.makeSearchPath "bin"
+      (stdenv.lib.filter (x: x != null) [ sbcl rlwrap tk gnuplot ]);
 in
 stdenv.mkDerivation {
   name = "${name}-${version}";
 
   src = fetchurl {
     url = "mirror://sourceforge/${name}/${name}-${version}.tar.gz";
-    sha256 = "0sdrv3lra6j3ylaqsblnd3x7rq4ybafyj7rb114ycadpx2qf06lq";
+    sha256 = "49c90fb809f5027787600050503476193db3620fd9517f620b82ad492ba30c0a";
   };
 
-  preConfigure = ''
-    configureFlags="--infodir=$out/share/info --mandir=$out/share/man"
+  buildInputs = [sbcl texinfo perl makeWrapper];
+
+  postInstall = ''
+    # Make sure that maxima can find its runtime dependencies.
+    for prog in "$out/bin/"*; do
+      wrapProgram "$prog" --prefix PATH ":" "${searchPath}"
+    done
+    # Move emacs modules and documentation into the right place.
+    ensureDir $out/share/emacs $out/share/doc
+    ln -s ../maxima/${version}/emacs $out/share/emacs/site-lisp
+    ln -s ../maxima/${version}/doc $out/share/doc/maxima
   '';
 
-  buildInputs = [clisp];
+  # The regression test suite has minor failures, but curiously enough
+  # this doesn't seem to abort the build process:
+  # <http://sourceforge.net/tracker/?func=detail&aid=3365831&group_id=4933&atid=104933>.
+  doCheck = true;
+
+  enableParallelBuilding = true;
 
   meta = {
     description = "Maxima computer algebra system";
diff --git a/pkgs/applications/science/math/msieve/default.nix b/pkgs/applications/science/math/msieve/default.nix
new file mode 100644
index 000000000000..baee2f23d4ca
--- /dev/null
+++ b/pkgs/applications/science/math/msieve/default.nix
@@ -0,0 +1,28 @@
+{stdenv, fetchurl, zlib, gmp, ecm }:
+
+stdenv.mkDerivation {
+  name = "msieve-1.48";
+
+  src = fetchurl {
+      url = mirror://sourceforge/msieve/msieve/Msieve%20v1.48/msieve148.tar.gz;
+      sha256 = "05cm23mpfsbwssqda243sbi8m31j783qx89x9gl7sy8a4dnv7h63";
+    };
+
+  buildInputs = [ zlib gmp ecm ];
+
+  ECM = if ecm == null then "0" else "1";
+
+  buildFlags = if stdenv.system == "x86_64-linux" then "x86_64"
+               else if stdenv.system == "i686-linux" then "x86"
+               else "generic";
+
+  installPhase = ''ensureDir $out/bin/
+                   cp msieve $out/bin/'';
+
+  meta = {
+    description = "a C library implementing a suite of algorithms to factor large integers";
+    license = stdenv.lib.licenses.publicDomain;
+    homepage = http://msieve.sourceforge.net/;
+    maintainers = [ stdenv.lib.maintainers.roconnor ];
+  };
+}
diff --git a/pkgs/applications/science/math/pari/default.nix b/pkgs/applications/science/math/pari/default.nix
index 62763ac2198a..43291d792b72 100644
--- a/pkgs/applications/science/math/pari/default.nix
+++ b/pkgs/applications/science/math/pari/default.nix
@@ -11,10 +11,10 @@ let
     (builtins.attrNames (builtins.removeAttrs x helperArgNames));
   sourceInfo = rec {
     baseName="pari";
-    version="2.3.5";
+    version="2.5.0";
     name="${baseName}-${version}";
     url="http://pari.math.u-bordeaux.fr/pub/pari/unix/${name}.tar.gz";
-    hash="124xr2jdz2c15v45i1zvgylng44lhf23729a1mk7ci1vywdaxpa7";
+    hash="18ipxj4hzj7s3fqz878fiypkzrkbjj8wvbygz9j8c3ya06q27jax";
   };
 in
 rec {
diff --git a/pkgs/applications/science/math/wxmaxima/default.nix b/pkgs/applications/science/math/wxmaxima/default.nix
index ece6eb985178..6bd6e9266e6b 100644
--- a/pkgs/applications/science/math/wxmaxima/default.nix
+++ b/pkgs/applications/science/math/wxmaxima/default.nix
@@ -1,22 +1,29 @@
-{ stdenv, fetchurl, maxima, wxGTK }:
-
-# TODO: Build the correct ${maxima}/bin/maxima store path into wxMaxima so that
-#       it can run that binary without relying on $PATH, /etc/wxMaxima.conf, or
-#       ~/.wxMaxima.
+{ stdenv, fetchurl, maxima, wxGTK, makeWrapper }:
 
 let
-    name    = "wxmaxima";
-    version = "0.8.6";
+  name    = "wxmaxima";
+  version = "11.04.0";
 in
 stdenv.mkDerivation {
   name = "${name}-${version}";
 
   src = fetchurl {
     url = "mirror://sourceforge/${name}/wxMaxima-${version}.tar.gz";
-    sha256 = "09w6gai0jfhl959yrdcdikz5l9kdjshasjk404vl19nfnivdbj9f";
+    sha256 = "1dfwh5ka125wr6wxzyiwz16lk8kaf09rb6lldzryjwh8zi7yw8dm";
   };
 
-  buildInputs = [maxima wxGTK];
+  buildInputs = [wxGTK maxima makeWrapper];
+
+  postInstall = ''
+    # Make sure that wxmaxima can find its runtime dependencies.
+    for prog in "$out/bin/"*; do
+      wrapProgram "$prog" --prefix PATH ":" "${maxima}/bin"
+    done
+  '';
+
+  doCheck = true;
+
+  enableParallelBuilding = true;
 
   meta = {
     description = "Cross platform GUI for the computer algebra system Maxima.";
diff --git a/pkgs/applications/science/misc/tulip/configure-opengl.patch b/pkgs/applications/science/misc/tulip/configure-opengl.patch
deleted file mode 100644
index e5346ef07283..000000000000
--- a/pkgs/applications/science/misc/tulip/configure-opengl.patch
+++ /dev/null
@@ -1,75 +0,0 @@
-Remove broken detection of OpenGL and GLEW.  See
-<http://sourceforge.net/tracker/?func=detail&aid=3015936&group_id=61223&atid=496518>.
-
---- tulip-3.3.1/acinclude.m4	2010-01-18 20:34:02.000000000 +0100
-+++ tulip-3.3.1/acinclude.m4	2010-06-14 16:25:25.000000000 +0200
-@@ -353,68 +353,8 @@ AC_ARG_WITH(gl-libraries,
-     [  ac_gl_libraries="$withval"
-     ])
- 
--AC_CACHE_VAL(ac_cv_have_gl,
--[
--if test ${VAR_WIN32} = 1
--then
--gl_incdirs=" /mingw/include $ac_gl_includes $GLDIR/include /usr/include /usr/X11R6/include/X11 /usr/X11R6/include $x_includes "
--else
--gl_incdirs=" $ac_gl_includes $GLDIR/include /usr/include /usr/X11R6/include/X11 /usr/X11R6/include $x_includes "
--fi
--AC_FIND_FILE(GL/gl.h, $gl_incdirs, gl_incdir)
--ac_gl_includes="$gl_incdir"
--
--if test ${VAR_WIN32} = 1
--then
--gl_libdirs="$GLDIR $ac_gl_libraries $GLLIB /usr/X11R6/lib /usr/lib /usr/local/lib $x_libraries "
--else
--gl_libdirs="$ac_gl_libraries $GLLIB /usr/X11R6/lib64 /usr/lib64 /usr/local/lib64/usr/X11R6/lib /usr/lib /usr/local/lib $x_libraries "
--fi
--
--test -n "$GLDIR" && gl_libdirs="$GLDIR/lib64 $GLDIR/lib $GLDIR $gl_libdirs"
--test=NONE
--gl_libdir=NONE
--for dir in $gl_libdirs; do
--if test ${VAR_WIN32} = 1
--then
--  try="ls -1 $dir/*opengl*"
--else
--  try="ls -1 $dir/libGL*"
--fi
--  if test=`eval $try 2> /dev/null`; then 
--    gl_libdir=$dir
--    if test ${VAR_WIN32} = 0 ; then 	 
--      try="ls -1 $gl_libdir/libGLEW.*" 	 
--      if test=`eval $try 2> /dev/null`; then break; else AC_MSG_ERROR([ libGLEW not found , please install it in $gl_libdir ]); fi 	 
--    else 	 
--      break 	 
--    fi
--  else 
--    echo "tried $dir" >&AC_FD_CC
--  fi
--done
--ac_gl_libraries="$gl_libdir"
- ])
- 
--eval "$ac_cv_have_gl"
--if test "$ac_gl_libraries" = NONE; then
--  AC_MSG_ERROR([ Not found , put your GLDIR environnement variable to the OpenGL directory ]);
--else
--  ac_cv_have_gl="have_gl=yes \
--  ac_gl_includes=$ac_gl_includes ac_gl_libraries=$ac_gl_libraries"
--  AC_MSG_RESULT([ libraries $ac_gl_libraries, headers $ac_gl_includes ])  
--  gl_libraries="$ac_gl_libraries"
--  gl_includes="$ac_gl_includes"
--if test ${VAR_MACOSX} = 1
--then
--  GL_INCLUDES="-I$ac_gl_includes"
--  GL_LDFLAGS=""
--else
--  GL_INCLUDES="-I$ac_gl_includes"	
--  GL_LDFLAGS="-L$ac_gl_libraries"
--fi
--fi
--
- dnl MAC PORT
- if test ${VAR_MACOSX} = 1
- then
-
diff --git a/pkgs/applications/science/misc/tulip/default.nix b/pkgs/applications/science/misc/tulip/default.nix
index 3bca42023e9f..b213c14cc1a5 100644
--- a/pkgs/applications/science/misc/tulip/default.nix
+++ b/pkgs/applications/science/misc/tulip/default.nix
@@ -1,31 +1,23 @@
 { fetchurl, stdenv, libxml2, freetype, mesa, glew, qt
-, autoconf, automake, libtool }:
+, autoconf, automake, libtool, cmake, makeWrapper }:
 
-let version = "3.4.0"; in
+let version = "3.5.0"; in
 stdenv.mkDerivation rec {
   name = "tulip-${version}";
 
   src = fetchurl {
-    url = "mirror://sourceforge/auber/tulip/tulip-${version}/${name}.tar.bz2";
-    sha256 = "2889113f773ba539472d501fb4f45dbf5eb76e02c949dfa74c63f6f815a2baab";
+    url = "mirror://sourceforge/auber/tulip/tulip-${version}/${name}-src.tar.gz";
+    sha256 = "0wl0wqjlifpay61pn7dxr3dl5r4a7v80f5g277p6s06ibvn2p3ln";
   };
 
-  patches = [ ./configure-opengl.patch ];
-
-  preConfigure =
-    '' export CPATH="${mesa}/include:${glew}/include"
-       export LIBRARY_PATH="${mesa}/lib:${glew}/lib"
-       export QTDIR="${qt}"
-       export LDFLAGS="-lGLEW"
-
-       rm -vf aclocal.m4 ltmain.sh
-       autoreconf -fi
-    '';
-
   buildInputs = [ libxml2 freetype glew ]
-    ++ [ autoconf automake libtool ];
+    ++ [ autoconf automake libtool cmake qt makeWrapper ];
   propagagedBuildInputs = [ mesa qt ];
 
+  postInstall=''
+    wrapProgram "$out/bin/tulip"
+  '';
+
   # FIXME: "make check" needs Docbook's DTD 4.4, among other things.
   doCheck = false;
 
diff --git a/pkgs/applications/taxes/aangifte-2010/default.nix b/pkgs/applications/taxes/aangifte-2010/default.nix
new file mode 100644
index 000000000000..cd8a3b62269b
--- /dev/null
+++ b/pkgs/applications/taxes/aangifte-2010/default.nix
@@ -0,0 +1,37 @@
+{ stdenv, fetchurl, makeWrapper, xdg_utils, libX11, libXext, libSM }:
+
+stdenv.mkDerivation {
+  name = "aangifte2010-1";
+  
+  src = fetchurl {
+    url = http://download.belastingdienst.nl/belastingdienst/apps/linux/ib2010_linux.tar.gz;
+    sha256 = "15mingjyqjvy4k6ws6qlhaaw8dj7336b54zg7mj70ig7jskjkz5h";
+  };
+
+  dontStrip = true;
+  dontPatchELF = true;
+
+  buildInputs = [ makeWrapper ];
+
+  buildPhase =
+    ''
+      for i in bin/*; do
+          patchelf \
+              --set-interpreter "$(cat $NIX_GCC/nix-support/dynamic-linker)" \
+              --set-rpath ${stdenv.lib.makeLibraryPath [ libX11 libXext libSM ]}:$(cat $NIX_GCC/nix-support/orig-gcc)/lib \
+              $i
+      done
+    '';
+
+  installPhase =
+    ''
+      ensureDir $out
+      cp -prvd * $out/
+      wrapProgram $out/bin/ib2010ux --prefix PATH : ${xdg_utils}/bin
+    '';
+
+  meta = {
+    description = "Elektronische aangifte IB 2010 (Dutch Tax Return Program)";
+    url = http://www.belastingdienst.nl/particulier/aangifte2009/download/;
+  };
+}
diff --git a/pkgs/applications/version-management/bazaar/default.nix b/pkgs/applications/version-management/bazaar/default.nix
index 46a09ccf422c..8eb28ea04c73 100644
--- a/pkgs/applications/version-management/bazaar/default.nix
+++ b/pkgs/applications/version-management/bazaar/default.nix
@@ -1,30 +1,27 @@
-{stdenv, fetchurl, python, makeWrapper}:
+{ stdenv, fetchurl, pythonPackages }:
 
 stdenv.mkDerivation rec {
-  version = "2.2";
-  release = ".0";
+  version = "2.3";
+  release = ".1";
   name = "bazaar-${version}${release}";
 
   src = fetchurl {
     url = "http://launchpad.net/bzr/${version}/${version}${release}/+download/bzr-${version}${release}.tar.gz";
-    sha256 = "64cd6c23097884e40686adc7f0ad4a8200e2292bdc5e0caba3563b6f5c32bacf";
+    sha256 = "07kx41w4gqv68bcykdflsg68wvpmcyqknzyb4vr1zqlf27hahp53";
   };
 
-  buildInputs = [python makeWrapper];
+  buildInputs = [ pythonPackages.python pythonPackages.wrapPython ];
+
+  # Readline support is needed by bzrtools.
+  pythonPath = [ pythonPackages.ssl pythonPackages.readline ];
 
   installPhase = ''
     python setup.py install --prefix=$out
-    wrapProgram $out/bin/bzr --prefix PYTHONPATH : "$(toPythonPath $out)"
+    wrapPythonPrograms
   '';
 
-  passthru = {
-    # If someone wants to assert python features..
-    inherit python;
-  };
-
   meta = {
     homepage = http://bazaar-vcs.org/;
     description = "A distributed version control system that Just Works";
   };
-
 }
diff --git a/pkgs/applications/version-management/bazaar/tools.nix b/pkgs/applications/version-management/bazaar/tools.nix
index 5e5292cf1306..5a4b706f418a 100644
--- a/pkgs/applications/version-management/bazaar/tools.nix
+++ b/pkgs/applications/version-management/bazaar/tools.nix
@@ -1,9 +1,5 @@
 args : with args; 
 
-if ! bazaar.python.readlineSupport then 
-  throw "Bazaar Tools require readline support in python."
-else
-
 rec {
   version = "2.2.0";
   src = fetchurl {
diff --git a/pkgs/applications/version-management/darcs/darcs-2.nix b/pkgs/applications/version-management/darcs/darcs-2.nix
deleted file mode 100644
index eb7c3f066e9d..000000000000
--- a/pkgs/applications/version-management/darcs/darcs-2.nix
+++ /dev/null
@@ -1,20 +0,0 @@
-{cabal, curl, html, mtl, parsec, regexCompat, haskeline, hashedStorage, zlib, tar, text} :
-
-cabal.mkDerivation (self : {
-  pname = "darcs";
-  name = self.fname;
-  version = "2.5";
-  sha256 = "0i99z3wsfc1hhr0a0ax7254gj3i69yg8cb9lhp55wl6lfqvpzcnh";
-
-  propagatedBuildInputs = [
-    curl html parsec regexCompat haskeline hashedStorage zlib tar text
-  ];
-
-  meta = {
-    homepage = http://darcs.net/;
-    description = "Patch-based version management system";
-    license = "GPL";
-    maintainers = [self.stdenv.lib.maintainers.andres];
-  };
-
-})
diff --git a/pkgs/applications/version-management/darcs/default.nix b/pkgs/applications/version-management/darcs/default.nix
new file mode 100644
index 000000000000..e3f1742ee594
--- /dev/null
+++ b/pkgs/applications/version-management/darcs/default.nix
@@ -0,0 +1,27 @@
+{ cabal, curl, extensibleExceptions, hashedStorage, haskeline, html
+, HTTP, mmap, mtl, network, parsec, random, regexCompat, tar
+, terminfo, text, zlib
+}:
+
+cabal.mkDerivation (self: {
+  pname = "darcs";
+  version = "2.5.2";
+  sha256 = "11mk1xcrxk2x5c0s96s19wb4xvhjl9s59bdqcrj8f4w09zbgjlw9";
+  isLibrary = true;
+  isExecutable = true;
+  buildDepends = [
+    extensibleExceptions hashedStorage haskeline html HTTP mmap mtl
+    network parsec random regexCompat tar terminfo text zlib
+  ];
+  extraLibraries = [ curl ];
+  meta = {
+    homepage = "http://darcs.net/";
+    description = "a distributed, interactive, smart revision control system";
+    license = "GPL";
+    platforms = self.ghc.meta.platforms;
+    maintainers = [
+      self.stdenv.lib.maintainers.andres
+      self.stdenv.lib.maintainers.simons
+    ];
+  };
+})
diff --git a/pkgs/applications/version-management/fossil/default.nix b/pkgs/applications/version-management/fossil/default.nix
index 5feb8a429e33..002226292b02 100644
--- a/pkgs/applications/version-management/fossil/default.nix
+++ b/pkgs/applications/version-management/fossil/default.nix
@@ -1,15 +1,16 @@
 {stdenv, fetchurl, zlib, openssl, tcl}:
 
 let
-  version = "20101207133137";
+  version = "1.18";
+  filedate = "20110713230341";
 in
 
 stdenv.mkDerivation {
   name = "fossil-${version}";
 
   src = fetchurl {
-    url = "http://www.fossil-scm.org/download/fossil-src-${version}.tar.gz";
-    sha256 = "1yx35gq9ialvnvjn1r5yar4zxgy0rkxzyz9paxwy8qan3qb53mwz";
+    url = "http://www.fossil-scm.org/download/fossil-src-${filedate}.tar.gz";
+    sha256 = "065hp5hppzjzvvk9g8zaqbfms011rkiimydnfsgkp4s8jlc2h6dc";
   };
 
   buildInputs = [ zlib openssl ];
@@ -17,6 +18,8 @@ stdenv.mkDerivation {
 
   doCheck = true;
 
+  configurePhase = ":";
+
   checkTarget = "test";
 
   installPhase = ''
diff --git a/pkgs/applications/version-management/git-and-tools/default.nix b/pkgs/applications/version-management/git-and-tools/default.nix
index 419918e983ee..53e4bfbe83b6 100644
--- a/pkgs/applications/version-management/git-and-tools/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/default.nix
@@ -4,18 +4,16 @@
 args: with args; with pkgs;
 let
   inherit (pkgs) stdenv fetchurl subversion;
-  config = getPkgConfig "git";
 in
 rec {
 
   git = lib.makeOverridable (import ./git) {
     inherit fetchurl stdenv curl openssl zlib expat perl python gettext gnugrep
-      asciidoc texinfo xmlto docbook2x
-      docbook_xsl docbook_xml_dtd_45 libxslt
+      asciidoc texinfo xmlto docbook2x docbook_xsl docbook_xml_dtd_45 libxslt
       cpio tcl tk makeWrapper subversion;
-    svnSupport = config "svnSupport" false; # for git-svn support
-    guiSupport = config "guiSupport" false;
-    sendEmailSupport = config "sendEmailSupport" false;
+    svnSupport = false;		# for git-svn support
+    guiSupport = false;		# requires tcl/tk
+    sendEmailSupport = false;	# requires plenty of perl libraries
     perlLibs = [perlPackages.LWP perlPackages.URI perlPackages.TermReadKey];
     smtpPerlLibs = [
       perlPackages.NetSMTP perlPackages.NetSMTPSSL
@@ -25,23 +23,34 @@ rec {
     ];
   };
 
+  # Git with SVN support, but without GUI.
+  gitSVN = lowPrio (appendToName "with-svn" (git.override {
+    svnSupport = true;
+  }));
+
   # The full-featured Git.
-  gitFull = git.override {
+  gitFull = appendToName "full" (git.override {
     svnSupport = true;
     guiSupport = true;
     sendEmailSupport = stdenv.isDarwin == false;
-  };
+  });
 
   gitGit = import ./git/git-git.nix {
     inherit fetchurl sourceFromHead stdenv curl openssl zlib expat perl gettext
       asciidoc texinfo xmlto docbook2x
       docbook_xsl docbook_xml_dtd_45 libxslt
       cpio tcl tk makeWrapper subversion autoconf;
-    svnSupport = config "svnSupport" false; # for git-svn support
-    guiSupport = config "guiSupport" false;
+    svnSupport = false;
+    guiSupport = false;
     perlLibs = [perlPackages.LWP perlPackages.URI perlPackages.TermReadKey subversion];
   };
 
+  gitAnnex = lib.makeOverridable (import ./git-annex) {
+    inherit stdenv fetchurl libuuid rsync findutils curl perl git ikiwiki which;
+    inherit (haskellPackages) ghc MissingH utf8String QuickCheck2 pcreLight SHA dataenc
+      HTTP testpack monadControl;
+  };
+
   qgit = import ./qgit {
     inherit fetchurl stdenv;
     inherit (xlibs) libXext libX11;
@@ -56,37 +65,11 @@ rec {
 
 
   stgit = import ./stgit {
-        inherit fetchurl stdenv python git;
+    inherit fetchurl stdenv python git;
   };
 
-  topGit = stdenv.mkDerivation rec {
-    name = "topgit-0.8-32-g8b0f1f9";
-
-    src = fetchurl {
-      url = "http://repo.or.cz/w/topgit.git/snapshot/${name}.zip";
-      sha256 = "0v3binh7wc2di57w6rdnlww30ryszzsklfdmm61sl1ildyl1klk4";
-    };
-
-    buildInputs = [unzip];
-    configurePhase = "export prefix=$out";
-
-    postInstall = ''
-      mkdir -p "$out/share/doc/${name}"
-      cp -v README "$out/share/doc/${name}"
-
-      mkdir -p $out/etc/bash_completion.d
-      make prefix=$out \
-        install
-      mv contrib/tg-completion.bash $out/etc/bash_completion.d
-    '';
-
-    meta = {
-      description = "TopGit aims to make handling of large amount of interdependent topic branches easier";
-      maintainers = [ lib.maintainers.marcweber lib.maintainers.ludo lib.maintainers.simons ];
-      homepage = http://repo.or.cz/w/topgit.git;
-      license = "GPLv2";
-      platforms = stdenv.lib.platforms.unix;
-    };
+  topGit = lib.makeOverridable (import ./topgit) {
+    inherit stdenv fetchurl unzip;
   };
 
   tig = stdenv.mkDerivation {
@@ -116,12 +99,16 @@ rec {
     inherit fetchgit stdenv perl;
   };
 
+  svn2git = import ./svn2git {
+    inherit stdenv fetchgit qt47 subversion apr;
+  };
+
   gitSubtree = stdenv.mkDerivation {
-    name = "git-subtree-0.3";
+    name = "git-subtree-0.4";
     src = fetchurl {
-      url = "http://github.com/apenwarr/git-subtree/tarball/v0.3";
+      url = "http://github.com/apenwarr/git-subtree/tarball/v0.4";
 #      sha256 = "0y57lpbcc2142jgrr4lflyb9xgzs9x33r7g4b919ncn3alb95vdr";
-      sha256 = "f2ccac1e9cff4c35d989dc2a5581133c96b72d96c6a5ed89e51b6446dadac03f";
+      sha256 = "19s8352igwh7x1nqgdfs7rgxahw9cnfv7zmpzpd63m1r3l2945d4";
     };
     unpackCmd = "gzip -d < $curSrc | tar xvf -";
     buildInputs = [ git asciidoc xmlto docbook_xsl docbook_xml_dtd_45 libxslt ];
diff --git a/pkgs/applications/version-management/git-and-tools/git-annex/default.nix b/pkgs/applications/version-management/git-and-tools/git-annex/default.nix
new file mode 100644
index 000000000000..d72b1868b039
--- /dev/null
+++ b/pkgs/applications/version-management/git-and-tools/git-annex/default.nix
@@ -0,0 +1,52 @@
+{ stdenv, fetchurl, ghc, libuuid, rsync, findutils, curl, perl, MissingH, utf8String
+, QuickCheck2, pcreLight, SHA, dataenc, HTTP, testpack, git, ikiwiki, which
+, monadControl }:
+
+let
+  version = "3.20110819";
+in
+stdenv.mkDerivation {
+  name = "git-annex-${version}";
+
+  src = fetchurl {
+    url = "http://ftp.de.debian.org/debian/pool/main/g/git-annex/git-annex_${version}.tar.gz";
+    sha256 = "1442ba4ff35ec8f92f336a5f1055d7ad8306348871a9697262f4f2af3b3c0943";
+  };
+
+  buildInputs = [ghc libuuid rsync findutils curl perl MissingH utf8String QuickCheck2 pcreLight
+    SHA dataenc HTTP testpack git ikiwiki which monadControl];
+
+  checkTarget = "test";
+  doCheck = true;
+
+  preConfigure = ''
+    makeFlagsArray=( PREFIX=$out )
+    sed -i -e 's|#!/usr/bin/perl|#!${perl}/bin/perl|' mdwn2man
+  '';
+
+  meta = {
+    homepage = "http://git-annex.branchable.com/";
+    description = "Manage files with git without checking them into git";
+    license = "GPLv3+";
+
+    longDescription = ''
+      Git-annex allows managing files with git, without checking the
+      file contents into git. While that may seem paradoxical, it is
+      useful when dealing with files larger than git can currently
+      easily handle, whether due to limitations in memory, checksumming
+      time, or disk space.
+
+      Even without file content tracking, being able to manage files
+      with git, move files around and delete files with versioned
+      directory trees, and use branches and distributed clones, are all
+      very handy reasons to use git. And annexed files can co-exist in
+      the same git repository with regularly versioned files, which is
+      convenient for maintaining documents, Makefiles, etc that are
+      associated with annexed files but that benefit from full revision
+      control.
+    '';
+
+    platforms = ghc.meta.platforms;
+    maintainers = [ stdenv.lib.maintainers.simons ];
+  };
+}
diff --git a/pkgs/applications/version-management/git-and-tools/git/default.nix b/pkgs/applications/version-management/git-and-tools/git/default.nix
index 5ed6275caf70..ee207788875b 100644
--- a/pkgs/applications/version-management/git-and-tools/git/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/git/default.nix
@@ -12,11 +12,11 @@ let
 in
 
 stdenv.mkDerivation rec {
-  name = "git-1.7.3.2";
+  name = "git-1.7.6";
 
   src = fetchurl {
     url = "mirror://kernel/software/scm/git/${name}.tar.bz2";
-    sha256 = "0w9yappfl0jb88fk28vv680p33c2j4b0afzl1q2mcq0igjygck5w";
+    sha256 = "778795cece63cd758192378f3a999870cea290181b3a4c9de573c77192561082";
   };
 
   patches = [ ./docbook2texi.patch ];
@@ -41,16 +41,25 @@ stdenv.mkDerivation rec {
         chmod +x $1
       }
 
-      # Install Emacs mode.
-      echo "installing Emacs mode..."
+      # Install contrib stuff.
+      ensureDir $out/share/git
+      mv contrib $out/share/git/
       ensureDir $out/share/emacs/site-lisp
-      cp -p contrib/emacs/*.el $out/share/emacs/site-lisp
+      ln -s "$out/share/git/contrib/emacs/"*.el $out/share/emacs/site-lisp/
+      ensureDir $out/etc/bash_completion.d
+      ln -s $out/share/git/contrib/completion/git-completion.bash $out/etc/bash_completion.d/
 
       # grep is a runtime dependence, need to patch so that it's found
       substituteInPlace $out/libexec/git-core/git-sh-setup \
           --replace ' grep' ' ${gnugrep}/bin/grep' \
           --replace ' egrep' ' ${gnugrep}/bin/egrep'
-    '' # */
+
+      # Fix references to the perl binary. Note that the tab character
+      # in the patterns is important.
+      sed -i -e 's|	perl -ne|	${perl}/bin/perl -ne|g' \
+             -e 's|	perl -e|	${perl}/bin/perl -e|g' \
+             $out/libexec/git-core/{git-am,git-submodule}
+    ''
 
    + (if svnSupport then
 
@@ -84,41 +93,37 @@ stdenv.mkDerivation rec {
 
    + (if guiSupport then ''
        # Wrap Tcl/Tk programs
-       for prog in bin/gitk bin/git
-       do
-         wrapProgram "$out/$prog"                       \
-                     --set TK_LIBRARY "${tk}/lib/${tk.libPrefix}" \
-                     --prefix PATH : "${tk}/bin"
+       for prog in bin/gitk libexec/git-core/{git-gui,git-citool,git-gui--askpass}; do
+         sed -i -e "s|exec 'wish'|exec '${tk}/bin/wish'|g" \
+                -e "s|exec wish|exec '${tk}/bin/wish'|g" \
+		"$out/$prog"
        done
      '' else ''
-      # Don't wrap Tcl/Tk, replace them by notification scripts
-       for prog in bin/gitk libexec/git-core/git-gui
-       do
+       # Don't wrap Tcl/Tk, replace them by notification scripts
+       for prog in bin/gitk libexec/git-core/git-gui; do
          notSupported "$out/$prog" \
                       "reinstall with config git = { guiSupport = true; } set"
        done
      '')
 
-   + ''# install bash completion script
-      d="$out/etc/bash_completion.d"
-      ensureDir $d; cp contrib/completion/git-completion.bash "$d"
-     ''
    # Don't know why hardlinks aren't created. git installs the same executable
    # multiple times into $out so replace duplicates by symlinks because I
    # haven't tested whether the nix distribution system can handle hardlinks.
    # This reduces the size of $out from 115MB down to 13MB on x86_64-linux!
-   + ''#
+   + ''
       declare -A seen
-      find $out -type f | while read f; do
+      shopt -s globstar
+      for f in "$out/"**; do
+        if [ -L "$f" ]; then continue; fi
+        test -f "$f" || continue
         sum=$(md5sum "$f");
         sum=''\${sum/ */}
         if [ -z "''\${seen["$sum"]}" ]; then
           seen["$sum"]="$f"
         else
-          rm "$f"; ln -s "''\${seen["$sum"]}" "$f"
+          rm "$f"; ln -v -s "''\${seen["$sum"]}" "$f"
         fi
       done
-
      '';
 
   enableParallelBuilding = true;
diff --git a/pkgs/applications/version-management/git-and-tools/git2cl/default.nix b/pkgs/applications/version-management/git-and-tools/git2cl/default.nix
index 026fc18c8018..f3fc8c9b6e98 100644
--- a/pkgs/applications/version-management/git-and-tools/git2cl/default.nix
+++ b/pkgs/applications/version-management/git-and-tools/git2cl/default.nix
@@ -1,19 +1,22 @@
-{ fetchgit
-, stdenv
-, perl
-}:
-stdenv.mkDerivation rec {
+{ fetchgit, stdenv, perl }:
+
+stdenv.mkDerivation {
   name = "git2cl";
 
   src = fetchgit {
-    url = git://git.sv.gnu.org/git2cl.git;
+    url = "git://repo.or.cz/git2cl.git";
     rev = "8373c9f74993e218a08819cbcdbab3f3564bbeba";
     sha256 = "b0d39379640c8a12821442431e2121f7908ce1cc88ec8ec6bede218ea8c21f2f";
   };
 
-  buildCommand = ''
-    ensureDir $out/bin
-    cp ${src}/git2cl $out/bin
-    sed -i 's|/usr/bin/perl|${perl}/bin/perl|' $out/bin/git2cl
+  buildInputs = [ perl ];
+  installPhase = ''
+    install -D -m755 git2cl $out/bin/git2cl
+    install -D -m644 README $out/share/doc/git2cl/README
   '';
+
+  meta = {
+    homepage = "http://josefsson.org/git2cl/";
+    description = "convert git logs to GNU style ChangeLog files";
+  };
 }
diff --git a/pkgs/applications/version-management/git-and-tools/svn2git/default.nix b/pkgs/applications/version-management/git-and-tools/svn2git/default.nix
new file mode 100644
index 000000000000..ae928fa2d4d5
--- /dev/null
+++ b/pkgs/applications/version-management/git-and-tools/svn2git/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, fetchgit, qt47, subversion, apr}:
+
+stdenv.mkDerivation rec {
+  name = "svn2git";
+
+  src = fetchgit {
+    url = http://git.gitorious.org/svn2git/svn2git.git;
+    rev = "197979b6a641b8b5fa4856c700b1235491c73a41";
+    sha256 = "7be1a8f5822aff2d4ea7f415dce0b4fa8c6a82310acf24e628c5f1ada2d2d613";
+  };
+
+  buildPhase = ''
+    sed -i 's|/bin/cat|cat|' ./src/repository.cpp
+    qmake
+    make CXXFLAGS='-I${apr}/include/apr-1 -I${subversion}/include/subversion-1 -DVER="\"${src.rev}\""'
+  '';
+
+  installPhase = ''
+    ensureDir $out/bin
+    cp svn-all-fast-export $out/bin
+  '';
+
+  buildInputs = [subversion apr qt47];
+  
+}
diff --git a/pkgs/applications/version-management/git-and-tools/topgit/default.nix b/pkgs/applications/version-management/git-and-tools/topgit/default.nix
new file mode 100644
index 000000000000..ef8bb1b4dcfd
--- /dev/null
+++ b/pkgs/applications/version-management/git-and-tools/topgit/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchurl, unzip }:
+
+let
+  version = "0.8-45-gd279e29";
+  lib = stdenv.lib;
+in
+stdenv.mkDerivation {
+  name = "topgit-${version}";
+
+  src = fetchurl {
+    url = "http://repo.or.cz/w/topgit.git/snapshot/topgit-${version}.zip";
+    sha256 = "0vzrng1w2k7m4z0x9h6zbrcf33dx08ly8fnbxzz3ms2k2dbsmpl6";
+  };
+
+  buildInputs = [unzip];
+  configurePhase = "export prefix=$out";
+
+  postInstall = ''
+    ensureDir "$out/share/doc/topgit-${version}"
+    cp README "$out/share/doc/topgit-${version}/"
+    ensureDir "$out/etc/bash_completion.d"
+    make prefix="$out" install
+    mv "contrib/tg-completion.bash" "$out/etc/bash_completion.d/"
+  '';
+
+  meta = {
+    description = "TopGit aims to make handling of large amount of interdependent topic branches easier";
+    maintainers = [ lib.maintainers.marcweber lib.maintainers.ludo lib.maintainers.simons ];
+    homepage = http://repo.or.cz/w/topgit.git;
+    license = "GPLv2";
+    platforms = stdenv.lib.platforms.unix;
+  };
+}
diff --git a/pkgs/applications/version-management/kdesvn/default.nix b/pkgs/applications/version-management/kdesvn/default.nix
index b6893ba17e14..10a590e941b4 100644
--- a/pkgs/applications/version-management/kdesvn/default.nix
+++ b/pkgs/applications/version-management/kdesvn/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, lib, cmake, qt4, perl, gettext, apr, aprutil, subversion, db4
-, kdelibs, automoc4, phonon, kdebase}:
+, kdelibs, automoc4, phonon, kde_baseapps }:
 
 stdenv.mkDerivation {
   name = "kdesvn-1.5.5";
diff --git a/pkgs/applications/version-management/meld/default.nix b/pkgs/applications/version-management/meld/default.nix
index 9a4c58d11c48..d131841618ec 100644
--- a/pkgs/applications/version-management/meld/default.nix
+++ b/pkgs/applications/version-management/meld/default.nix
@@ -1,18 +1,23 @@
 {stdenv, fetchurl, pygtk, python, intltool, scrollkeeper, makeWrapper }:
 
+let
+  minor = "1.5";
+  version = "${minor}.1";
+in
+
 stdenv.mkDerivation {
-  name = "meld-1.3.1";
+  name = "meld-${version}";
 
   src = fetchurl {
-    url = http://ftp.gnome.org/pub/gnome/sources/meld/1.3/meld-1.3.1.tar.bz2;
-    sha256 = "0iqnj3qb9l7z12akgmf64fr2xqirsqxflvj60xqcqr5vd5c763nn";
+    url = "http://ftp.gnome.org/pub/gnome/sources/meld/${minor}/meld-${version}.tar.bz2";
+    sha256 = "0ykj3rb5hvcr4dmc52mz8q3iknrsh042v1x7yvffgs6yibakcac2";
   };
 
   buildInputs = [ pygtk python intltool scrollkeeper makeWrapper ];
 
   patchPhase = ''
     sed -e s,/usr/local,$out, -i INSTALL
-    sed -e 's,#!.*,#!${python}/bin/python,' -i meld
+    sed -e 's,#!.*,#!${python}/bin/python,' -i bin/meld
   '';
 
   postInstall = ''
diff --git a/pkgs/applications/version-management/mercurial/default.nix b/pkgs/applications/version-management/mercurial/default.nix
index f3d18036d079..eca4dfea17ee 100644
--- a/pkgs/applications/version-management/mercurial/default.nix
+++ b/pkgs/applications/version-management/mercurial/default.nix
@@ -1,20 +1,20 @@
-{ stdenv, fetchurl, python, makeWrapper
-, guiSupport ? false, tk ? null }:
+{ stdenv, fetchurl, python, makeWrapper, docutils
+, guiSupport ? false, tk ? null, ssl }:
 
 stdenv.mkDerivation rec {
-  name = "mercurial-1.6.4";
-  
+  name = "mercurial-1.9";
+
   src = fetchurl {
-    url = "http://www.selenic.com/mercurial/release/${name}.tar.gz";
-    sha256 = "04c8vj942ys71dn0bjga33i0qi5hybjjhq087xd0jp29ijzxp3hy";
+    url = "http://mercurial.selenic.com/release/${name}.tar.gz";
+    sha256 = "1q1307rv5cyv7qalwkampy1h2f92j4d46v4x9647ljljs8f4n7ki";
   };
 
   inherit python; # pass it so that the same version can be used in hg2git
 
-  buildInputs = [ python makeWrapper ];
-  
+  buildInputs = [ python makeWrapper docutils ];
+
   makeFlags = "PREFIX=$(out)";
-  
+
   postInstall = (stdenv.lib.optionalString guiSupport
     ''
       ensureDir $out/etc/mercurial
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
     ''
       for i in $(cd $out/bin && ls); do
         wrapProgram $out/bin/$i \
-          --prefix PYTHONPATH : "$(toPythonPath $out)" \
+          --prefix PYTHONPATH : "$(toPythonPath "$out ${ssl}")" \
           $WRAP_TK
       done
 
diff --git a/pkgs/applications/version-management/monotone-viz/mtn-head.nix b/pkgs/applications/version-management/monotone-viz/mtn-head.nix
index 5cb2d3beed57..b9a2daade5b5 100644
--- a/pkgs/applications/version-management/monotone-viz/mtn-head.nix
+++ b/pkgs/applications/version-management/monotone-viz/mtn-head.nix
@@ -11,7 +11,7 @@ rec {
 
   buildInputs = [ocaml lablgtk libgnomecanvas gtk graphviz glib 
     pkgconfig autoconf automake libtool];
-  configureFlags = ["--with-lablgtk-dir=${lablgtk}/lib/ocaml/lablgtk2"];
+  configureFlags = ["--with-lablgtk-dir=$(echo ${lablgtk}/lib/ocaml/*/site-lib/lablgtk2)"];
 
   /* doConfigure should be specified separately */
   phaseNames = ["doAutoconf" "doPatch" "doConfigure" "doMakeInstall"];
diff --git a/pkgs/applications/version-management/monotone/default.nix b/pkgs/applications/version-management/monotone/default.nix
index fbd36417bfcc..70dd669e30fd 100644
--- a/pkgs/applications/version-management/monotone/default.nix
+++ b/pkgs/applications/version-management/monotone/default.nix
@@ -1,25 +1,33 @@
-{stdenv, fetchurl, boost, zlib, botan, libidn,
-  lua, pcre, sqlite, perl, pkgconfig}:
+{ stdenv, fetchurl, boost, zlib, botan, libidn
+, lua, pcre, sqlite, perl, pkgconfig }:
 
-let 
-  version = "0.99.1";
-  perlVersion = builtins.substring 5 10 perl.name;
-in stdenv.mkDerivation rec {
+let
+  version = "1.0";
+  perlVersion = (builtins.parseDrvName perl.name).version;
+in
+
+assert perlVersion != "";
+
+stdenv.mkDerivation rec {
   name = "monotone-${version}";
+
   src = fetchurl {
-    url = "http://monotone.ca/downloads/${version}/monotone-${version}.tar.gz";
-    sha256 = "189h5f6gqd4ng0qmzi3xwnj17nnpxm2vzras216ar6b5yc9bnki0";
+    url = "http://monotone.ca/downloads/${version}/monotone-${version}.tar.bz2";
+    sha256 = "5c530bc4652b2c08b5291659f0c130618a14780f075f981e947952dcaefc31dc";
   };
+
   buildInputs = [boost zlib botan libidn lua pcre sqlite pkgconfig];
+
   postInstall = ''
     ensureDir $out/share/${name}
     cp -rv contrib/ $out/share/${name}/contrib
     ensureDir $out/lib/perl5/site_perl/${perlVersion}
     cp -v contrib/Monotone.pm $out/lib/perl5/site_perl/${perlVersion}
   '';
+
   meta = {
     description = "A free distributed version control system";
     maintainers = [stdenv.lib.maintainers.raskin];
-    platforms = stdenv.lib.platforms.all;
+    platforms = stdenv.lib.platforms.unix;
   };
 }
diff --git a/pkgs/applications/version-management/subversion/default.nix b/pkgs/applications/version-management/subversion/default.nix
index 95d21e2f7a6c..e1604ccc2e76 100644
--- a/pkgs/applications/version-management/subversion/default.nix
+++ b/pkgs/applications/version-management/subversion/default.nix
@@ -19,13 +19,13 @@ assert compressionSupport -> neon.compressionSupport;
 
 stdenv.mkDerivation rec {
 
-  version = "1.6.15";
+  version = "1.6.17";
 
   name = "subversion-${version}";
 
   src = fetchurl {
     url = "http://subversion.tigris.org/downloads/${name}.tar.bz2";
-    sha1 = "b6fadf944a94b86f989f07bc2d781be41df017bf";
+    sha1 = "6e3ed7c87d98fdf5f0a999050ab601dcec6155a1";
   };
 
   buildInputs = [ zlib apr aprutil sqlite ]
diff --git a/pkgs/applications/version-management/veracity/default.nix b/pkgs/applications/version-management/veracity/default.nix
index 3005da5aba69..82a588f6a1ed 100644
--- a/pkgs/applications/version-management/veracity/default.nix
+++ b/pkgs/applications/version-management/veracity/default.nix
@@ -2,13 +2,14 @@ x@{builderDefsPackage
   , cmake, curl, patch, zlib, icu, sqlite, libuuid
   , readline, openssl, spidermonkey_1_8_0rc1
   , nspr, nss
+  , runTests ? false
   , ...}:
 builderDefsPackage
 (a :  
 let 
   s = import ./src-for-default.nix;
   helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ 
-    [];
+    ["runTests"];
   buildInputs = map (n: builtins.getAttr n x)
     (builtins.attrNames (builtins.removeAttrs x helperArgNames));
     
@@ -19,19 +20,35 @@ rec {
   inherit (s) name;
   inherit buildInputs;
 
-  phaseNames = ["prepare_sgneeds" "dump0" "prepareMakefiles" "doMake" "doDeploy"];
+  phaseNames = ["prepare_sgneeds" "dump0" "prepareMakefiles" "doMake" "doTest" "doDeploy"];
 
   dump0 = (a.doDump "0");
 
+  runTests = a.stdenv.lib.attrByPath ["runTests"] false a;
+
+  doTest = a.fullDepEntry (if runTests then ''
+    sed -e "s@/bin/bash@${a.stdenv.shell}@" -i $(find .. -type f)
+    mkdir pseudo-home
+    export HOME=$PWD/pseudo-home
+    make test || true
+  '' else "") ["doMake" "minInit"];
+
   prepare_sgneeds = a.fullDepEntry (''
+    ensureDir "$out/sgneeds/include/spidermonkey"
     for d in bin include lib; do 
       ensureDir "$out/sgneeds/$d"
+      ensureDir "$out/sgneeds/$d"
       for p in "${spidermonkey_1_8_0rc1}"; do
         for f in "$p"/"$d"/*; do
 	  ln -sf "$f" "$out"/sgneeds/"$d"
 	done
       done
     done
+      for p in  "${spidermonkey_1_8_0rc1}/include" "${spidermonkey_1_8_0rc1}/include/js"; do
+        for f in "$p"/*; do
+	  ln -sf "$f" "$out"/sgneeds/include/spidermonkey/
+	done
+      done
 
     ensureDir "$out/sgneeds/include/sgbrings"
     ln -s "$out/sgneeds/include/js" "$out/sgneeds/include/sgbrings/js"
@@ -41,14 +58,19 @@ rec {
     done
 
     export SGNEEDS_DIR="$out"/sgneeds/
+    export VVTHIRDPARTY="$out"/sgneeds/
+
+    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I$out/sgneeds/include"
   '') ["minInit" "defEnsureDir"];
 
   prepareMakefiles = a.fullDepEntry ''
+    sed -e 's@ /bin/uname @ uname @g' -i CMakeLists.txt
+    sed -e 's@ /bin/uname @ uname @g' -i common-CMakeLists.txt
     cd ..
     mkdir build
     cd build
     export NIX_LDFLAGS="$NIX_LDFLAGS -lssl"
-    cmake -G "Unix Makefiles" -D SGNEEDS_DIR="$SGNEEDS_DIR" ../veracity*
+    cmake -G "Unix Makefiles" -D SGNEEDS_DIR="$SGNEEDS_DIR" -D VVTHIRDPARTY="$VVTHIRDPARTY" -D SPIDERMONKEY_INCDIR="${a.spidermonkey_1_8_0rc1}/include" -D SPIDERMONKEY_LIB="${a.spidermonkey_1_8_0rc1}/lib/libjs.so" ../veracity*
   '' ["minInit" "addInputs" "doUnpack"];
 
   doDeploy = a.fullDepEntry ''
@@ -56,6 +78,10 @@ rec {
     cp -r .. "$out/share/veracity/build-dir"
     ln -s "$out/share/veracity/build-dir/build/src/cmd/vv" "$out/bin"
     ln -s "$out/share/veracity/build-dir/build/src/script/vscript" "$out/bin"
+    ${if runTests then "" else '' 
+      rm -rf  "$out/share/veracity/build-dir/veracity/testsuite" 
+      rm -rf  "$out/share/veracity/build-dir/build/testsuite" 
+    ''}
   '' ["doMake" "minInit" "defEnsureDir"];
 
   meta = {
diff --git a/pkgs/applications/version-management/veracity/src-for-default.nix b/pkgs/applications/version-management/veracity/src-for-default.nix
index 010c3acd929a..504d260204cd 100644
--- a/pkgs/applications/version-management/veracity/src-for-default.nix
+++ b/pkgs/applications/version-management/veracity/src-for-default.nix
@@ -1,9 +1,9 @@
 rec {
-   version="0.5.5.10353";
-   name="veracity-0.5.5.10353";
-   hash="06clsn9li6bxdihmzcjd6ch5n6n5wgydd0sw76mk0ljy7s9ylhjr";
-   url="http://download-us.sourcegear.com/Veracity/nightly/veracity-source-${version}.tar.gz";
-   advertisedUrl="http://download-us.sourcegear.com/Veracity/nightly/veracity-source-0.5.5.10353.tar.gz";
+   version="1.0.0.10517";
+   name="veracity-1.0.0.10517";
+   hash="08bka5zzn7i7c3dm3xp57n3szvm9msmi7mq1zynqb6i210qix79g";
+   url="http://download.sourcegear.com/Veracity/release/1.0.0.10517/veracity-source-${version}.tar.gz";
+   advertisedUrl="http://download.sourcegear.com/Veracity/release/1.0.0.10517/veracity-source-1.0.0.10517.tar.gz";
   
   
 }
diff --git a/pkgs/applications/version-management/veracity/src-info-for-default.nix b/pkgs/applications/version-management/veracity/src-info-for-default.nix
index dac6c65e85c6..cf4936ffc554 100644
--- a/pkgs/applications/version-management/veracity/src-info-for-default.nix
+++ b/pkgs/applications/version-management/veracity/src-info-for-default.nix
@@ -1,5 +1,5 @@
 {
-  #downloadPage = "http://sourcegear.com/veracity/downloads.html";
-  downloadPage = "http://download-us.sourcegear.com/Veracity/nightly/index.html";
+  downloadPage = "http://veracity-scm.org/downloads.html";
+  #downloadPage = "http://download-us.sourcegear.com/Veracity/nightly/index.html";
   baseName = "veracity";
 }
diff --git a/pkgs/applications/video/MPlayer/default.nix b/pkgs/applications/video/MPlayer/default.nix
index 11391cea975b..348a5e7e3237 100644
--- a/pkgs/applications/video/MPlayer/default.nix
+++ b/pkgs/applications/video/MPlayer/default.nix
@@ -1,6 +1,6 @@
 { alsaSupport ? true, xvSupport ? true, theoraSupport ? true, cacaSupport ? true
 , xineramaSupport ? true, randrSupport ? true, dvdnavSupport ? true
-, stdenv, fetchurl, x11, freetype, fontconfig, zlib
+, stdenv, fetchurl, fetchsvn, fetchgit, x11, freetype, fontconfig, zlib
 , alsaLib ? null, libXv ? null, libtheora ? null, libcaca ? null
 , libXinerama ? null, libXrandr ? null, libdvdnav ? null
 , cdparanoia ? null, cddaSupport ? true
@@ -49,29 +49,50 @@ let
 
   codecs = if codecs_src != null then stdenv.mkDerivation {
     name = "MPlayer-codecs-essential-20071007";
-  
+
     src = codecs_src;
 
     installPhase = ''
       mkdir $out
       cp -prv * $out
     '';
-  
+
     meta = {
       license = "unfree";
     };
   } else null;
+  
+  ffmpegGit = fetchgit {
+    url = "git://git.videolan.org/ffmpeg.git";
+    rev = "80d156d";
+    sha256 = "6d0124621491b8adc5f1bfb426ab137efc72dab99a89835aa3c30b970cb14004";
+  };
+  
+  mplayerRev = "33472";
 
-in  
+in
 
 stdenv.mkDerivation rec {
-  name = "MPlayer-1.0-pre20101227";
+  name = "mplayer-r${mplayerRev}";
+
+  src = fetchsvn {
+    # Old kind of URL:
+    # url = http://nixos.org/tarballs/mplayer-snapshot-20101227.tar.bz2;
+    # Snapshot I took on 20110423
 
-  src = fetchurl {
-    url = http://nixos.org/tarballs/mplayer-snapshot-20101227.tar.bz2;
-    sha256 = "0q9rvjz3byvs0qlnb9jbnw3qs6c3vdcqaqxm1rnql8kqic442hv2";
+    #Transient
+    #url = http://www.mplayerhq.hu/MPlayer/releases/mplayer-export-snapshot.tar.bz2;
+    #sha256 = "cc1b3fda75b172f02c3f46581cfb2c17f4090997fe9314ad046e464a76b858bb";
+
+    url = "svn://svn.mplayerhq.hu/mplayer/trunk";
+    rev = "${mplayerRev}";
+    sha256 = "01b0b5x6li8c2m2mam7mabmk02npvprcwrim00a51sdlvqxh309v";
   };
 
+  prePatch = ''
+    sed -i /^_install_strip/d configure
+  '';
+
   buildInputs =
     [ freetype zlib pkgconfig ]
     ++ stdenv.lib.optional x11Support [ libX11 libXext mesa ]
@@ -94,6 +115,16 @@ stdenv.mkDerivation rec {
 
   buildNativeInputs = [ yasm ];
 
+  preConfigure = ''
+    cp -r ${ffmpegGit} ffmpeg
+    chmod u+w -R ffmpeg
+    sed -ie '1i#include "libavutil/intreadwrite.h"' ffmpeg/libavcodec/libmp3lame.c
+  '';
+
+  postConfigure = ''
+    echo CONFIG_MPEGAUDIODSP=yes >> config.mak
+  '';
+
   configureFlags = ''
     ${if cacaSupport then "--enable-caca" else "--disable-caca"}
     ${if dvdnavSupport then "--enable-dvdnav --enable-dvdread --disable-dvdread-internal" else ""}
@@ -103,6 +134,9 @@ stdenv.mkDerivation rec {
     ${if x11Support then "--enable-x11" else ""}
     --disable-xanim
     --disable-ivtv
+    --enable-vidix
+    --enable-fbdev
+    --disable-ossaudio
   '';
 
   NIX_LDFLAGS = if x11Support then "-lX11 -lXext" else "";
@@ -115,14 +149,15 @@ stdenv.mkDerivation rec {
     '';
 
   crossAttrs = {
-    preConfigure = ''
+    dontSetConfigureCross = true;
+    # Some things (vidix) are nanonote specific. Once someone cares, we can make options from them.
+    preConfigure = preConfigure + ''
       configureFlags="`echo $configureFlags |
-        sed -e 's/--build[^ ]\+//' \
-        -e 's/--host[^ ]\+//' \
-        -e 's/--codecsdir[^ ]\+//' \
+        sed -e 's/--codecsdir[^ ]\+//' \
         -e 's/--enable-runtime-cpudetection//' `"
       configureFlags="$configureFlags --target=${stdenv.cross.arch}-linux
-        --cc=$crossConfig-gcc --as=$crossConfig-as"
+        --enable-cross-compile --cc=$crossConfig-gcc --as=$crossConfig-as
+        --disable-vidix-pcidb --with-vidix-drivers=no --host-cc=gcc"
     '';
   };
 
diff --git a/pkgs/applications/video/bangarang/default.nix b/pkgs/applications/video/bangarang/default.nix
index 7784fc439135..e6ff1770c46d 100644
--- a/pkgs/applications/video/bangarang/default.nix
+++ b/pkgs/applications/video/bangarang/default.nix
@@ -1,10 +1,10 @@
 { stdenv, fetchurl, cmake, qt4, kdelibs, automoc4, phonon, soprano, kdemultimedia, taglib, glibc, gettext }:
 stdenv.mkDerivation rec {
-  name = "bangarang-1.0.1";
+  name = "bangarang-2.0";
 
   src = fetchurl {
     url = "http://bangarangissuetracking.googlecode.com/files/${name}.tar.gz";
-    sha256 = "0a89w6zqyzcb34vp3qmyp1mdm2k0igm71b5sh11xnikjvs3k7c33";
+    sha256 = "1fixqx56k0mk0faz35rzpdg6zaa0mvm4548rg0g7fhafl35fxzlz";
   };
 
   buildInputs = [ cmake qt4 kdelibs automoc4 phonon soprano kdemultimedia taglib glibc gettext ];
diff --git a/pkgs/applications/video/cinelerra/default.nix b/pkgs/applications/video/cinelerra/default.nix
index 58a84d91b83e..83736d039327 100644
--- a/pkgs/applications/video/cinelerra/default.nix
+++ b/pkgs/applications/video/cinelerra/default.nix
@@ -1,39 +1,43 @@
-{ stdenv, fetchurl, sourceFromHead, autoconf, automake, libtool
+{ stdenv, fetchgit, sourceFromHead, autoconf, automake, libtool
 , pkgconfig, faad2, faac, a52dec, alsaLib, fftw, lame, libavc1394
 , libiec61883, libraw1394, libsndfile, libvorbis, libogg, libjpeg
-, libtiff, freetype, mjpegtools, x264, gettext, openexr, esound 
-, libXxf86vm, libXv, libXi, libX11, xextproto, libtheora, libpng
-, libdv, nasm, perl, e2fsprogs }:
+, libtiff, freetype, mjpegtools, x264, gettext, openexr, esound
+, libXext, libXxf86vm, libXv, libXi, libX11, xextproto, libtheora, libpng
+, libdv, libuuid, file, nasm, perl }:
         
 stdenv.mkDerivation {
   name = "cinelerra-git";
 
-  # REGION AUTO UPDATE:    { name="cinelerra"; type="git"; url="git://git.cinelerra.org/j6t/cinelerra.git"; }
-  src= sourceFromHead "cinelerra-9f9adf2ad5472886d5bc43a05c6aa8077cabd967.tar.gz"
-               (fetchurl { url = "http://mawercer.de/~nix/repos/cinelerra-9f9adf2ad5472886d5bc43a05c6aa8077cabd967.tar.gz"; sha256 = "0b264e2a770d2257550c9a23883a060afcaff12293fe43828954e7373f5f4fb4"; });
-  # END
+  # # REGION AUTO UPDATE:    { name="cinelerra"; type="git"; url="git://git.cinelerra.org/j6t/cinelerra.git"; }
+  # src= sourceFromHead "cinelerra-9f9adf2ad5472886d5bc43a05c6aa8077cabd967.tar.gz"
+  #              (fetchurl { url = "http://mawercer.de/~nix/repos/cinelerra-9f9adf2ad5472886d5bc43a05c6aa8077cabd967.tar.gz"; sha256 = "0b264e2a770d2257550c9a23883a060afcaff12293fe43828954e7373f5f4fb4"; });
+  # # END
 
-  # touch confi.rpath: work around bug in automake 1.10 ?
+  src = fetchgit {
+    url = "git://git.cinelerra.org/j6t/cinelerra.git";
+    rev = "01dc4375a0fb65d10dd95151473d0e195239175f";
+    sha256 = "afb406a5637e4d0afad94e62ffd3af5b61e39f75aba9c08521523d00a0a5fec5";
+  };
+
+  # touch config.rpath: work around bug in automake 1.10 ?
   preConfigure = ''
     find -type f -print0 | xargs --null sed -e "s@/usr/bin/perl@${perl}/bin/perl@" -i
     touch config.rpath
     ./autogen.sh
+    sed -i -e "s@/usr/bin/file@${file}/bin/file@" ./configure
   '';
-  
-  configureFlags = [ "--enable-freetype2" ];
 
   buildInputs =
     [ automake
-      autoconf libtool pkgconfig
+      autoconf libtool pkgconfig file
       faad2 faac
       a52dec alsaLib   fftw lame libavc1394 libiec61883
       libraw1394 libsndfile libvorbis libogg libjpeg libtiff freetype
       mjpegtools x264 gettext openexr esound 
-      libXxf86vm libXv libXi libX11 xextproto
-      libtheora libpng libdv
+      libXext libXxf86vm libXv libXi libX11 xextproto
+      libtheora libpng libdv libuuid
       nasm
       perl
-      e2fsprogs
     ];
 
   meta = { 
diff --git a/pkgs/applications/video/gnash/default.nix b/pkgs/applications/video/gnash/default.nix
index 00369be6c993..81b33849887c 100644
--- a/pkgs/applications/video/gnash/default.nix
+++ b/pkgs/applications/video/gnash/default.nix
@@ -3,19 +3,21 @@
 , gstFfmpeg, speex
 , libogg, libxml2, libjpeg, mesa, libpng, libungif, libtool
 , boost, freetype, agg, dbus, curl, pkgconfig, gettext
-, glib, gtk, gtkglext, x11, ming, dejagnu, python
-, lib, makeWrapper }:
+, glib, gtk, gtkglext, x11, ming, dejagnu, python, perl
+, freefont_ttf, haxe, swftools
+, lib, makeWrapper
+, xulrunner }:
 
 assert stdenv ? glibc;
 
-let version = "0.8.8"; in
+let version = "0.8.9"; in
 
 stdenv.mkDerivation rec {
   name = "gnash-${version}";
 
   src = fetchurl {
     url = "mirror://gnu/gnash/${version}/${name}.tar.bz2";
-    sha256 = "0872qrgzpy76lxq5b2xigyzaghn53xrpqba2qp3nrk8yz20lpb6w";
+    sha256 = "1ga8khwaympj4fphhpyqx6ddcikv0zmcpnlykcipny1xy33bs3gr";
   };
 
   patchPhase = ''
@@ -32,19 +34,27 @@ stdenv.mkDerivation rec {
     do
       sed -i "$file" -es'|/tmp/|$TMPDIR/|g'
     done
+
+    # Provide a default font.
+    sed -i "configure" \
+        -e 's|/usr/share/fonts/truetype/freefont/|${freefont_ttf}/share/fonts/truetype/|g'
   '';
 
+  enableParallelBuilding = true;
+
   # XXX: KDE is supported as well so we could make it available optionally.
   buildInputs = [
     gettext x11 SDL SDL_mixer gstreamer gstPluginsBase gstPluginsGood
     gstFfmpeg speex libtool
     libogg libxml2 libjpeg mesa libpng libungif boost freetype agg
     dbus curl pkgconfig glib gtk gtkglext
+    xulrunner
     makeWrapper
+  ]
 
-    # For the test suite
-    ming dejagnu python
-  ];
+  ++ (stdenv.lib.optionals doCheck [
+        ming dejagnu python perl haxe swftools
+      ]);
 
   preConfigure =
     '' configureFlags="                                         \
@@ -58,12 +68,15 @@ stdenv.mkDerivation rec {
        # Work around this using GCC's $CPATH variable.
        export CPATH="${gstPluginsBase}/include/gstreamer-0.10:${gstPluginsGood}/include/gstreamer-0.10"
        echo "\$CPATH set to \`$CPATH'"
+
+       echo "\$GST_PLUGIN_PATH set to \`$GST_PLUGIN_PATH'"
     '';
 
   # Make sure `gtk-gnash' gets `libXext' in its `RPATH'.
   NIX_LDFLAGS="-lX11 -lXext";
 
-  doCheck = true;
+  # XXX: Tests currently fail.
+  doCheck = false;
 
   preInstall = ''ensureDir $out/plugins'';
   postInstall = ''
diff --git a/pkgs/applications/video/gnome-mplayer/default.nix b/pkgs/applications/video/gnome-mplayer/default.nix
index 0d86e902efdb..7c1d13fd79d9 100644
--- a/pkgs/applications/video/gnome-mplayer/default.nix
+++ b/pkgs/applications/video/gnome-mplayer/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl, pkgconfig, glib, gtk, dbus, dbus_glib, GConf}:
 
 stdenv.mkDerivation rec {
-  name = "gnome-mplayer-0.9.99.rc1";
+  name = "gnome-mplayer-1.0.4";
 
   src = fetchurl {
     url = "http://gnome-mplayer.googlecode.com/files/${name}.tar.gz";
-    sha256 = "00fbcjpashrld8bpvm63q9ms17kjnj3rrn1ghsfyqi2swpwzk2k1";
+    sha256 = "1k5yplsvddcm7xza5h4nfb6vibzjcqsk8gzis890alizk07f5xp2";
   };
 
   buildInputs = [pkgconfig glib gtk dbus dbus_glib GConf];
diff --git a/pkgs/applications/video/kdenlive/default.nix b/pkgs/applications/video/kdenlive/default.nix
index 38f843c447f5..6db6e630d325 100644
--- a/pkgs/applications/video/kdenlive/default.nix
+++ b/pkgs/applications/video/kdenlive/default.nix
@@ -1,15 +1,19 @@
-{stdenv, fetchurl, lib, cmake, qt4, perl, kdelibs, automoc4, phonon, mlt, gettext,
-shared_mime_info, soprano}:
+{ stdenv, fetchurl, lib, cmake, qt4, perl, kdelibs, automoc4, phonon, mlt, gettext
+, qimageblitz, qjson, shared_mime_info, soprano }:
+
+stdenv.mkDerivation rec {
+  name = "kdenlive-${version}";
+  version = "0.8";
 
-stdenv.mkDerivation {
-  name = "kdenlive-0.7.8";
   src = fetchurl {
-    url = mirror://sourceforge/kdenlive/kdenlive-0.7.8.tar.gz;
-    sha256 = "10bwmhh3kzdbq1nzq8s5ln7ydrzg41d1rihj5kdmf5hb91az8mvx";
+    url = "mirror://sourceforge/kdenlive/${name}.tar.gz";
+    sha256 = "18e3390c9eb7124af5cd43819c679374aec46dcaf1fc5cdb43918db470c1076f";
   };
 
+  patches = [ ./kdenlive-newmlt.patch ];
+
   buildInputs = [ cmake qt4 perl kdelibs automoc4 phonon mlt gettext
-    shared_mime_info soprano ];
+    qimageblitz qjson shared_mime_info soprano ];
 
   meta = {
     description = "Free and open source video editor";
diff --git a/pkgs/applications/video/kdenlive/kdenlive-newmlt.patch b/pkgs/applications/video/kdenlive/kdenlive-newmlt.patch
new file mode 100644
index 000000000000..b3a772a7ac6e
--- /dev/null
+++ b/pkgs/applications/video/kdenlive/kdenlive-newmlt.patch
@@ -0,0 +1,70 @@
+From http://kdenlive.org/forum/cant-start-kdnlive-sdl-module-missing-mlt
+
+Kdenlive 0.8 tries to detect mlt by reading from stderr, but between
+mlt 0.7.2 and 0.7.4 mlt this has changed from stderr to stdout.
+===================================================================
+--- kdenlive-0.8/src.orig/wizard.cpp	2011-04-26 21:44:22.000000000 +0200
++++ kdenlive-0.8/src/wizard.cpp	2011-07-21 18:22:18.470831892 +0200
+@@ -214,7 +214,7 @@
+         button(QWizard::NextButton)->setEnabled(false);
+     } else {
+         checkProcess.waitForFinished();
+-        QByteArray result = checkProcess.readAllStandardError();
++        QByteArray result = checkProcess.readAllStandardOutput();
+
+         // Check MLT avformat module
+         QTreeWidgetItem *avformatItem = new QTreeWidgetItem(m_mltCheck.programList, QStringList() << QString() << i18n("Avformat module (FFmpeg)"));
+@@ -246,7 +246,7 @@
+                     kDebug() << "// Error querying MLT's version";
+                 } else {
+                     checkProcess.waitForFinished();
+-                    mltVersion = checkProcess.readAllStandardError();
++                    mltVersion = checkProcess.readAllStandardOutput();
+                     mltVersion = mltVersion.section('\n', 0, 0).simplified();
+                     mltVersion = mltVersion.section(' ', -1).simplified();
+                     version = 1000 * mltVersion.section('.', 0, 0).toInt() + 100 * mltVersion.section('.', 1, 1).toInt() + mltVersion.section('.', 2, 2).toInt();
+@@ -275,7 +275,7 @@
+                     kDebug() << "// Error parsing MLT's avformat codecs";
+                 } else {
+                     checkProcess2.waitForFinished();
+-                    QByteArray codecList = checkProcess2.readAllStandardError();
++                    QByteArray codecList = checkProcess2.readAllStandardOutput();
+                     QString acodecList(codecList);
+                     QStringList result;
+                     QStringList alist = acodecList.split('\n', QString::SkipEmptyParts);
+@@ -292,7 +292,7 @@
+                     kDebug() << "// Error parsing MLT's avformat codecs";
+                 } else {
+                     checkProcess2.waitForFinished();
+-                    QByteArray codecList = checkProcess2.readAllStandardError();
++                    QByteArray codecList = checkProcess2.readAllStandardOutput();
+                     QString vcodecList(codecList);
+                     QStringList result;
+                     QStringList vlist = vcodecList.split('\n', QString::SkipEmptyParts);
+@@ -309,7 +309,7 @@
+                     kDebug() << "// Error parsing MLT's avformat codecs";
+                 } else {
+                     checkProcess2.waitForFinished();
+-                    QByteArray codecList = checkProcess2.readAllStandardError();
++                    QByteArray codecList = checkProcess2.readAllStandardOutput();
+                     QString vcodecList(codecList);
+                     QStringList result;
+                     QStringList vlist = vcodecList.split('\n', QString::SkipEmptyParts);
+@@ -606,7 +606,7 @@
+
+     checkProcess.waitForFinished();
+
+-    QByteArray result = checkProcess.readAllStandardError();
++    QByteArray result = checkProcess.readAllStandardOutput();
+     if (!result.contains("- avformat")) errorMessage.append(i18n("MLT's avformat (FFMPEG) module not found. Please check your FFMPEG and MLT install. Kdenlive will not work until this issue is fixed.") + "\n");*/
+
+     QProcess checkProcess2;
+@@ -616,7 +616,7 @@
+
+     checkProcess2.waitForFinished();
+
+-    QByteArray result = checkProcess2.readAllStandardError();
++    QByteArray result = checkProcess2.readAllStandardOutput();
+     if (!result.contains("sdl") || !result.contains("sdl_preview")) errorMessage.append(i18n("MLT's SDL module not found. Please check your MLT install. Kdenlive will not work until this issue is fixed.") + '\n');
+
+     if (!errorMessage.isEmpty()) {
diff --git a/pkgs/applications/video/kino/default.nix b/pkgs/applications/video/kino/default.nix
index cac769d60de3..696c1e4738c3 100644
--- a/pkgs/applications/video/kino/default.nix
+++ b/pkgs/applications/video/kino/default.nix
@@ -50,21 +50,23 @@
 #AMR-WB float support      no
 #AMR-WB IF2 support        no
 
+{ stdenv, fetchurl, gtk, libglade, libxml2, libraw1394, libsamplerate, libdv
+, pkgconfig, perl, perlXMLParser, libavc1394, libiec61883, libXv, gettext
+, libX11, glib, cairo, intltool, ffmpeg
+}:
 
-args: with args;
 stdenv.mkDerivation {
-  name = "kino-1.2.0";
-
-  phases = "unpackPhase configurePhase buildPhase installPhase";
+  name = "kino-1.3.4";
 
   src = fetchurl {
-    url = http://downloads.sourceforge.net/kino/kino-1.2.0.tar.gz;
-    sha256 = "15q1qmii5a2zbrrrg8iba2d1rjzaisa75zvxjhrs86jwglpn4lp9";
+    url = http://downloads.sourceforge.net/kino/kino-1.3.4.tar.gz;
+    sha256 = "020s05k0ma83rq2kfs8x474pqicaqp9spar81qc816ddfrnh8k8i";
   };
 
   buildInputs = [ gtk libglade libxml2 libraw1394 libsamplerate libdv 
-      pkgconfig perl perlXMLParser libavc1394 libiec61883 x11 libXv gettext libX11 glib cairo ]; # TODOoptional packages 
+      pkgconfig perl perlXMLParser libavc1394 libiec61883 intltool libXv gettext libX11 glib cairo ffmpeg ]; # TODOoptional packages 
 
+  configureFlags = "--enable-local-ffmpeg=no";
   #preConfigure = "
   #  grep 11 env-vars
   #  ex
diff --git a/pkgs/applications/video/mkvtoolnix/default.nix b/pkgs/applications/video/mkvtoolnix/default.nix
new file mode 100644
index 000000000000..7355266b9349
--- /dev/null
+++ b/pkgs/applications/video/mkvtoolnix/default.nix
@@ -0,0 +1,40 @@
+{ stdenv, fetchurl
+, libmatroska
+, flac
+, libvorbis
+, file
+, boost
+, lzo
+, xdg_utils
+, expat
+, wxGTK
+, zlib
+, ruby
+, gettext
+}:
+
+stdenv.mkDerivation rec {
+  name = "mkvtoolnix-4.4.0";
+
+  src = fetchurl {
+    url = "http://www.bunkus.org/videotools/mkvtoolnix/sources/${name}.tar.bz2";
+    sha256 = "0apgmah1d4dh5x1phr4n5vgwmy0w1nym9pydzh4kdgcs167l8n6l";
+  };
+
+  buildInputs = [ libmatroska flac libvorbis file boost lzo xdg_utils expat wxGTK zlib ruby gettext ];
+
+  configureFlags = "--with-boost-libdir=${boost}/lib";
+  buildPhase = ''
+    ruby ./drake
+  '';
+
+  installPhase = ''
+    ruby ./drake install
+  '';
+
+  meta = {
+    description = "Cross-platform tools for Matroska";
+    homepage = http://www.bunkus.org/videotools/mkvtoolnix/;
+  };
+}
+
diff --git a/pkgs/applications/video/vlc/default.nix b/pkgs/applications/video/vlc/default.nix
index 21a2313ce16b..ce7b233fdd20 100644
--- a/pkgs/applications/video/vlc/default.nix
+++ b/pkgs/applications/video/vlc/default.nix
@@ -1,32 +1,39 @@
 { stdenv, fetchurl, perl, xlibs, libdvdnav
-, zlib, a52dec, libmad, faad2, ffmpeg, alsa
+, zlib, a52dec, libmad, faad2, ffmpeg, alsaLib
 , pkgconfig, dbus, hal, fribidi, qt4, freefont_ttf
 , libvorbis, libtheora, speex, lua, libgcrypt, libupnp
+, libcaca, pulseaudio, flac, schroedinger, libxml2, librsvg
+, mpeg2dec, udev, gnutls, avahi, libcddb, jackaudio, SDL, SDL_image
+, libmtp, unzip, taglib, libkate, libtiger, libv4l, samba, liboggz
+, libass, libva
 }:
 
-stdenv.mkDerivation {
-  name = "vlc-1.1.0";
+stdenv.mkDerivation rec {
+  name = "vlc-${version}";
+  version = "1.1.11";
+
+  patchPhase = ''sed -e "s@/bin/echo@echo@g" -i configure'';
 
   src = fetchurl {
-    url = http://download.videolan.org/pub/videolan/vlc/1.1.0/vlc-1.1.0.tar.bz2;
-    sha256 = "1j7icg7a2lr99kpc3sjjdp3z7128y6afnvxsafxlnih0qif2ryx9";
+    url = "mirror://sourceforge/vlc/${name}.tar.bz2";
+    sha256 = "1jz1yklvh5apy2ygqwnyq61mhg09h0fn32hdygxfsaxq12z609b8";
   };
 
   buildInputs = [
-    perl xlibs.xlibs xlibs.libXv zlib a52dec libmad faad2 ffmpeg
-    alsa libdvdnav libdvdnav.libdvdread pkgconfig dbus hal fribidi qt4
-    libvorbis libtheora speex lua libgcrypt libupnp
-  ];
+    perl zlib a52dec libmad faad2 ffmpeg alsaLib libdvdnav libdvdnav.libdvdread
+    pkgconfig dbus hal fribidi qt4 libvorbis libtheora speex lua libgcrypt
+    libupnp libcaca pulseaudio flac schroedinger libxml2 librsvg mpeg2dec
+    udev gnutls avahi libcddb jackaudio SDL SDL_image libmtp unzip taglib
+    libkate libtiger libv4l samba liboggz libass
+  ]
+  ++ (with xlibs; [ xlibs.xlibs libXv libXvMC libXpm xcbutil libva ]);
 
   configureFlags = [ "--enable-alsa"
     "--disable-glx"
     "--disable-remoteosd"
-    "--enable-faad"
-    "--enable-theora"
-    "--enable-vorbis"
-    "--enable-speex"
     "--disable-dbus"
     "--disable-dbus-control"
+    "--with-kde-solid=$out/share/apps/solid/actions"
   ];
 
   preBuild = ''
diff --git a/pkgs/applications/virtualization/nova/client.nix b/pkgs/applications/virtualization/nova/client.nix
new file mode 100644
index 000000000000..84858c416c88
--- /dev/null
+++ b/pkgs/applications/virtualization/nova/client.nix
@@ -0,0 +1,20 @@
+{ fetchurl, pythonPackages }:
+
+pythonPackages.buildPythonPackage rec {
+  name = "novaclient-2.4.3";
+  namePrefix = "";
+
+  src = fetchurl {
+    url = "http://pypi.python.org/packages/source/p/python-novaclient/python-${name}.tar.gz";
+    md5 = "c4be4adf371d1a84ce1581af365a53d0";
+  };
+
+  pythonPath = [ pythonPackages.prettytable pythonPackages.argparse pythonPackages.httplib2 pythonPackages.ssl ];
+
+  buildInputs = [ pythonPackages.mock pythonPackages.nose ];
+
+  meta = {
+    homepage = https://github.com/rackspace/python-novaclient;
+    description = "Client library and command line tool for the OpenStack Nova API";
+  };
+}
diff --git a/pkgs/applications/virtualization/nova/convert.patch b/pkgs/applications/virtualization/nova/convert.patch
new file mode 100644
index 000000000000..f11c9a7fc4f2
--- /dev/null
+++ b/pkgs/applications/virtualization/nova/convert.patch
@@ -0,0 +1,12 @@
+diff -ru -x '*~' nova-2011.2-orig//bin/nova-manage nova-2011.2//bin/nova-manage
+--- nova-2011.2-orig//bin/nova-manage	2011-04-15 04:57:52.000000000 +0200
++++ nova-2011.2//bin/nova-manage	2011-06-09 18:28:39.063299654 +0200
+@@ -1009,7 +1009,7 @@
+         if (FLAGS.image_service == 'nova.image.local.LocalImageService'
+             and directory == os.path.abspath(FLAGS.images_path)):
+             new_dir = "%s_bak" % directory
+-            os.move(directory, new_dir)
++            os.rename(directory, new_dir)
+             os.mkdir(directory)
+             directory = new_dir
+         for fn in glob.glob("%s/*/info.json" % directory):
diff --git a/pkgs/applications/virtualization/nova/default.nix b/pkgs/applications/virtualization/nova/default.nix
new file mode 100644
index 000000000000..a9a36ffca4fe
--- /dev/null
+++ b/pkgs/applications/virtualization/nova/default.nix
@@ -0,0 +1,94 @@
+{ stdenv, fetchurl, pythonPackages, intltool, libvirt, libxml2Python, curl, novaclient }:
+
+with stdenv.lib;
+
+let version = "2011.2"; in
+
+stdenv.mkDerivation rec {
+  name = "nova-${version}";
+
+  src = fetchurl {
+    url = "http://launchpad.net/nova/cactus/${version}/+download/nova-${version}.tar.gz";
+    sha256 = "1s2w0rm332y9x34ngjz8sys9sbldg857rx9d6r3nb1ik979fx8p7";
+  };
+
+  patches =
+    [ ./convert.patch ];
+
+  pythonPath = with pythonPackages;
+    [ setuptools eventlet greenlet gflags netaddr sqlalchemy carrot routes
+      paste_deploy m2crypto ipy boto_1_9 twisted sqlalchemy_migrate
+      distutils_extra simplejson readline glance cheetah lockfile httplib2
+      # !!! should libvirt be a build-time dependency?  Note that
+      # libxml2Python is a dependency of libvirt.py. 
+      libvirt libxml2Python
+      novaclient
+    ];
+
+  buildInputs =
+    [ pythonPackages.python 
+      pythonPackages.wrapPython
+      pythonPackages.mox
+      intltool
+    ] ++ pythonPath;
+
+  PYTHON_EGG_CACHE = "`pwd`/.egg-cache";
+
+  preConfigure =
+    ''
+      # Set the built-in state location to something sensible.
+      sed -i nova/flags.py \
+        -e "/DEFINE.*'state_path'/ s|../|/var/lib/nova|"
+
+      substituteInPlace nova/virt/images.py --replace /usr/bin/curl ${curl}/bin/curl
+
+      substituteInPlace nova/api/ec2/cloud.py \
+        --replace 'sh genrootca.sh' $out/libexec/nova/genrootca.sh
+    '';
+  
+  buildPhase = "python setup.py build";
+
+  installPhase =
+    ''    
+      p=$(toPythonPath $out)
+      export PYTHONPATH=$p:$PYTHONPATH
+      mkdir -p $p
+      python setup.py install --prefix=$out
+
+      # Nova doesn't like to be called ".nova-foo-wrapped" because it
+      # computes some stuff from its own argv[0].  So put the wrapped
+      # programs in $out/libexec under their original names.
+      mkdir -p $out/libexec/nova
+      
+      wrapProgram() {
+          local prog="$1"
+          local hidden=$out/libexec/nova/$(basename "$prog")
+          mv $prog $hidden
+          makeWrapper $hidden $prog "$@"
+      }
+      
+      wrapPythonPrograms
+
+      cp -prvd etc $out/etc
+
+      # Nova makes some weird assumptions about where to find its own
+      # programs relative to the Python directory.
+      ln -sfn $out/bin $out/lib/${pythonPackages.python.libPrefix}/site-packages/bin
+
+      # Install the certificate generation script.
+      cp nova/CA/genrootca.sh $out/libexec/nova/
+      cp nova/CA/openssl.cnf.tmpl $out/libexec/nova/
+
+      # Allow nova-manage etc. to find the proper configuration file.
+      ln -s /etc/nova/nova.conf $out/libexec/nova/nova.conf
+    '';
+
+  doCheck = false; # !!! fix
+
+  checkPhase = "python setup.py test";
+    
+  meta = {
+    homepage = http://nova.openstack.org/;
+    description = "OpenStack Compute (a.k.a. Nova), a cloud computing fabric controller";
+  };
+}
diff --git a/pkgs/applications/virtualization/qemu/0.13.nix b/pkgs/applications/virtualization/qemu/0.13.nix
index 45961f950cf8..e1b636749696 100644
--- a/pkgs/applications/virtualization/qemu/0.13.nix
+++ b/pkgs/applications/virtualization/qemu/0.13.nix
@@ -1,15 +1,15 @@
-{stdenv, fetchurl, SDL, zlib, which}:
+{ stdenv, fetchurl, SDL, zlib, which, ncurses }:
 
 stdenv.mkDerivation rec {
   name = "qemu-0.13.0";
 
   src = fetchurl {
-    url = "http://download.savannah.gnu.org/releases/qemu/${name}.tar.gz";
+    url = "mirror://savannah/releases/qemu/${name}.tar.gz";
     sha256 = "0xyqbwy78218ja6r9ya5p37j8hcd81l4cpw3ghvnxsjwn18mhvqy";
   };
-  
-  buildInputs = [SDL zlib which];
-  
+
+  buildInputs = [ SDL zlib which ncurses ];
+
   meta = {
     description = "QEmu processor emulator";
     license = "GPLv2+";
diff --git a/pkgs/applications/virtualization/virt-viewer/default.nix b/pkgs/applications/virtualization/virt-viewer/default.nix
new file mode 100644
index 000000000000..90e92a3e68de
--- /dev/null
+++ b/pkgs/applications/virtualization/virt-viewer/default.nix
@@ -0,0 +1,50 @@
+x@{builderDefsPackage
+  , gnome, gtk, glib, libxml2, pkgconfig, libvirt, gtkvnc, cyrus_sasl, libtasn1
+  , gnupg, libgcrypt, perl
+  , ...}:
+builderDefsPackage
+(a :  
+let 
+  helperArgNames = ["stdenv" "fetchurl" "builderDefsPackage"] ++ 
+    ["gnome"];
+
+  buildInputs = (map (n: builtins.getAttr n x)
+    (builtins.attrNames (builtins.removeAttrs x helperArgNames)))
+    ++ [gnome.libglade];
+  sourceInfo = rec {
+    baseName="virt-viewer";
+    version="0.2.0";
+    name="${baseName}-${version}";
+    url="http://virt-manager.org/download/sources/${baseName}/${name}.tar.gz";
+    hash="0lhkmp4kn0s2z8241lqf2fdi55jg9iclr5hjw3m4wzaznpiajwlp";
+  };
+in
+rec {
+  src = a.fetchurl {
+    url = sourceInfo.url;
+    sha256 = sourceInfo.hash;
+  };
+
+  inherit (sourceInfo) name version;
+  inherit buildInputs;
+
+  /* doConfigure should be removed if not needed */
+  phaseNames = ["doConfigure" "doMakeInstall"];
+      
+  meta = {
+    description = "A viewer for remote virtual machines";
+    maintainers = with a.lib.maintainers;
+    [
+      raskin
+    ];
+    platforms = with a.lib.platforms;
+      linux;
+    license = a.lib.licenses.gpl2;
+  };
+  passthru = {
+    updateInfo = {
+      downloadPage = "http://virt-manager.org/download.html";
+    };
+  };
+}) x
+
diff --git a/pkgs/applications/virtualization/virtualbox/default.nix b/pkgs/applications/virtualization/virtualbox/default.nix
index 5d89d33a81b6..0cb4999bce64 100644
--- a/pkgs/applications/virtualization/virtualbox/default.nix
+++ b/pkgs/applications/virtualization/virtualbox/default.nix
@@ -1,31 +1,36 @@
 { stdenv, fetchurl, lib, iasl, dev86, pam, libxslt, libxml2, libX11, xproto, libXext
 , libXcursor, qt4, libIDL, SDL, hal, libcap, zlib, libpng, glib, kernel
 , python, which, alsaLib, curl, gawk
+, xorriso, makeself, perl, jdk
 }:
 
+let version = "4.1.0"; in
+
 stdenv.mkDerivation {
-  name = "virtualbox-3.2.8-${kernel.version}";
+  name = "virtualbox-${version}-${kernel.version}";
 
   src = fetchurl {
-    url = http://download.virtualbox.org/virtualbox/3.2.8/VirtualBox-3.2.8-OSE.tar.bz2;
-    sha256 = "00qvgaqg4gsabrc0rba5rh0jxqrjzk2vn6qbkc6nlxvngha95klh";
+    url = "http://download.virtualbox.org/virtualbox/${version}/VirtualBox-${version}.tar.bz2";
+    sha256 = "1pi066xnjgr3fl42i1vc1pbwic9l4m1k6mzs4ip41fz99w59xfzp";
   };
 
-  buildInputs = [iasl dev86 libxslt libxml2 xproto libX11 libXext libXcursor qt4 libIDL SDL hal libcap glib kernel python alsaLib curl pam];
+  buildInputs = [iasl dev86 libxslt libxml2 xproto libX11 libXext libXcursor qt4 libIDL SDL hal libcap glib kernel python alsaLib curl pam xorriso makeself perl jdk ];
 
   patchPhase = "
     set -x
     MODULES_BUILD_DIR=`echo ${kernel}/lib/modules/*/build`
     sed -e 's@/lib/modules/`uname -r`/build@'$MODULES_BUILD_DIR@ \\
+        -e 's@MKISOFS --version@MKISOFS -version@' \\
         -i configure
     ls kBuild/bin/linux.x86/k* tools/linux.x86/bin/* | xargs -n 1 patchelf --set-interpreter ${stdenv.glibc}/lib/ld-linux.so.2 
     ls kBuild/bin/linux.amd64/k* tools/linux.amd64/bin/* | xargs -n 1 patchelf --set-interpreter ${stdenv.glibc}/lib/ld-linux-x86-64.so.2 
+    find . -type f | xargs sed 's/depmod -a/true/' -i
     export USER=nix
     set +x
   ";
 
   configurePhase = ''
-    ./configure --with-qt4-dir=${qt4} --disable-python --disable-pulse --disable-hardening
+    ./configure --with-qt4-dir=${qt4} --disable-python --disable-pulse --disable-hardening --with-mkisofs=${xorriso}/bin/xorrisofs
     sed -e 's@PKG_CONFIG_PATH=.*@PKG_CONFIG_PATH=${libIDL}/lib/pkgconfig:${glib}/lib/pkgconfig ${libIDL}/bin/libIDL-config-2@' \
         -i AutoConfig.kmk
     sed -e 's@arch/x86/@@' \
@@ -34,7 +39,10 @@ stdenv.mkDerivation {
     cat >> AutoConfig.kmk << END_PATHS
     VBOX_PATH_APP_PRIVATE := $out
     VBOX_PATH_APP_DOCS := $out/doc
+    VBOX_JAVA_HOME := ${jdk}
     END_PATHS
+    echo "VBOX_WITH_DOCS :=" >> LocalConfig.kmk
+    echo "VBOX_WITH_WARNINGS_AS_ERRORS :=" >> LocalConfig.kmk
   '';
 
   buildPhase = ''
diff --git a/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix b/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix
index eb8a91551426..9dfe9c26c0de 100644
--- a/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix
+++ b/pkgs/applications/virtualization/virtualbox/guest-additions/default.nix
@@ -1,11 +1,13 @@
 { stdenv, fetchurl, lib, patchelf, cdrkit, kernel, which, makeWrapper
 , libX11, libXt, libXext, libXmu, libXcomposite, libXfixes, libXrandr, libXcursor}:
 
+let version = "4.1.0"; in
+
 stdenv.mkDerivation {
-  name = "VirtualBox-GuestAdditions-3.2.8";
+  name = "VirtualBox-GuestAdditions-${version}";
   src = fetchurl {
-    url = http://download.virtualbox.org/virtualbox/3.2.8/VBoxGuestAdditions_3.2.8.iso;
-    sha256 = "1pyfgrcdmw6zf3yxgzcd8c5qzqqn62bz4085ka453gfmi9d65lys";
+    url = "http://download.virtualbox.org/virtualbox/${version}/VBoxGuestAdditions_${version}.iso";
+    sha256 = "0azj08l0457cjl5v2ddgb5kz8gblsi7cgjgdmyiszvlqpyfbh98w";
   };
   KERN_DIR = "${kernel}/lib/modules/*/build";
   buildInputs = [ patchelf cdrkit makeWrapper ];
@@ -17,22 +19,25 @@ stdenv.mkDerivation {
   '';
   
   buildCommand = ''
-    ${if stdenv.system == "i686-linux" then ''
-        isoinfo -J -i $src -x /VBoxLinuxAdditions-x86.run > ./VBoxLinuxAdditions-x86.run
-        chmod 755 ./VBoxLinuxAdditions-x86.run
-        ./VBoxLinuxAdditions-x86.run --noexec --keep
-      ''
-      else if stdenv.system == "x86_64-linux" then ''
-        isoinfo -J -i $src -x /VBoxLinuxAdditions-amd64.run > ./VBoxLinuxAdditions-amd64.run
-        chmod 755 ./VBoxLinuxAdditions-amd64.run
-	./VBoxLinuxAdditions-amd64.run --noexec --keep
+    ${if stdenv.system == "i686-linux" || stdenv.system == "x86_64-linux" then ''
+        isoinfo -J -i $src -x /VBoxLinuxAdditions.run > ./VBoxLinuxAdditions.run
+        chmod 755 ./VBoxLinuxAdditions.run
+	./VBoxLinuxAdditions.run --noexec --keep
       ''
       else throw ("Architecture: "+stdenv.system+" not supported for VirtualBox guest additions")
     }
     
     # Unpack files
     cd install
-    tar xfvj VBoxGuestAdditions.tar.bz2
+    ${if stdenv.system == "i686-linux" then ''
+        tar xfvj VBoxGuestAdditions-x86.tar.bz2
+      ''
+      else if stdenv.system == "x86_64-linux" then ''
+        tar xfvj VBoxGuestAdditions-amd64.tar.bz2
+      ''
+      else throw ("Architecture: "+stdenv.system+" not supported for VirtualBox guest additions")
+    }
+
     
     # Build kernel modules    
     cd src        
@@ -40,10 +45,11 @@ stdenv.mkDerivation {
     for i in *
     do
 	cd $i
-	sed -i -e "s/depmod/echo/g" Makefile
+	find . -type f | xargs sed 's/depmod -a/true/' -i
 	make
 	cd ..
     done
+
     cd ..
     
     # Change the interpreter for various binaries
@@ -99,8 +105,8 @@ stdenv.mkDerivation {
     
     # Install Xorg drivers
     ensureDir $out/lib/xorg/modules/{drivers,input}
-    install -m 644 lib/VBoxGuestAdditions/vboxvideo_drv_18.so $out/lib/xorg/modules/drivers/vboxvideo_drv.so
-    install -m 644 lib/VBoxGuestAdditions/vboxmouse_drv_18.so $out/lib/xorg/modules/input/vboxmouse_drv.so
+    install -m 644 lib/VBoxGuestAdditions/vboxvideo_drv_19.so $out/lib/xorg/modules/drivers/vboxvideo_drv.so
+    install -m 644 lib/VBoxGuestAdditions/vboxmouse_drv_19.so $out/lib/xorg/modules/input/vboxmouse_drv.so
     
     # Install kernel modules
     cd src
@@ -110,8 +116,8 @@ stdenv.mkDerivation {
         cd $i
 	kernelVersion=$(cd ${kernel}/lib/modules; ls)
 	export MODULE_DIR=$out/lib/modules/$kernelVersion/misc
-	sed -i -e "s|-o root||g" \
-	       -e "s|-g root||g" Makefile
+	find . -type f | xargs sed -i -e "s|-o root||g" \
+	                              -e "s|-g root||g"
 	make install
 	cd ..
     done    
diff --git a/pkgs/applications/virtualization/xen/default.nix b/pkgs/applications/virtualization/xen/default.nix
index 4c93a277e984..9b8cff7d9c65 100644
--- a/pkgs/applications/virtualization/xen/default.nix
+++ b/pkgs/applications/virtualization/xen/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchurl, which, zlib, pkgconfig, SDL, openssl, python
+{ stdenv, fetchurl, which, zlib, pkgconfig, SDL, openssl
 , libuuid, gettext, ncurses, dev86, iasl, pciutils, bzip2, xz
-, lvm2, utillinux, procps, texinfo, perl }:
+, lvm2, utillinux, procps, texinfo, perl, pythonPackages }:
 
 with stdenv.lib;
 
@@ -50,10 +50,13 @@ stdenv.mkDerivation {
     ];
 
   buildInputs =
-    [ which zlib pkgconfig SDL openssl python libuuid gettext ncurses
+    [ which zlib pkgconfig SDL openssl libuuid gettext ncurses
       dev86 iasl pciutils bzip2 xz texinfo perl
+      pythonPackages.python pythonPackages.wrapPython
     ];
 
+  pythonPath = [ pythonPackages.curses ];
+
   makeFlags = "PREFIX=$(out) CONFIG_DIR=/etc";
 
   buildFlags = "xen tools stubdom";
@@ -117,23 +120,12 @@ stdenv.mkDerivation {
 
   installPhase =
     ''
-      cp -prvd dist/install/nix/store/* $out
+      mkdir -p $out
+      cp -prvd dist/install/nix/store/*/* $out/
       cp -prvd dist/install/boot $out/boot
       cp -prvd dist/install/etc $out/etc
       cp -dR docs/man1 docs/man5 $out/share/man/
-    ''; # */
-
-  postFixup =
-    ''
-      # Set the Python search path in all Python scripts.
-      for fn in $(grep -l '#!.*python' $out/bin/* $out/sbin/*); do
-          sed -i "$fn" -e "1 a import sys\nsys.path = ['$out/lib/python2.6/site-packages'] + sys.path"
-      done
-
-      # Remove calls to `env'.
-      for fn in $(grep -l '#!.*/env.*python' $out/bin/* $out/sbin/*); do
-          sed -i "$fn" -e "1 s^/nix/store/.*/env.*python^${python}/bin/python^"
-      done
+      wrapPythonPrograms
     ''; # */
 
   meta = {
diff --git a/pkgs/applications/window-managers/awesome/cmake284.patch b/pkgs/applications/window-managers/awesome/cmake284.patch
new file mode 100644
index 000000000000..4af70227805f
--- /dev/null
+++ b/pkgs/applications/window-managers/awesome/cmake284.patch
@@ -0,0 +1,40 @@
+From 1aedd853fcaeeafadd24512f84e6e269f5db0b4e Mon Sep 17 00:00:00 2001
+From: Thomas Moschny <thomas.moschny@gmx.de>
+Date: Mon, 21 Feb 2011 17:58:04 +0100
+Subject: [PATCH] Normalize icon path names (fixes #869).
+
+The elements in ${icon_sources}, as returned by file(GLOB ...) contain
+double slashes, could be a bug in cmake. This causes building with
+cmake 2.8.4 to fail, due to dependency problems lateron.
+
+This patch works around the issue by normalizing all path names in
+${icon_sources} while appending them to ${ALL_ICONS}, thereby removing
+the double slashes.
+---
+ CMakeLists.txt |    3 ++-
+ 1 files changed, 2 insertions(+), 1 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 64be9b9..472bec2 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -244,14 +244,15 @@ endif()
+ 
+ # {{{ Theme icons
+ file(GLOB icon_sources RELATIVE ${SOURCE_DIR} ${SOURCE_DIR}/themes/*/titlebar/*.png)
+-set(ALL_ICONS ${icon_sources})
+ 
+ foreach(icon ${icon_sources})
+     # Copy all icons to the build dir to simplify the following code.
+     # Source paths are interpreted relative to ${SOURCE_DIR}, target paths
+     # relative to ${BUILD_DIR}.
+     get_filename_component(icon_path ${icon} PATH)
++    get_filename_component(icon_name ${icon} NAME)
+     file(COPY ${icon} DESTINATION ${icon_path})
++    set(ALL_ICONS ${ALL_ICONS} "${icon_path}/${icon_name}")
+ endforeach()
+ 
+ macro(a_icon_convert match replacement input)
+-- 
+1.7.3.4
+
diff --git a/pkgs/applications/window-managers/awesome/default.nix b/pkgs/applications/window-managers/awesome/default.nix
index 4bc0610082b6..b94b350a8482 100644
--- a/pkgs/applications/window-managers/awesome/default.nix
+++ b/pkgs/applications/window-managers/awesome/default.nix
@@ -3,12 +3,16 @@
 , libstartup_notification, libev, asciidoc, xmlto, dbus, docbook_xsl
 , docbook_xml_dtd_45, libxslt, coreutils}:
 
+let
+  version = "3.4.9";
+in
+
 stdenv.mkDerivation rec {
-  name = "awesome-3.4.8";
+  name = "awesome-${version}";
  
   src = fetchurl {
-    url = http://awesome.naquadah.org/download/awesome-3.4.8.tar.xz;
-    sha256 = "1mrdk8q0kj1p7zp5mchr2zl3cnja4z4ir0wx3yz5y361py5bjy78";
+    url = "http://awesome.naquadah.org/download/awesome-${version}.tar.xz";
+    sha256 = "0382v482904xv295l0gvhwzc64b7631miiv8wyq7jxmwqf2vfbp7";
   };
  
   buildInputs = [ xz cmake gperf imagemagick pkgconfig lua glib cairo pango
@@ -18,13 +22,15 @@ stdenv.mkDerivation rec {
   # We use coreutils for 'env', that will allow then finding 'bash' or 'zsh' in
   # the awesome lua code. I prefered that instead of adding 'bash' or 'zsh' as
   # dependencies.
-  patchPhase = ''
+  prePatch = ''
     # Fix the tab completion (supporting bash or zsh)
     sed s,/usr/bin/env,${coreutils}/bin/env, -i lib/awful/completion.lua.in
     # Remove the 'root' PATH override (I don't know why they have that)
     sed /WHOAMI/d -i utils/awsetbg
   '';
 
+  patches = [ ./cmake284.patch ];
+
   # Somehow libev does not get into the rpath, although it should.
   # Something may be wrong in the gcc wrapper.
   preBuild = ''
@@ -38,5 +44,7 @@ stdenv.mkDerivation rec {
     homepage = http://awesome.naquadah.org/;
     description = "Highly configurable, dynamic window manager for X";
     license = "GPLv2+";
+    maintainers = with stdenv.lib.maintainers; [viric];
+    platforms = with stdenv.lib.platforms; linux;
   };
 }
diff --git a/pkgs/applications/window-managers/compiz/core.nix b/pkgs/applications/window-managers/compiz/core.nix
index ef5279613d09..d4a5b79b7fb3 100644
--- a/pkgs/applications/window-managers/compiz/core.nix
+++ b/pkgs/applications/window-managers/compiz/core.nix
@@ -16,6 +16,9 @@ stdenv.mkDerivation {
       # directories to be overriden through $COMPIZ_PLUGINDIR and
       # $COMPIZ_METADATADIR, respectively.
       ./plugindir-core.patch
+
+      # Fix compilation with recent GTK versions.
+      ./gdk-deprecated.patch
     ];
 
   buildInputs =
diff --git a/pkgs/applications/window-managers/compiz/gdk-deprecated.patch b/pkgs/applications/window-managers/compiz/gdk-deprecated.patch
new file mode 100644
index 000000000000..d80a5514ee9d
--- /dev/null
+++ b/pkgs/applications/window-managers/compiz/gdk-deprecated.patch
@@ -0,0 +1,14 @@
+diff -ru -x '*~' compiz-0.8.6-orig//gtk/window-decorator/gtk-window-decorator.c compiz-0.8.6//gtk/window-decorator/gtk-window-decorator.c
+--- compiz-0.8.6-orig//gtk/window-decorator/gtk-window-decorator.c	2010-03-28 14:15:35.000000000 +0200
++++ compiz-0.8.6//gtk/window-decorator/gtk-window-decorator.c	2011-03-14 11:00:00.000000000 +0100
+@@ -31,10 +31,6 @@
+ #include <X11/extensions/Xrender.h>
+ #include <X11/Xregion.h>
+ 
+-#ifndef GDK_DISABLE_DEPRECATED
+-#define GDK_DISABLE_DEPRECATED
+-#endif
+-
+ #ifndef GTK_DISABLE_DEPRECATED
+ #define GTK_DISABLE_DEPRECATED
+ #endif
diff --git a/pkgs/applications/window-managers/dwm/default.nix b/pkgs/applications/window-managers/dwm/default.nix
index cca60332d06c..1427eec54f6c 100644
--- a/pkgs/applications/window-managers/dwm/default.nix
+++ b/pkgs/applications/window-managers/dwm/default.nix
@@ -1,11 +1,11 @@
 {stdenv, fetchurl, libX11, libXinerama, patches ? []}:
 
 stdenv.mkDerivation rec {
-  name = "dwm-5.8.2";
+  name = "dwm-5.9";
  
   src = fetchurl {
     url = "http://dl.suckless.org/dwm/${name}.tar.gz";
-    sha256 = "0rlv72fls2k4s48a0mw7mxa05d4qdxgs8pqbkyqkpzz3jb3kn965";
+    sha256 = "0cp25zqgaqj5k1mlvgxnc5jqi252chqjc5v0fzpqbhrklaidbk9d";
   };
  
   buildInputs = [ libX11 libXinerama ];
diff --git a/pkgs/applications/window-managers/icewm/default.nix b/pkgs/applications/window-managers/icewm/default.nix
index 02096cd6141f..632bc50c8690 100644
--- a/pkgs/applications/window-managers/icewm/default.nix
+++ b/pkgs/applications/window-managers/icewm/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl, gettext, libjpeg, libtiff, libungif, libpng, imlib, xlibs, automake, pkgconfig,
-  gtk }:
+{ stdenv, fetchurl, gettext, libjpeg, libtiff, libungif, libpng, imlib
+, xlibs, automake, pkgconfig, gtk }:
 
 stdenv.mkDerivation rec {
   name = "icewm-1.3.6";
@@ -15,6 +15,8 @@ stdenv.mkDerivation rec {
     sha256 = "1pr7rc10rddwvy4ncng4mf5fpxd1nqjsw34xba9ngsg32rg57b91";
   };
 
+  NIX_LDFLAGS = "-lfontconfig";
+
   # The fuloong2f is not supported by 1.3.6 still
   preConfigure = ''
     cp ${automake}/share/automake*/config.{sub,guess} .
diff --git a/pkgs/applications/window-managers/jwm/default.nix b/pkgs/applications/window-managers/jwm/default.nix
index e52cb91ec4bc..57e6ecf17492 100644
--- a/pkgs/applications/window-managers/jwm/default.nix
+++ b/pkgs/applications/window-managers/jwm/default.nix
@@ -1,4 +1,5 @@
-{ stdenv, fetchurl, libX11, libXext, libXinerama, libXpm, libXft }:
+{ stdenv, fetchurl, libX11, libXext, libXinerama, libXpm, libXft, freetype,
+  fontconfig }:
 
 stdenv.mkDerivation {
   name = "jwm-2.0.1";
@@ -8,7 +9,13 @@ stdenv.mkDerivation {
      sha256 = "1ix5y00cmg3cyazl0adzgv49140zxaf2dpngyg1dyy4ma6ysdmnw";
   };
 
-  buildInputs = [ libX11 libXext libXinerama libXpm libXft ];
+  buildInputs = [ libX11 libXext libXinerama libXpm libXft freetype 
+    fontconfig ];
+
+  preConfigure = ''
+    export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -I${freetype}/include/freetype2 "
+    export NIX_LDFLAGS="$NIX_LDFLAGS -lXft -lfreetype -lfontconfig "
+  '';
 
   postInstall =
     ''
diff --git a/pkgs/applications/window-managers/ratpoison/default.nix b/pkgs/applications/window-managers/ratpoison/default.nix
index cec59ab6f6bf..77a998b9f74c 100644
--- a/pkgs/applications/window-managers/ratpoison/default.nix
+++ b/pkgs/applications/window-managers/ratpoison/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl, libX11, inputproto, libXt, libXpm, libXft, fontconfig
-, libXtst, xextproto, readline, libXi, pkgconfig, autoconf, automake }:
+{ stdenv, fetchurl, libX11, inputproto, libXt, libXpm, libXft, fontconfig, freetype
+, libXtst, xextproto, readline, libXi, pkgconfig, perl, autoconf, automake }:
 
 stdenv.mkDerivation rec {
   name = "ratpoison-1.4.5";
@@ -16,13 +16,13 @@ stdenv.mkDerivation rec {
        })
     ];
 
-  preConfigure = "autoreconf -vf";
+  preConfigure = "autoreconf -vf";	# needed because of the patch above
 
+  NIX_CFLAGS_COMPILE = "-I${freetype}/include/freetype2"; # urgh
+  
   buildInputs =
-    [ libX11 inputproto libXt
-      libXpm libXft fontconfig libXtst
-      xextproto readline libXi pkgconfig
-      autoconf automake  # needed because of the patch above
+    [ libX11 inputproto libXt libXpm libXft fontconfig freetype libXtst
+      xextproto readline libXi pkgconfig perl autoconf automake
     ];
 
   meta = {
@@ -46,8 +46,7 @@ stdenv.mkDerivation rec {
 
     homepage = http://www.nongnu.org/ratpoison/;
 
-    maintainers = [ stdenv.lib.maintainers.ludo ];
+    maintainers = [ stdenv.lib.maintainers.ludo stdenv.lib.maintainers.simons ];
     platforms = stdenv.lib.platforms.gnu;  # arbitrary choice
   };
 }
-
diff --git a/pkgs/applications/window-managers/trayer/default.nix b/pkgs/applications/window-managers/trayer/default.nix
new file mode 100644
index 000000000000..ce66f7d9bcc0
--- /dev/null
+++ b/pkgs/applications/window-managers/trayer/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, fetchurl, pkgconfig, gdk_pixbuf, gtk, libXmu }:
+
+stdenv.mkDerivation rec {
+  name = "trayer-1.1.3";
+
+  buildInputs = [ pkgconfig gdk_pixbuf gtk libXmu ];
+
+  src = fetchurl {
+          url = "https://github.com/sargon/trayer-srg/tarball/${name}";
+          name = "${name}.tar.gz";
+          sha256 = "03be5ea47278ecdb6ffb1d3b5115a855a6eccd6aa6702b84e89ee047ddd76558";
+        };
+
+  makeFlags = [ "PREFIX=$(out)" ];
+
+  meta = {
+    homepage = http://github.com/sargon/trayer-srg;
+
+    license = "bsd";
+
+    description = "A lightweight GTK2-based systray for UNIX desktop";
+
+    maintainers = [ stdenv.lib.maintainers.shlevy ];
+
+    platforms = stdenv.lib.platforms.linux;
+  };
+}
+
diff --git a/pkgs/applications/window-managers/xmonad/default.nix b/pkgs/applications/window-managers/xmonad/default.nix
index 52cfe1e9798d..76b9b37456e2 100644
--- a/pkgs/applications/window-managers/xmonad/default.nix
+++ b/pkgs/applications/window-managers/xmonad/default.nix
@@ -1,14 +1,21 @@
-{cabal, X11, mtl, xmessage}:
+{cabal, X11, mtl, xmessage, syb}:
 
-cabal.mkDerivation (self : {
+cabal.mkDerivation (self: {
   pname = "xmonad";
   name = "${self.fname}";
-  version = "0.9.1";
-  sha256 = "014201200e8a521ee3a0d8c0727392916a7549207b91064fb456f8c660609927";
-  propagatedBuildInputs = [X11 mtl];
+  version = "0.9.2";
+  sha256 = "07w5k3pqmybjn0zh2nr1glp69685xg2fhj3z9zxb37x5nzss7kdd";
+  noHaddock = true;
+  propagatedBuildInputs = [X11 mtl syb];
   meta = {
-    description = "xmonad is a tiling window manager for X";
-    homepage = http://xmonad.org/;
+    homepage = "http://xmonad.org";
+    description = "A tiling window manager";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [
+      self.stdenv.lib.maintainers.andres
+      self.stdenv.lib.maintainers.simons
+    ];
   };
 
   preConfigure = '' 
diff --git a/pkgs/applications/window-managers/xmonad/xmonad-contrib.nix b/pkgs/applications/window-managers/xmonad/xmonad-contrib.nix
index 1c0619356e05..7ca5e2b17fd1 100644
--- a/pkgs/applications/window-managers/xmonad/xmonad-contrib.nix
+++ b/pkgs/applications/window-managers/xmonad/xmonad-contrib.nix
@@ -1,12 +1,22 @@
-{cabal, xmonad, X11, utf8String, X11Xft}:
+{ cabal, extensibleExceptions, mtl, random, utf8String, X11, X11Xft
+, xmonad
+}:
 
-cabal.mkDerivation (self : {
+cabal.mkDerivation (self: {
   pname = "xmonad-contrib";
-  name = "${self.fname}";
-  version = "0.9.1";
-  sha256 = "b4ca1d71d12903be76187ce58898697086e7af3ef73468987cb7ef03b076ec47";
-  propagatedBuildInputs = [X11 xmonad utf8String X11Xft];
+  version = "0.9.2";
+  sha256 = "06hg5j4w8iz62wmyygq4c7xcbi9dxlhhh3dbic438cjk7c0w1h5p";
+  buildDepends = [
+    extensibleExceptions mtl random utf8String X11 X11Xft xmonad
+  ];
   meta = {
-    description = "a huge extension library for xmonad";
+    homepage = "http://xmonad.org/";
+    description = "Third party extensions for xmonad";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [
+      self.stdenv.lib.maintainers.andres
+      self.stdenv.lib.maintainers.simons
+    ];
   };
 })
diff --git a/pkgs/applications/window-managers/xmonad/xmonad-extras.nix b/pkgs/applications/window-managers/xmonad/xmonad-extras.nix
new file mode 100644
index 000000000000..6d9b2a420fbe
--- /dev/null
+++ b/pkgs/applications/window-managers/xmonad/xmonad-extras.nix
@@ -0,0 +1,21 @@
+{cabal, xmonad, xmonadContrib, X11, utf8String, X11Xft,
+ parsec, split}:
+
+cabal.mkDerivation (self: {
+  pname = "xmonad-extras";
+  version = "0.9.2";
+  sha256 = "54b41a4c59ff3d68b3a214d727fb5675fa7c1b90090d99e58ecae62b3dfdd701";
+  propagatedBuildInputs =
+    [X11 xmonad xmonadContrib utf8String X11Xft parsec split];
+  noHaddock = true;
+  meta = {
+    homepage = "http://projects.haskell.org/xmonad-extras";
+    description = "Third party extensions for xmonad with wacky dependencies";
+    license = self.stdenv.lib.licenses.bsd3;
+    platforms = self.ghc.meta.platforms;
+    maintainers = [
+      self.stdenv.lib.maintainers.andres
+      self.stdenv.lib.maintainers.simons
+    ];
+  };
+})